View | Details | Raw Unified | Return to bug 128433
Collapse All | Expand All

(-)rc.subr (-3 / +10 lines)
Lines 438-443 Link Here
438
#				to run the chrooted ${command} with.
438
#				to run the chrooted ${command} with.
439
#				Requires /usr to be mounted.
439
#				Requires /usr to be mounted.
440
#
440
#
441
#	${name}_suopt	n	Command parameter for 'su'. Default is '-m'.
442
#
441
#	${rc_arg}_cmd	n	If set, use this as the method when invoked;
443
#	${rc_arg}_cmd	n	If set, use this as the method when invoked;
442
#				Otherwise, use default command (see below)
444
#				Otherwise, use default command (see below)
443
#
445
#
Lines 595-601 Link Here
595
	fi
597
	fi
596
	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
598
	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
597
	    _nice=\$${name}_nice	_user=\$${name}_user \
599
	    _nice=\$${name}_nice	_user=\$${name}_user \
598
	    _group=\$${name}_group	_groups=\$${name}_groups
600
	    _group=\$${name}_group	_groups=\$${name}_groups \
601
		_suopt=\$${name}_suopt
599
602
600
	if [ -n "$_user" ]; then	# unset $_user if running as that user
603
	if [ -n "$_user" ]; then	# unset $_user if running as that user
601
		if [ "$_user" = "$(eval $IDCMD)" ]; then
604
		if [ "$_user" = "$(eval $IDCMD)" ]; then
Lines 603-608 Link Here
603
		fi
606
		fi
604
	fi
607
	fi
605
608
609
	if [ -z "$_suopt" ]; then # set default value
610
		_suopt="-m"
611
	fi
612
606
					# if ${rcvar} is set, and $1 is not
613
					# if ${rcvar} is set, and $1 is not
607
					# "rcvar", then run
614
					# "rcvar", then run
608
					#	checkyesno ${rcvar}
615
					#	checkyesno ${rcvar}
Lines 673-679 Link Here
673
${_chdir:+cd $_chdir && }\
680
${_chdir:+cd $_chdir && }\
674
$command $rc_flags $command_args"
681
$command $rc_flags $command_args"
675
				if [ -n "$_user" ]; then
682
				if [ -n "$_user" ]; then
676
				    _doit="su -m $_user -c 'sh -c \"$_doit\"'"
683
				    _doit="su $_suopt $_user -c 'sh -c \"$_doit\"'"
677
				fi
684
				fi
678
				if [ -n "$_nice" ]; then
685
				if [ -n "$_nice" ]; then
679
					if [ -z "$_user" ]; then
686
					if [ -z "$_user" ]; then
Lines 852-858 Link Here
852
859
853
	_cmd="kill -$1 $rc_pid"
860
	_cmd="kill -$1 $rc_pid"
854
	if [ -n "$_user" ]; then
861
	if [ -n "$_user" ]; then
855
		_cmd="su -m ${_user} -c 'sh -c \"${_cmd}\"'"
862
		_cmd="su ${_suopt} ${_user} -c 'sh -c \"${_cmd}\"'"
856
	fi
863
	fi
857
	echo "$_cmd"
864
	echo "$_cmd"
858
}
865
}

Return to bug 128433