git: d9fa6016011e - main - nuageinit; Skip SSH keys and doas/sudo if adduser fails
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 13 Nov 2026 15:54:41 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=d9fa6016011efe39022a25f26783590690aa2fe2
commit d9fa6016011efe39022a25f26783590690aa2fe2
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2026-11-11 15:51:55 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-11-13 15:54:22 +0000
nuageinit; Skip SSH keys and doas/sudo if adduser fails
Previously we would still try to add SSH keys after a failed adduser,
which would result in an uncaught Lua error, causing the remainder of
the setup to be skipped.
Reported by: llm-postcr
Reviewed by: dtxdf, bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61441
---
libexec/nuageinit/nuageinit | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit
index 758a7f20b305..4cbbb15fe1ed 100755
--- a/libexec/nuageinit/nuageinit
+++ b/libexec/nuageinit/nuageinit
@@ -190,6 +190,10 @@ local function users(obj, metadata)
goto unext
end
local homedir = nuage.adduser(u)
+ if homedir == nil then
+ nuage.warn("error creating user " .. u.name)
+ goto unext
+ end
if u.ssh_authorized_keys then
for _, v in ipairs(u.ssh_authorized_keys) do
nuage.addsshkey(homedir, v)