Date: Fri, 23 May 2014 21:48:24 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r354964 - in head/mail/qmailadmin: . files Message-ID: <201405232148.s4NLmOdq071023@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Fri May 23 21:48:24 2014 New Revision: 354964 URL: http://svnweb.freebsd.org/changeset/ports/354964 QAT: https://qat.redports.org/buildarchive/r354964/ Log: - Add CRACKLIB support Submitted by: Matt Simerson <matt@simerson.net> Obtained from: http://sourceforge.net/p/qmailadmin/patches/28/ Added: head/mail/qmailadmin/files/cracklib.patch (contents, props changed) Modified: head/mail/qmailadmin/Makefile Modified: head/mail/qmailadmin/Makefile ============================================================================== --- head/mail/qmailadmin/Makefile Fri May 23 21:11:02 2014 (r354963) +++ head/mail/qmailadmin/Makefile Fri May 23 21:48:24 2014 (r354964) @@ -3,7 +3,7 @@ PORTNAME= qmailadmin PORTVERSION= 1.2.15 -PORTREVISION= 5 +PORTREVISION= 6 PORTEPOCH= 2 CATEGORIES= mail www MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-stable/${PORTVERSION} \ @@ -36,7 +36,7 @@ AUTOMAKE_ARGS+= --add-missing OPTIONS_DEFINE= IPAUTH USER_INDEX MODIFY_QUOTA DOMAIN_AUTOFILL \ IDX IDX_SQL HELP SPAM_DETECTION SPAM_NEEDS_EMAIL \ - CATCHALL TRIVIAL_PASSWORD NOCACHE + CATCHALL TRIVIAL_PASSWORD NOCACHE CRACKLIB OPTIONS_DEFAULT=IPAUTH IDX_SQL USER_INDEX CATCHALL TRIVIAL_PASSWORD IPAUTH_DESC= Check IP address after login USER_INDEX_DESC= Enable user index display @@ -50,6 +50,7 @@ SPAM_NEEDS_EMAIL_DESC= Append user's ema CATCHALL_DESC= Enable catch-all accounts TRIVIAL_PASSWORD_DESC= Disallow password containing username NOCACHE_DESC= Prohibit caching via http headers +CRACKLIB_DESC= Use cracklib to enforce stronger passwords CONFIGURE_ARGS+= \ --enable-qmaildir=${QMAIL_PREFIX} \ @@ -87,6 +88,15 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-ezmlm CONFIGURE_ARGS+= --enable-spam-command="${SPAM_COMMAND}" .endif +.if ${PORT_OPTIONS:MCRACKLIB} +EXTRA_PATCHES+= ${FILESDIR}/cracklib.patch +BUILD_DEPENDS+= ${LOCALBASE}/include/crack.h:${PORTSDIR}/security/cracklib +CONFIGURE_ARGS+= --enable-cracklib=${LOCALBASE}/libdata/cracklib/pw_dict +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +CONFIGURE_ENV+= LIBS="-lcrack" +.endif + # vpopmail installation directory # # NB: change this with extreme caution! For instance, if vpopmail is not Added: head/mail/qmailadmin/files/cracklib.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/qmailadmin/files/cracklib.patch Fri May 23 21:48:24 2014 (r354964) @@ -0,0 +1,78 @@ +--- ./configure.in.orig 2011-01-14 13:35:14.000000000 -0800 ++++ ./configure.in 2014-05-22 21:51:26.000000000 -0700 +@@ -26,6 +26,7 @@ + dnl Checks for libraries. + AC_CHECK_LIB(crypt,crypt) + AC_CHECK_LIB(shadow,crypt) ++AC_CHECK_LIB(crack,FascistCheck) + #AC_CHECK_LIB(m,floor) + #AC_CHECK_LIB(nsl, gethostbyaddr) + #AC_CHECK_LIB(socket, getsockname) +@@ -421,6 +422,31 @@ + AC_DEFINE_UNQUOTED(SPAM_COMMAND, "$spam_command","") + AC_SUBST(SPAM_COMMAND) + ++cracklib=no ++AC_ARG_ENABLE(cracklib, [ --enable-cracklib=PATH Path to cracklib dictionary.], ++ cracklib="$enableval", ++ [ ++ if test "$cracklib" = "" ++ then ++ AC_MSG_ERROR([Unable to find your cracklib directory, specify --enable-cracklib.]) ++ fi ++ ] ) ++ ++if test "$cracklib" = "yes" ++then ++ cracklib="/usr/local/libdata/cracklib/pw_dict" ++fi ++ ++case $cracklib in ++0*|n*|N*) ++ echo "checking whether to use password checking... no" ++ ;; ++*) ++ AC_DEFINE_UNQUOTED(CRACKLIB,"$cracklib","") ++ echo "checking whether to use password checking... yes" ++ ;; ++esac ++ + HELP=no + AC_ARG_ENABLE(help, [ --enable-help Display help links on login page.], + HELP="$enableval",) +@@ -485,4 +511,7 @@ + then + echo " spam command = "$spam_command"" + fi +- ++if test "$cracklib" != "no" ++then ++ echo "cracklib dictionary= "$cracklib"" ++fi +--- ./user.c.orig 2014-05-22 21:51:03.000000000 -0700 ++++ ./user.c 2014-05-22 21:52:14.000000000 -0700 +@@ -47,6 +47,9 @@ + #include "user.h" + #include "util.h" + #include "vauth.h" ++#ifdef CRACKLIB ++# include </usr/local/include/crack.h> ++#endif + + + #define HOOKS 1 +@@ -800,6 +803,14 @@ + exit(0); + } + #endif ++#ifdef CRACKLIB ++ if ((tmpstr = FascistCheck(Password1, CRACKLIB)) != NULL ) { ++ sprintf(StatusMessage, "Bad password - %s\n", tmpstr); ++ moduser(); ++ vclose(); ++ exit(0); ++ } ++#endif + ret_code = vpasswd( ActionUser, Domain, Password1, USE_POP); + if ( ret_code != VA_SUCCESS ) { + snprintf (StatusMessage, sizeof(StatusMessage), "%s (%s)", html_text[140],
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405232148.s4NLmOdq071023>