From nobody Tue Jul 23 13:04:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSy5s273Wz5Rvdx; Tue, 23 Jul 2024 13:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSy5s1jV6z4Fy8; Tue, 23 Jul 2024 13:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721739857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J52obvdbpaN8HjmB+FmWFaHac6l5vXopkhsQLjMqbyk=; b=mxPVYYFtcA8kBKYFtlSjS+HHyvA+cV7r17HU8u6tS0EHsdCos/ASw/8zDPqtVB6B/ReHXn eHKY0gDunpzotMrdSMM5C8aDmMlMSrrE1Cck3k8j9Xz5+1nt2kmhR8riErk/OXy/EnfAoV aQMPES6XFS3tIhY70aiUf1VJalzhsf3u+LaAbodLDGMGK1U3KxykbusB9i9ROOZtKjZ1i/ riuZjy96/2szpPzu/J0XmjoIrjvUwZvUhC9+JEcDGog0uNNnOzFmtw4llrf3ipcmoRwfJ0 0ES+aY31RnBcpkS2af1zE4WHGAPYcxGSLmOoM2gWDbt/qJ785sXQsiXSiVI4Wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721739857; a=rsa-sha256; cv=none; b=UyLmtfClDEOjPPOB/YUQyQSFXwRBBclA3E2kYThioQwxopm6LT3BIRzoyu9lOD0yUrKrI5 6bv4UZjmt2ermocnz793bxuLz3V87hQJYUr6pfPXKeZJSvONTrYcml1eiSZo4mQ+ZMz+G2 Ynn2TBx32UPyHyp64RoKGZrOu2Hv0oVoyZP88wl1OL/z6DpZlYWc0HnSSPUdqa0XWCxXQr EHEzo8z1nbheKyThaoenceZZZ2ECvoTkjY6xGxsw9MkbfS5PHVRsH3v/N2Vn6a0yAdQseW 7V4M9mIyfLNoe7+0fEtiYFK6KyqGWKxiCESlEGiY5T8hSHUWgql+jGPCaWrjvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721739857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J52obvdbpaN8HjmB+FmWFaHac6l5vXopkhsQLjMqbyk=; b=XjTrZZcuoVQ+LCfuTB7qhxMr/0JC2cWpZozA8eLLtQVVBUmEOQYyRMViMApvcmfmuZkTWZ agJi7rKmGBqKMvBtxHB/gZUqIcjPCVyNp2KB65lAYkLR6bIY0/uDTa1hkBvofKto95S1Bi abngLolaAeDK5laiXqUn18RDcaozXNVKrZmd2HA3bsGWAfIqrUONwQaIf8W/IBCvolvrGZ okGu+gDPn6d0U2GCKUec57TbFvxA4oqi4msg9xxRI77vwmpQpBlMztb9h+CctuLbqUHC6J 4K1D1m1lxZ53w4NOFSfeakdrafG9LhkI+/ejW4CODFwz2KjDftU2MPuQ3EOwjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSy5s11nkzTS5; Tue, 23 Jul 2024 13:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46ND4HGi086202; Tue, 23 Jul 2024 13:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46ND4H3v086199; Tue, 23 Jul 2024 13:04:17 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:04:17 GMT Message-Id: <202407231304.46ND4H3v086199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 7b73ecfe6484 - main - nuageinit: Accept plain text passwords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b73ecfe648487c7706ac2b854dcf1435e60e4ca Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7b73ecfe648487c7706ac2b854dcf1435e60e4ca commit 7b73ecfe648487c7706ac2b854dcf1435e60e4ca Author: Jose Luis Duran AuthorDate: 2024-07-23 03:49:36 +0000 Commit: Baptiste Daroussin CommitDate: 2024-07-23 13:01:54 +0000 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. --- libexec/nuageinit/nuage.lua | 2 +- libexec/nuageinit/tests/nuageinit.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index ca70c778791b..81fb40c0d8eb 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -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 diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 54c88ceb539a..c6a86bc15486 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -104,6 +104,7 @@ sys:*:1:0::0:0:Sys:/home/sys:/bin/csh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh foobar:H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh EOF + sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" ${here}/etc/master.passwd atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd atf_check -o file:expectedgroup cat ${here}/etc/group }