From nobody Thu May 09 13:16:55 2024 X-Original-To: dev-commits-src-branches@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 4VZsx34cH0z5Jfqy; Thu, 09 May 2024 13:16:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZsx325Zxz58C6; Thu, 9 May 2024 13:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260615; 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=HzgqFkkP9/Lo9zr9nCTh3jIsHzwPbY5w+ZtpjGU5yGY=; b=BZ70V046znUG5EVjiPohcwlpgGymNwBglGPxXg2woCjKSipL/qKn9thzLBv9iBwa2Jf9c4 I4ksqSniWvaiEu+1JTTLZBp6dt9bzUaBJP+vGww6K/Mck2FuwIQrNVftY5z8Ti+eiVFeXL Lyp0lr6l47pbopPITY69U/0yQTTUPOQ2Etu6/qWldowgBj1YxgBvF6wUn6esvupwQMOp/7 ZcFs1cML4tkt9OizYYvRg31ehhWd4CaLzhvsNMTSRn2yuyw9bY8aAO4DbPzf3GIga+DxW0 xd0MRXOW5+K0NBZh16wnnbBE1EgVP9wpsHyfGJpQTLGgBTJlggx+5AAQcfsvvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715260615; a=rsa-sha256; cv=none; b=dBibhS+FAnakbddwW2tVAdUQkj6lh5rRA+uO901x5TDNgzK046zStAtjBLbkXK+Psf62xA pr9kqtIsqH/aImPbWgAQENQy0AYjUZ0cFzjOEgj4X08TB3UGNbWJQVck7Ju9HC9oHX12BN MeiSuPWlya5htHtq8YE7vgxZ23ge9yYL8tXeMcY7rUVdJL3pLdr4AG1MnaZxYw8lWtb3y/ qIBb6ywXWzOYTkOH7rlJMzUayj83flpJHjLT46qiSLz2BN+M90vf73iXScX6ZDWtCv1XmA 4YEI896QMfm3WSEhOYy+Fv+Va0NErxN8cbkV2tad5goyTK7K2WmMmKWmAKhv6g== 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=1715260615; 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=HzgqFkkP9/Lo9zr9nCTh3jIsHzwPbY5w+ZtpjGU5yGY=; b=nDxG5Os31mauDpFpOFsfoTSXmhamzZXg+Kz+/VUGBrvNCrkNR0pgvFeg6RNhbRYZrYtn5u 32yqIsZrZkyparDYv1ypcUGjDsR1T2FfzkeI591krk7nGTPkwIwkdGff+k6sbGWImqIIUM 3HxwEiuKxrY2MkVwYRPQzstEdbeE4q6mNdnKrIn2meNUPH3gW9BzGUqZoszAOXCO0eVh59 Xqgwdl7iagD3QOQ5gSkUrYsfKfLA/+5dchhtavp6dPeukssyhyPYGxitg+kROPfYQQ4CWs YKCnCfKcn4f4A1PhWCYvrxA6CieJx8ouhYA5E/z38lV+MfGBfr7k5kq4ZoJGKA== 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 4VZsx31k4Sz18g0; Thu, 9 May 2024 13:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DGtqx032277; Thu, 9 May 2024 13:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DGtIN032274; Thu, 9 May 2024 13:16:55 GMT (envelope-from git) Date: Thu, 9 May 2024 13:16:55 GMT Message-Id: <202405091316.449DGtIN032274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 9f21d0ef9196 - stable/13 - adduser: Fix confusion between `uclass` and `_class`. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9f21d0ef91960e183913a068a8e52e23db71d65b Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9f21d0ef91960e183913a068a8e52e23db71d65b commit 9f21d0ef91960e183913a068a8e52e23db71d65b Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 11:05:36 +0000 adduser: Fix confusion between `uclass` and `_class`. This caused adduser to produce an invalid `pw(8)` command line. Due to bugs in `pw(8)`, the command line was silently accepted and led to the user being created, but locked out and with no home directory. Also fix the default value for the “Another user?” prompt. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels, allanjude Differential Revision: https://reviews.freebsd.org/D45098 (cherry picked from commit 46c4e86ebf1819fc09084c8aa79423d96fcaad4a) --- usr.sbin/adduser/adduser.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index e9027b6b7876..61a4b3b5058f 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -194,7 +194,7 @@ save_config() { # add_user() { local _uid _name _comment _gecos _home _group _grouplist _shell _class - local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod + local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod _pwcmd # Is this a configuration run? If so, don't modify user database. # @@ -519,7 +519,7 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { - local _input _uclass + local _input _class uclass="$defaultclass" _class=${uclass:-"default"} @@ -740,7 +740,6 @@ input_interactive() { local _logingroup_ok="no" local _groups_ok="no" local _all_ok="yes" - local _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -1129,6 +1128,7 @@ if [ -n "$fflag" ]; then else input_interactive while : ; do + _another_user="no" if [ -z "$configflag" ]; then echo -n "Add another user? (yes/no) [$_another_user]: " else