diff options
author | Oliver Lehmann <oliver@FreeBSD.org> | 2008-06-12 20:13:47 +0000 |
---|---|---|
committer | Oliver Lehmann <oliver@FreeBSD.org> | 2008-06-12 20:13:47 +0000 |
commit | 76558768f8737d9649e8a05070ee092ece37ae8d (patch) | |
tree | f1b201c21e4e724e2dcef58ec154353789f7e88e /security/courier-authlib | |
parent | 940fe094347f20f0bc00394ef2eb0b6d5f679ca7 (diff) | |
download | ports-76558768f8737d9649e8a05070ee092ece37ae8d.tar.gz ports-76558768f8737d9649e8a05070ee092ece37ae8d.zip |
Notes
Diffstat (limited to 'security/courier-authlib')
-rw-r--r-- | security/courier-authlib/Makefile | 7 | ||||
-rw-r--r-- | security/courier-authlib/distinfo | 6 | ||||
-rw-r--r-- | security/courier-authlib/files/patch-Makefile.in | 158 | ||||
-rw-r--r-- | security/courier-authlib/files/patch-authvchkpw | 635 | ||||
-rw-r--r-- | security/courier-authlib/files/patch-configure | 493 |
5 files changed, 1085 insertions, 214 deletions
diff --git a/security/courier-authlib/Makefile b/security/courier-authlib/Makefile index d7d51324f336..c3b8b02990dc 100644 --- a/security/courier-authlib/Makefile +++ b/security/courier-authlib/Makefile @@ -6,7 +6,7 @@ # PORTNAME= courier-authlib -PORTVERSION= 0.60.2 +PORTVERSION= 0.60.4 CATEGORIES?= security mail .if defined(PKGNAMESUFFIX) MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} @@ -182,8 +182,9 @@ pre-everything:: .endif post-patch: - @${REINPLACE_CMD} -e 's|$$VPOPMAILLIBS|& -lcrypt|g' \ - -e 's|^\(INSTALL_STRIP_PROGRAM=\).*$$|\1"$${INSTALL_PROGRAM} -s"|' \ + @${REINPLACE_CMD} -e 's|$$VPOPMAILLIBS|& -lcrypt|g; \ + s|^\(INSTALL_STRIP_PROGRAM=\).*$$|\1"$${INSTALL_PROGRAM} -s"| ; \ + s|mysql_connect|mysql_real_connect|g' \ ${WRKSRC}/*/configure \ ${WRKSRC}/configure .for subdir in ${REMOVE_SUBDIRS} diff --git a/security/courier-authlib/distinfo b/security/courier-authlib/distinfo index ffb3a035f5f8..8ebea3f7a0e1 100644 --- a/security/courier-authlib/distinfo +++ b/security/courier-authlib/distinfo @@ -1,3 +1,3 @@ -MD5 (courier-authlib-0.60.2.tar.bz2) = dd972318b77efd0d04dbcb4a6b140bbe -SHA256 (courier-authlib-0.60.2.tar.bz2) = 824e92b6b6f7755ec06a22b5b1eb3734853ee8824612c62f92a9b2f33be04bbd -SIZE (courier-authlib-0.60.2.tar.bz2) = 2158473 +MD5 (courier-authlib-0.60.4.tar.bz2) = b09e08d62c71415419865f309766130f +SHA256 (courier-authlib-0.60.4.tar.bz2) = 9c3ce908f5c3420a13abc949905a3f852510617ae6c1f9f1a09afd707668dadc +SIZE (courier-authlib-0.60.4.tar.bz2) = 2171976 diff --git a/security/courier-authlib/files/patch-Makefile.in b/security/courier-authlib/files/patch-Makefile.in index 3bc64df0b1bb..1e6104ba6e6e 100644 --- a/security/courier-authlib/files/patch-Makefile.in +++ b/security/courier-authlib/files/patch-Makefile.in @@ -1,5 +1,5 @@ ---- Makefile.in.orig 2007-09-29 16:43:44.000000000 +0200 -+++ Makefile.in 2007-10-03 11:59:48.000000000 +0200 +--- Makefile.in.orig 2008-05-10 05:13:24.000000000 +0200 ++++ Makefile.in 2008-06-12 20:14:53.000000000 +0200 @@ -41,11 +41,10 @@ POST_UNINSTALL = : build_triplet = @build@ @@ -25,24 +25,62 @@ LTLIBRARIES = $(pkglib_LTLIBRARIES) am_libauthcustom_la_OBJECTS = authcustom.lo preauthcustom.lo libauthcustom_la_OBJECTS = $(am_libauthcustom_la_OBJECTS) -@@ -443,8 +442,14 @@ +@@ -133,6 +132,12 @@ + libauthuserdb_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libauthuserdb_la_LDFLAGS) $(LDFLAGS) -o $@ ++am_libauthvchkpw_la_OBJECTS = authvchkpw.lo authvchkpwlib.lo \ ++ preauthvchkpw.lo ++libauthvchkpw_la_OBJECTS = $(am_libauthvchkpw_la_OBJECTS) ++libauthvchkpw_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ ++ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ ++ $(libauthvchkpw_la_LDFLAGS) $(LDFLAGS) -o $@ + libcourierauth_la_DEPENDENCIES = numlib/libnumlib.la \ + random128/librandom128.la rfc822/libencode.la + am_libcourierauth_la_OBJECTS = authdaemon.lo authdaemonlib.lo \ +@@ -227,7 +232,8 @@ + $(libauthmysql_la_SOURCES) $(libauthpam_la_SOURCES) \ + $(libauthpgsql_la_SOURCES) $(libauthpipe_la_SOURCES) \ + $(libauthpwd_la_SOURCES) $(libauthshadow_la_SOURCES) \ +- $(libauthuserdb_la_SOURCES) $(libcourierauth_la_SOURCES) \ ++ $(libauthuserdb_la_SOURCES) $(libauthvchkpw_la_SOURCES) \ ++ $(libcourierauth_la_SOURCES) \ + $(libcourierauthcommon_la_SOURCES) \ + $(libcourierauthsasl_la_SOURCES) \ + $(libcourierauthsaslclient_la_SOURCES) \ +@@ -239,7 +245,8 @@ + $(libauthmysql_la_SOURCES) $(libauthpam_la_SOURCES) \ + $(libauthpgsql_la_SOURCES) $(libauthpipe_la_SOURCES) \ + $(libauthpwd_la_SOURCES) $(libauthshadow_la_SOURCES) \ +- $(libauthuserdb_la_SOURCES) $(libcourierauth_la_SOURCES) \ ++ $(libauthuserdb_la_SOURCES) $(libauthvchkpw_la_SOURCES) \ ++ $(libcourierauth_la_SOURCES) \ + $(am__libcourierauthcommon_la_SOURCES_DIST) \ + $(libcourierauthsasl_la_SOURCES) \ + $(libcourierauthsaslclient_la_SOURCES) \ +@@ -326,6 +333,7 @@ + LIBAUTHPWD = @LIBAUTHPWD@ + LIBAUTHSHADOW = @LIBAUTHSHADOW@ + LIBAUTHUSERDB = @LIBAUTHUSERDB@ ++LIBAUTHVCHKPW = @LIBAUTHVCHKPW@ + LIBDB = @LIBDB@ + LIBDL = @LIBDL@ + LIBGDBM = @LIBGDBM@ +@@ -431,22 +439,28 @@ + top_srcdir = @top_srcdir@ userdb = @userdb@ - vpopmail_home = @vpopmail_home@ AUTOMAKE_OPTIONS = dist-bzip2 --SUBDIRS = @LIBLTDL_SUBDIR@ @DBSUBDIR@ md5 sha1 libhmac numlib makedat userdb rfc822 random128 liblock liblog --DIST_SUBDIRS = libltdl gdbmobj bdbobj md5 sha1 libhmac numlib makedat userdb rfc822 random128 liblock liblog -+SUBDIRS = libltdl @DBSUBDIR@ md5 sha1 libhmac numlib -+@HAVE_USERDB_TRUE@SUBDIRS += makedat userdb +-SUBDIRS = libltdl gdbmobj bdbobj md5 sha1 libhmac numlib makedat userdb rfc822 random128 liblock liblog ++SUBDIRS = libltdl gdbmobj bdbobj md5 sha1 libhmac numlib ++@HAVE_USERDB_TRUE@SUBDIRS+= makedat userdb +SUBDIRS += rfc822 random128 -+@HAVE_BASE_TRUE@SUBDIRS += liblock liblog -+DIST_SUBDIRS = libltdl gdbmobj bdbobj md5 sha1 libhmac numlib -+@HAVE_USERDB_TRUE@DIST_SUBDIRS+= makedat userdb -+DIST_SUBDIRS += rfc822 random128 -+@HAVE_BASE_TRUE@DIST_SUBDIRS += liblock liblog ++@HAVE_BASE_TRUE@SUBDIRS+= liblock liblog INCLUDES = $(LTDLINCL) modules = @LIBAUTHUSERDB@ \ @LIBAUTHPAM@ @LIBAUTHPWD@ @LIBAUTHSHADOW@ \ -@@ -453,9 +458,11 @@ + @LIBAUTHPGSQL@ @LIBAUTHLDAP@ @LIBAUTHMYSQL@ \ +- @LIBAUTHCUSTOM@ @LIBAUTHPIPE@ ++ @LIBAUTHCUSTOM@ @LIBAUTHVCHKPW@ @LIBAUTHPIPE@ pkglibexecdir = $(libexecdir)/courier-authlib pkglibexec_SCRIPTS = authsystem.passwd @@ -57,7 +95,26 @@ sbin_SCRIPTS = authdaemond EXTRA_LTLIBRARIES = libauthuserdb.la \ -@@ -613,8 +620,8 @@ + libauthpam.la libauthpwd.la libauthshadow.la \ ++ libauthvchkpw.la \ + libauthpgsql.la \ + libauthldap.la \ + libauthmysql.la \ +@@ -517,6 +531,13 @@ + libauthshadow_la_LIBADD = $(commonlibadd) $(libauthshadow_t) + libauthshadow_la_LDFLAGS = $(commonldflags) + ++# The authvchkpw module ++libauthvchkpw_t = @VPOPMAILLIBS@ @LIBM@ ++libauthvchkpw_la_SOURCES = authvchkpw.c authvchkpwlib.c preauthvchkpw.c ++libauthvchkpw_la_DEPENDENCIES = $(commonlibdep) ++libauthvchkpw_la_LIBADD = $(commonlibadd) ++libauthvchkpw_la_LDFLAGS = $(commonldflags) $(libauthvchkpw_t) ++ + # The authpgsql module + libauthpgsql_t = @PGSQL_LIBS@ @LIBM@ @NETLIBS@ + libauthpgsql_la_SOURCES = authpgsql.c preauthpgsql.c authpgsqllib.c authpgsql.h +@@ -592,8 +613,8 @@ libcourierauthsaslclient_la_LIBADD = libcourierauth.la libcourierauthsaslclient_la_LDFLAGS = -export-symbols-regex '^auth_sasl_client$$' @@ -68,7 +125,7 @@ courierauthconfig_SOURCES = authinfo.c authpasswd_SOURCES = authpasswd.c -@@ -655,7 +662,7 @@ +@@ -634,7 +655,7 @@ man3 = authlib.3 auth_generic.3 auth_login.3 auth_getuserinfo.3 \ auth_enumerate.3 auth_passwd.3 auth_getoption.3 auth_sasl.3 @@ -76,8 +133,34 @@ +man1 = authtest.1 man_MANS = $(man1) $(man3) BUILT1 = authlib.html authldaprc.h authmysqlrc.h authpgsqlrc.h authpiperc.h \ - authdaemonrc.h vpopmail_config.h packageversion.h \ -@@ -1038,8 +1045,8 @@ + authdaemonrc.h packageversion.h \ +@@ -769,6 +790,8 @@ + $(libauthshadow_la_LINK) $(libauthshadow_la_OBJECTS) $(libauthshadow_la_LIBADD) $(LIBS) + libauthuserdb.la: $(libauthuserdb_la_OBJECTS) $(libauthuserdb_la_DEPENDENCIES) + $(libauthuserdb_la_LINK) $(libauthuserdb_la_OBJECTS) $(libauthuserdb_la_LIBADD) $(LIBS) ++libauthvchkpw.la: $(libauthvchkpw_la_OBJECTS) $(libauthvchkpw_la_DEPENDENCIES) ++ $(libauthvchkpw_la_LINK) $(libauthvchkpw_la_OBJECTS) $(libauthvchkpw_la_LIBADD) $(LIBS) + libcourierauth.la: $(libcourierauth_la_OBJECTS) $(libcourierauth_la_DEPENDENCIES) + $(libcourierauth_la_LINK) -rpath $(pkglibdir) $(libcourierauth_la_OBJECTS) $(libcourierauth_la_LIBADD) $(LIBS) + libcourierauthcommon.la: $(libcourierauthcommon_la_OBJECTS) $(libcourierauthcommon_la_DEPENDENCIES) +@@ -947,6 +970,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authtest.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authuserdb.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authuserdbpwd.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authvchkpw.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authvchkpwlib.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkpassword.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkpasswordmd5.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkpasswordsha1.Plo@am__quote@ +@@ -963,6 +988,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preauthshadow.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preauthuserdb.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preauthuserdbcommon.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preauthvchkpw.Plo@am__quote@ + + .c.o: + @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@@ -1014,8 +1040,8 @@ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ @@ -88,7 +171,7 @@ done uninstall-man1: @$(NORMAL_UNINSTALL) -@@ -1083,8 +1090,8 @@ +@@ -1059,8 +1085,8 @@ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ @@ -99,7 +182,7 @@ done uninstall-man3: @$(NORMAL_UNINSTALL) -@@ -1462,17 +1469,23 @@ +@@ -1438,17 +1464,23 @@ info-am: @@ -132,7 +215,20 @@ install-html: install-html-recursive -@@ -1590,6 +1603,19 @@ +@@ -1521,6 +1553,12 @@ + uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS + + ++authvchkpw.lo: authvchkpw.c vpopmail_config.h ++preauthvchkpw.lo: preauthvchkpw.c vpopmail_config.h ++ ++vpopmail_config.h: ++ echo '#include "@vpopmail_home@/include/config.h"' >vpopmail_config.h ++ + authpgsqllib.lo: authpgsqllib.c authpgsqlrc.h + + @HAVE_AUTHPGSQL_TRUE@install-authpgsqlrc: +@@ -1560,6 +1598,19 @@ @HAVE_LDAP_FALSE@uninstall-authldaprc: @HAVE_LDAP_FALSE@ @: @@ -152,7 +248,7 @@ authldaprc.h: echo "#define AUTHLDAPRC \"@authldaprc@\"" >authldaprc.h -@@ -1619,16 +1645,22 @@ +@@ -1589,16 +1640,22 @@ authpiperc.h: echo "#define PIPE_PROGRAM \"@authProg@\"" >authpiperc.h @@ -184,7 +280,7 @@ authdaemonrc.h: echo "#define AUTHDAEMONRC \"@authdaemonrc@\"" >authdaemonrc.h -@@ -1671,18 +1703,18 @@ +@@ -1641,21 +1698,23 @@ # automake still a bit stupid... install-data-hook: install-authdaemonrc install-authpgsqlrc \ @@ -212,7 +308,12 @@ test "@LIBAUTHUSERDB@" = "" && exit 0 ;\ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) makedat/makedatprog \ $(DESTDIR)$(pkglibexecdir)/makedatprog ; \ -@@ -1700,7 +1732,7 @@ ++ $(INSTALL_SCRIPT) userdb/vchkpw2userdb \ ++ $(DESTDIR)$(sbindir)/vchkpw2userdb ; \ + $(INSTALL_SCRIPT) userdb/pw2userdb \ + $(DESTDIR)$(sbindir)/pw2userdb ; \ + $(INSTALL_SCRIPT) userdb/makeuserdb \ +@@ -1668,9 +1727,10 @@ $(DESTDIR)$(sbindir)/userdb-test-cram-md5 uninstall-hook: uninstall-authldaprc uninstall-authdaemonrc uninstall-authmysqlrc uninstall-authpgsqlrc @@ -220,8 +321,11 @@ +@HAVE_BASE_TRUE@ rm -f $(DESTDIR)$(pkglibexecdir)/authdaemond test "@AUTHUSERDB@" = "" && exit 0 ;\ rm -f $(DESTDIR)$(pkglibexecdir)/makedatprog \ - $(DESTDIR)$(sbindir)/vchkpw2userdb \ -@@ -1714,7 +1746,7 @@ ++ $(DESTDIR)$(sbindir)/vchkpw2userdb \ + $(DESTDIR)$(sbindir)/pw2userdb \ + $(DESTDIR)$(sbindir)/makeuserdb \ + $(DESTDIR)$(sbindir)/userdb \ +@@ -1681,7 +1741,7 @@ CONFIG_FILES=authlib.html CONFIG_HEADERS= $(SHELL) ./config.status authlib.3: authlib.3.in @@ -230,7 +334,7 @@ @HAVE_SGML_TRUE@authpasswd.html: authpasswd.sgml docbook/sgml2html @HAVE_SGML_TRUE@ docbook/sgml2html authpasswd.sgml authpasswd.html -@@ -1788,10 +1820,10 @@ +@@ -1755,10 +1815,10 @@ @SHELL@ authmigrate install-configure: diff --git a/security/courier-authlib/files/patch-authvchkpw b/security/courier-authlib/files/patch-authvchkpw new file mode 100644 index 000000000000..77130366fe57 --- /dev/null +++ b/security/courier-authlib/files/patch-authvchkpw @@ -0,0 +1,635 @@ +diff -ruN authvchkpw.c authvchkpw.c +--- authvchkpw.c 1970-01-01 01:00:00.000000000 +0100 ++++ authvchkpw.c 2008-06-12 19:15:23.000000000 +0200 +@@ -0,0 +1,242 @@ ++/* ++** Copyright 1998 - 2007 Double Precision, Inc. See COPYING for ++** distribution information. ++*/ ++ ++#if HAVE_CONFIG_H ++#include "courier_auth_config.h" ++#endif ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <errno.h> ++#include <pwd.h> ++#if HAVE_UNISTD_H ++#include <unistd.h> ++#endif ++#include "auth.h" ++#include "authstaticlist.h" ++#include "courierauthdebug.h" ++#include "vpopmail_config.h" ++#include <vpopmail.h> ++#include <vauth.h> ++ ++static const char rcsid[]="$Id: authvchkpw.c,v 1.29 2007/10/07 02:50:45 mrsam Exp $"; ++ ++ ++extern int auth_vchkpw_pre(const char *userid, const char *service, ++ int (*callback)(struct authinfo *, void *), ++ void *arg); ++ ++extern FILE *authvchkpw_file(const char *, const char *); ++ ++static int auth_vchkpw_login(const char *service, char *authdata, ++ int (*callback_func)(struct authinfo *, void *), void *callback_arg); ++ ++struct callback_info { ++ const char *pass; ++ int (*callback_func)(struct authinfo *, void *); ++ void *callback_arg; ++ }; ++ ++static int callback_vchkpw(struct authinfo *a, void *p) ++{ ++struct callback_info *i=(struct callback_info *)p; ++ ++ /* exit with perm failure if the supplied password is empty, ++ * or if the supplied password doesnt match the retrieved password */ ++ if (a->passwd == 0) ++ { ++ DPRINTF("no password supplied"); ++ return (-1); ++ } ++ ++ if (authcheckpassword(i->pass, a->passwd)) ++ return (-1); ++ ++ a->clearpasswd=i->pass; ++ return (*i->callback_func)(a, i->callback_arg); ++} ++ ++#if HAVE_HMACLIB ++ ++#include "libhmac/hmac.h" ++#include "cramlib.h" ++ ++static int auth_vchkpw_login(const char *service, char *authdata, ++ int (*callback_func)(struct authinfo *, void *), void *callback_arg); ++ ++static int auth_vchkpw_cram(const char *service, ++ const char *authtype, char *authdata, ++ int (*callback_func)(struct authinfo *, void *), ++ void *callback_arg) ++{ ++ struct cram_callback_info cci; ++ ++ if (auth_get_cram(authtype, authdata, &cci)) ++ return (-1); ++ ++ cci.callback_func=callback_func; ++ cci.callback_arg=callback_arg; ++ ++ return auth_vchkpw_pre(cci.user, service, &auth_cram_callback, &cci); ++} ++#endif ++ ++int auth_vchkpw(const char *service, const char *authtype, char *authdata, ++ int (*callback_func)(struct authinfo *, void *), ++ void *callback_arg) ++{ ++ if (strcmp(authtype, AUTHTYPE_LOGIN) == 0) ++ return (auth_vchkpw_login(service, authdata, ++ callback_func, callback_arg)); ++ ++#if HAVE_HMACLIB ++ return (auth_vchkpw_cram(service, authtype, authdata, ++ callback_func, callback_arg)); ++#else ++ errno=EPERM; ++ return (-1); ++#endif ++ ++} ++ ++ ++ ++static int auth_vchkpw_login(const char *service, char *authdata, ++ int (*callback_func)(struct authinfo *, void *), void *callback_arg) ++{ ++char *user, *pass; ++struct callback_info ci; ++int rc; ++ /* Make sure that we have been supplied with the correct ++ * AUTHDATA format which is : userid<NEWLINE>password<NEWLINE> ++ */ ++ if ( (user=strtok(authdata, "\n")) == 0 || (pass=strtok(0, "\n")) == 0) ++ { ++ /* login syntax was invalid */ ++ errno=EPERM; ++ return (-1); ++ } ++ ++ ci.pass=pass; ++ ci.callback_func=callback_func; ++ ci.callback_arg=callback_arg; ++ ++ /* auth_vchkpw_pre() does this : ++ * - lookup the passwd entry for this user from the auth backend ++ * - check to see if this user is permitted to use this service type ++ * If successful it will populate the ci struct with the ++ * user's passwd entry. Return value of function will be 0. ++ * If unsuccessful (eg user doesnt exist, or is not permitted to ++ * use this auth method), it will return : ++ * <0 on a permanent failure (eg user doesnt exist) ++ * >0 on a temp failure ++ */ ++ rc=auth_vchkpw_pre(user, service, &callback_vchkpw, &ci); ++ ++ if (rc) ++ return rc; ++ ++ /* user has been successfully auth'ed at this point */ ++ ++#if 0 ++ /* ++ ** sam - new courier-authlib never receives TCPREMOTEIP, at this ++ ** time. ++ */ ++ ++#ifdef HAVE_OPEN_SMTP_RELAY ++ if ( (strcmp("pop3", service)==0) || (strcmp("imap", service)==0) ) { ++ /* Michael Bowe 13th August 2003 ++ * ++ * There is a problem here because open_smtp_relay needs ++ * to get the user's ip from getenv("TCPREMOTEIP"). ++ * If we run --with-authvchkpw --without-authdaemon, ++ * then this var is available. ++ * But if we run --with-authvchkpw --with-authdaemon, ++ * then TCPREMOTEIP is null ++ * ++ * If TCPREMOTEIP isnt available, then open_smtp_relay() ++ * will just return() back immediately. ++ */ ++ open_smtp_relay(); ++ } ++#endif ++#endif ++ ++ return 0; ++} ++ ++static void authvchkpwclose() ++{ ++} ++ ++static int auth_vchkpw_changepass(const char *service, ++ const char *username, ++ const char *pass, ++ const char *npass) ++{ ++struct vqpasswd *vpw; ++char User[256]; ++char Domain[256]; ++ ++ /* Take the supplied userid, and split it out into the user and domain ++ * parts. (If a domain was not supplied, then set the domain to be ++ * the default domain) ++ */ ++ /* WARNING: parse_email lowercases the username in place - not const!! */ ++ if ( parse_email(username, User, Domain, 256) != 0) { ++ /* Failed to successfully extract user and domain. ++ * So now exit with a permanent failure code ++ */ ++ return(-1); ++ } ++ ++ /* check to see if domain exists. ++ * If you pass an alias domain to vget_assign, it will change it ++ * to be the real domain on return from the function ++ */ ++ if ( vget_assign(Domain,NULL,0,NULL,NULL) ==NULL ) { ++ /* domain doesnt exist */ ++ return (-1); ++ } ++ ++ if ( (vpw=vauth_getpw(User, Domain)) == NULL) { ++ /* That user doesnt exist in the auth backend */ ++ errno=ENOENT; ++ return (-1); ++ } ++ ++ /* Exit if any of the following : ++ * - user's password field in the passwd entry is empty ++ * - supplied current password doesnt match stored password ++ */ ++ if (vpw->pw_passwd == 0 || authcheckpassword(pass, vpw->pw_passwd)) { ++ errno=EPERM; ++ return (-1); ++ } ++ ++ /* save the new password into the auth backend */ ++ if ( vpasswd(User, Domain, (char *)npass, 0) != 0 ) { ++ /* password set failed */ ++ return (-1); ++ }; ++ ++ return (0); ++} ++ ++struct authstaticinfo authvchkpw_info={ ++ "authvchkpw", ++ auth_vchkpw, ++ auth_vchkpw_pre, ++ authvchkpwclose, ++ auth_vchkpw_changepass, ++ authvchkpwclose, ++ NULL}; ++ ++ ++struct authstaticinfo *courier_authvchkpw_init() ++{ ++ return &authvchkpw_info; ++} +diff -ruN authvchkpwlib.c authvchkpwlib.c +--- authvchkpwlib.c 1970-01-01 01:00:00.000000000 +0100 ++++ authvchkpwlib.c 2008-06-12 19:15:33.000000000 +0200 +@@ -0,0 +1,33 @@ ++/* ++** Copyright 1998 - 2000 Double Precision, Inc. See COPYING for ++** distribution information. ++*/ ++ ++#if HAVE_CONFIG_H ++#include "courier_auth_config.h" ++#endif ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <errno.h> ++#include <pwd.h> ++#if HAVE_UNISTD_H ++#include <unistd.h> ++#endif ++#include <sys/types.h> ++#include <sys/stat.h> ++#include "auth.h" ++ ++static const char rcsid[]="$Id: authvchkpwlib.c,v 1.8 2004/10/21 00:10:49 mrsam Exp $"; ++ ++char *authvchkpw_isvirtual(char *c) ++{ ++char *p; ++ ++ if ((p=strchr(c, '@')) != 0) return (p); ++#if 0 ++ if ((p=strchr(c, '%')) != 0) return (p); ++#endif ++ if ((p=strchr(c, ':')) != 0) return (p); ++ return (0); ++} +diff -ruN courier_auth_config.h courier_auth_config.h +--- courier_auth_config.h 2008-05-08 19:11:34.000000000 +0200 ++++ courier_auth_config.h 2008-06-12 19:26:44.000000000 +0200 +@@ -61,6 +61,9 @@ + /* Whether header installation directory is nontstandard */ + /* #undef HAVE_NOSTDHEADERDIR */ + ++/* Whether -lvpopmail has the open_smtp_relay() function */ ++/* #undef HAVE_OPEN_SMTP_RELAY */ ++ + /* Define to 1 if you have the <Pam/pam_appl.h> header file. */ + /* #undef HAVE_PAM_PAM_APPL_H */ + +@@ -118,6 +121,9 @@ + /* Define to 1 if you have the <unistd.h> header file. */ + #define HAVE_UNISTD_H 1 + ++/* Whether -lvpopmail has the vset_lastauth() function */ ++/* #undef HAVE_VSET_LASTAUTH */ ++ + /* Whether we must a prototype for crypt() */ + #define NEED_CRYPT_PROTOTYPE 0 + +diff -ruN courier_auth_config.h.in courier_auth_config.h.in +--- courier_auth_config.h.in 2008-05-10 05:13:31.000000000 +0200 ++++ courier_auth_config.h.in 2008-06-12 19:26:46.000000000 +0200 +@@ -60,6 +60,9 @@ + /* Whether header installation directory is nontstandard */ + #undef HAVE_NOSTDHEADERDIR + ++/* Whether -lvpopmail has the open_smtp_relay() function */ ++#undef HAVE_OPEN_SMTP_RELAY ++ + /* Define to 1 if you have the <Pam/pam_appl.h> header file. */ + #undef HAVE_PAM_PAM_APPL_H + +@@ -117,6 +120,9 @@ + /* Define to 1 if you have the <unistd.h> header file. */ + #undef HAVE_UNISTD_H + ++/* Whether -lvpopmail has the vset_lastauth() function */ ++#undef HAVE_VSET_LASTAUTH ++ + /* Whether we must a prototype for crypt() */ + #undef NEED_CRYPT_PROTOTYPE + +diff -ruN preauthvchkpw.c preauthvchkpw.c +--- preauthvchkpw.c 1970-01-01 01:00:00.000000000 +0100 ++++ preauthvchkpw.c 2008-06-12 19:22:22.000000000 +0200 +@@ -0,0 +1,159 @@ ++/* ++** Copyright 1998 - 2001 Double Precision, Inc. See COPYING for ++** distribution information. ++*/ ++ ++#if HAVE_CONFIG_H ++#include "courier_auth_config.h" ++#endif ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <errno.h> ++#include <pwd.h> ++#if HAVE_UNISTD_H ++#include <unistd.h> ++#endif ++#include "auth.h" ++#include "courierauthdebug.h" ++#include <vpopmail.h> ++#include <vauth.h> ++#include "vpopmail_config.h" ++ ++/* make use of pw_flags only if available */ ++#ifndef VQPASSWD_HAS_PW_FLAGS ++#define pw_flags pw_gid ++#endif ++ ++extern FILE *authvchkpw_file(const char *, const char *); ++ ++static const char rcsid[]="$Id: preauthvchkpw.c,v 1.26 2007/04/22 18:53:30 mrsam Exp $"; ++ ++/* This function is called by the auth_vchkpw() function ++ * ++ * This function does the following : ++ * - extract the username and domain from the supplied userid ++ * - lookup the passwd entry for that user from the auth backend ++ * - populate *and return) a courier authinfo structure with the values ++ * from the vpopmail passwd entry ++ * ++ * Return -1 on perm failure ++ * Return 0 on success ++ * Return 1 on temp failure ++ * ++ */ ++ ++int auth_vchkpw_pre( ++ const char *userid, ++ const char *service, ++ int (*callback)(struct authinfo *, void *), ++ void *arg) ++{ ++struct vqpasswd *vpw; ++static uid_t uid; ++gid_t gid; ++struct authinfo auth; ++static char User[256]; ++static char Domain[256]; ++static char options[80]; ++ ++ /* Make sure the auth struct is empty */ ++ memset(&auth, 0, sizeof(auth)); ++ ++ /* Take the supplied userid, and split it out into the user and domain ++ * parts. (If a domain was not supplied, then set the domain to be ++ * the default domain) ++ */ ++ if ( parse_email(userid, User, Domain, 256) != 0) { ++ /* Failed to successfully extract user and domain. ++ * So now exit with a permanent failure code ++ */ ++ DPRINTF("vchkpw: unable to split into user and domain"); ++ return(-1); ++ } ++ ++ /* Check to see if the domain exists. ++ * If so, on return vget_assign will : ++ * Rewrite Domain to be the real domain if it was sent as an alias domain ++ * Retrieve the domain's uid and gid ++ */ ++ if ( vget_assign(Domain,NULL,0,&uid, &gid) == NULL ) { ++ /* Domain does not exist ++ * So now exit with a permanent failure code */ ++ DPRINTF("vchkpw: domain does not exist"); ++ return (-1); ++ } ++ ++ /* Try and retrieve the user's passwd entry from the auth backend */ ++ if ( (vpw=vauth_getpw(User, Domain)) == NULL) { ++ /* User does not exist ++ * So now exit with a permanent failure code ++ */ ++ DPRINTF("vchkpw: user does not exist"); ++ return (-1); ++ } ++ ++ /* Check to see if the user has been allocated a dir yet. ++ * Some of the vpopmail backends (eg mysql) allow users to ++ * be manually inserted into the auth backend but without ++ * allocating a dir. A dir will be created when the user ++ * first trys to auth (or when they 1st receive mail) ++ */ ++ if (vpw->pw_dir == NULL || strlen(vpw->pw_dir) == 0 ) { ++ /* user does not have a dir allocated yet */ ++ if ( make_user_dir(User, Domain, uid, gid) == NULL) { ++ /* Could not allocate a user dir at this time ++ * so exit with a temp error code ++ */ ++ DPRINTF("vchkpw: make_user_dir failed"); ++ return(1); ++ } ++ /* We have allocated the user a dir now. ++ * Go and grab the updated passwd entry ++ */ ++ if ( (vpw=vauth_getpw(User, Domain)) == NULL ) { ++ /* Could not get the passwd entry ++ * So exit with a permanent failure code ++ */ ++ DPRINTF("vchkpw: could not get the password entry"); ++ return(-1); ++ } ++ } ++ ++ snprintf(options, sizeof(options), ++ "disablewebmail=%d,disablepop3=%d,disableimap=%d", ++ vpw->pw_flags & NO_WEBMAIL ? 1 : 0, ++ vpw->pw_flags & NO_POP ? 1 : 0, ++ vpw->pw_flags & NO_IMAP ? 1 : 0); ++ ++#ifdef HAVE_VSET_LASTAUTH ++ /* if we are keeping track of their last auth time, ++ * then store this value now. Note that this isnt ++ * consistent with the authentication via vchkpw ++ * because it only stores the lastauth attempt ++ * after the password has been verified. Here we are ++ * logging it after the user has been found to exist, ++ * but before the password has been verified. We could ++ * do the logging inside authvchkpw.c, but that would ++ * be a lot harder because we would have to go and ++ * parse_email() again there before calling vset_lastauth() ++ */ ++ vset_lastauth(User, Domain, service); ++#endif ++ ++ /* save the user's passwd fields into the appropriate ++ * courier structure ++ */ ++ /*auth.sysusername = userid;*/ ++ auth.sysuserid = &uid; ++ auth.sysgroupid = gid; ++ auth.homedir = vpw->pw_dir; ++ auth.address = userid; ++ auth.fullname = vpw->pw_gecos; ++ auth.passwd = vpw->pw_passwd; ++ auth.clearpasswd = vpw->pw_clear_passwd; ++ auth.options = options; ++ courier_authdebug_authinfo("DEBUG: authvchkpw: ", &auth, 0, vpw->pw_passwd); ++ ++ return ((*callback)(&auth, arg)); ++} +diff -ruN userdb/Makefile.in userdb/Makefile.in +--- userdb/Makefile.in 2008-05-08 19:21:19.000000000 +0200 ++++ userdb/Makefile.in 2008-06-12 19:26:47.000000000 +0200 +@@ -48,7 +48,7 @@ + $(srcdir)/../missing $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/makeuserdb.in \ + $(srcdir)/pw2userdb.in $(srcdir)/userdb.pl.in \ +- $(top_srcdir)/configure ++ $(srcdir)/vchkpw2userdb.in $(top_srcdir)/configure + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/configure.in + am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ +@@ -56,7 +56,7 @@ + am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno + mkinstalldirs = $(install_sh) -d +-CONFIG_CLEAN_FILES = userdb.pl makeuserdb pw2userdb ++CONFIG_CLEAN_FILES = userdb.pl makeuserdb pw2userdb vchkpw2userdb + LTLIBRARIES = $(noinst_LTLIBRARIES) + libuserdb_la_LIBADD = + am_libuserdb_la_OBJECTS = userdb.lo userdb2.lo userdbmkpw.lo +@@ -223,7 +223,7 @@ + userdb.html.in userdb.8.in \ + userdbpw.html.in userdbpw.8.in + +-noinst_SCRIPTS = makeuserdb pw2userdb dummy ++noinst_SCRIPTS = makeuserdb pw2userdb vchkpw2userdb dummy + noinst_DATA = makeuserdb.html userdb.html userdbpw.html + userdbpw_SOURCES = userdbpw.c + userdbpw_LDADD = libuserdb.la @HMACLIB@ @MD5LIB@ @SHA1LIB@ @CRYPTLIBS@ +@@ -276,6 +276,8 @@ + cd $(top_builddir) && $(SHELL) ./config.status $@ + pw2userdb: $(top_builddir)/config.status $(srcdir)/pw2userdb.in + cd $(top_builddir) && $(SHELL) ./config.status $@ ++vchkpw2userdb: $(top_builddir)/config.status $(srcdir)/vchkpw2userdb.in ++ cd $(top_builddir) && $(SHELL) ./config.status $@ + + clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) +diff -ruN userdb/configure userdb/configure +--- userdb/configure 2008-05-08 19:21:18.000000000 +0200 ++++ userdb/configure 2008-06-12 19:26:49.000000000 +0200 +@@ -20639,7 +20639,7 @@ + fi + + +-ac_config_files="$ac_config_files Makefile userdb.pl makeuserdb pw2userdb" ++ac_config_files="$ac_config_files Makefile userdb.pl makeuserdb pw2userdb vchkpw2userdb" + + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure +@@ -21252,6 +21252,7 @@ + "userdb.pl") CONFIG_FILES="$CONFIG_FILES userdb.pl" ;; + "makeuserdb") CONFIG_FILES="$CONFIG_FILES makeuserdb" ;; + "pw2userdb") CONFIG_FILES="$CONFIG_FILES pw2userdb" ;; ++ "vchkpw2userdb") CONFIG_FILES="$CONFIG_FILES vchkpw2userdb" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 + echo "$as_me: error: invalid argument: $ac_config_target" >&2;} +diff -ruN userdb/vchkpw2userdb.in userdb/vchkpw2userdb.in +--- userdb/vchkpw2userdb.in 1970-01-01 01:00:00.000000000 +0100 ++++ userdb/vchkpw2userdb.in 2008-06-12 19:26:29.000000000 +0200 +@@ -0,0 +1,80 @@ ++#! @PERL@ ++# ++# Convert vchkpw to userdb format. ++# ++# $Id: vchkpw2userdb.in,v 1.4 2000/02/16 01:12:13 mrsam Exp $ ++# ++# Copyright 1998 - 1999 Double Precision, Inc. See COPYING for ++# distribution information. ++ ++use Getopt::Long; ++ ++die "Invalid options.\n" unless ++ GetOptions("vpopmailhome=s" => \$vpopmailhome, ++ "todir=s" => \$todir); ++ ++if ( ! ( $vpopmailhome =~ /./ )) ++{ ++ (undef, undef, undef, undef, undef, undef, undef, $vpopmailhome) ++ = getpwnam("vpopmail"); ++ ++ die "Cannot find vpopmail home.\n" unless $vpopmailhome =~ /./; ++} ++ ++-d "$vpopmailhome" || die "$vpopmailhome: not found.\n"; ++ ++if ( $todir =~ /./ ) ++{ ++ -d "$todir" || mkdir($todir, 0700) || die "$!\n"; ++} ++ ++$bindir=$0; ++ ++if ($bindir =~ /^(.*)\/[^\/]*$/ ) ++{ ++ $bindir=$1; ++} ++else ++{ ++ $bindir="."; ++} ++ ++die "Unable to locate pw2userdb.\n" unless -f "$bindir/pw2userdb"; ++ ++$redir=""; ++ ++if ( $todir =~ /./ ) ++{ ++ $redir=">$todir/users-vpasswd"; ++ -d "$todir/domains" || mkdir("$todir/domains", 0700) || die "$!\n"; ++} ++ ++if ( -f "$vpopmailhome/users/vpasswd") ++{ ++ $rc=system ("$bindir/pw2userdb --vpopuid --passwd='$vpopmailhome/users/vpasswd' --noshadow --nouid $redir"); ++ exit $rc / 256 if $rc; ++} ++ ++if ( opendir(DIR, "$vpopmailhome/domains")) ++{ ++ while ($domain=readdir(DIR)) ++ { ++ $domainopt="--domain='$domain'"; ++ $domainopt="" if $domain eq "default"; ++ next if $domain eq "." || $domain eq ".."; ++ next unless -f "$vpopmailhome/domains/$domain/vpasswd"; ++ $redir=""; ++ if ( $todir =~ /./ ) ++ { ++ $redir=">$todir/domains/$domain"; ++ $redir=">$todir/users-default" ++ if $domain eq "default"; ++ } ++ ++ $rc=system ("$bindir/pw2userdb --passwd='$vpopmailhome/domains/$domain/vpasswd' --vpopuid --noshadow --nouid $domainopt $redir"); ++ ++ exit $rc / 256 if $rc != 0; ++ } ++ close(DIR); ++} ++ diff --git a/security/courier-authlib/files/patch-configure b/security/courier-authlib/files/patch-configure index 4489fe9fe086..a61996a84c95 100644 --- a/security/courier-authlib/files/patch-configure +++ b/security/courier-authlib/files/patch-configure @@ -1,6 +1,16 @@ ---- configure.orig 2007-09-29 16:43:43.000000000 +0200 -+++ configure 2007-10-03 13:14:36.000000000 +0200 -@@ -942,7 +942,11 @@ +--- configure.orig 2008-06-12 20:25:13.000000000 +0200 ++++ configure 2008-06-12 20:23:39.000000000 +0200 +@@ -907,6 +907,9 @@ + SHADOWLIBS + LIBAUTHSHADOW + LIBAUTHPWD ++vpopmail_home ++VPOPMAILLIBS ++LIBAUTHVCHKPW + authpgsqlrc + PG_CONFIG + PGSQL_LIBS +@@ -937,7 +940,11 @@ HAVE_SGML_FALSE subdirs LIBOBJS @@ -13,7 +23,24 @@ ac_subst_files='' ac_precious_vars='build_alias host_alias -@@ -21215,8 +21219,12 @@ +@@ -1561,6 +1568,7 @@ + --with-authldaprc=filename Expect to find authldaprc here + --without-authpwd Do not include the authpwd module + --without-authshadow Do not include the authshadow module ++ --without-authvchkpw Do not include the authvchkpw module + --with-authpgsqlrc=filename Expect to find authpgsql here + --without-authpgsql Do not include the authpgsql module + --with-pgsql-libs=DIR Look for pgsql libs in this dir +@@ -2502,7 +2510,7 @@ + fi + + fi +-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" ++INSTALL_STRIP_PROGRAM="${INSTALL_PROGRAM} -s" + + # We need awk for the "check" target. The system "awk" is bad on + # some platforms. +@@ -21290,8 +21298,12 @@ if test "$doauthuserdb" = "no" then @@ -26,7 +53,7 @@ AUTHUSERDB="authuserdb" LIBAUTHUSERDB="libauthuserdb.la" -@@ -22894,6 +22902,20 @@ +@@ -22969,6 +22981,20 @@ fi @@ -47,190 +74,294 @@ if test "$HAVE_LDAP" = 1; then HAVE_LDAP_TRUE= -@@ -24180,9 +24202,9 @@ - if test "$doauthmysql" = "" - then - LIBS="$MYSQL_LIBS $LIBS" -- { echo "$as_me:$LINENO: checking for mysql_connect" >&5 --echo $ECHO_N "checking for mysql_connect... $ECHO_C" >&6; } --if test "${ac_cv_func_mysql_connect+set}" = set; then -+ { echo "$as_me:$LINENO: checking for mysql_real_connect" >&5 -+echo $ECHO_N "checking for mysql_real_connect... $ECHO_C" >&6; } -+if test "${ac_cv_func_mysql_real_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF -@@ -24191,12 +24213,12 @@ - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ --/* Define mysql_connect to an innocuous variant, in case <limits.h> declares mysql_connect. -+/* Define mysql_real_connect to an innocuous variant, in case <limits.h> declares mysql_real_connect. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ --#define mysql_connect innocuous_mysql_connect -+#define mysql_real_connect innocuous_mysql_real_connect - - /* System header to define __stub macros and hopefully few prototypes, -- which can conflict with char mysql_connect (); below. -+ which can conflict with char mysql_real_connect (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -@@ -24206,7 +24228,7 @@ - # include <assert.h> - #endif - --#undef mysql_connect -+#undef mysql_real_connect - - /* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC -@@ -24214,18 +24236,18 @@ - #ifdef __cplusplus - extern "C" - #endif --char mysql_connect (); -+char mysql_real_connect (); - /* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ --#if defined __stub_mysql_connect || defined __stub___mysql_connect -+#if defined __stub_mysql_real_connect || defined __stub___mysql_real_connect - choke me - #endif - - int - main () - { --return mysql_connect (); -+return mysql_real_connect (); - ; - return 0; - } -@@ -24248,20 +24270,20 @@ - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then -- ac_cv_func_mysql_connect=yes -+ ac_cv_func_mysql_real_connect=yes - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - -- ac_cv_func_mysql_connect=no -+ ac_cv_func_mysql_real_connect=no - fi - - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi --{ echo "$as_me:$LINENO: result: $ac_cv_func_mysql_connect" >&5 --echo "${ECHO_T}$ac_cv_func_mysql_connect" >&6; } --if test $ac_cv_func_mysql_connect = yes; then -+{ echo "$as_me:$LINENO: result: $ac_cv_func_mysql_real_connect" >&5 -+echo "${ECHO_T}$ac_cv_func_mysql_real_connect" >&6; } -+if test $ac_cv_func_mysql_real_connect = yes; then - doauthmysql="yes" - - fi -@@ -24362,9 +24384,9 @@ - else - saveLIBS="$LIBS" - LIBS="$MYSQL_LIBS $LIBS" -- { echo "$as_me:$LINENO: checking for mysql_connect" >&5 --echo $ECHO_N "checking for mysql_connect... $ECHO_C" >&6; } --if test "${ac_cv_func_mysql_connect+set}" = set; then -+ { echo "$as_me:$LINENO: checking for mysql_real_connect" >&5 -+echo $ECHO_N "checking for mysql_real_connect... $ECHO_C" >&6; } -+if test "${ac_cv_func_mysql_real_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF -@@ -24373,12 +24395,12 @@ - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ --/* Define mysql_connect to an innocuous variant, in case <limits.h> declares mysql_connect. -+/* Define mysql_real_connect to an innocuous variant, in case <limits.h> declares mysql_real_connect. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ --#define mysql_connect innocuous_mysql_connect -+#define mysql_real_connect innocuous_mysql_real_connect - - /* System header to define __stub macros and hopefully few prototypes, -- which can conflict with char mysql_connect (); below. -+ which can conflict with char mysql_real_connect (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -@@ -24388,7 +24410,7 @@ - # include <assert.h> - #endif - --#undef mysql_connect -+#undef mysql_real_connect - - /* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC -@@ -24396,18 +24418,18 @@ - #ifdef __cplusplus - extern "C" - #endif --char mysql_connect (); -+char mysql_real_connect (); - /* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ --#if defined __stub_mysql_connect || defined __stub___mysql_connect -+#if defined __stub_mysql_real_connect || defined __stub___mysql_real_connect - choke me - #endif +@@ -23617,6 +23643,256 @@ - int - main () - { --return mysql_connect (); -+return mysql_real_connect (); - ; - return 0; - } -@@ -24430,20 +24452,20 @@ - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then -- ac_cv_func_mysql_connect=yes -+ ac_cv_func_mysql_real_connect=yes - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 -- ac_cv_func_mysql_connect=no -+ ac_cv_func_mysql_real_connect=no - fi - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi --{ echo "$as_me:$LINENO: result: $ac_cv_func_mysql_connect" >&5 --echo "${ECHO_T}$ac_cv_func_mysql_connect" >&6; } --if test $ac_cv_func_mysql_connect = yes; then -+{ echo "$as_me:$LINENO: result: $ac_cv_func_mysql_real_connect" >&5 -+echo "${ECHO_T}$ac_cv_func_mysql_real_connect" >&6; } -+if test $ac_cv_func_mysql_real_connect = yes; then - LIBAUTHMYSQL="libauthmysql.la" - HAVE_AUTHMYSQL=1 - else -@@ -26915,9 +26937,12 @@ - subdirs!$subdirs$ac_delim - LIBOBJS!$LIBOBJS$ac_delim - LTLIBOBJS!$LTLIBOBJS$ac_delim ++ ++vpopmail_home=`$PERL -e '@a=getpwnam("vpopmail"); print "$a[7]";'` ++ ++ ++ ++ ++# Check whether --with-authvchkpw was given. ++if test "${with_authvchkpw+set}" = set; then ++ withval=$with_authvchkpw; doauthvchkpw="$withval" ++else ++ doauthvchkpw=no ++ if test "$vpopmail_home" != "" ++ then ++ doauthvchkpw=yes ++ fi ++fi ++ ++ ++if test "$doauthvchkpw" = "no" ++then ++ HAVE_VCHKPW=0 ++ vpopmail_home=. ++else ++ HAVE_VCHKPW=1 ++ ++ ++ cat <<EOF ++---------------------------------------------------- ++ NOTE ++ ++ ++All questions regarding ANY vpopmail-related problems, ++such as compiling/building failures, or login errors ++should be referred to the vpopmail mailing list. ++Vpopmail questions sent to the Courier mailing lists ++will be IGNORED. ++---------------------------------------------------- ++ ++EOF ++ sleep 5 ++ ++ if test -f ${vpopmail_home}/etc/lib_deps ++ then ++ CFLAGS="`cat ${vpopmail_home}/etc/inc_deps` $CFLAGS" ++ VPOPMAILLIBS="`cat ${vpopmail_home}/etc/lib_deps`" ++ else ++ { { echo "$as_me:$LINENO: error: ${vpopmail_home}/etc/lib_deps does not exist - upgrade vpopmail to the current version or fix the permissions on this file" >&5 ++echo "$as_me: error: ${vpopmail_home}/etc/lib_deps does not exist - upgrade vpopmail to the current version or fix the permissions on this file" >&2;} ++ { (exit 1); exit 1; }; } ++ fi ++fi ++ ++ ++ ++LIBAUTHVCHKPW="" ++if test "$HAVE_VCHKPW" = 1 ++then ++ LIBAUTHVCHKPW="libauthvchkpw.la" ++ HAVE_VCHKPW="1" ++ ++ ++ _SAVE_LIBS=$LIBS ++ LIBS="$VPOPMAILLIBS $CRYPTLIBS $LIBS" ++ { echo "$as_me:$LINENO: checking for open_smtp_relay" >&5 ++echo $ECHO_N "checking for open_smtp_relay... $ECHO_C" >&6; } ++if test "${ac_cv_func_open_smtp_relay+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define open_smtp_relay to an innocuous variant, in case <limits.h> declares open_smtp_relay. ++ For example, HP-UX 11i <limits.h> declares gettimeofday. */ ++#define open_smtp_relay innocuous_open_smtp_relay ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char open_smtp_relay (); below. ++ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since ++ <limits.h> exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include <limits.h> ++#else ++# include <assert.h> ++#endif ++ ++#undef open_smtp_relay ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char open_smtp_relay (); ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined __stub_open_smtp_relay || defined __stub___open_smtp_relay ++choke me ++#endif ++ ++int ++main () ++{ ++return open_smtp_relay (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_func_open_smtp_relay=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_func_open_smtp_relay=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_func_open_smtp_relay" >&5 ++echo "${ECHO_T}$ac_cv_func_open_smtp_relay" >&6; } ++if test $ac_cv_func_open_smtp_relay = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HAVE_OPEN_SMTP_RELAY 1 ++_ACEOF ++ ++fi ++ ++ { echo "$as_me:$LINENO: checking for vset_lastauth" >&5 ++echo $ECHO_N "checking for vset_lastauth... $ECHO_C" >&6; } ++if test "${ac_cv_func_vset_lastauth+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define vset_lastauth to an innocuous variant, in case <limits.h> declares vset_lastauth. ++ For example, HP-UX 11i <limits.h> declares gettimeofday. */ ++#define vset_lastauth innocuous_vset_lastauth ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char vset_lastauth (); below. ++ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since ++ <limits.h> exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include <limits.h> ++#else ++# include <assert.h> ++#endif ++ ++#undef vset_lastauth ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char vset_lastauth (); ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined __stub_vset_lastauth || defined __stub___vset_lastauth ++choke me ++#endif ++ ++int ++main () ++{ ++return vset_lastauth (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_func_vset_lastauth=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_func_vset_lastauth=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_func_vset_lastauth" >&5 ++echo "${ECHO_T}$ac_cv_func_vset_lastauth" >&6; } ++if test $ac_cv_func_vset_lastauth = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HAVE_VSET_LASTAUTH 1 ++_ACEOF ++ ++fi ++ ++ LIBS=$_SAVE_LIBS ++fi ++ ++ ++ ++ ++ ++ ++ + # Check whether --with-authpgsqlrc was given. + if test "${with_authpgsqlrc+set}" = set; then + withval=$with_authpgsqlrc; authpgsqlrc="$withval" +@@ -26616,9 +26892,13 @@ + CXXFLAGS!$CXXFLAGS$ac_delim + ac_ct_CXX!$ac_ct_CXX$ac_delim + CXXDEPMODE!$CXXDEPMODE$ac_delim +HAVE_BASE_TRUE!$HAVE_BASE_TRUE$ac_delim +HAVE_BASE_FALSE!$HAVE_BASE_FALSE$ac_delim +HAVE_USERDB_TRUE!$HAVE_USERDB_TRUE$ac_delim +HAVE_USERDB_FALSE!$HAVE_USERDB_FALSE$ac_delim _ACEOF -- -- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then -+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then + +- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then ++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 101; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +@@ -26698,6 +26978,9 @@ + SHADOWLIBS!$SHADOWLIBS$ac_delim + LIBAUTHSHADOW!$LIBAUTHSHADOW$ac_delim + LIBAUTHPWD!$LIBAUTHPWD$ac_delim ++vpopmail_home!$vpopmail_home$ac_delim ++VPOPMAILLIBS!$VPOPMAILLIBS$ac_delim ++LIBAUTHVCHKPW!$LIBAUTHVCHKPW$ac_delim + authpgsqlrc!$authpgsqlrc$ac_delim + PG_CONFIG!$PG_CONFIG$ac_delim + PGSQL_LIBS!$PGSQL_LIBS$ac_delim +@@ -26731,7 +27014,7 @@ + LTLIBOBJS!$LTLIBOBJS$ac_delim + _ACEOF + +- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 72; then ++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 75; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 |