View | Details | Raw Unified | Return to bug 168338
Collapse All | Expand All

(-)./Makefile (-26 / +41 lines)
Lines 3-34 Link Here
3
# Whom:					melifaro@ipfw.ru
3
# Whom:					melifaro@ipfw.ru
4
#
4
#
5
# $FreeBSD: ports/net/nss-pam-ldapd/Makefile,v 1.13 2012/04/01 17:04:27 crees Exp $
5
# $FreeBSD: ports/net/nss-pam-ldapd/Makefile,v 1.13 2012/04/01 17:04:27 crees Exp $
6
# 
7
# vim: ft=pmake tw=78 fo=cq
6
#
8
#
7
9
8
PORTNAME=		nss-pam-ldapd
10
PORTNAME=		nss-pam-ldapd
9
PORTVERSION=		0.8.6
11
PORTVERSION=		0.8.9
10
CATEGORIES=		net
12
CATEGORIES=		net
11
MASTER_SITES=		http://arthurdejong.org/nss-pam-ldapd/ \
13
MASTER_SITES=		http://arthurdejong.org/nss-pam-ldapd/
12
			http://static.ipfw.ru/files/
13
14
14
MAINTAINER=		rflynn@acsalaska.net
15
MAINTAINER?=		rflynn@acsalaska.net
15
COMMENT=		Advanced fork of nss_ldap
16
COMMENT?=		Advanced fork of nss_ldap
16
17
17
LICENSE=		LGPL21 LGPL3
18
LICENSE=		LGPL21 LGPL3
18
LICENSE_COMB=		dual
19
LICENSE_COMB=		dual
19
20
20
GNU_CONFIGURE=		yes
21
GNU_CONFIGURE=		yes
21
USE_GMAKE=		yes
22
# Gmake seems to be not really needed anymore.
23
# Gmake specific constructs are limited to maintainer targets
24
# USE_GMAKE=		yes
22
USE_OPENLDAP=		yes
25
USE_OPENLDAP=		yes
23
USE_RC_SUBR=		nslcd
26
USE_RC_SUBR=		nslcd
24
PAM_LDAP_SHMAJOR=	1
27
PAM_LDAP_SHMAJOR=	1
25
NSS_LDAP_SHMAJOR=	1
28
NSS_LDAP_SHMAJOR=	1
29
PKGMESSAGE=		${WRKDIR}/pkg-message
30
SUB_FILES+=		pkg-message
26
31
27
NSLCD_PIDFILE?=		/var/run/nslcd.pid
32
NSLCD_PIDFILE?=		/var/run/nslcd.pid
28
NSLCD_SOCKET?=		/var/run/nslcd.ctl
33
NSLCD_SOCKET?=		/var/run/nslcd.ctl
29
34
30
OPTIONS=		SASL		"Enable SASL" off \
35
.if defined(SLAVE_PORT)
36
OPTIONS=		PAM		"Build pam_ldap" on \
37
			NSS		"Build nss support" on
38
WITH_SASL=yes
39
CONFLICTS+=		nss-pam-ldapd-[0-9]*
40
.else
41
OPTIONS=		NSS		"Build nss support" on \
31
			PAM		"Build pam_ldap" on
42
			PAM		"Build pam_ldap" on
