3 # SPDX-License-Identifier: BSD-2-Clause
5 # Copyright (c) 2002-2004 Michael Telahun Makonnen. All rights reserved.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
10 # 1. Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
12 # 2. Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in the
14 # documentation and/or other materials provided with the distribution.
16 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 # Email: Mike Makonnen <mtm@FreeBSD.Org>
32 # Display $msg on stderr, unless we're being quiet.
35 if [ -z "$quietflag" ]; then
36 echo 1>&2 ${THISCMD}: ERROR: $*
41 # Display $msg on stdout, unless we're being quiet.
44 if [ -z "$quietflag" ]; then
45 echo ${THISCMD}: INFO: $*
50 # Output the value of $_uid if it is available for use. If it
51 # is not, output the value of the next higher uid that is available.
52 # If a uid is not specified, output the first available uid, as indicated
56 local _uid=$1 _nextuid
58 if [ -z "$_uid" ]; then
59 _nextuid="$(${PWCMD} usernext | cut -f1 -d:)"
62 if ! ${PWCMD} usershow $_uid > /dev/null 2>&1; then
73 # Display usage information for this utility.
76 echo "usage: ${THISCMD} [options]"
77 echo " options may include:"
78 echo " -C save to the configuration file only"
79 echo " -D do not attempt to create the home directory"
80 echo " -E disable this account after creation"
81 echo " -G additional groups to add accounts to"
82 echo " -L login class of the user"
83 echo " -M file permission for home directory"
84 echo " -N do not read configuration file"
85 echo " -Z do not attempt to create ZFS home dataset"
86 echo " -S a nonexistent shell is not an error"
87 echo " -d home directory"
88 echo " -f file from which input will be received"
89 echo " -g default login group"
90 echo " -h display this usage message"
91 echo " -k path to skeleton home directory"
92 echo " -m user welcome message file"
93 echo " -q absolute minimal user feedback"
95 echo " -u uid to start at"
96 echo " -w password type: no, none, yes or random"
100 # Outputs a list of valid shells from /etc/shells. Only the
101 # basename of the shell is output.
106 ${GREPCMD} '^[^#]' ${ETCSHELLS} |
107 while read _path _junk ; do
108 echo -n "${_prefix}${_path##*/}"
112 # /usr/sbin/nologin is a special case
113 [ -x "${NOLOGIN_PATH}" ] && echo -n " ${NOLOGIN}"
116 # fullpath_from_shell shell
117 # Given $shell, which is either the full path to a shell or
118 # the basename component of a valid shell, get the
119 # full path to the shell from the /etc/shells file.
121 fullpath_from_shell() {
122 local _shell=$1 _fullpath
124 if [ -z "$_shell" ]; then
128 # /usr/sbin/nologin is a special case; it needs to be handled
129 # before the grep | while loop, since a 'return' from within
130 # a subshell will not terminate the function's execution, and
131 # the path to the nologin shell might be printed out twice.
133 if [ "$_shell" = "${NOLOGIN}" ] ||
134 [ "$_shell" = "${NOLOGIN_PATH}" ]; then
139 ${GREPCMD} '^[^#]' ${ETCSHELLS} |
140 while read _path _junk ; do
141 if [ "$_path" = "$_shell" ] ||
142 [ "${_path##*/}" = "$_shell" ]; then
150 # If the given shell is listed in ${ETCSHELLS} or it is
151 # the nologin shell this function will return 0.
152 # Otherwise, it will return 1. If shell is valid but
153 # the path is invalid or it is not executable it
154 # will emit an informational message saying so.
159 if [ -z "$(fullpath_from_shell "$_sh")" ] ; then
160 err "Invalid shell ($_sh) for user $username."
164 info "The shell ($_sh) does not exist or is not executable."
169 # Save some variables to a configuration file.
170 # Note: not all script variables are saved, only those that
171 # it makes sense to save.
174 echo "# Configuration file for adduser(8)." > ${ADDUSERCONF}
175 echo "# NOTE: only *some* variables are saved." >> ${ADDUSERCONF}
176 echo "# Last Modified on $(${DATECMD})." >> ${ADDUSERCONF}
177 echo '' >> ${ADDUSERCONF}
178 echo "defaultHomePerm=$uhomeperm" >> ${ADDUSERCONF}
179 echo "defaultLgroup=$ulogingroup" >> ${ADDUSERCONF}
180 echo "defaultclass=$uclass" >> ${ADDUSERCONF}
181 echo "defaultgroups=$ugroups" >> ${ADDUSERCONF}
182 echo "passwdtype=$passwdtype" >> ${ADDUSERCONF}
183 echo "homeprefix=$homeprefix" >> ${ADDUSERCONF}
184 echo "defaultshell=$ushell" >> ${ADDUSERCONF}
185 echo "udotdir=$udotdir" >> ${ADDUSERCONF}
186 echo "msgfile=$msgfile" >> ${ADDUSERCONF}
187 echo "disableflag=$disableflag" >> ${ADDUSERCONF}
188 echo "uidstart=$uidstart" >> ${ADDUSERCONF}
192 # Add a user to the user database. If the user chose to send a welcome
193 # message or lock the account, do so.
196 local _uid _name _comment _gecos _home _group _grouplist _shell _class
197 local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod
199 # Is this a configuration run? If so, don't modify user database.
201 if [ -n "$configflag" ]; then
206 _name="-n '$username'"
207 [ -n "$uuid" ] && _uid='-u "$uuid"'
208 [ -n "$ulogingroup" ] && _group='-g "$ulogingroup"'
209 [ -n "$ugroups" ] && _grouplist='-G "$ugroups"'
210 [ -n "$ushell" ] && _shell='-s "$ushell"'
211 [ -n "$uclass" ] && _class='-L "$uclass"'
212 [ -n "$ugecos" ] && _comment='-c "$ugecos"'
213 [ -n "$udotdir" ] && _dotdir='-k "$udotdir"'
214 [ -n "$uexpire" ] && _expire='-e "$uexpire"'
215 [ -n "$upwexpire" ] && _pwexpire='-p "$upwexpire"'
216 if [ -z "$Dflag" ] && [ -n "$uhome" ]; then
217 # The /nonexistent home directory is special. It
218 # means the user has no home directory.
219 if [ "$uhome" = "$NOHOME" ]; then
222 # Use home directory permissions if specified
223 if [ -n "$uhomeperm" ]; then
224 _home='-m -d "$uhome" -M "$uhomeperm"'
226 _home='-m -d "$uhome"'
229 elif [ -n "$Dflag" ] && [ -n "$uhome" ]; then
234 _passwdmethod="-w no"
238 # Note on processing the password: The outer double quotes
239 # make literal everything except ` and \ and $.
240 # The outer single quotes make literal ` and $.
241 # We can ensure the \ isn't treated specially by specifying
242 # the -r switch to the read command used to obtain the input.
244 _passwdmethod="-w yes"
246 _upasswd='echo "$upass" |'
249 _passwdmethod="-w none"
252 _passwdmethod="-w random"
256 # create ZFS dataset before home directory is created with pw
257 if [ "${Zcreate}" = "yes" ]; then
258 if [ "${Zencrypt}" = "yes" ]; then
259 echo "Enter encryption keyphrase for ZFS dataset (${zhome}):"
261 if [ -n "$BSDINSTALL_CHROOT" ]; then
262 create_zfs_chrooted_dataset
264 if ! create_zfs_dataset; then
265 err "There was an error adding user ($username)."
271 _pwcmd="$_upasswd ${PWCMD} useradd $_uid $_name $_group $_grouplist $_comment"
272 _pwcmd="$_pwcmd $_shell $_class $_home $_dotdir $_passwdmethod $_passwd"
273 _pwcmd="$_pwcmd $_expire $_pwexpire"
275 if ! _output=$(eval $_pwcmd) ; then
276 err "There was an error adding user ($username)."
279 info "Successfully added ($username) to the user database."
280 if [ "random" = "$passwdtype" ]; then
281 randompass="$_output"
282 info "Password for ($username) is: $randompass"
286 if [ -n "$disableflag" ]; then
287 if ${PWCMD} lock $username ; then
288 info "Account ($username) is locked."
290 info "Account ($username) could NOT be locked."
294 # give newly created user permissions to their home zfs dataset
295 if [ "${Zcreate}" = "yes" ]; then
297 if [ -n "$BSDINSTALL_CHROOT" ]; then
302 local _line _owner _perms _file _dir
303 if [ -n "$msgflag" ]; then
304 if [ -r "$msgfile" ]; then
305 # We're evaluating the contents of an external file.
306 # Let's not open ourselves up for attack. _perms will
307 # be empty if it's writeable only by the owner. _owner
308 # will *NOT* be empty if the file is owned by root.
310 _dir="$(dirname "$msgfile")"
311 _file="$(basename "$msgfile")"
312 _perms=$(/usr/bin/find "$_dir" -name "$_file" -perm +07022 -prune)
313 _owner=$(/usr/bin/find "$_dir" -name "$_file" -user 0 -prune)
314 if [ -z "$_owner" ] || [ -n "$_perms" ]; then
315 err "The message file ($msgfile) may be writeable only by root."
318 while read _line ; do
320 done <"$msgfile" | ${MAILCMD} -s"Welcome" ${username}
321 info "Sent welcome message to ($username)."
327 # Reads username of the account from standard input or from a global
328 # variable containing an account line from a file. The username is
329 # required. If this is an interactive session it will prompt in
330 # a loop until a username is entered. If it is batch processing from
331 # a file it will output an error message and return to the caller.
336 # No need to take down user names if this is a configuration saving run.
337 [ -n "$configflag" ] && return
340 if [ -z "$fflag" ]; then
344 _input="$(echo "$fileline" | cut -f1 -d:)"
347 # There *must* be a username, and it must not exist. If
348 # this is an interactive session give the user an
349 # opportunity to retry.
351 if [ -z "$_input" ]; then
352 err "You must enter a username!"
353 [ -z "$fflag" ] && continue
355 if ${PWCMD} usershow "$_input" > /dev/null 2>&1; then
357 [ -z "$fflag" ] && continue
365 # Reads extra information about the user. Can be used both in interactive
366 # and batch (from file) mode.
371 # No need to take down additional user information for a configuration run.
372 [ -n "$configflag" ] && return
374 if [ -z "$fflag" ]; then
375 echo -n "Full name: "
378 _input="$(echo "$fileline" | cut -f7 -d:)"
384 # Get the account's shell. Works in interactive and batch mode. It
385 # accepts either the base name of the shell or the full path.
386 # If an invalid shell is entered it will simply use the default shell.
389 local _input _fullpath
390 ushell="$defaultshell"
392 # Make sure the current value of the shell is a valid one
393 if [ -z "$Sflag" ]; then
394 if ! shell_exists $ushell ; then
395 info "Using default shell ${defaultshell}."
396 ushell="$defaultshell"
400 if [ -z "$fflag" ]; then
401 echo -n "Shell ($shells) [${ushell##*/}]: "
404 _input="$(echo "$fileline" | cut -f9 -d:)"
406 if [ -n "$_input" ]; then
407 if [ -n "$Sflag" ]; then
410 _fullpath=$(fullpath_from_shell "$_input")
411 if [ -n "$_fullpath" ]; then
414 err "Invalid shell ($_input) for user $username."
415 info "Using default shell ${defaultshell}."
416 ushell="$defaultshell"
423 # Reads the account's home directory. Used both with interactive input
428 if [ -z "$fflag" ]; then
429 echo -n "Home directory [${homeprefix}/${username}]: "
432 _input="$(echo "$fileline" | cut -f8 -d:)"
435 if [ -n "$_input" ]; then
437 # if this is a configuration run, then user input is the home
438 # directory prefix. Otherwise it is understood to
441 [ -z "$configflag" ] &&
442 homeprefix="$(dirname "$uhome")" ||
445 uhome="${homeprefix}/${username}"
450 # Reads the account's home directory permissions.
454 uhomeperm=$defaultHomePerm
456 if [ -n "$uhomeperm" ]; then
457 _prompt="Home directory permissions [${uhomeperm}]: "
459 _prompt="Home directory permissions (Leave empty for default): "
461 if [ -z "$fflag" ]; then
466 if [ -n "$_input" ]; then
472 # Determine if homeprefix is located on a ZFS filesystem and if
473 # so, enable ZFS home dataset creation.
478 # check if zfs kernel module is loaded before attempting to run zfs to
479 # prevent loading the kernel module on systems that don't use ZFS
480 if ! "$KLDSTATCMD" -q -m zfs ||
484 if ! _prefix=$(${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null) ||
485 [ -z "${_prefix}" ]; then
489 zhome="${_prefix}/${username}"
493 # Reads a numeric userid in an interactive or batch session. Automatically
494 # allocates one if it is not specified.
500 if [ -n "$uuid" ]; then
501 uuid=$(get_nextuid "$uuid")
502 _prompt="Uid [$uuid]: "
504 _prompt="Uid (Leave empty for default): "
506 if [ -z "$fflag" ]; then
510 _input="$(echo "$fileline" | cut -f2 -d:)"
513 [ -n "$_input" ] && uuid=$_input
514 uuid=$(get_nextuid "$uuid")
519 # Reads login class of account. Can be used in interactive or batch mode.
523 uclass="$defaultclass"
524 _class=${uclass:-"default"}
526 if [ -z "$fflag" ]; then
527 echo -n "Login class [$_class]: "
530 _input="$(echo "$fileline" | cut -f4 -d:)"
533 [ -n "$_input" ] && uclass="$_input"
537 # Reads user's login group. Can be used in both interactive and batch
538 # modes. The specified value can be a group name or its numeric id.
539 # This routine leaves the field blank if nothing is provided and
540 # a default login group has not been set. The pw(8) command
541 # will then provide a login group with the same name as the username.
545 ulogingroup="$defaultLgroup"
547 if [ -z "$fflag" ]; then
548 echo -n "Login group [${ulogingroup:-$username}]: "
551 _input="$(echo "$fileline" | cut -f3 -d:)"
554 # Pw(8) will use the username as login group if it's left empty
555 [ -n "$_input" ] && ulogingroup="$_input"
559 # Read additional groups for the user. It can be used in both interactive
564 ugroups="$defaultgroups"
565 _group=${ulogingroup:-"${username}"}
567 if [ -z "$configflag" ]; then
568 [ -z "$fflag" ] && echo -n "Login group is $_group. Invite $username"
569 [ -z "$fflag" ] && echo -n " into other groups? [$ugroups]: "
571 [ -z "$fflag" ] && echo -n "Enter additional groups [$ugroups]: "
575 [ -n "$_input" ] && ugroups="$_input"
579 # Read expiry information for the account and also for the password. This
580 # routine is used only from batch processing mode.
583 upwexpire="$(echo "$fileline" | cut -f5 -d:)"
584 uexpire="$(echo "$fileline" | cut -f6 -d:)"
588 # Read the password in batch processing mode. The password field matters
589 # only when the password type is "yes" or "random". If the field is empty and the
590 # password type is "yes", then it assumes the account has an empty passsword
591 # and changes the password type accordingly. If the password type is "random"
592 # and the password field is NOT empty, then it assumes the account will NOT
593 # have a random password and set passwdtype to "yes."
596 # We may temporarily change a password type. Make sure it's changed
597 # back to whatever it was before we process the next account.
599 if [ -n "$savedpwtype" ]; then
600 passwdtype=$savedpwtype
604 # There may be a ':' in the password
605 upass=${fileline#*:*:*:*:*:*:*:*:*:}
607 if [ -z "$upass" ]; then
610 # if it's empty, assume an empty password
626 # Ask user if they want to enable encryption on their ZFS home dataset.
628 get_zfs_encryption() {
630 _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: "
635 [ -z "$_input" ] && _input=$Zencrypt
641 [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
646 # invalid answer; repeat loop
652 if [ "${Zencrypt}" = "yes" ]; then
653 zfsopt="-o encryption=on -o keylocation=prompt -o keyformat=passphrase"
657 # create_zfs_chrooted_dataset
658 # Create ZFS dataset owned by the user that was just added within a bsdinstall chroot
660 create_zfs_chrooted_dataset() {
661 if ! ${ZFSCMD} create -u ${zfsopt} "${zhome}"; then
662 err "There was an error creating ZFS dataset (${zhome})."
665 ${ZFSCMD} set mountpoint=legacy "${zhome}"
666 ${MKDIRCMD} -p "${uhome}"
667 ${MOUNTCMD} -t zfs "${zhome}" "${uhome}"
671 # Unmount ZFS home directory created as a legacy mount and switch inheritance
673 umount_legacy_zfs() {
674 ${UMOUNTCMD} "${uhome}"
675 ${ZFSCMD} inherit mountpoint "${zhome}"
679 # Create ZFS dataset owned by the user that was just added.
681 create_zfs_dataset() {
682 if ! ${ZFSCMD} create ${zfsopt} "${zhome}"; then
683 err "There was an error creating ZFS dataset (${zhome})."
686 info "Successfully created ZFS dataset (${zhome})."
691 # Give new user ownership of newly created zfs dataset.
694 if ! ${ZFSCMD} allow "${username}" create,destroy,mount,snapshot "${zhome}"; then
695 err "There was an error setting permissions on ZFS dataset (${zhome})."
701 # Reads a line of account information from standard input and
702 # adds it to the user database.
707 while read -r fileline ; do
723 ugroups="$defaultgroups"
732 # Prompts for user information interactively, and commits to
735 input_interactive() {
736 local _disable _pass _passconfirm _input
738 local _emptypass="no"
740 local _logingroup_ok="no"
741 local _groups_ok="no"
743 local _another_user="no"
761 # The case where group = user is handled elsewhere, so
762 # validate any other groups the user is invited to.
763 until [ "$_logingroup_ok" = yes ]; do
766 if [ -n "$ulogingroup" ] && [ "$username" != "$ulogingroup" ]; then
767 if ! ${PWCMD} show group $ulogingroup > /dev/null 2>&1; then
768 echo "Group $ulogingroup does not exist!"
773 until [ "$_groups_ok" = yes ]; do
776 for i in $ugroups; do
777 if [ "$username" != "$i" ]; then
778 if ! ${PWCMD} show group $i > /dev/null 2>&1; then
779 echo "Group $i does not exist!"
791 [ "$Zcreate" = "yes" ] && get_zfs_encryption
794 echo -n "Use password-based authentication? [$_usepass]: "
796 [ -z "$_input" ] && _input=$_usepass
801 [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
803 echo -n "Use an empty password? (yes/no) [$_emptypass]: "
805 [ -n "$_input" ] && _emptypass=$_input
808 echo -n "Use a random password? (yes/no) [$_random]: "
810 [ -n "$_input" ] && _random="$_input"
812 [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
818 [ -n "$configflag" ] && break
819 trap 'stty echo; exit' 0 1 2 3 15
821 echo -n "Enter password: "
824 echo -n "Enter password again: "
825 IFS= read -r _passconfirm
828 # if user entered a blank password
829 # explicitly ask again.
830 [ -z "$upass$_passconfirm" ] && continue
832 [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
837 # invalid answer; repeat the loop
841 if [ "$upass" != "$_passconfirm" ]; then
842 echo "Passwords did not match!"
849 # invalid answer; repeat loop
855 _disable=${disableflag:-"no"}
857 echo -n "Lock out the account after creation? [$_disable]: "
859 [ -z "$_input" ] && _input=$_disable
864 [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
868 # invalid answer; repeat loop
875 # Display the information we have so far and prompt to
878 _disable=${disableflag:-"no"}
879 [ -z "$configflag" ] && printf "%-11s : %s\n" Username $username
894 [ -z "$configflag" ] && printf "%-11s : %s\n" "Password" "$_pass"
895 [ -n "$configflag" ] && printf "%-11s : %s\n" "Pass Type" "$passwdtype"
896 [ -z "$configflag" ] && printf "%-11s : %s\n" "Full Name" "$ugecos"
897 [ -z "$configflag" ] && printf "%-11s : %s\n" "Uid" "$uuid"
898 [ "$Zcreate" = "yes" ] && [ -z "$configflag" ] &&
899 printf "%-11s : %s\n" "ZFS dataset" "${zhome}"
900 [ "$Zencrypt" = "yes" ] && [ -z "$configflag" ] &&
901 printf "%-11s : %s\n" "Encrypted" "${Zencrypt}"
902 printf "%-11s : %s\n" "Class" "$uclass"
903 printf "%-11s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups"
904 printf "%-11s : %s\n" "Home" "$uhome"
905 printf "%-11s : %s\n" "Home Mode" "$uhomeperm"
906 printf "%-11s : %s\n" "Shell" "$ushell"
907 printf "%-11s : %s\n" "Locked" "$_disable"
909 echo -n "OK? (yes/no) [$_all_ok]: "
911 if [ -z "$_input" ]; then
918 [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
930 #### END SUBROUTINE DEFINITION ####
934 ADDUSERCONF="${ADDUSERCONF:-/etc/adduser.conf}"
935 PWCMD="${PWCMD:-/usr/sbin/pw}"
936 MAILCMD="${MAILCMD:-mail}"
937 ETCSHELLS="${ETCSHELLS:-/etc/shells}"
938 NOHOME="/nonexistent"
940 NOLOGIN_PATH="/usr/sbin/nologin"
941 GREPCMD="/usr/bin/grep"
943 MKDIRCMD="/bin/mkdir"
944 MOUNTCMD="/sbin/mount"
945 UMOUNTCMD="/sbin/umount"
947 KLDSTATCMD="/sbin/kldstat"
961 udotdir=/usr/share/skel
965 shells="$(valid_shells)"
967 msgfile=/etc/adduser.msg
985 defaultshell="${DEFAULTSHELL}"
990 # Make sure the user running this program is root. This isn't a security
991 # measure as much as it is a useful method of reminding the user to
992 # 'su -' before he/she wastes time entering data that won't be saved.
994 procowner=${procowner:-$(/usr/bin/id -u)}
995 if [ "$procowner" != "0" ]; then
996 err 'you must be the super-user (uid 0) to use this utility.'
1000 # Override from our conf file
1001 # Quickly go through the commandline line to see if we should read
1002 # from our configuration file. The actual parsing of the commandline
1003 # arguments happens after we read in our configuration file (commandline
1004 # should override configuration file).
1007 if [ "$_i" = "-N" ]; then
1012 if [ -n "$readconfig" ] && [ -r "${ADDUSERCONF}" ]; then
1016 # Process command-line options
1041 [ "$2" != "-" ] && infile="$2"
1098 defaultshell="$(fullpath_from_shell $2)"
1116 # If the -f switch was used, get input from a file. Otherwise,
1117 # this is an interactive session.
1119 if [ -n "$fflag" ]; then
1120 if [ -z "$infile" ]; then
1122 elif [ -n "$infile" ]; then
1123 if [ -r "$infile" ]; then
1124 input_from_file < $infile
1126 err "File ($infile) is unreadable or does not exist."
1132 if [ -z "$configflag" ]; then
1133 echo -n "Add another user? (yes/no) [$_another_user]: "
1135 echo -n "Re-edit the default configuration? (yes/no) [$_another_user]: "
1138 if [ -z "$_input" ]; then
1139 _input=$_another_user
1142 [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
1143 uidstart=$(get_nextuid $uidstart)