View | Details | Raw Unified | Return to bug 60636 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/src/usr.sbin/adduser/adduser.sh (-27 lines)
Lines 82-88 Link Here
82
	echo "  -L		login class of the user"
82
	echo "  -L		login class of the user"
83
	echo "  -N		do not read configuration file"
83
	echo "  -N		do not read configuration file"
84
	echo "  -d		home directory"
84
	echo "  -d		home directory"
85
	echo "  -o		home directory permissions (octal)"
86
	echo "  -f		file from which input will be received"
85
	echo "  -f		file from which input will be received"
87
	echo "  -g		default login group"
86
	echo "  -g		default login group"
88
	echo "  -h		display this usage message"
87
	echo "  -h		display this usage message"
Lines 152-158 Link Here
152
	echo "defaultgroups=$ugroups"	>> ${ADDUSERCONF}
151
	echo "defaultgroups=$ugroups"	>> ${ADDUSERCONF}
153
	echo "passwdtype=$passwdtype" 	>> ${ADDUSERCONF}
152
	echo "passwdtype=$passwdtype" 	>> ${ADDUSERCONF}
154
	echo "homeprefix=$homeprefix" 	>> ${ADDUSERCONF}
153
	echo "homeprefix=$homeprefix" 	>> ${ADDUSERCONF}
155
	echo "mode=$mode"		>> ${ADDUSERCONF}
156
	echo "defaultshell=$ushell"	>> ${ADDUSERCONF}
154
	echo "defaultshell=$ushell"	>> ${ADDUSERCONF}
157
	echo "udotdir=$udotdir"		>> ${ADDUSERCONF}
155
	echo "udotdir=$udotdir"		>> ${ADDUSERCONF}
158
	echo "msgfile=$msgfile"		>> ${ADDUSERCONF}
156
	echo "msgfile=$msgfile"		>> ${ADDUSERCONF}
Lines 271-279 Link Here
271
			info "Sent welcome message to ($username)."
269
			info "Sent welcome message to ($username)."
272
		}
270
		}
273
	fi
271
	fi
274
275
	chmod $mode "$uhome";
276
	info "Set permissions of ($uhome) to $mode.";
277
}
272
}
278
273
279
# get_user
274
# get_user
Lines 387-407 Link Here
387
	fi
382
	fi
388
}
383
}
389
384
390
# get_mode
391
#	Reads an octal number (permissions) in an interactive session or batch
392
#	session.  Sets the user's new home directory to these permissions.
393
#
394
get_mode() {
395
	_input=
396
397
	echo -n "Home directory permissions [$mode]: "
398
	read _input
399
400
	if [ -n "$_input" ]; then
401
		mode=$_input
402
	fi
403
}
404
405
# get_uid
385
# get_uid
406
#	Reads a numeric userid in an interactive or batch session. Automatically
386
#	Reads a numeric userid in an interactive or batch session. Automatically
407
#	allocates one if it is not specified.
387
#	allocates one if it is not specified.
Lines 625-631 Link Here
625
	get_class
605
	get_class
626
	get_shell
606
	get_shell
627
	get_homedir
607
	get_homedir
628
	get_mode
629
608
630
	while : ; do
609
	while : ; do
631
		echo -n "Use password-based authentication? [$_usepass]: "
610
		echo -n "Use password-based authentication? [$_usepass]: "
Lines 736-742 Link Here
736
	printf "%-10s : %s\n" "Class" "$uclass"
715
	printf "%-10s : %s\n" "Class" "$uclass"
737
	printf "%-10s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups"
716
	printf "%-10s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups"
738
	printf "%-10s : %s\n" "Home" "$uhome"
717
	printf "%-10s : %s\n" "Home" "$uhome"
739
	printf "%-10s : %s\n" "Home Perms" "$mode"
740
	printf "%-10s : %s\n" "Shell" "$ushell"
718
	printf "%-10s : %s\n" "Shell" "$ushell"
741
	printf "%-10s : %s\n" "Locked" "$_disable"
719
	printf "%-10s : %s\n" "Locked" "$_disable"
742
	while : ; do
720
	while : ; do
Lines 802-808 Link Here
802
defaultLgroup=
780
defaultLgroup=
803
defaultgoups=
781
defaultgoups=
804
defaultshell="${DEFAULTSHELL}"
782
defaultshell="${DEFAULTSHELL}"
805
mode=0751
806
783
807
# Make sure the user running this program is root. This isn't a security
784
# Make sure the user running this program is root. This isn't a security
808
# measure as much as it is a usefull method of reminding the user to
785
# measure as much as it is a usefull method of reminding the user to
Lines 874-883 Link Here
874
	-d)
851
	-d)
875
		homeprefix="$2"
852
		homeprefix="$2"
876
		shift; shift
853
		shift; shift
877
		;;
878
	-o)
879
		mode="$2"
880
		shift; shift;
881
		;;
854
		;;
882
	-m)
855
	-m)
883
		case "$2" in
856
		case "$2" in

Return to bug 60636