From nobody Tue Sep 03 07:08: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 4WycCj5fjkz5W4y5; Tue, 03 Sep 2024 07:08: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 4WycCj55q9z4TPk; Tue, 3 Sep 2024 07:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347297; 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=JxNLLr+QBcSvDaqXlcqLJvr1hgio9EEconrBwAPMIOc=; b=HdwqWDyLo1yQD6urOxDF6fGoQ4bvwXJRaiAjCbw+jhDe0vZIjBAJBxjrPhhBEnt1WfmfYH lOfkKSAH9whFG9i7lY9dxrwSaKKUQ/UJ6JUJWZv7xWrWwllLdAF783RTR2AbCjpWob0k0C rlWuDIL1fST+nX62lCi66DeAPZ74jz4MOUX81m6X6dcYQuqDm7rnhMAS3/klCA3SeTtwaO xVJp+GHMjpaIXWKs+IKGnkqE0tn9xTq6o9CoWhYA9gOCBnBhudSLL89OhsrwucQkTiMP2S 5Ke+uAZmHTxkdVlcyUXUmE2LdmVmkXb24LdEfkatdMrB/ox6FhhXd79pKyoYyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347297; a=rsa-sha256; cv=none; b=D4lQZRxXMEIzI0vM73YDvQWp9Huv+Fi2STp8rkQ5tAZw9dmNSg12WsUPE3y/R6JAStfxeG XBc0bb6DE21M4vCk6sgVsYbav0WcZXgI1pmbxgBfShDu2liCaGE+6VCCWsimqHLJI5iVNl EIEkzsq873Frkyp4nSQWZsDRtvcO9uBH2lvTacjgJ2euGVEEF0npPYOVZmnus1TQaTJHXn vPp0SCdo6zRurmKlHefyXu5l555TDWgje4o1EUhoxvROr7TbMETsABeMtQrnbxvk4oG2Z9 OJlxYrTTmnRqdD8vhDMPS2m2zzqw1pUvcWneqIDoZwdYpz9CEsm2L9zdcapDpQ== 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=1725347297; 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=JxNLLr+QBcSvDaqXlcqLJvr1hgio9EEconrBwAPMIOc=; b=fdnRNBdKXzJOTy2+sjLvkclRRlMiZrmh0SGGvcTfLjl0yu7Cnk2etunXleZ3+6WzYebKo9 njXQUwp09eGEOhDenfNb1pyLdNHxh4OxCf871mBdYKnjHgVilCUYi+/igBNcTCQIITPCvr x769OJj/m7iqAsH0O/RNG4Rbau6PZyZjWRVV7cnH9wlfH2D1vIqnsry1JUMKDOWSZxY+5/ 4AfI2Z18jEhBjIoC37hY1RhsHYSHPgUV4evqq9nPztt0u4cxvwy539A90ifG0bLykC5WEV 9S1/8ROAWjdKWy+P8hNnIHib6DEJp4qCVLnSqq7CsIkhfGmf0xALJ7zE1dBN2Q== 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 4WycCj4kLYzX3G; Tue, 3 Sep 2024 07:08: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 48378Hfu069019; Tue, 3 Sep 2024 07:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48378HJ7069016; Tue, 3 Sep 2024 07:08:17 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:08:17 GMT Message-Id: <202409030708.48378HJ7069016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: c7887c8e2e1c - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c7887c8e2e1c3e8234db21b4a63770abbaf73b8b Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c7887c8e2e1c3e8234db21b4a63770abbaf73b8b commit c7887c8e2e1c3e8234db21b4a63770abbaf73b8b Author: Jose Luis Duran AuthorDate: 2024-07-23 03:49:36 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:24 +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. (cherry picked from commit 7b73ecfe648487c7706ac2b854dcf1435e60e4ca) --- 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 }