git: e121845426c8 - stable/14 - adduser: Fix confusion between `uclass` and `_class`.

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Thu, 09 May 2024 13:16:26 UTC
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 <des@FreeBSD.org>
AuthorDate: 2024-05-06 16:18:47 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
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