From nobody Tue Jul 18 17:39:27 2023 X-Original-To: dev-commits-src-main@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 4R55mc24cJz4ngqk; Tue, 18 Jul 2023 17:39:28 +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 4R55mc1gdGz40W8; Tue, 18 Jul 2023 17:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689701968; 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=0f1GZdGCoS0ztcArfqM0qWitLzwrgF67IwBItHaOonE=; b=i0Qrj7fRcCrUpPtaFc5QNAJlrIIfSeLIMqM7r0RiURoP1F04ghWSfWRkujBmubBZuXkd+8 PjWGkmixRMZ3BItM1QdxBzFiIX42eMwn5oKO1zQAPFMbEPuM6koGjfKAhZ/aBmyIbQL6/B hrgDYTZIfdn7nttREnUu0UUQC+jhdJA/6DLKhBz3COq/UgDqeoRu2h7HkzEVvAPRk/o8Ml Fv5mte6KRFhCTILzmmYomOAPNHBHC1TM4Bj/0uIaeewC70a+1bvu8/bw7b+b9LOuzkKz+t 8T62q3DgGwpTQ4TxEYr8vz3DS58oJvesOYipEYYhWxgBIHN23dE5qZvB/GV0Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689701968; 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=0f1GZdGCoS0ztcArfqM0qWitLzwrgF67IwBItHaOonE=; b=yDMu3KbMBWYuVbKP/czji+PESjOgHn6UTxEumB6zHT5UbFMZH0ZKxwKVmZGCxT1d0SGYxY Ya7q3ncU7pnSh5TX3MBvz057qHbznSVb82N1CBUbsyPR+hZubWXbGzKLP5qdHVErZBqss+ Tmfu8j36E3jsAzKd/WyCq5qFQ/c8tCQnPQk9s8H4zD/SqMP15KhgxaadXsmglHnnumD2Jp c0B34esD1bHMouyTdmGGyErmRXkLeafnBMPM7gIatOZLh34goRp83H4aRRDpE8qPElbKIu 0Ybklfq6CkS9kD136LT57HBWX1nuViz1rzfixiS+LZcGfrMESpniZOJ4pYlFxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689701968; a=rsa-sha256; cv=none; b=X7XgE/6feTeNmmGW2xBIvIkegB80QBDeffGvklTXOAZd3yA1X/OWISgKF9+8SkKz7nmKXP SFkKcZo51bBJmqRjcA/4cEShjt5q+QjFwNBouo+azsaW8nndLjYEcnEH/9ImXTN9UhKjdJ IoPrUXNk8dbvj4BDbCHU11z08zPjDo0I0U3Fs9Xo5tJXj7qE52GYv4PiJQTizR8jA/Llv1 vuoLRbIOF8opa23K4qZG4Q8v0XkwaFYZnKalbSXfexT/g8N+TYVfOGHwaCNIsNF8ABytKU OikjZQGuq5aaj23FC2GLOuNdztf5pO6IgE4YZGVp1EVk95/XkDfA4BsmhwTuxQ== 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 4R55mc0bNCzFN9; Tue, 18 Jul 2023 17:39:28 +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 36IHdRnG048242; Tue, 18 Jul 2023 17:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IHdRfU048241; Tue, 18 Jul 2023 17:39:27 GMT (envelope-from git) Date: Tue, 18 Jul 2023 17:39:27 GMT Message-Id: <202307181739.36IHdRfU048241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9efad6f9e108 - main - add defaults for adduser.sh (OK? [yes] & additional user [no]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9efad6f9e1084e97dd6e2599562e7db0bd31a4ab Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9efad6f9e1084e97dd6e2599562e7db0bd31a4ab commit 9efad6f9e1084e97dd6e2599562e7db0bd31a4ab Author: Sven Ruediger AuthorDate: 2023-07-18 17:37:48 +0000 Commit: John Baldwin CommitDate: 2023-07-18 17:37:48 +0000 add defaults for adduser.sh (OK? [yes] & additional user [no]) Event: Kitchener-Waterloo Hackathon 202305 Differential Revision: https://reviews.freebsd.org/D40157 --- usr.sbin/adduser/adduser.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index fb4b51fc23e3..75db900c4524 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -657,6 +657,8 @@ input_interactive() { _usepass="yes" _logingroup_ok="no" _groups_ok="no" + _all_ok="yes" + _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -817,8 +819,11 @@ input_interactive() { printf "%-10s : %s\n" "Shell" "$ushell" printf "%-10s : %s\n" "Locked" "$_disable" while : ; do - echo -n "OK? (yes/no): " + echo -n "OK? (yes/no) [$_all_ok]: " read _input + if [ -z "$_input" ]; then + _input=$_all_ok + fi case $_input in [Nn][Oo]|[Nn]) return 1 @@ -1030,11 +1035,14 @@ else input_interactive while : ; do if [ -z "$configflag" ]; then - echo -n "Add another user? (yes/no): " + echo -n "Add another user? (yes/no) [$_another_user]: " else - echo -n "Re-edit the default configuration? (yes/no): " + echo -n "Re-edit the default configuration? (yes/no) [$_another_user]: " fi read _input + if [ -z "$_input" ]; then + _input=$_another_user + fi case $_input in [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) uidstart=`get_nextuid $uidstart`