diff options
-rw-r--r-- | security/cyrus-sasl/Makefile | 39 | ||||
-rw-r--r-- | security/cyrus-sasl/distinfo | 6 | ||||
-rw-r--r-- | security/cyrus-sasl/files/cyrus_sasl1 | 16 | ||||
-rw-r--r-- | security/cyrus-sasl/files/patch-ab | 120 | ||||
-rw-r--r-- | security/cyrus-sasl/files/patch-plugins::gssapi.c | 15 | ||||
-rw-r--r-- | security/cyrus-sasl/files/patch-saslauthd::Makefile.am | 19 | ||||
-rw-r--r-- | security/cyrus-sasl/files/pwcheck.sh | 133 | ||||
-rw-r--r-- | security/cyrus-sasl/files/saslauthd.sh | 157 | ||||
-rw-r--r-- | security/cyrus-sasl/pkg-deinstall | 32 | ||||
-rw-r--r-- | security/cyrus-sasl/pkg-install | 18 | ||||
-rw-r--r-- | security/cyrus-sasl/pkg-plist | 6 | ||||
-rw-r--r-- | security/cyrus-sasl/scripts/configure.sasl | 64 |
12 files changed, 405 insertions, 220 deletions
diff --git a/security/cyrus-sasl/Makefile b/security/cyrus-sasl/Makefile index d110335..15f5c11 100644 --- a/security/cyrus-sasl/Makefile +++ b/security/cyrus-sasl/Makefile @@ -6,22 +6,24 @@ # PORTNAME= cyrus-sasl -PORTVERSION= 1.5.27 -PORTREVISION= 7 +PORTVERSION= 1.5.28 +PORTREVISION= 0 CATEGORIES= security ipv6 MASTER_SITES= ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/%SUBDIR%/ \ - http://www.surf.org.uk/downloads/ \ ftp://ftp.westbend.net/pub/cyrus-mail/%SUBDIR%/ \ - ${MASTER_SITE_SOURCEFORGE} \ - ftp://ftp.hanse.de/sites/transit/mirror/ftp.andrew.cmu.edu/pub/cyrus-mail/ -MASTER_SITE_SUBDIR= . OLD-VERSIONS/sasl cyrus-utils + ftp://ftp.hanse.de/sites/transit/mirror/ftp.andrew.cmu.edu/pub/cyrus-mail/ \ + http://www.surf.org.uk/downloads/:ldap_mysql \ + ftp://ftp.westbend.net/pub/cyrus-mail/%SUBDIR%/:ldap_mysql \ + ${MASTER_SITE_SOURCEFORGE:S/$/:ldap_mysql/} \ + +MASTER_SITE_SUBDIR= . OLD-VERSIONS/sasl cyrus-utils:ldap_mysql DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ - sasl-${PORTVERSION}-ldap-ssl-filter-mysql-patch4.tgz + sasl-${PORTVERSION}-ldap-ssl-filter-mysql-patch.tgz:ldap_mysql -PATCH_SITES= ftp://ftp.westbend.net/pub/cyrus-mail/contrib/ \ +PATCH_SITES= ftp://ftp.westbend.net/pub/cyrus-mail/contrib/:apop \ http://www.imasy.or.jp/~ume/ipv6/ -PATCHFILES= sasl_apop_patch.gz \ +PATCHFILES= sasl_apop_patch.gz:apop \ ${DISTNAME}-ipv6-${IPV6_VER}.diff.gz MAINTAINER= hetzels@westbend.net @@ -131,10 +133,16 @@ pre-patch: # Fix pkg-{install/deinstall/messages} post-patch: @${SED} -e "s;%%SASLDB%%;${SASLDB_NAME};g" \ + -e "s;%%PWCHECK%%;${PWCHECK};g" \ + -e "s;%%ENABLE_PWCHECK%%;${ENABLE_PWCHECK};g" \ -e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \ + -e "s;%%ENABLE_SASLAUTHD%%;${ENABLE_SASLAUTHD};g" \ ${.CURDIR}/pkg-install > ${PKGINSTALL} @${SED} -e "s;%%SASLDB%%;${SASLDB_NAME};g" \ + -e "s;%%PWCHECK%%;${PWCHECK};g" \ + -e "s;%%ENABLE_PWCHECK%%;${ENABLE_PWCHECK};g" \ -e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \ + -e "s;%%ENABLE_SASLAUTHD%%;${ENABLE_SASLAUTHD};g" \ ${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL} @${SED} -e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \ -e "s;%%PREFIX%%;${PREFIX};g" \ @@ -162,16 +170,19 @@ pre-install: fi post-install: - @${SED} -e "s;%%PREFIX%%;${PREFIX};g" ${PWCHECK_SUB} \ - ${FILESDIR}/pwcheck.sh > ${PREFIX}/etc/rc.d/pwcheck.sh @${MKDIR} ${EXAMPLESDIR} @${SED} -e 's;%%PREFIX%%;${PREFIX};g' \ ${FILESDIR}/cyrus.pam > ${EXAMPLESDIR}/cyrus.pam - @${CHMOD} 755 ${PREFIX}/etc/rc.d/pwcheck.sh - ${INSTALL} -d -m 770 -o cyrus -g cyrus /var/pwcheck - @${SED} -e "s;%%PREFIX%%;${PREFIX};g" ${SASLAUTHD_SUB} \ + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/pwcheck.sh > ${PREFIX}/etc/rc.d/cyrus_pwcheck.sh + @${CHMOD} 755 ${PREFIX}/etc/rc.d/cyrus_pwcheck.sh + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/saslauthd.sh > ${PREFIX}/etc/rc.d/saslauthd1.sh @${CHMOD} 755 ${PREFIX}/etc/rc.d/saslauthd1.sh + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/cyrus_sasl1 > ${PREFIX}/etc/rc.d/cyrus_sasl1 + @${CHMOD} 755 ${PREFIX}/etc/rc.d/cyrus_sasl1 + ${INSTALL} -d -m 770 -o cyrus -g cyrus /var/pwcheck ${INSTALL} -d -m 770 -o cyrus -g cyrus /var/state/saslauthd1 .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} diff --git a/security/cyrus-sasl/distinfo b/security/cyrus-sasl/distinfo index d11c589..b50ae05 100644 --- a/security/cyrus-sasl/distinfo +++ b/security/cyrus-sasl/distinfo @@ -1,4 +1,4 @@ -MD5 (cyrus-sasl-1.5.27.tar.gz) = 76ea426e2e2da3b8d2e3a43af5488f3b -MD5 (sasl-1.5.27-ldap-ssl-filter-mysql-patch4.tgz) = 3e2b5cf7c5f8f0e8551f28a8d83391bb +MD5 (cyrus-sasl-1.5.28.tar.gz) = 60710be040801e9aff7353563b636518 +MD5 (sasl-1.5.28-ldap-ssl-filter-mysql-patch.tgz) = 1cb8cd37573b6baa91339bcef2912e1a MD5 (sasl_apop_patch.gz) = 6bf7a34b73d1c8d139d2269069d1ba4c -MD5 (cyrus-sasl-1.5.27-ipv6-20020106.diff.gz) = b2956a084954a46ba2d751f56a80a275 +MD5 (cyrus-sasl-1.5.28-ipv6-20020106.diff.gz) = 5987181a53531a46b2aec88b9aea6f9a diff --git a/security/cyrus-sasl/files/cyrus_sasl1 b/security/cyrus-sasl/files/cyrus_sasl1 new file mode 100644 index 0000000..f467b7f --- /dev/null +++ b/security/cyrus-sasl/files/cyrus_sasl1 @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: sasl1 +# REQUIRE: DAEMON %%MYSQL_REQ%% +# KEYWORD: FreeBSD +# +# NOTE for FreeBSD 5.0+: +# If you want this script to start with the base rc scripts copy +# cyrus_sasl1 to /etc/rc.d/cyrus_sasl1 + +# This is a dummy dependancy, to ensure that daemons are run _before_ +# `sasl1' is available. + diff --git a/security/cyrus-sasl/files/patch-ab b/security/cyrus-sasl/files/patch-ab index 4b1a2c3..d87eafb 100644 --- a/security/cyrus-sasl/files/patch-ab +++ b/security/cyrus-sasl/files/patch-ab @@ -1,5 +1,5 @@ ---- configure.in.orig Wed May 22 20:49:46 2002 -+++ configure.in Thu May 23 16:52:07 2002 +--- configure.in.orig Tue Feb 18 13:18:11 2003 ++++ configure.in Tue Feb 18 14:34:11 2003 @@ -66,8 +66,12 @@ dnl check for -R, etc. switch CMU_GUESS_RUNPATH_SWITCH @@ -24,37 +24,7 @@ fi AM_CONDITIONAL(SAMPLE, test "$enable_sample" = yes) -@@ -149,11 +151,13 @@ - AC_CHECK_HEADER(db.h, - AC_CHECK_LIB(db-3, db_create, SASL_DB_LIB="-ldb-3"; - dblib="berkeley", -+ AC_CHECK_LIB(db3, db_create, SASL_DB_LIB="-ldb3"; -+ dblib="berkeley", - AC_CHECK_LIB(db, db_create, SASL_DB_LIB="-ldb"; - dblib="berkeley", - AC_CHECK_LIB(db, db_open, SASL_DB_LIB="-ldb"; - dblib="berkeley", -- dblib="no"))), -+ dblib="no")))), - dblib="no") - ;; - gdbm) -@@ -175,11 +179,13 @@ - AC_CHECK_HEADER(db.h, - AC_CHECK_LIB(db-3, db_create, SASL_DB_LIB="-ldb-3"; - dblib="berkeley", -+ AC_CHECK_LIB(db3, db_create, SASL_DB_LIB="-ldb3"; -+ dblib="berkeley", - AC_CHECK_LIB(db, db_create, SASL_DB_LIB="-ldb"; - dblib="berkeley", - AC_CHECK_LIB(db, db_open, SASL_DB_LIB="-ldb"; - dblib="berkeley", -- dblib="no"))), -+ dblib="no")))), - dblib="no") - if test "$dblib" = no; then - dnl How about ndbm? -@@ -229,6 +235,13 @@ +@@ -239,6 +241,13 @@ berkeley) SASL_DB_BACKEND="db_${dblib}.lo" AC_DEFINE(SASL_BERKELEYDB) @@ -68,25 +38,69 @@ ;; *) AC_MSG_WARN([Disabling SASL authentication database support]) -@@ -534,12 +547,16 @@ +@@ -473,16 +482,40 @@ + CPPFLAGS="$CPPFLAGS -I${with_des}/include" + LDFLAGS="$LDFLAGS -L${with_des}/lib" fi +- AC_CHECK_LIB(des, des_pcbc_encrypt, [LIB_DES="-ldes"; +- with_des=yes], with_des=no) ++ ++ dnl check for openssl installing -lcrypto, then make vanilla check ++ AC_CHECK_LIB(crypto, des_cbc_encrypt, [ ++ AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES) ++ LIB_DES="-lcrypto"; ++ with_des=yes], ++ with_des=no)], ++ with_des=no, $LIB_RSAREF) ++ ++ dnl same test again, different symbol name ++ if test "$with_des" = no; then ++ AC_CHECK_LIB(crypto, DES_cbc_encrypt, [ ++ AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES) ++ LIB_DES="-lcrypto"; ++ with_des=yes], ++ with_des=no)], ++ with_des=no, $LIB_RSAREF) ++ fi ++ ++ if test "$with_des" = no; then ++ AC_CHECK_LIB(des, des_pcbc_encrypt, [LIB_DES="-ldes"; ++ with_des=yes], with_des=no) ++ fi ++ + if test "$with_des" = no; then + AC_CHECK_LIB(des524, des_pcbc_encrypt, [LIB_DES="-ldes524"; + with_des=yes], with_des=no) + fi ++ + if test "$with_des" = no; then + AC_CHECK_LIB(des425, des_pcbc_encrypt, [LIB_DES="-ldes425"; + with_des=yes], with_des=no) + fi ++ + if test "$with_des" = no; then + dnl if openssl is around, we might be able to use that for des + +@@ -493,7 +526,7 @@ + LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes, + cmu_have_rsaref=no) + +- AC_CHECK_LIB(crypto, des_pcbc_encrypt, ++ AC_CHECK_LIB(crypto, des_cbc_encrypt, + AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES) + LIB_DES="-lcrypto"; + with_des=yes], +@@ -502,10 +535,9 @@ + fi + fi + +-dnl if test "$with_des" != no; then +-dnl AC_DEFINE(WITH_DES) +-dnl LIB_DES="-ldes" +-dnl fi ++if test "$with_des" != no; then ++ AC_DEFINE(WITH_DES) ++fi + + AC_SUBST(LIB_DES) - if test "$with_des" != no; then -+ case "$host_os" in -+ freebsd*) -+ COM_ERR="-lcom_err" -+ ;; -+ esac - AC_CHECK_HEADER(krb.h, -- AC_CHECK_LIB(krb, krb_mk_priv, COM_ERR="", -- AC_CHECK_LIB(krb, krb_mk_priv, COM_ERR="-lcom_err", -- AC_WARN(No Kerberos V4 found); krb4=no, -ldes -lcom_err), -- -ldes), -- AC_WARN(No Kerberos V4 found); krb4=no) -+ AC_CHECK_LIB(krb, krb_mk_priv,:, -+ AC_WARN(No Kerberos V4 found); krb4=no, -+ -ldes ${COM_ERR}), -+ AC_WARN(No Kerberos V4 headers found); krb4=no) - else - AC_WARN(No DES library found for Kerberos V4 support) - krb4=no diff --git a/security/cyrus-sasl/files/patch-plugins::gssapi.c b/security/cyrus-sasl/files/patch-plugins::gssapi.c deleted file mode 100644 index 0227363..0000000 --- a/security/cyrus-sasl/files/patch-plugins::gssapi.c +++ /dev/null @@ -1,15 +0,0 @@ ---- plugins/gssapi.c.orig Fri Mar 9 23:56:46 2001 -+++ plugins/gssapi.c Mon Jan 21 21:03:32 2002 -@@ -71,6 +71,12 @@ - #include <saslutil.h> - #include <saslplug.h> - -+#ifdef HAVE_UNISTD_H -+#include <unistd.h> -+#endif -+ -+#include <errno.h> -+ - #ifdef WIN32 - /* This must be after sasl.h */ - # include "saslgssapi.h" diff --git a/security/cyrus-sasl/files/patch-saslauthd::Makefile.am b/security/cyrus-sasl/files/patch-saslauthd::Makefile.am index 0dd7869..89e79ec 100644 --- a/security/cyrus-sasl/files/patch-saslauthd::Makefile.am +++ b/security/cyrus-sasl/files/patch-saslauthd::Makefile.am @@ -1,11 +1,10 @@ ---- saslauthd/Makefile.am.orig Fri Mar 23 19:41:35 2001 -+++ saslauthd/Makefile.am Tue Aug 13 13:57:10 2002 -@@ -2,7 +2,7 @@ - man_MANS = saslauthd.8 - - saslauthd_SOURCES = saslauthd.c mechanisms.c globals.h mechanisms.h auth_dce.c auth_dce.h auth_getpwent.c auth_getpwent.h auth_krb4.c auth_krb4.h auth_pam.c auth_pam.h auth_rimap.c auth_rimap.h auth_shadow.c auth_shadow.h auth_sia.c auth_sia.h --saslauthd_LDADD = @SASL_KRB_LIB@ -+saslauthd_LDADD = @SASL_KRB_LIB@ @LIB_PAM@ @LIB_CRYPT@ - +--- saslauthd/Makefile.am.orig Thu Dec 20 20:31:19 2001 ++++ saslauthd/Makefile.am Tue Sep 10 01:26:07 2002 +@@ -7,5 +7,5 @@ INCLUDES = -I$(top_srcdir)/include - EXTRA_DIST = saslauthd.8 + + install-data-local: +- $(mkinstalldirs) $(DESTDIR)$(mandir)/cat8 +- $(INSTALL_DATA) saslauthd.8 $(DESTDIR)$(mandir)/cat8/saslauthd.8 ++ $(mkinstalldirs) $(DESTDIR)$(mandir)/man8 ++ $(INSTALL_DATA) saslauthd.8 $(DESTDIR)$(mandir)/man8/saslauthd.8 diff --git a/security/cyrus-sasl/files/pwcheck.sh b/security/cyrus-sasl/files/pwcheck.sh index 2fdfa60..3049098 100644 --- a/security/cyrus-sasl/files/pwcheck.sh +++ b/security/cyrus-sasl/files/pwcheck.sh @@ -3,64 +3,105 @@ # $FreeBSD$ # -action=$1 - -PREFIX=%%PREFIX%% - -# Suck in the configuration variables. -if [ -z "${source_rc_confs_defined}" ]; then - if [ -r /etc/defaults/rc.conf ]; then - . /etc/defaults/rc.conf - source_rc_confs - elif [ -r /etc/rc.conf ]; then - . /etc/rc.conf - fi -fi +# PROVIDE: cyrus_pwcheck +# REQUIRE: DAEMON +# BEFORE: mail imap +# KEYWORD: FreeBSD shutdown +# +# NOTE for FreeBSD 5.0+: +# If you want this script to start with the base rc scripts +# move cyrus_pwcheck.sh to /etc/rc.d/cyrus_pwcheck -# The following sasl_pwcheck_* variables may be defined in rc.conf +# Define the following cyrus_pwcheck_* variables in one of the following: +# /etc/rc.conf +# /etc/rc.conf.d/pwcheck +# ${prefix}/etc/rc.conf.d/pwcheck # -# sasl_pwcheck_enable - Set to YES to enable pwcheck -# Default: %%ENABLEPWCHECK%% +# cyrus_pwcheck_enable - Set to YES to enable pwcheck +# Default: %%ENABLE_PWCHECK%% # -# sasl_pwcheck_program - Path to pwcheck program (pwcheck/pwcheck_pam) -# Default: ${PREFIX}/sbin/%%PWCHECK%% +# cyrus_pwcheck_program - Path to pwcheck program (pwcheck/pwcheck_pam) +# Default: ${prefix}/sbin/%%PWCHECK%% -if [ -z "${sasl_pwcheck_enable}" ] ; then - sasl_pwcheck_enable=%%ENABLEPWCHECK%% -fi +prefix=%%PREFIX%% -if [ -z "${sasl_pwcheck_program}" ]; then - sasl_pwcheck_program=${PREFIX}/sbin/%%PWCHECK%% -fi +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr -rc=0 + name="cyrus_pwcheck" + rcvar=`set_rcvar` + command=${prefix}/sbin/%%PWCHECK%% + pidfile="/var/run/pwcheck.pid" -case "${sasl_pwcheck_enable}" in - [Yy][Ee][Ss]) - case "${action}" in + # The below may be removed when load_local_rc_config is added to rc.subr + + if [ -f ${prefix}/etc/rc.conf.d/"$name" ]; then + debug "Sourcing ${prefix}/etc/rc.conf.d/${name}" + . ${prefix}/etc/rc.conf.d/"$name" + fi - start) - if [ -x ${sasl_pwcheck_program} ] ; then - ${sasl_pwcheck_program} && echo -n " pwcheck" - fi - ;; + load_rc_config $name + + if [ -z "${cyrus_pwcheck_enable}" ] ; then + cyrus_pwcheck_enable=%%ENABLE_PWCHECK%% + fi - stop) - if [ -r /var/run/pwcheck.pid ]; then - kill `cat /var/run/pwcheck.pid` && echo -n " pwcheck" - rm /var/run/pwcheck.pid + # The above may be removed when load_local_rc_config is added to rc.subr + # + # load_local_rc_config $name + run_rc_command "$1" +else + # Suck in the configuration variables. + if [ -z "${source_rc_confs_defined}" ]; then + if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs + elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf fi - ;; + fi + + if [ -f ${prefix}/etc/rc.conf.d/cyrus_pwcheck" ]; then + . ${prefix}/etc/rc.conf.d/cyrus_pwcheck}" + fi + + if [ -z "${cyrus_pwcheck_enable}" ] ; then + cyrus_pwcheck_enable=%%ENABLE_PWCHECK%% + fi + if [ -z "${cyrus_pwcheck_program}" ]; then + cyrus_pwcheck_program=${prefix}/sbin/%%PWCHECK%% + fi + + rc=0 + + case "${cyrus_pwcheck_enable}" in + [Yy][Ee][Ss]) + case "${action}" in + + start) + if [ -x ${cyrus_pwcheck_program} ] ; then + ${cyrus_pwcheck_program} && echo -n " cyrus_pwcheck" + fi + ;; + + stop) + if [ -r /var/run/pwcheck.pid ]; then + kill `cat /var/run/pwcheck.pid` && echo -n " cyrus_pwcheck" + rm /var/run/pwcheck.pid + fi + ;; + + *) + echo "usage: $0 {start|stop}" 1>&2 + rc=64 + ;; + esac + ;; *) - echo "usage: $0 {start|stop}" 1>&2 - rc=64 + rc=0 ;; esac - ;; - *) - rc=0 - ;; -esac -exit $rc + exit $rc +fi diff --git a/security/cyrus-sasl/files/saslauthd.sh b/security/cyrus-sasl/files/saslauthd.sh index 70a99b4..a477f80 100644 --- a/security/cyrus-sasl/files/saslauthd.sh +++ b/security/cyrus-sasl/files/saslauthd.sh @@ -3,73 +3,124 @@ # $FreeBSD$ # -action=$1 - -PREFIX=%%PREFIX%% - -# Suck in the configuration variables. -if [ -z "${source_rc_confs_defined}" ]; then - if [ -r /etc/defaults/rc.conf ]; then - . /etc/defaults/rc.conf - source_rc_confs - elif [ -r /etc/rc.conf ]; then - . /etc/rc.conf - fi -fi +# PROVIDE: saslauthd1 +# REQUIRE: DAEMON +# BEFORE: mail imap +# KEYWORD: FreeBSD shutdown +# +# NOTE for FreeBSD 5.0+: +# If you want this script to start with the base rc scripts +# move saslauthd1.sh to /etc/rc.d/saslauthd1 -# The following sasl_saslauthd_* variables may be defined in rc.conf +# Define the following saslauthd1_* variables in one of the following: +# /etc/rc.conf +# /etc/rc.conf.d/saslauthd1 +# ${prefix}/etc/rc.conf.d/saslauthd1 # -# sasl_saslauthd1_enable - Set to YES to enable saslauthd -# Default: %%ENABLESASLAUTHD%% +# saslauthd1_enable - Set to YES to enable saslauthd +# Default: %%ENABLE_SASLAUTHD%% # -# sasl_saslauthd1_program - Path to saslauthd program -# Default: ${PREFIX}/sbin/saslauthd1 +# saslauthd1_program - Path to saslauthd program +# Default: ${prefix}/sbin/saslauthd1 # -# sasl_saslauthd1_flags - Flags to saslauthd program -# Default: -a pam +# saslauthd1_flags - Flags to saslauthd program +# Default: -a pam -if [ -z "${sasl_saslauthd1_enable}" ]; then - sasl_saslauthd1_enable=%%ENABLESASLAUTHD%% -fi +prefix=%%PREFIX%% -if [ -z "${sasl_saslauthd1_program}" ]; then - sasl_saslauthd1_program=${PREFIX}/sbin/saslauthd1 -fi +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr -if [ -z "${sasl_saslauthd1_flags}" ]; then - sasl_saslauthd1_flags="-a pam" -fi + name="saslauthd1" + rcvar=`set_rcvar` + command="${prefix}/sbin/${name}" + pidfile="/var/state/${name}/mux.pid" -rc=0 + # The below may be removed when load_local_rc_config is added to rc.subr -case "${sasl_saslauthd1_enable}" in - [Yy][Ee][Ss]) - case "${action}" in + if [ -f ${prefix}/etc/rc.conf.d/"$name" ]; then + debug "Sourcing ${prefix}/etc/rc.conf.d/${name}" + . ${prefix}/etc/rc.conf.d/"$name" + fi - start) - if [ -x ${sasl_saslauthd1_program} ] ; then - ${sasl_saslauthd1_program} ${sasl_saslauthd1_flags} \ - && echo -n " saslauthd1" - fi - ;; + load_rc_config $name + + if [ -z "${saslauthd1_enable}" ]; then + saslauthd1_enable=%%ENABLE_SASLAUTHD%% + fi - stop) - if [ -r /var/state/saslauthd1/mux.pid ]; then - kill `cat /var/state/saslauthd1/mux.pid` && \ - echo -n " saslauthd1" - rm /var/state/saslauthd1/mux.pid + # The above may be removed when load_local_rc_config is added to rc.subr + # + #load_local_rc_config $name + run_rc_command "$1" +else + # Suck in the configuration variables. + if [ -z "${source_rc_confs_defined}" ]; then + if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs + elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf fi - ;; + fi + + if [ -f ${prefix}/etc/rc.conf.d/saslauthd1 ]; then + . ${prefix}/etc/rc.conf.d/saslauthd1 + fi + + if [ -n "${sasl_saslauthd1_enable}" ]; then + echo "sasl_saslauthd1_enable has been depreciated, use saslauthd1_enable instead" + saslauthd1_enable=$sasl_saslauthd1_enable + fi + + if [ -z "${saslauthd1_enable}" ]; then + saslauthd1_enable=%%ENABLE_SASLAUTHD%% + fi + if [ -z "${saslauthd1_program}" ]; then + saslauthd1_program=${prefix}/sbin/saslauthd1 + fi + + if [ -n "${sasl_saslauthd1_flags}" ]; then + echo "sasl_saslauthd1_flags has been depreciated, use saslauthd1_flags instead" + saslauthd1_flags=$sasl_saslauthd1_flags + fi + + if [ -z "${saslauthd1_flags}" ]; then + saslauthd1_flags="-a pam" + fi + + rc=0 + + case "${saslauthd1_enable}" in + [Yy][Ee][Ss]) + case "${1}" in + + start) + if [ -x ${saslauthd1_program} ] ; then + ${saslauthd1_program} ${saslauthd1_flags} \ + && echo -n " saslauthd1" + fi + ;; + + stop) + if [ -r /var/state/saslauthd1/mux.pid ]; then + kill `cat /var/state/saslauthd1/mux.pid` && \ + echo -n " saslauthd1" + rm /var/state/saslauthd1/mux.pid + fi + ;; + + *) + echo "usage: $0 {start|stop}" 1>&2 + rc=64 + ;; + esac + ;; *) - echo "usage: $0 {start|stop}" 1>&2 - rc=64 + rc=0 ;; esac - ;; - *) - rc=0 - ;; -esac -exit $rc + exit $rc +fi diff --git a/security/cyrus-sasl/pkg-deinstall b/security/cyrus-sasl/pkg-deinstall index 2321024..30fa993 100644 --- a/security/cyrus-sasl/pkg-deinstall +++ b/security/cyrus-sasl/pkg-deinstall @@ -12,6 +12,32 @@ PKG_PREFIX=${PKG_PREFIX:=/usr/local} SASLDB_NAME=${PKG_PREFIX}/etc/%%SASLDB%% +remove_file() +{ + file=$1 + + if cmp -s ${file} ${file}.tmp; then + rm -f ${file} + fi + rm -f ${file}.tmp +} + +delete_rc_conf_d() { + PWCHECK_CONF=${PKG_PREFIX}/etc/rc.conf.d/cyrus_pwcheck + SASLAUTHD_CONF=${PKG_PREFIX}/etc/rc.conf.d/saslauthd1 + + if [ -f ${SASLAUTHD_CONF} ]; then + echo "saslauthd1_enable=%%ENABLE_SASLAUTHD%%" >> ${SASLAUTHD_CONF}.tmp + echo "saslauthd1_flags=\"-a pam\"" >> ${SASLAUTHD_CONF}.tmp + remove_file ${SASLAUTHD_CONF} + fi + if [ -f ${PWCHECK_CONF} ]; then + echo "cyrus_pwcheck_enable=%%ENABLE_PWCHECK%%" > ${PWCHECK_CONF}.tmp + echo "cyrus_pwcheck_program=${PKG_PREFIX}/sbin/%%PWCHECK%%" >> ${PWCHECK_CONF}.tmp + remove_file ${PWCHECK_CONF} + fi +} + # delete sasldb database delete_sasldb() { @@ -39,16 +65,14 @@ delete_user() { sendmail_conf() { if [ -f ${PKG_PREFIX}/lib/sasl/Sendmail.conf ]; then echo "pwcheck_method: %%PWCHECK_METHOD%%" > ${PKG_PREFIX}/lib/sasl/Sendmail.conf.tmp - if cmp -s ${PKG_PREFIX}/lib/sasl/Sendmail.conf ${PKG_PREFIX}/lib/sasl/Sendmail.conf.tmp; then - rm -f ${PKG_PREFIX}/lib/sasl/Sendmail.conf - fi - rm -f ${PKG_PREFIX}/lib/sasl/Sendmail.conf.tmp + remove_file ${PKG_PREFIX}/lib/sasl/Sendmail.conf fi } case $2 in DEINSTALL) delete_sasldb + delete_rc_conf_d sendmail_conf ;; POST-DEINSTALL) diff --git a/security/cyrus-sasl/pkg-install b/security/cyrus-sasl/pkg-install index 9237718..be7e93a 100644 --- a/security/cyrus-sasl/pkg-install +++ b/security/cyrus-sasl/pkg-install @@ -90,6 +90,23 @@ sendmail_conf() { fi } +create_rc_conf_d() { + PWCHECK_CONF=${PKG_PREFIX}/etc/rc.conf.d/cyrus_pwcheck + SASLAUTHD_CONF=${PKG_PREFIX}/etc/rc.conf.d/saslauthd1 + + if [ ! -d ${PKG_PREFIX}/etc/rc.conf.d ]; then + mkdir ${PKG_PREFIX}/etc/rc.conf.d + fi + if [ ! -f ${SASLAUTHD_CONF} ]; then + echo "saslauthd1_enable=%%ENABLE_SASLAUTHD%%" > ${SASLAUTHD_CONF} + echo "saslauthd1_flags=\"-a pam\"" >> ${SASLAUTHD_CONF} + fi + if [ ! -f ${PWCHECK_CONF} ]; then + echo "cyrus_pwcheck_enable=%%ENABLE_PWCHECK%%" > ${PWCHECK_CONF} + echo "cyrus_pwcheck_program=${PKG_PREFIX}/sbin/%%PWCHECK%%" >> ${PWCHECK_CONF} + fi +} + case $2 in PRE-INSTALL) create_user @@ -97,6 +114,7 @@ case $2 in POST-INSTALL) if [ "${PKG_BATCH}" = "NO" ]; then create_sasldb + create_rc_conf_d sendmail_conf fi ;; diff --git a/security/cyrus-sasl/pkg-plist b/security/cyrus-sasl/pkg-plist index e9df945..eff53e2 100644 --- a/security/cyrus-sasl/pkg-plist +++ b/security/cyrus-sasl/pkg-plist @@ -1,8 +1,9 @@ @comment The following makes sure that the pwcheck and saslauthd @comment daemons are stopped before removing the files. -@unexec if [ -f /var/run/pwcheck.pid ] ; then %D/etc/rc.d/pwcheck.sh stop ; echo " stopped." ; fi +@unexec if [ -f /var/run/pwcheck.pid ] ; then %D/etc/rc.d/cyrus_pwcheck.sh stop ; echo " stopped." ; fi @unexec if [ -f /var/state/saslauthd1/mux.pid ] ; then %D/etc/rc.d/saslauthd1.sh stop ; echo " stopped." ; fi -etc/rc.d/pwcheck.sh +etc/rc.d/cyrus_pwcheck.sh +etc/rc.d/cyrus_sasl1 etc/rc.d/saslauthd1.sh include/sasl1/hmac-md5.h include/sasl1/md5.h @@ -82,6 +83,7 @@ sbin/saslauthd1 %%PORTDOCS%%%%DOCSDIR%%/rfc2831.txt %%PORTDOCS%%%%DOCSDIR%%/gssapi.html %%PORTDOCS%%%%DOCSDIR%%/index.html +%%PORTDOCS%%%%DOCSDIR%%/macosx.html %%PORTDOCS%%%%DOCSDIR%%/programming.html %%PORTDOCS%%%%DOCSDIR%%/sysadmin.html %%PORTDOCS%%@dirrm %%DOCSDIR%% diff --git a/security/cyrus-sasl/scripts/configure.sasl b/security/cyrus-sasl/scripts/configure.sasl index 5f0aa68..5d3b662 100644 --- a/security/cyrus-sasl/scripts/configure.sasl +++ b/security/cyrus-sasl/scripts/configure.sasl @@ -93,7 +93,7 @@ fi ${MKDIR} ${WRKDIRPREFIX}${REALCURDIR} exec > ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc -echo "PREFIX= ${PREFIX}" +echo "PREFIX= ${PREFIX}" while [ "$1" ]; do case $1 in @@ -133,6 +133,7 @@ while [ "$1" ]; do \"MySQL\") echo "LIB_DEPENDS+= mysqlclient.10:\${PORTSDIR}/databases/mysql323-client" echo "CONFIGURE_ARGS+= --with-mysql=\${PREFIX}" + MYSQL_REQ=mysql MSG=1 ;; \"OpenLDAP1\") @@ -144,7 +145,9 @@ while [ "$1" ]; do echo "LIB_DEPENDS+= ldap.1:\${PORTSDIR}/net/openldap12" echo "LIB_DEPENDS+= lber.1:\${PORTSDIR}/net/openldap12" echo "CONFIGURE_ARGS+= --with-ldap=\${PREFIX}" + LDAP_REQ=ldap OPENLDAP=1 + MSG=1 ;; \"OpenLDAP2\") if [ "$OPENLDAP" ]; then @@ -155,22 +158,22 @@ while [ "$1" ]; do echo "LIB_DEPENDS+= ldap.2:\${PORTSDIR}/net/openldap20" echo "LIB_DEPENDS+= lber.2:\${PORTSDIR}/net/openldap20" echo "CONFIGURE_ARGS+= --with-ldap=\${PREFIX}" + LDAP_REQ=ldap OPENLDAP=1 + MSG=1 ;; \"PWCHECK\") if [ "$PWCHECK" ]; then echo "PWCHECK or PAMPWCHECK must be choosen seperately: Defaulting to PAMPWCHECK" > /dev/stderr else - echo "PWCHECK_SUB+= -e \"s;%%PWCHECK%%;pwcheck;g\"" - PWCHECK=1 + PWCHECK=pwcheck fi ;; \"PAMPWCHECK\") if [ "$PWCHECK" ]; then echo "PWCHECK or PAMPWCHECK must be choosen seperately: Defaulting to PWCHECK" > /dev/stderr else - echo "PWCHECK_SUB+= -e \"s;%%PWCHECK%%;pwcheck_pam;g\"" - PWCHECK=1 + PWCHECK=pwcheck_pam fi ;; \"SASLAUTHD\") @@ -188,24 +191,35 @@ while [ "$1" ]; do shift done -if [ ! "${PWCHECK}" ]; then - echo "PWCHECK_SUB+= -e \"s;%%PWCHECK%%;pwcheck;g\"" -fi - -if [ "$SASLAUTHD" ]; then - echo "PWCHECK_SUB+= -e \"s;%%ENABLEPWCHECK%%;no;g\"" - echo "PWCHECK_METHOD= saslauthd" - echo "SASLAUTHD_SUB+= -e \"s;%%ENABLESASLAUTHD%%;yes;g\"" +if [ "${SASLAUTHD}" ]; then + ENABLE_PWCHECK=no + PWCHECK_METHOD=saslauthd + ENABLE_SASLAUTHD=yes + if [ -z "${PWCHECK}" ]; then + PWCHECK=pwcheck + fi else - if [ "$PWCHECK" ]; then - echo "PWCHECK_SUB+= -e \"s;%%ENABLEPWCHECK%%;yes;g\"" + if [ "${PWCHECK}" ]; then + ENABLE_PWCHECK=yes else - echo "PWCHECK_SUB+= -e \"s;%%ENABLEPWCHECK%%;no;g\"" + ENABLE_PWCHECK=no + PWCHECK=pwcheck fi - echo "PWCHECK_METHOD+= pwcheck" - echo "SASLAUTHD_SUB+= -e \"s;%%ENABLESASLAUTHD%%;no;g\"" + PWCHECK_METHOD=pwcheck + ENABLE_SASLAUTHD=no fi +echo "PWCHECK= ${PWCHECK}" +echo "PWCHECK_METHOD= ${PWCHECK_METHOD}" +echo "ENABLE_PWCHECK= ${ENABLE_PWCHECK}" +echo "ENABLE_SASLAUTHD= ${ENABLE_SASLAUTHD}" + +echo "RC_SCRIPTS_SUB+= PREFIX=\${PREFIX} \\" +echo " PWCHECK=\${PWCHECK} \\" +echo " ENABLE_PWCHECK=\${ENABLE_PWCHECK} \\" +echo " ENABLE_SASLAUTHD=\${ENABLE_SASLAUTHD} \\" +echo " MYSQL_REQ=${MYSQL_REQ}" + if [ ! "${DEFJAVA}" ]; then echo "PLIST_SUB+= JAVASASL=\"@comment \"" fi @@ -214,6 +228,16 @@ if [ ! "${DBLIB}" ]; then echo "SASLDB_NAME= sasldb.db" fi -if [ "$OPENLDAP" ]; then - echo "LDAP_MYSQL_MSG= \"See sysadmin.html in the Cyrus-SASL docs directory for informaion on using LDAP or MySQL for authentication.\"" +if [ "${MSG}" ]; then + if [ -n "${LDAP_REQ}" ]; then + METHOD="LDAP" + + if [ -n "${MYSQL_REQ}" ]; then + METHOD="LDAP or MySQL" + fi + elif [ -n "${MYSQL_REQ}" ]; then + METHOD="MySQL" + fi + + echo "LDAP_MYSQL_MSG= \"See sysadmin.html in the Cyrus-SASL docs directory for informaion on using ${METHOD} for authentication.\"" fi |