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

Collapse All | Expand All

(-)files/isc-dhcpd.in (-5 / +6 lines)
Lines 271-286 Link Here
271
271
272
safe_useradd ()
272
safe_useradd ()
273
{
273
{
274
	local _user _group _home _shell _gecos
274
	local _user _group _home _shell _gecos _gid _uid
275
275
276
	_user=$1 _group=$2 _gecos=${3:-"& daemon"}
276
	_user=$1 _group=$2 _gecos=${3:-"& daemon"}
277
	_home=${4:-/nonexistent} _shell=${5:-/usr/sbin/nologin}
277
	_uid=$4  _gid=$5
278
	_home=${6:-/nonexistent} _shell=${7:-/usr/sbin/nologin}
278
279
279
	if [ -n "${_group}" ]; then
280
	if [ -n "${_group}" ]; then
280
		if pw group show ${_group} 2>/dev/null; then
281
		if pw group show ${_group} 2>/dev/null; then
281
			echo "You already have a group \"${_group}\"," \
282
			echo "You already have a group \"${_group}\"," \
282
			     "so I will use it."
283
			     "so I will use it."
283
		elif pw groupadd ${_group} -h -; then
284
		elif pw groupadd ${_group} -g ${_gid} -h -; then
284
			echo "Added group \"${_group}\"."
285
			echo "Added group \"${_group}\"."
285
		else
286
		else
286
			echo "Adding group \"${_group}\" failed..."
287
			echo "Adding group \"${_group}\" failed..."
Lines 292-298 Link Here
292
		if pw user show ${_user} 2>/dev/null; then
293
		if pw user show ${_user} 2>/dev/null; then
293
			echo "You already have a user \"${_user}\"," \
294
			echo "You already have a user \"${_user}\"," \
294
			     "so I will use it."
295
			     "so I will use it."
295
		elif pw useradd ${_user} -g ${_group} -h - \
296
		elif pw useradd ${_user} -u ${_uid} -g ${_group} -h - \
296
			-d ${_home} -s ${_shell} -c "${_gecos}"; then
297
			-d ${_home} -s ${_shell} -c "${_gecos}"; then
297
			echo "Added user \"${_user}\"."
298
			echo "Added user \"${_user}\"."
298
		else
299
		else
Lines 638-644 Link Here
638
{
639
{
639
	if checkyesno paranoia; then
640
	if checkyesno paranoia; then
640
		safe_useradd "${dhcpd_withuser}" "${dhcpd_withgroup}" \
641
		safe_useradd "${dhcpd_withuser}" "${dhcpd_withgroup}" \
641
			     "DHCP Daemon"
642
			     "DHCP Daemon" 136 136
642
	fi
643
	fi
643
}
644
}
644
645

Return to bug 127995