43
CONFLICTS+=		nss-pam-ldapd-sasl-[0-9]*
44
.endif
32
45
33
USERS=			nslcd
46
USERS=			nslcd
34
GROUPS=			nslcd
47
GROUPS=			nslcd
Lines 45-51 Link Here
45
58
46
CONFIG_FILE=		"nslcd.conf"
59
CONFIG_FILE=		"nslcd.conf"
47
CONFIGURE_ARGS+=	--with-ldap-conf-file=${PREFIX}/etc/${CONFIG_FILE}
60
CONFIGURE_ARGS+=	--with-ldap-conf-file=${PREFIX}/etc/${CONFIG_FILE}
48
PLIST_SUB+=		CONFIG=${CONFIG_FILE}
61
PLIST_SUB+=		CONFIG="${CONFIG_FILE}"
62
SUB_LIST+=		CONFIG_FILE="${PREFIX}/etc/${CONFIG_FILE}"
49
63
50
.if defined(WITH_SASL)
64
.if defined(WITH_SASL)
51
WANT_OPENLDAP_SASL=	yes
65
WANT_OPENLDAP_SASL=	yes
Lines 69-80 Link Here
69
.if defined(WITHOUT_NSS)
83
.if defined(WITHOUT_NSS)
70
CONFIGURE_ARGS+=	--disable-nss
84
CONFIGURE_ARGS+=	--disable-nss
71
PLIST_SUB+=		NSS="@comment "
85
PLIST_SUB+=		NSS="@comment "
86
SUB_LIST+=		NSS_MESSAGE=""
72
.else
87
.else
73
CONFIGURE_ARGS+=	--enable-nss
88
CONFIGURE_ARGS+=	--enable-nss
74
CONFLICTS+=		nss_ldap-1.*
89
CONFLICTS+=		nss_ldap-1.*
75
PLIST_SUB+=		NSS=""
90
PLIST_SUB+=		NSS=""
91
SUB_LIST+=		NSS_MESSAGE="WARNING: Be sure to set uid and gid configuration parameters to make nslcd run under unprivileged user."
76
.endif
92
.endif
77
93
94
# Won't hook this in to OPTIONS until PADL ports are at least DEPRECATED.
95
# It doesn't do the software any good to run as replacement for the PADL ports
96
# without running the daemon.
78
.if defined(WITHOUT_NSLCD)
97
.if defined(WITHOUT_NSLCD)
79
CONFIGURE_ARGS+=	--disable-nslcd
98
CONFIGURE_ARGS+=	--disable-nslcd
80
PLIST_SUB+=		NSLCD="@comment "
99
PLIST_SUB+=		NSLCD="@comment "
Lines 85-117 Link Here
85
MAN8+=			nslcd.8
104
MAN8+=			nslcd.8
86
.endif
105
.endif
87
106
107
.if defined(WITHOUT_NSS) && defined(WITHOUT_PAM)
108
BROKEN=	Software is useless if both NSS and PAM are disabled.\
109
	Rerun 'make config' or 'portmaster --force-config'.
110
.endif
111
88
post-extract:
112
post-extract:
89
	@${REINPLACE_CMD} -e 's/\(INSTALL_\)\(.*\)) -D /\1\2) /' ${WRKSRC}/Makefile.in ${WRKSRC}/nss/Makefile.in
113
	@${REINPLACE_CMD} -e 's/\(INSTALL_\)\(.*\)) -D /\1\2) /' ${WRKSRC}/Makefile.in ${WRKSRC}/nss/Makefile.in
90
114
91
post-configure:
115
post-configure:
92
	${REINPLACE_CMD} -e 's/^\(CFLAGS.*\) \-O2 \(.*\)$$/\1 -O0 \2/' ${WRKSRC}/nss/Makefile
116
	${REINPLACE_CMD} -e 's/^\(CFLAGS.*\) \-O2 \(.*\)$$/\1 -O0 \2/' ${WRKSRC}/nss/Makefile
93
117
94
post-install:
118
show-pkgmessage::
119
	@${ECHO_CMD}; ${CAT} ${PKGMESSAGE} | ${FMT} 75 79; ${ECHO_CMD}
120
121
# We take care of the sample file, upstream install target installs the actual
122
# file if it does not exist yet.
123
post-install: show-pkgmessage
124
	@${INSTALL_DATA} ${WRKSRC}/nslcd.conf ${PREFIX}/etc/nslcd.conf.sample
95
.if !defined(WITHOUT_NSS)
125
.if !defined(WITHOUT_NSS)
96
	@cd ${PREFIX}/lib && ${LN} -fs nss_ldap.so.${NSS_LDAP_SHMAJOR} \
126
	@${LN} -fs nss_ldap.so.${NSS_LDAP_SHMAJOR} ${PREFIX}/lib/nss_ldap.so
97
		nss_ldap.so
98
.endif
127
.endif
99
.if !defined(WITHOUT_PAM)
128
.if !defined(WITHOUT_PAM)
100
	@cd ${PREFIX}/lib && ${LN} -fs pam_ldap.so.${PAM_LDAP_SHMAJOR} \
