diff options
author | des <des@FreeBSD.org> | 2004-04-13 15:08:15 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-04-13 15:08:15 +0000 |
commit | eed88363650c7ebd7c7b8d267eb1024afbcb5068 (patch) | |
tree | 2140acd6471274e8ef749fc256cbb54d287aa600 /mail/postfix26 | |
parent | 150492033dafe42d047b5f3f5aa20370a5397ab1 (diff) | |
download | FreeBSD-ports-eed88363650c7ebd7c7b8d267eb1024afbcb5068.zip FreeBSD-ports-eed88363650c7ebd7c7b8d267eb1024afbcb5068.tar.gz |
Use /usr/sbin/nologin instead of /sbin/nologin if it exists and is
executable.
Use fixed UIDs (125) and GIDs (125, 126).
Approved by: maintainer
Diffstat (limited to 'mail/postfix26')
-rw-r--r-- | mail/postfix26/pkg-install | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/mail/postfix26/pkg-install b/mail/postfix26/pkg-install index 8cf5a9a..44a1d6c 100644 --- a/mail/postfix26/pkg-install +++ b/mail/postfix26/pkg-install @@ -17,6 +17,12 @@ else DEFAULT_REPLACE_MAILERCONF=y fi +if [ -x /usr/sbin/nologin ]; then + NOLOGIN=/usr/sbin/nologin +else + NOLOGIN=/sbin/nologin +fi + ask() { local question default answer @@ -48,13 +54,16 @@ yesno() { if [ x"$2" = xPRE-INSTALL ]; then USER=postfix + UID=125 GROUP=postfix + GID=125 GROUP2=maildrop + GID2=126 if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then echo "You already have a group \"${GROUP}\", so I will use it." else - if /usr/sbin/pw groupadd ${GROUP} -h - + if /usr/sbin/pw groupadd ${GROUP} -g ${GID} then echo "Added group \"${GROUP}\"." else @@ -67,7 +76,7 @@ if [ x"$2" = xPRE-INSTALL ]; then if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then echo "You already have a group \"${GROUP2}\", so I will use it." else - if /usr/sbin/pw groupadd ${GROUP2} -h - + if /usr/sbin/pw groupadd ${GROUP2} -g ${GID2} then echo "Added group \"${GROUP2}\"." else @@ -80,9 +89,9 @@ if [ x"$2" = xPRE-INSTALL ]; then if /usr/sbin/pw user show "${USER}" 2>/dev/null; then echo "You already have a user \"${USER}\", so I will use it." else - if /usr/sbin/pw useradd ${USER} -g ${GROUP} -h - \ + if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ -d /var/spool/postfix \ - -s /sbin/nologin \ + -s ${NOLOGIN} \ -c "Postfix Mail System" then echo "Added user \"${USER}\"." |