From nobody Mon May 06 16:19:22 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 4VY66z1k2Fz5KWkD; Mon, 06 May 2024 16:19:23 +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 4VY66y5zVmz4ZkK; Mon, 6 May 2024 16:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715012362; 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=HbdewNQkyax5jt73k8tRzQVR304ctepbk7doz82SxqY=; b=bxKsFQM+iQQshKAWmJNJCy3K67kGEcF5g6P2cdajZajKzRP9eiLLLcIEnMsM8IxOlEsdag Wvj6vrGeicEevXMStPb8tV+fttMLmNMFwNrg6DH0efB8oaeDYlNyGaSwXwF8kOGm7PdpRT lJ02UfsCjCXAunBBhC2HIGzomZBnyz26ggltOW/dIRGeGFeRgwpe0WV3f9udZhMIzYdlS3 h6LnYKh/hFgYaOoE4PrnrE1LpOx78ifF4YP9zfZpwClcJ85z5fqaljmGG91bU7ibGyN7Ay W+DwIo0oCLm2lWXzFldGwQs1YgIx2oDKcSwj6KMYexSB8MoeIr57QA/IfhQriA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715012362; a=rsa-sha256; cv=none; b=YUY1nf+l9zkkRpJsIwmLBop+EFf//pmOm3DixmYD2J/zzNr9ocQy9EuRlb3s5gA4BNV2sF zdp0GgJZCzm2nKCdcRKkmoKifY/oEsmAgquhc9wPvkHgGZ5jULxhm9CfoQP5YULKiF4rPQ 3fjGy9YqEDlXwxGsXSXse7KFU/KxiZwPshmausijnuURTznAIsgHxOi0UDp/i51vRnzu+x lpKapQuX2+QVm80KhbJInKcdKDocYF2qhnDUw9oz0lcI5PHBqrYG/ktlOHypw90wQ+IxhR 6rpsPUJemeVCY+vhv0/gSKBwZfqmm298/+rEUtf/hDjEnyrguoTNswUNKM4rzA== 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=1715012362; 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=HbdewNQkyax5jt73k8tRzQVR304ctepbk7doz82SxqY=; b=UODAh+81O/F0uGlJpPS7R+b2NXM69fBJ8vrAkUWfKtVfmIMOKftuFg2XZoyWA1e9wlBV2i JTge8J8w+K10Eane5BMZ4ifq/zC3jtwxnVE5oK3nIn1+XCW7TVf43gqTZAjsOcBLNF2PoS AXMfX1RJd58ftuO53Aia91KZr3Ylp7KR1ajCGR3B9zT5B7RrY6Qb+FIQ+euDppEhdFaCBo eYh+/CFqWImTNEzi6sA0ZEU4+M67qMGaRs848DYowkViEO1lo7iXC5Ep1v0u1aKoM0y7KT JsM9zyh+mCu4yEXsHXHg4Hhvpjs3j0zRIwIdhxes7Qukn2MxX7IOZB6L24PWiA== 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 4VY66y5ZGsz13tL; Mon, 6 May 2024 16:19:22 +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 446GJMGS022811; Mon, 6 May 2024 16:19:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 446GJMmL022808; Mon, 6 May 2024 16:19:22 GMT (envelope-from git) Date: Mon, 6 May 2024 16:19:22 GMT Message-Id: <202405061619.446GJMmL022808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 46c4e86ebf18 - main - adduser: Fix confusion between `uclass` and `_class`. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46c4e86ebf1819fc09084c8aa79423d96fcaad4a Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=46c4e86ebf1819fc09084c8aa79423d96fcaad4a commit 46c4e86ebf1819fc09084c8aa79423d96fcaad4a Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-06 16:18:47 +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 --- 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