nuageinit: Accept plain text passwords

Per pw(8), when -H is set, the password should be supplied already
encrypted in a form suitable for writing directly to the password
database (passwd in cloud-init tems); -h provides a special interface by
which interactive scripts can set an account password using pw(8) in
plain text (plain_text_passwd in cloud-init terms).

The default user (freebsd) is defined with a plain_text_passwd
(freebsd), not with an encrypted one.
This commit is contained in:
Jose Luis Duran
2024-07-23 03:49:36 +00:00
committed by Baptiste Daroussin
parent 9840598aa3
commit 7b73ecfe64
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ local function adduser(pwd)
postcmd = " -H 0 "
elseif pwd.plain_text_passwd then
precmd = "echo "..pwd.plain_text_passwd .. "| "
postcmd = " -H 0 "
postcmd = " -h 0 "
end
cmd = precmd .. "pw "
if root then