diff options
author | ume <ume@FreeBSD.org> | 2003-01-30 22:04:02 +0800 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-01-30 22:04:02 +0800 |
commit | 1ee12b52dbeca25c802a997cd6de226cca1b0d3c (patch) | |
tree | f66052896ca9dbacd93962e3e6a9d3924dd2e3a5 /security | |
parent | 0f27788e08d15ce592702005b41df83d23cd09fc (diff) | |
download | freebsd-ports-gnome-1ee12b52dbeca25c802a997cd6de226cca1b0d3c.tar.gz freebsd-ports-gnome-1ee12b52dbeca25c802a997cd6de226cca1b0d3c.tar.zst freebsd-ports-gnome-1ee12b52dbeca25c802a997cd6de226cca1b0d3c.zip |
Add CYRUS_USER and CYRUS_GROUP options to be able to configure
psuedo user for cyrus.
Requested by: Cyrus Anderson Yunker <cayunker@unity.ncsu.edu>
Diffstat (limited to 'security')
-rw-r--r-- | security/cyrus-sasl2/Makefile | 9 | ||||
-rw-r--r-- | security/cyrus-sasl2/pkg-deinstall | 11 | ||||
-rw-r--r-- | security/cyrus-sasl2/pkg-install | 13 |
3 files changed, 23 insertions, 10 deletions
diff --git a/security/cyrus-sasl2/Makefile b/security/cyrus-sasl2/Makefile index ee91c0492953..1aec02ed394d 100644 --- a/security/cyrus-sasl2/Makefile +++ b/security/cyrus-sasl2/Makefile @@ -95,6 +95,9 @@ CONFIGURE_ENV+= LOCALBASE=${LOCALBASE} \ OPENSSLINC=${OPENSSLINC} \ OPENSSLLIB=${OPENSSLLIB} +CYRUS_USER?= cyrus +CYRUS_GROUP?= cyrus + DOCS= AUTHORS COPYING ChangeLog INSTALL NEWS README DOC2= ONEWS TODO draft-burdis-cat-srp-sasl-06.txt \ @@ -135,9 +138,13 @@ pre-fetch: post-patch: @${SED} -e "s;%%SASLDB%%;${SASLDB_NAME};g" \ -e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \ + -e "s;%%CYRUS_USER%%;${CYRUS_USER};g" \ + -e "s;%%CYRUS_GROUP%%;${CYRUS_GROUP};g" \ ${.CURDIR}/pkg-install > ${PKGINSTALL} @${SED} -e "s;%%SASLDB%%;${SASLDB_NAME};g" \ -e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \ + -e "s;%%CYRUS_USER%%;${CYRUS_USER};g" \ + -e "s;%%CYRUS_GROUP%%;${CYRUS_GROUP};g" \ ${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL} @${SED} -e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \ -e "s;%%PREFIX%%;${PREFIX};g" \ @@ -158,7 +165,7 @@ post-install: ${FILESDIR}/saslauthd.sh > ${PREFIX}/etc/rc.d/saslauthd.sh @${CHMOD} 755 ${PREFIX}/etc/rc.d/saslauthd.sh ${MKDIR} -m 770 /var/state/saslauthd - ${CHOWN} cyrus:cyrus /var/state/saslauthd + ${CHOWN} ${CYRUS_USER}:${CYRUS_GROUP} /var/state/saslauthd .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} @${MKDIR} ${DOCSDIR}/html diff --git a/security/cyrus-sasl2/pkg-deinstall b/security/cyrus-sasl2/pkg-deinstall index 3934276141a9..605204426f06 100644 --- a/security/cyrus-sasl2/pkg-deinstall +++ b/security/cyrus-sasl2/pkg-deinstall @@ -12,6 +12,9 @@ PKG_PREFIX=${PKG_PREFIX:=/usr/local} SASLDB_NAME=${PKG_PREFIX}/etc/%%SASLDB%% +CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%} +CYRUS_GROUP=${CYRUS_GROUP:=%%CYRUS_GROUP%%} + # delete sasldb database delete_sasldb() { @@ -25,11 +28,11 @@ delete_sasldb() { } delete_user() { - if pw usershow cyrus 2>/dev/null 1>&2; then - echo "To delete Cyrus user permanently, use 'pw userdel cyrus'" + if pw usershow ${CYRUS_USER} 2>/dev/null 1>&2; then + echo "To delete Cyrus user permanently, use 'pw userdel ${CYRUS_USER}'" fi - if pw groupshow cyrus 2>/dev/null 1>&2; then - echo "To delete Cyrus group permanently, use 'pw groupdel cyrus'" + if pw groupshow ${CYRUS_GROUP} 2>/dev/null 1>&2; then + echo "To delete Cyrus group permanently, use 'pw groupdel ${CYRUS_GROUP}'" fi } diff --git a/security/cyrus-sasl2/pkg-install b/security/cyrus-sasl2/pkg-install index 609c9becfba2..0ba4edab6ede 100644 --- a/security/cyrus-sasl2/pkg-install +++ b/security/cyrus-sasl2/pkg-install @@ -13,13 +13,16 @@ PKG_PREFIX=${PKG_PREFIX:=/usr/local} SASLDB_NAME=${PKG_PREFIX}/etc/%%SASLDB%% +CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%} +CYRUS_GROUP=${CYRUS_GROUP:=%%CYRUS_GROUP%%} + # # create 'cyrus' user and group before installing # create_user() { - USER=cyrus - GROUP=cyrus + USER=${CYRUS_USER} + GROUP=${CYRUS_GROUP} PW=/usr/sbin/pw if [ -x /sbin/nologin ]; then @@ -77,12 +80,12 @@ create_user() { create_sasldb() { if [ ! -f ${SASLDB_NAME} ]; then - echo "test" | ${PKG_PREFIX}/sbin/saslpasswd2 -p -c cyrus + echo "test" | ${PKG_PREFIX}/sbin/saslpasswd2 -p -c ${CYRUS_USER} if [ `${PKG_PREFIX}/sbin/sasldblistusers2 | wc -l` -eq 0 ] ; then echo "WARNING: Failed to create ${PKG_PREFIX}/etc/$SASLDB_NAME}" else - ${PKG_PREFIX}/sbin/saslpasswd2 -d cyrus - chown cyrus:mail ${SASLDB_NAME} + ${PKG_PREFIX}/sbin/saslpasswd2 -d ${CYRUS_USER} + chown ${CYRUS_USER}:mail ${SASLDB_NAME} chmod 640 ${SASLDB_NAME} fi fi |