Register a fixed UID/GID for the user 'dhcpd' and use that instead of a

dynamically chosen one.

PR:		127995
Submitted by:	Ashish Shukla <wahjava@gmail.com>
Approved by:	maintainer timeout (3 months)
This commit is contained in:
Stefan Walter
2009-01-12 15:17:52 +00:00
parent 1f0a55921a
commit d482a3c700
4 changed files with 9 additions and 6 deletions

1
GIDs
View File

@@ -67,6 +67,7 @@ _spamd:*:132:
freeradius:*:133:
undernet:*:134:
rabbitmq:*:135:
dhcpd:*:136:
dovecot:*:143:
rbldns:*:153:
sfs:*:171:

1
UIDs
View File

@@ -75,6 +75,7 @@ _spamd:*:132:132::0:0:Spam Daemon:/var/empty:/usr/sbin/nologin
freeradius:*:133:133::0:0:FreeRADIUS Daemon:/nonexistent:/usr/sbin/nologin
undernet:*:134:134::0:0:Undernet ircu Daemon:/nonexistant:/usr/sbin/nologin
rabbitmq:*:135:135::0:0:RabbitMQ:/var/db/rabbitmq:/usr/sbin/nologin
dhcpd:*:136:136::0:0:ISC DHCP daemon:/nonexistent:/usr/sbin/nologin
cricket:*:141:80::0:0:Cricket Monitoring User:/usr/local/cricket:/usr/sbin/nologin
dovecot:*:143:143::0:0:Dovecot User:/var/empty:/usr/sbin/nologin
rbldns:*:153:153::0:0:rbldnsd pseudo-user:/nonexistent:/usr/sbin/nologin

View File

@@ -8,7 +8,7 @@
PORTNAME= dhcp
PORTVERSION= 3.0.7
PORTREVISION= 1
PORTREVISION= 2
PORTREVISION= ${DHCP_PORTREVISION}
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_ISC}

View File

@@ -271,16 +271,17 @@ safe_umount () # dir
safe_useradd ()
{
local _user _group _home _shell _gecos
local _user _group _home _shell _gecos _gid _usr
_user=$1 _group=$2 _gecos=${3:-"& daemon"}
_home=${4:-/nonexistent} _shell=${5:-/usr/sbin/nologin}
_uid=$4 _gid=$5
_home=${6:-/nonexistent} _shell=${7:-/usr/sbin/nologin}
if [ -n "${_group}" ]; then
if pw group show ${_group} 2>/dev/null; then
echo "You already have a group \"${_group}\"," \
"so I will use it."
elif pw groupadd ${_group} -h -; then
elif pw groupadd ${_group} -g ${_gid} -h -; then
echo "Added group \"${_group}\"."
else
echo "Adding group \"${_group}\" failed..."
@@ -292,7 +293,7 @@ safe_useradd ()
if pw user show ${_user} 2>/dev/null; then
echo "You already have a user \"${_user}\"," \
"so I will use it."
elif pw useradd ${_user} -g ${_group} -h - \
elif pw useradd ${_user} -u ${_uid} -g ${_group} -h - \
-d ${_home} -s ${_shell} -c "${_gecos}"; then
echo "Added user \"${_user}\"."
else
@@ -638,7 +639,7 @@ dhcpd_install ()
{
if checkyesno paranoia; then
safe_useradd "${dhcpd_withuser}" "${dhcpd_withgroup}" \
"DHCP Daemon"
"DHCP Daemon" 136 136
fi
}