129
	@${LN} -fs pam_ldap.so.${PAM_LDAP_SHMAJOR} ${PREFIX}/lib/pam_ldap.so
101
		pam_ldap.so
102
.endif
103
	@${ECHO_MSG}
104
	@${ECHO_MSG} =====================================================================
105
	@${ECHO_MSG}
106
	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/${CONFIG_FILE}"
107
	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/${CONFIG_FILE}.sample"
108
	@${ECHO_MSG}
109
.if !defined(WITHOUT_NSS)
110
	@${ECHO_MSG} " WARNING: Be sure to set uid and gid configuration parameters"
111
	@${ECHO_MSG} " WARNING: to make nslcd run under unprivileged user"
112
.endif
130
.endif
113
	@${ECHO_MSG}
114
	@${ECHO_MSG} =====================================================================
115
	@${ECHO_MSG}
116
131
117
.include <bsd.port.mk>
132
.include <bsd.port.mk>
(-)./distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (nss-pam-ldapd-0.8.6.tar.gz) = 549f58c83c18ce8017f546138414e831b255a6edc5dfd8ff141aef52d94f25df
1
SHA256 (nss-pam-ldapd-0.8.9.tar.gz) = 722a010718c0a5073207d05f1f091e679aa32f2643a3c173dc6f916c2bfcc0d2
2
SIZE (nss-pam-ldapd-0.8.6.tar.gz) = 466292
2
SIZE (nss-pam-ldapd-0.8.9.tar.gz) = 475138
(-)./files/patch-Makefile.in (-19 lines)
Lines 1-19 Link Here
1
--- Makefile.in.orig	2012-03-02 12:50:47.000000000 -0900
2
+++ Makefile.in	2012-03-02 13:01:13.000000000 -0900
3
@@ -774,6 +774,7 @@
4
 
5
 # install a default configuration file if it is not already there
6
 install-nslcd_conf:
7
+	$(INSTALL_DATA) $(srcdir)/nslcd.conf $(DESTDIR)/$(NSLCD_CONF_PATH).sample
8
 	@if [ -f $(DESTDIR)$(NSLCD_CONF_PATH) ]; then \
9
 	  echo "$(DESTDIR)$(NSLCD_CONF_PATH) already exists, install will not overwrite"; \
10
 	else \
11
@@ -781,7 +782,7 @@
12
 	  $(INSTALL_DATA) $(srcdir)/nslcd.conf $(DESTDIR)$(NSLCD_CONF_PATH); \
13
 	fi
14
 uninstall-nslcd_conf:
15
-	-rm -f $(DESTDIR)$(NSLCD_CONF_PATH)
16
+	-rm -f $(DESTDIR)$(NSLCD_CONF_PATH).sample
17
 
18
 # fix permissions before distributing
19
 dist-hook:
(-)./files/patch-nss__shadow.c (-17 lines)
Lines 1-17 Link Here
1
--- nss/shadow.c.orig	2009-05-29 21:23:03.000000000 +0000
2
+++ nss/shadow.c	2009-08-02 22:32:27.000000000 +0000
3
@@ -22,6 +22,7 @@
4
 
5
 #include "config.h"
6
 
7
+#ifdef HAVE_SHADOW_H
8
 #include <string.h>
9
 #include <nss.h>
10
 #include <errno.h>
11
@@ -73,3 +74,6 @@
12
 {
13
   NSS_ENDENT(spentfp);
14
 }
15
+
16
+#endif
17
+
(-)./files/patch-r1626 (-50 lines)
Lines 1-50 Link Here
1
Modified: compat/ldap_compat.h
2
==============================================================================
3
--- compat/ldap_compat.h	Wed Feb 29 22:44:31 2012	(r1625)
4
+++ compat/ldap_compat.h	Mon Mar  5 22:53:54 2012	(r1626)
5
@@ -62,4 +62,12 @@
6
 #define LDAP_SASL_QUIET 2U
7
 #endif /* not LDAP_SASL_QUIET */
