2005-01-26 06:13:28 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Based on cyrus-sasl2 port
|
|
|
|
#
|
|
|
|
# create 'flowd' user
|
|
|
|
#
|
|
|
|
|
|
|
|
create_user() {
|
|
|
|
USER=${FLOWD_USER}
|
|
|
|
GROUP=nobody
|
|
|
|
PW=/usr/sbin/pw
|
|
|
|
|
|
|
|
if [ -x /usr/sbin/nologin ]; then
|
|
|
|
shell=/usr/sbin/nologin
|
|
|
|
elif [ -x /sbin/nologin ]; then
|
|
|
|
shell=/sbin/nologin
|
|
|
|
else
|
|
|
|
shell=/nonexistent
|
|
|
|
fi
|
2005-06-04 02:43:20 +02:00
|
|
|
uhome="/var/empty"
|
2005-01-26 06:13:28 +01:00
|
|
|
|
|
|
|
if ! ${PW} show user ${USER} -q >/dev/null; then
|
2005-06-04 02:43:20 +02:00
|
|
|
if ! ${PW} add user ${USER} -g ${GROUP} -d "${uhome}" \
|
2005-01-26 06:13:28 +01:00
|
|
|
-c "flowd privilege separation user" -s "${shell}" -p "*" \
|
|
|
|
; then
|
|
|
|
e=$?
|
|
|
|
echo "*** Failed to add user \`${USER}'. Please add it manually."
|
|
|
|
exit ${e}
|
|
|
|
fi
|
|
|
|
echo "*** Added user \`${USER}' (id ${uid})"
|
|
|
|
else
|
|
|
|
echo "*** You already have user \`${USER}'."
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
case $2 in
|
|
|
|
POST-INSTALL)
|
|
|
|
create_user
|
|
|
|
;;
|
|
|
|
esac
|