aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-04-13 23:37:52 +0800
committerdes <des@FreeBSD.org>2004-04-13 23:37:52 +0800
commit250260b42f1866f6386c6b6407e82530c40bdbb1 (patch)
tree9a8498cc09b1f63465dc2ab7dab0cda55361b6c4
parent6b0c928bb99900930d9c61b1a43589950db3a01b (diff)
downloadfreebsd-ports-graphics-250260b42f1866f6386c6b6407e82530c40bdbb1.tar.gz
freebsd-ports-graphics-250260b42f1866f6386c6b6407e82530c40bdbb1.tar.zst
freebsd-ports-graphics-250260b42f1866f6386c6b6407e82530c40bdbb1.zip
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
-rw-r--r--mail/postfix-current/pkg-install17
1 files changed, 13 insertions, 4 deletions
diff --git a/mail/postfix-current/pkg-install b/mail/postfix-current/pkg-install
index eb176bd400b..99485fabb79 100644
--- a/mail/postfix-current/pkg-install
+++ b/mail/postfix-current/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}\"."