8
 
9
+/* on some systems LDAP_OPT_DIAGNOSTIC_MESSAGE isn't there but
10
+   LDAP_OPT_ERROR_STRING is */
11
+#ifndef LDAP_OPT_DIAGNOSTIC_MESSAGE
12
+#ifdef LDAP_OPT_ERROR_STRING
13
+#define LDAP_OPT_DIAGNOSTIC_MESSAGE LDAP_OPT_ERROR_STRING
14
+#endif /* LDAP_OPT_ERROR_STRING */
15
+#endif /* not LDAP_OPT_DIAGNOSTIC_MESSAGE */
16
+
17
 #endif /* COMPAT__LDAP_COMPAT_H */
18
19
Modified: nslcd/myldap.c
20
==============================================================================
21
--- nslcd/myldap.c	Wed Feb 29 22:44:31 2012	(r1625)
22
+++ nslcd/myldap.c	Mon Mar  5 22:53:54 2012	(r1626)
23
@@ -378,6 +378,7 @@
24
 static int do_bind(LDAP *ld,const char *binddn,const char *bindpw,const char *uri)
25
 {
26
   int rc;
27
+  char *msg=NULL;
28
 #ifdef HAVE_LDAP_SASL_INTERACTIVE_BIND_S
29
 #ifndef HAVE_SASL_INTERACT_T
30
   struct berval cred;
31
@@ -392,9 +393,16 @@
32
     rc=ldap_start_tls_s(ld,NULL,NULL);
33
     if (rc!=LDAP_SUCCESS)
34
     {
35
-      log_log(LOG_WARNING,"ldap_start_tls_s() failed: %s%s%s (uri=\"%s\")",
36
-                          ldap_err2string(rc),(errno==0)?"":": ",
37
-                          (errno==0)?"":strerror(errno),uri);
38
+#ifdef LDAP_OPT_DIAGNOSTIC_MESSAGE
39
+      ldap_get_option(ld,LDAP_OPT_DIAGNOSTIC_MESSAGE,&msg);
40
+#endif /* LDAP_OPT_DIAGNOSTIC_MESSAGE */
41
+      log_log(LOG_WARNING,"ldap_start_tls_s() failed: %s%s%s%s%s (uri=\"%s\")",
42
+                          ldap_err2string(rc),
43
+                          (msg==NULL)?"":": ",(msg==NULL)?"":msg,
44
+                          (errno==0)?"":": ",(errno==0)?"":strerror(errno),
45
+                          uri);
46
+      if (msg)
47
+        ldap_memfree(msg);
48
       return rc;
49
     }
50
   }
(-)./files/patch-r1631 (-21 lines)
Lines 1-21 Link Here
1
Modified: nslcd/common.h
2
==============================================================================
3
--- nslcd/common.h	Sat Mar 10 21:31:58 2012	(r1630)
4
+++ nslcd/common.h	Sat Mar 10 21:41:37 2012	(r1631)
5
@@ -3,7 +3,7 @@
6
    This file is part of the nss-pam-ldapd library.
7
 
8
    Copyright (C) 2006 West Consulting
9
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Arthur de Jong
10
+   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arthur de Jong
11
 
12
    This library is free software; you can redistribute it and/or
13
    modify it under the terms of the GNU Lesser General Public
14
@@ -25,6 +25,7 @@
15
 #define NSLCD__COMMON_H 1
16
 
17
 #include <errno.h>
18
+#include <limits.h>
19
 
20
 #include "nslcd.h"
21
 #include "common/nslcd-prot.h"
(-)./files/pkg-message.in (+12 lines)
Line 0 Link Here
1
=====================================================================
2
3
LDAP and nslcd daemon parameters should be set in %%CONFIG_FILE%%. When upgrading review %%CONFIG_FILE%%.sample for additional or changed parameters.
4
5
%%NSS_MESSAGE%%
6
7
To start nslcd add nslcd_enable="YES" to /etc/rc.conf and run:
8
9
  # service nslcd start
10
11
See the comments in %%PREFIX%%/etc/rc.d/nslcd for additional tunables.
12
=====================================================================

Return to bug 168338