2000-09-13 18:36:15 +02:00
#!/bin/sh
2002-01-14 18:37:30 +01:00
if [ -n "${PACKAGE_BUILDING}" ]; then
exit 0
fi
if [ "$2" = "POST-INSTALL" ]; then
USER=gdm
GROUP=${USER}
2002-08-10 00:13:43 +02:00
UID=92
2002-01-14 18:37:30 +01:00
GID=${UID}
2002-01-28 18:50:11 +01:00
PW=/usr/sbin/pw
2002-01-14 18:37:30 +01:00
2002-01-28 18:50:11 +01:00
if ${PW} group show "${GROUP}" 2>/dev/null; then
2002-01-14 18:37:30 +01:00
echo "You already have a group \"${GROUP}\", so I will use it."
else
2002-01-28 18:50:11 +01:00
if ${PW} groupadd ${GROUP} -g ${GID}; then
2002-01-14 18:37:30 +01:00
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
2002-01-28 18:50:11 +01:00
if ${PW} user show "${USER}" 2>/dev/null; then
2002-01-14 18:37:30 +01:00
echo "You already have a user \"${USER}\", so I will use it."
else
2002-01-28 18:50:11 +01:00
if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \
2002-01-14 18:37:30 +01:00
-d "/nonexistent" -s /sbin/nologin -c "GNOME Display Manager"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
exit 0
2000-09-13 18:36:15 +02:00
fi
2002-04-24 23:26:08 +02:00
if [ -z "${BATCH}" ]; then
/usr/bin/dialog --yesno "GDM may contain vulnerabilities leading local root compromise, and it is reported widely with various security sites and groups. It is not recommended that this port be installed in public environment. Do you wish to accept the security risk and build GDM anyway?" 10 60 || /usr/bin/false
fi