summaryrefslogtreecommitdiff
path: root/security/cyrus-sasl/INSTALL
diff options
context:
space:
mode:
Diffstat (limited to 'security/cyrus-sasl/INSTALL')
-rw-r--r--security/cyrus-sasl/INSTALL83
1 files changed, 83 insertions, 0 deletions
diff --git a/security/cyrus-sasl/INSTALL b/security/cyrus-sasl/INSTALL
new file mode 100644
index 00000000000..5ae49d96ca3
--- /dev/null
+++ b/security/cyrus-sasl/INSTALL
@@ -0,0 +1,83 @@
+#! /bin/sh
+#
+# $NetBSD: INSTALL,v 1.1 2001/11/01 01:16:36 zuntum Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+USER="@CYRUS_USER@"
+GROUP="@CYRUS_GROUP@"
+
+ADDUSER="@ADDUSER@"
+ADDGROUP="@ADDGROUP@"
+CHGRP="@CHGRP@"
+CHMOD="@CHMOD@"
+CHOWN="@CHOWN@"
+ID="@ID@"
+MKDIR="@MKDIR@"
+RM="@RM@"
+TOUCH="@TOUCH@"
+
+SASLDB=/etc/sasldb.db
+PWCHECKDIR=/var/pwcheck
+
+case ${STAGE} in
+PRE-INSTALL)
+ # Group... the default's shipped with NetBSD
+ # We need to check that ${GROUP} exists before adding the user.
+ # Do it with chgrp to be able to use NIS.
+ #
+ ${TOUCH} "/tmp/grouptest.$$"
+ ${CHGRP} ${GROUP} "/tmp/grouptest.$$" >/dev/null 2>&1
+ if [ $? -eq 0 ]
+ then
+ echo "Group '${GROUP}' already exists...proceeding."
+ else
+ echo "Creating '${GROUP}' group..."
+ ${ADDGROUP} ${GROUP}
+ echo "Done."
+ fi
+ ${RM} -f "/tmp/grouptest.$$"
+
+ # Use `id' to be able to use NIS.
+ #
+ ${ID} ${USER} 2>/dev/null >/dev/null
+ if [ $? -eq 0 ]
+ then
+ echo "User '${USER}' already exists...proceeding."
+ else
+ echo "Creating '${USER}' user..."
+ ${ADDUSER} -c "Cyrus User" -g ${GROUP} -s /bin/sh ${USER}
+ echo "Done."
+ fi
+ ;;
+
+POST-INSTALL)
+ # Create empty sasldb shared secrets database with proper permissions
+ # for saslpasswd.
+ #
+ if [ -f ${SASLDB} ]
+ then
+ echo "${SASLDB} already exists."
+ else
+ echo "Creating empty ${SASLDB}..."
+ echo password | ${PKG_PREFIX}/sbin/saslpasswd -p user
+ ${PKG_PREFIX}/sbin/saslpasswd -d user
+ ${CHOWN} ${USER} ${SASLDB}
+ ${CHMOD} 600 ${SASLDB}
+ echo "Done."
+ fi
+
+ # Create directory with proper permissions for pwcheck socket.
+ #
+ ${MKDIR} ${PWCHECKDIR}
+ ${CHOWN} ${USER} ${PWCHECKDIR}
+ ${CHMOD} 700 ${PWCHECKDIR}
+ ;;
+
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0