adduser: Normalize supplemental groups

Rather than insist on a space-separated list, normalize the input so
that any number of spaces, commas, colons, or semicolons are accepted.

Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D57774
This commit is contained in:
Dag-Erling Smørgrav committed 2026-06-25 05:05:36 +02:00
1 parent 4d299a767a
commit 65fba082f4
1 file changed
+2 -2
+2 -2
View File
@@ -574,13 +574,13 @@ get_groups() {
if [ -z "$configflag" ]; then
[ -z "$fflag" ] && echo -n "Login group is $_group. Invite $username"
[ -z "$fflag" ] && echo -n " into other (space separated) groups? [$ugroups]: "
[ -z "$fflag" ] && echo -n " into other groups? [$ugroups]: "
else
[ -z "$fflag" ] && echo -n "Enter additional groups [$ugroups]: "
fi
read _input
[ -n "$_input" ] && ugroups="$_input"
[ -n "$_input" ] && ugroups="$(echo "$_input" | tr -s ',:;' ' ')"
}
# get_expire_dates