diff options
author | dinoex <dinoex@FreeBSD.org> | 2002-03-30 18:14:36 +0800 |
---|---|---|
committer | dinoex <dinoex@FreeBSD.org> | 2002-03-30 18:14:36 +0800 |
commit | b0751a3b694884feeace45233d70297d5a497742 (patch) | |
tree | afc6f10816f7801fd4707da9686ec5fa58709c05 /news/nntpcache | |
parent | 0c71d32c8a18da39b5c133b41d180acebff84e9c (diff) | |
download | freebsd-ports-gnome-b0751a3b694884feeace45233d70297d5a497742.tar.gz freebsd-ports-gnome-b0751a3b694884feeace45233d70297d5a497742.tar.zst freebsd-ports-gnome-b0751a3b694884feeace45233d70297d5a497742.zip |
Updated with new Option, some cleanups.
>Number: 30849
news/nntpcache fails compiling authinfo_pam.c, add radius & ldap auth mechanisms.
The fix is to place a #ifndef __FreeBSD__ .. #endif arround
<security/pam_misc.h> in authinfo_pam.c.
The attached patch corrects this problem, and adds additional authentication
functionality to the nntpcache port (RADIUS, LDAP[v1,v2]).
files/patch-src-authinfo_pam.ext removed due to a post-configure target is
added to the Makefile that recreates the authinfo_[pam,radius,ldap].ext files.
PR: 30849
Submitted by: hetzels@westbend.net
Diffstat (limited to 'news/nntpcache')
-rw-r--r-- | news/nntpcache/Makefile | 36 | ||||
-rw-r--r-- | news/nntpcache/files/patch-src-authinfo_ldap.c | 19 | ||||
-rw-r--r-- | news/nntpcache/files/patch-src-authinfo_pam.c | 12 | ||||
-rw-r--r-- | news/nntpcache/files/patch-src-authinfo_pam.ext | 11 | ||||
-rw-r--r-- | news/nntpcache/files/patch-src::authinfo_pam.c | 13 |
5 files changed, 67 insertions, 24 deletions
diff --git a/news/nntpcache/Makefile b/news/nntpcache/Makefile index b636af08735d..9eacbb09878e 100644 --- a/news/nntpcache/Makefile +++ b/news/nntpcache/Makefile @@ -16,6 +16,16 @@ MAINTAINER= ports@FreeBSD.org BUILD_DEPENDS= automake14:${PORTSDIR}/devel/automake14 +.if defined(WITH_LDAP) && !defined(WITH_LDAP2) +LIB_DEPENDS+= ldap.1:${PORTSDIR}/net/openldap +LIB_DEPENDS+= lber.1:${PORTSDIR}/net/openldap +.endif + +.if defined(WITH_LDAP2) +LIB_DEPENDS+= ldap.2:${PORTSDIR}/net/openldap2 +LIB_DEPENDS+= lber.2:${PORTSDIR}/net/openldap2 +.endif + # This may be set interactively at install-time. NNTPCache will # cache news articles and related data in ${SPOOLDIR}/nntpcache. SPOOLDIR?= /var/spool @@ -24,6 +34,20 @@ NO_CDROM= Free for individuals and non-military, non-profit organisations only USE_GMAKE= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --localstatedir=${SPOOLDIR} + +AUTHINFO_EXT= authinfo_pam.ext +.if !defined(WITHOUT_RADIUS) +CONFIGURE_ARGS+= --with-authinfo-radius +AUTHINFO_EXT+= authinfo_radius.ext +.endif +.if defined(WITH_LDAP) || defined(WITH_LDAP2) +CONFIGURE_ARGS+= --with-authinfo-ldap +CPPFLAGS+= -I${PREFIX}/include -I${LOCALBASE}/include +LDFLAGS+= -L${PREFIX}/lib -L${LOCALBASE}/lib +AUTHINFO_EXT+= authinfo_ldap.ext +CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +.endif + NNTPSPOOLDIR?= ${SPOOLDIR}/${PORTNAME} PLIST_SUB+= SPOOLDIR=${NNTPSPOOLDIR} CPIO= cpio --quiet -pdum -R @@ -31,6 +55,18 @@ MAN8= nntpcached.8 newshound.8 DOCS= AUTHORS ChangeLog FAQ FAQ.html HACKING HTML \ INSTALL LICENSING NEWS README README.INN VERSION +.if !defined(BATCH) +post-fetch: + @${ECHO} "To enable LDAP support use either:" + @${ECHO} " WITH_LDAP - LDAP v1 support" + @${ECHO} " WITH_LDAP2 - LDAP v2 support" + @${ECHO} + @${ECHO} "To disable radius support use WITHOUT_RADIUS" +.endif + +post-configure: + @cd ${WRKSRC}/src && ${GMAKE} ${AUTHINFO_EXT} + post-patch: @${PERL} -pi -e 's,AUTOMAKE=automake,AUTOMAKE=automake14,' \ ${WRKSRC}/configure diff --git a/news/nntpcache/files/patch-src-authinfo_ldap.c b/news/nntpcache/files/patch-src-authinfo_ldap.c new file mode 100644 index 000000000000..99b4a551cfd1 --- /dev/null +++ b/news/nntpcache/files/patch-src-authinfo_ldap.c @@ -0,0 +1,19 @@ +--- src/authinfo_ldap.c.orig Sat Dec 18 12:08:30 1999 ++++ src/authinfo_ldap.c Wed Sep 26 10:55:27 2001 +@@ -78,7 +78,16 @@ + + lderr = ldap_bind_s(ld, dnbuf, pass, LDAP_AUTH_SIMPLE); + if (lderr != LDAP_SUCCESS && lderr != LDAP_INVALID_CREDENTIALS && lderr != LDAP_INAPPROPRIATE_AUTH) ++#if LDAP_API_VERSION >= 2004 ++ { ++ int ld_errno = 0; ++ ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno); ++ logen(("LDAP ERROR: ldap user bind failed (%d): %s", lderr, ldap_err2string(ld_errno))); ++ } ++#else ++ + logen(("LDAP ERROR: ldap user bind failed (%d): %s", lderr, ldap_err2string(GET_LDERROR(ld)))); ++#endif + ldap_unbind(ld); + memset(pass, strlen(pass), 0); + if (lderr == LDAP_SUCCESS) { diff --git a/news/nntpcache/files/patch-src-authinfo_pam.c b/news/nntpcache/files/patch-src-authinfo_pam.c new file mode 100644 index 000000000000..0c71400c31f8 --- /dev/null +++ b/news/nntpcache/files/patch-src-authinfo_pam.c @@ -0,0 +1,12 @@ +--- src/authinfo_pam.c.orig Sun Jun 11 14:32:55 2000 ++++ src/authinfo_pam.c Wed Sep 26 11:27:09 2001 +@@ -15,7 +15,9 @@ + #include "authinfo_pam.h" + + #include <security/pam_appl.h> ++#ifndef __FreeBSD__ + #include <security/pam_misc.h> ++#endif + + /* + * pam authenticator. diff --git a/news/nntpcache/files/patch-src-authinfo_pam.ext b/news/nntpcache/files/patch-src-authinfo_pam.ext deleted file mode 100644 index f0d7d72256f5..000000000000 --- a/news/nntpcache/files/patch-src-authinfo_pam.ext +++ /dev/null @@ -1,11 +0,0 @@ ---- src/authinfo_pam.ext.orig Sun Jun 11 22:01:43 2000 -+++ src/authinfo_pam.ext Fri Sep 14 10:55:25 2001 -@@ -19,6 +19,8 @@ - #else - # define EXP_(x) - #endif -+extern authenticator pam_authenticator; -+extern int pam_got_pass(char *pass); - #ifdef __cplusplus - } - #endif diff --git a/news/nntpcache/files/patch-src::authinfo_pam.c b/news/nntpcache/files/patch-src::authinfo_pam.c deleted file mode 100644 index 6a645026e42f..000000000000 --- a/news/nntpcache/files/patch-src::authinfo_pam.c +++ /dev/null @@ -1,13 +0,0 @@ -$FreeBSD$ - ---- src/authinfo_pam.c.orig Sat Nov 10 05:52:17 2001 -+++ src/authinfo_pam.c Sat Nov 10 05:51:29 2001 -@@ -15,7 +15,7 @@ - #include "authinfo_pam.h" - - #include <security/pam_appl.h> --#include <security/pam_misc.h> -+/* #include <security/pam_misc.h> */ - - /* - * pam authenticator. |