From nobody Thu May 09 14:31:52 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 4VZvbX5hslz5Jpg1; Thu, 09 May 2024 14:31:52 +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 4VZvbX4wgZz45DS; Thu, 9 May 2024 14:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715265112; 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=82jfXB8rjieiyfVjigC3u0plI1yNZTVLho6KEsdZaDo=; b=KNP5dA8OvPiLi5VjtxRtp1pm2oSB/2Os+Ujf/3AmMeYFUcKwzTrdu4/cUZKyMSho4C+hcX xyBn5N0PYXGg/7N0ndZnTu6cF6IpQgQe703Q1ntArNUq7/WDM6WkdpO0vpttb9CMfMN9wK mcJbT/HOPHarC/xgbYdvyWhtoXrmlNo8jHiCREWf1fxLKQCdYQgCLL08CxHanESc5ZtdNs 85HPrBlCX6/RgcnCz4lFDFcX+ePREShKdkNjpsKYnKjfGLY+oaeIRdEl/CkNnR/Q2pjF+3 if/f5xPI5JYzEtqEg0ipksXtwyseI1QtLBD6MVkFkHWJ8qBCECvxaNkH3S++Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715265112; a=rsa-sha256; cv=none; b=g1DjIrupXJp2ZyiV8lJqh93Mgb3or6aYFMzofsy0GwGO4mzGt6PbM4bHxx1WAdgDedD6XA 8WzuLBHtoC3n+Ain7Fc1S7k+xG8uxyvLxvG+y/m9wue0ExKs4JX4lWVbtdDu3v0uZdHzEt hwZHIWw8j76PgwJoRlfXg5yUJ5Az4mkcbG4yt1FUgdVBFV9dI1cSP45CtuTJZuh9lhVy/+ SgtVSsLmRXgyMhIMMhHo7T9CUXngEsmrR7oPVyJhzSfN+JIMAbnNBNPgKJvRS78N4eosXp w1SmYrlfxQdsjpidNgqnwkoPFuYm+ORP7nvWwufdNx6gsLftghAkP4C9QOkhPg== 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=1715265112; 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=82jfXB8rjieiyfVjigC3u0plI1yNZTVLho6KEsdZaDo=; b=jPMODHB4MH+1yAayelyqpqhC2pwM+VrZ4JVijidU9Dnu6o3s9DkUIJEwBh72A97RYyJrHj Qa7lRAfDZn29T5KTVPh1e/FX3xyzEQPizu0IPuFxt4ZMGQzFlN7BaIujbCbWuiNbdr/+Le AT0QiAUO3AqEikuDOeSMlYAd3fGt/BzQaxx4kLcsacoACs3wiI7uWdUQgSf6fHrStf4mEu 4jWy5K5zlx0i/KjMLg3pZzeRR1KkDg1IP0+8lOXpxOfVNETsAxoOmTQeo7imgj9AmHzTFC 7DOsB/XXRgRv30JbMiopcAvyyQOi/bQpR+RhECGtZk7vEg9TfA4PbbAkTpYFKQ== 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 4VZvbX4Xgnz1BNY; Thu, 9 May 2024 14:31:52 +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 449EVq56065788; Thu, 9 May 2024 14:31:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449EVqWm065785; Thu, 9 May 2024 14:31:52 GMT (envelope-from git) Date: Thu, 9 May 2024 14:31:52 GMT Message-Id: <202405091431.449EVqWm065785@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: 01872b366578 - releng/14.1 - 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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 01872b366578d071e9fb981a2fda216379915ce3 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=01872b366578d071e9fb981a2fda216379915ce3 commit 01872b366578d071e9fb981a2fda216379915ce3 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 14:31:21 +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) (cherry picked from commit e121845426c8d587491370432de0657099a22843) Approved by: re (cperciva) --- 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