From nobody Thu May 09 13:16:26 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 4VZswV63Clz5Jffg; Thu, 09 May 2024 13:16:26 +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 4VZswV5X44z57ky; Thu, 9 May 2024 13:16:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260586; 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=+cWG2/l1D1XEJN0fFWo9d0FE6a0UD2uWRoI2HAw9rD4=; b=cxEHRNACbgsuxIQbQZ99nK5vBdyMQYgBEewL770Tm9Hq8s3PDh64JSGXJIvD8WOpj/jLxT WTdEdR/o5zWA554wSA+8M4YLVg516U0KdOxKuXxiUkFJ68HfSBZ7h3kKK+7IaYSNvmp4Be UpqlHGBOxBk3B4eQfrZ9Ow9I4eYJHef/82q+GXsH8iGo3+L7Qhh23x9XX0g5siAXUu7Hxk LfpLh2FZvQgxzBTc4pZE0y8UEJiQbIclMFP8sUzg6fP63LE2iq9YtfVYU6y2cfK22q/Lnl GtpYFt647UhXhhQHsZ8LeUFiHU61xShLnxKGUIymW/XjrWPkX6abAnAnOnrOxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715260586; a=rsa-sha256; cv=none; b=ls5MnUiZpwNlhOSDOqYwOva0k//pNrgN1bXiJ2rE907TfZk8v/6sQtblJeSaZLqEOuNvMV D8mA7NS1ydLN9J4YToSw/ZvsGTAMqFIIw3PovhUw5Inj9CWrWcHKkrlYnVFqPY5xpisgty ehY0iTGj43HA45eguWgcgDbHfD3N+EpZ41m22Q7OeTRMqFaunydrdtZVHwpGZqd6R+eIdD SbFeEKB7wvpEFlYxltwDmq7xi9NNwgNS6ISenGjDAeqHMOctOCNX34HzJc0QV6en5y80hS z5tHoDhqHr6eLoBV44p1GmBCdFQizO7OtBAwqYADpNOF2Iz9hLbkB8t/UcKz4w== 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=1715260586; 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=+cWG2/l1D1XEJN0fFWo9d0FE6a0UD2uWRoI2HAw9rD4=; b=EzmdKH0AgC+DGPkHeQrmMM/2sXJ6Ah7Xen7ioQ2iJUhnqSzdvuWzNGpbE0JqrYuFvYLv/j AKhLcizkQEurY0apOWAScvWDvQKrZ51+a/VjwXb3gJHfTlVh199jXks5LT+wNUQKDtDjgH WjDVsl1AGB0eSuq75sTPClpGVOAe1Gd65o1lWpgLf18LhWNMDxy3uTHBGM+2vUcsiv7XJ6 XOXXSa0U2lZHtUiDGR1MyglqnAhiwKxIQ9IZgpYvZFWlT0cBuq/mOrTv5+VFUmnkKGuv5A m9L5mWebtAxOToLgeWPzptcIYujz1rYqW/nqS6uf9bWzZrMObsRrvlar/ShZdg== 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 4VZswV4rJfz1953; Thu, 9 May 2024 13:16:26 +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 449DGQ6j031942; Thu, 9 May 2024 13:16:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DGQSv031939; Thu, 9 May 2024 13:16:26 GMT (envelope-from git) Date: Thu, 9 May 2024 13:16:26 GMT Message-Id: <202405091316.449DGQSv031939@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: e121845426c8 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: e121845426c8d587491370432de0657099a22843 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e121845426c8d587491370432de0657099a22843 commit e121845426c8d587491370432de0657099a22843 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 10:59:03 +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