View | Details | Raw Unified | Return to bug 153215 | Differences between
and this patch

Collapse All | Expand All

(-)net/nss-pam-ldapd/Makefile (-34 / +9 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=		nss-pam-ldapd
8
PORTNAME=		nss-pam-ldapd
9
PORTVERSION=		0.7.7
9
PORTVERSION=		0.7.13
10
CATEGORIES=		net
10
CATEGORIES=		net
11
MASTER_SITES=		http://arthurdejong.org/nss-pam-ldapd/ \
11
MASTER_SITES=		http://arthurdejong.org/nss-pam-ldapd/ \
12
			http://static.ipfw.ru/files/
12
			http://static.ipfw.ru/files/
Lines 25-32 Link Here
25
NSLCD_SOCKET?=		/var/run/nslcd.ctl
25
NSLCD_SOCKET?=		/var/run/nslcd.ctl
26
26
27
OPTIONS=		SASL		"Enable SASL" off \
27
OPTIONS=		SASL		"Enable SASL" off \
28
			PAM		"Build pam_ldap" on \
28
			PAM		"Build pam_ldap" on
29
			NSS_COMPAT	"Enable nss_ldap compatibility (DEPRECATED)" off
30
29
31
USERS=			nslcd
30
USERS=			nslcd
32
GROUPS=			nslcd
31
GROUPS=			nslcd
Lines 37-63 Link Here
37
IGNORE=			problems with nss/libc TLS
36
IGNORE=			problems with nss/libc TLS
38
.endif
37
.endif
39
38
39
.if ${OSVERSION} < 800000
40
EXTRA_PATCHES+=		${FILESDIR}/rtld_nss__nslcd.c
41
.endif
42
40
CONFIGURE_ENV=		CPPFLAGS="-I${LOCALBASE}/include" \
43
CONFIGURE_ENV=		CPPFLAGS="-I${LOCALBASE}/include" \
41
			LDFLAGS="-L${LOCALBASE}/lib"
44
			LDFLAGS="-L${LOCALBASE}/lib"
42
45
43
CONFIGURE_ARGS+=	--with-nslcd-pidfile=${NSLCD_PIDFILE} \
46
CONFIGURE_ARGS+=	--with-nslcd-pidfile=${NSLCD_PIDFILE} \
44
			--with-nslcd-socket=${NSLCD_SOCKET} \
47
			--with-nslcd-socket=${NSLCD_SOCKET} \
45
			--with-ldap-lib=openldap --disable-kerberos
48
			--with-ldap-lib=openldap --disable-kerberos \
49
			--with-nss-ldap-soname=nss_ldap.so.1
46
50
47
.if defined(WITHOUT_NSS)
48
.undef NSS_COMPAT
49
.endif
50
51
.if defined(WITH_NSS_COMPAT)
52
CONFIG_FILE=		"nss_ldap.conf"
53
CONFIGURE_ARGS+=	--enable-nss_compat --disable-configfile-checking --with-ldap-conf-file=${PREFIX}/etc/${CONFIG_FILE}
54
EXTRA_PATCHES+=		${FILESDIR}/nss_patch.diff
55
PLIST_SUB+=		CONFIG=${CONFIG_FILE}
56
.else
57
CONFIG_FILE=		"nslcd.conf"
51
CONFIG_FILE=		"nslcd.conf"
58
CONFIGURE_ARGS+=	--with-ldap-conf-file=${PREFIX}/etc/${CONFIG_FILE}
52
CONFIGURE_ARGS+=	--with-ldap-conf-file=${PREFIX}/etc/${CONFIG_FILE}
59
PLIST_SUB+=		CONFIG=${CONFIG_FILE}
53
PLIST_SUB+=		CONFIG=${CONFIG_FILE}
60
.endif
61
54
62
.if defined(WITH_SASL)
55
.if defined(WITH_SASL)
63
WANT_OPENLDAP_SASL=	yes
56
WANT_OPENLDAP_SASL=	yes
Lines 95-110 Link Here
95
MAN8+=			nslcd.8
88
MAN8+=			nslcd.8
96
.endif
89
.endif
97
90
98
.if ${OSVERSION} < 800000
99
BROKEN=		fails to patch on 7.X
100
.endif
101
102
post-extract:
91
post-extract:
103
	@${REINPLACE_CMD} -e 's/\(INSTALL_\)\(.*\)) -D /\1\2) /' ${WRKSRC}/Makefile.in ${WRKSRC}/nss/Makefile.in
92
	@${REINPLACE_CMD} -e 's/\(INSTALL_\)\(.*\)) -D /\1\2) /' ${WRKSRC}/Makefile.in ${WRKSRC}/nss/Makefile.in
104
	@${REINPLACE_CMD} -e 's/shadow.$$(OBJEXT)/shadow.$$(OBJEXT) bsdnss.$$(OBJEXT)/;s/shadow\.c/shadow.c bsdnss.c/' ${WRKSRC}/nss/Makefile.in
93
	@${REINPLACE_CMD} -e 's/shadow.$$(OBJEXT)/shadow.$$(OBJEXT) bsdnss.$$(OBJEXT)/;s/shadow\.c/shadow.c bsdnss.c/' ${WRKSRC}/nss/Makefile.in
105
	@${REINPLACE_CMD} -e 's/^NSS_VERS = .*/NSS_VERS = 1/;s/libnss_ldap\.so/nss_ldap.so/' ${WRKSRC}/nss/Makefile.in
94
#	@${REINPLACE_CMD} -e '/^$$(ACLOCAL_M4/,+2d' ${WRKSRC}/Makefile.in
106
	@${REINPLACE_CMD} -e 's/$$(DESTDIR)$$(NSS_LDAP_PATH_CONF)/$$(DESTDIR)$$(NSS_LDAP_PATH_CONF).sample/' ${WRKSRC}/Makefile.in
107
	@${REINPLACE_CMD} -e '/^$$(ACLOCAL_M4/,+2d' ${WRKSRC}/Makefile.in
108
95
109
post-configure:
96
post-configure:
110
	${REINPLACE_CMD} -e 's/^\(CFLAGS.*\) \-O2 \(.*\)$$/\1 -O0 \2/' ${WRKSRC}/nss/Makefile
97
	${REINPLACE_CMD} -e 's/^\(CFLAGS.*\) \-O2 \(.*\)$$/\1 -O0 \2/' ${WRKSRC}/nss/Makefile
Lines 113-133 Link Here
113
	@${ECHO_MSG}
100
	@${ECHO_MSG}
114
	@${ECHO_MSG} =====================================================================
101
	@${ECHO_MSG} =====================================================================
115
	@${ECHO_MSG}
102
	@${ECHO_MSG}
116
.if defined(WITH_NSS_COMPAT)
117
	@${ECHO_MSG} "                NSS_LDAP compatibility ENABLED."
118
	@${ECHO_MSG} "          It is DEPRECATED now and will be removed."
119
	@${ECHO_MSG}
120
	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/${CONFIG_FILE}"
103
	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/${CONFIG_FILE}"
121
	@${ECHO_MSG} " Secret file:             ${PREFIX}/etc/nss_ldap.secret"
122
	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/${CONFIG_FILE}.sample"
104
	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/${CONFIG_FILE}.sample"
123
	@${ECHO_MSG}
105
	@${ECHO_MSG}
124
	@${ECHO_MSG} " Check if you need to adjust  reconnect_* parameters"
125
	@${ECHO_MSG} " WARNING: nss_ldapd will use ONLY rootbinddn to access LDAP data"
126
.else
127
	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/${CONFIG_FILE}"
128
	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/${CONFIG_FILE}.sample"
129
	@${ECHO_MSG}
130
.endif
131
.if !defined(WITHOUT_NSS)
106
.if !defined(WITHOUT_NSS)
132
	@${ECHO_MSG} " WARNING: Be sure to set uid and gid configuration parameters"
107
	@${ECHO_MSG} " WARNING: Be sure to set uid and gid configuration parameters"
133
	@${ECHO_MSG} " WARNING: to make nslcd run under unprivileged user"
108
	@${ECHO_MSG} " WARNING: to make nslcd run under unprivileged user"
(-)net/nss-pam-ldapd/distinfo (-3 / +2 lines)
Lines 1-3 Link Here
1
MD5 (nss-pam-ldapd-0.7.7.tar.gz) = 7b37cc13b465495f90248e1209a05595
1
SHA256 (nss-pam-ldapd-0.7.13.tar.gz) = 1bdba144669ac3220162d59bafe5ba4f83404f520bc9ead58b179745c82b8d4a
2
SHA256 (nss-pam-ldapd-0.7.7.tar.gz) = fd6397990595243d3116fed2da409f582187329cc42794af2e47943a66ed363d
2
SIZE (nss-pam-ldapd-0.7.13.tar.gz) = 478944
3
SIZE (nss-pam-ldapd-0.7.7.tar.gz) = 457607
(-)net/nss-pam-ldapd/files/nss_patch.diff (-295 lines)
Lines 1-295 Link Here
1
--- configure.ac.orig	2009-10-17 20:09:01.000000000 +0400
2
+++ configure.ac	2009-12-20 19:58:24.000000000 +0300
3
@@ -160,6 +160,20 @@
4
   AC_DEFINE(ENABLE_CONFIGFILE_CHECKING,1,[Whether to check configfile options.])
5
 fi
6
 
7
+# check whether nss_compat options should be checked
8
+AC_MSG_CHECKING([whether to check nss_compat option])
9
+AC_ARG_ENABLE(nss_compat_checking,
10
+              AS_HELP_STRING([--enable-nss_compat],
11
+                             [check nss_compat option [[default=no]]]),
12
+              [nss_compat_checking=$enableval],
13
+              [nss_compat_checking="no"])
14
+AC_MSG_RESULT($nss_compat_checking)
15
+if test "x$nss_compat_checking" = "xyes"
16
+then
17
+  AC_CHECK_HEADERS([libgen.h], [], [AC_MSG_ERROR([libgen.h is required for nss_compat])])
18
+  AC_DEFINE(ENABLE_NSS_COMPAT,1,[Whether to check nss_compat options.])
19
+fi
20
+
21
 # check the name of the configuration file
22
 AC_ARG_WITH(ldap-conf-file,
23
             AS_HELP_STRING([--with-ldap-conf-file=PATH],
24
--- nslcd/cfg.c.orig	2009-10-05 21:47:47.000000000 +0400
25
+++ nslcd/cfg.c	2009-12-20 18:10:37.000000000 +0300
26
@@ -33,6 +33,9 @@
27
 #include <sys/types.h>
28
 #include <sys/stat.h>
29
 #include <unistd.h>
30
+#ifdef ENABLE_NSS_COMPAT
31
+#include <libgen.h>
32
+#endif
33
 #include <errno.h>
34
 #include <netdb.h>
35
 #include <sys/socket.h>
36
@@ -665,6 +668,25 @@
37
   int rc;
38
   char *value;
39
 #endif
40
+#ifdef ENABLE_NSS_COMPAT
41
+  /* get secret password */
42
+  snprintf(linebuf, sizeof(linebuf), "%s/nss_ldap.secret", dirname(filename));
43
+  if ((fp=fopen(linebuf,"r"))==NULL)
44
+  {
45
+    log_log(LOG_ERR,"cannot open secret file (%s): %s",linebuf,strerror(errno));
46
+    /* exit(EXIT_FAILURE); */
47
+  }
48
+  else if (fgets(linebuf,MAX_LINE_LENGTH,fp)!=NULL)
49
+  {
50
+    i=strlen(linebuf);
51
+    if (i>0)
52
+      linebuf[i-1]='\0';
53
+    cfg->ldc_bindpw=strdup(linebuf);
54
+  }
55
+  if (fp!=NULL)
56
+    fclose(fp);
57
+#endif
58
+
59
   /* open config file */
60
   if ((fp=fopen(filename,"r"))==NULL)
61
   {
62
@@ -733,13 +755,20 @@
63
       get_int(filename,lnr,keyword,&line,&cfg->ldc_version);
64
       get_eol(filename,lnr,keyword,&line);
65
     }
66
+#ifdef ENABLE_NSS_COMPAT
67
+    else if (strcasecmp(keyword,"rootbinddn")==0)
68
+#else
69
     else if (strcasecmp(keyword,"binddn")==0)
70
+#endif
71
     {
72
       get_restdup(filename,lnr,keyword,&line,&cfg->ldc_binddn);
73
     }
74
     else if (strcasecmp(keyword,"bindpw")==0)
75
     {
76
-      get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw);
77
+#ifdef ENABLE_NSS_COMPAT
78
+      if (cfg->ldc_bindpw == NULL)
79
+#endif
80
+        get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw);
81
     }
82
     /* SASL authentication options */
83
     else if (strcasecmp(keyword,"sasl_authcid")==0)
84
--- config.h.in.orig	2009-12-20 17:49:41.000000000 +0300
85
+++ config.h.in	2009-12-20 17:41:46.000000000 +0300
86
@@ -3,6 +3,9 @@
87
 /* Whether to check configfile options. */
88
 #undef ENABLE_CONFIGFILE_CHECKING
89
 
90
+/* Whether to check nss_compat options. */
91
+#undef ENABLE_NSS_COMPAT
92
+
93
 /* Define to 1 if you have the <aliases.h> header file. */
94
 #undef HAVE_ALIASES_H
95
 
96
--- configure.orig	2010-02-27 09:17:45.000000000 -0600
97
+++ configure	2010-04-29 07:28:11.044647697 -0500
98
@@ -738,6 +738,7 @@
99
 enable_sasl
100
 enable_kerberos
101
 enable_configfile_checking
102
+enable_nss_compat
103
 with_ldap_conf_file
104
 with_bindpw_file
105
 with_nslcd_pidfile
106
@@ -1386,6 +1387,7 @@
107
   --disable-kerberos      disable Kerberos support [[default=enabled]]
108
   --disable-configfile-checking
109
                           check configfile options [[default=enabled]]
110
+  --enable-nss_compat     check nss_compat option [[default=disabled]]
111
 
112
 Optional Packages:
113
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
114
@@ -4782,6 +4784,181 @@
115
 
116
 fi
117
 
118
+# check whether nss_compat options should be checked
119
+{ $as_echo "$as_me:$LINENO: checking whether to check nss_compat option" >&5
120
+$as_echo_n "checking whether to check nss_compat option... " >&6; }
121
+# Check whether --enable-nss_compat was given.
122
+if test "${enable_nss_compat+set}" = set; then
123
+  enableval=$enable_nss_compat; nss_compat=$enableval
124
+else
125
+  nss_compat="no"
126
+fi
127
+
128
+{ $as_echo "$as_me:$LINENO: result: $nss_compat" >&5
129
+$as_echo "$nss_compat" >&6; }
130
+if test "x$nss_compat" = "xyes"
131
+then
132
+
133
+for ac_header in libgen.h
134
+do
135
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
136
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
137
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
138
+$as_echo_n "checking for $ac_header... " >&6; }
139
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
140
+  $as_echo_n "(cached) " >&6
141
+fi
142
+ac_res=`eval 'as_val=${'$as_ac_Header'}
143
+		 $as_echo "$as_val"'`
144
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
145
+$as_echo "$ac_res" >&6; }
146
+else
147
+  # Is the header compilable?
148
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
149
+$as_echo_n "checking $ac_header usability... " >&6; }
150
+cat >conftest.$ac_ext <<_ACEOF
151
+/* confdefs.h.  */
152
+_ACEOF
153
+cat confdefs.h >>conftest.$ac_ext
154
+cat >>conftest.$ac_ext <<_ACEOF
155
+/* end confdefs.h.  */
156
+$ac_includes_default
157
+#include <$ac_header>
158
+_ACEOF
159
+rm -f conftest.$ac_objext
160
+if { (ac_try="$ac_compile"
161
+case "(($ac_try" in
162
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
163
+  *) ac_try_echo=$ac_try;;
164
+esac
165
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
166
+$as_echo "$ac_try_echo") >&5
167
+  (eval "$ac_compile") 2>conftest.er1
168
+  ac_status=$?
169
+  grep -v '^ *+' conftest.er1 >conftest.err
170
+  rm -f conftest.er1
171
+  cat conftest.err >&5
172
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
173
+  (exit $ac_status); } && {
174
+	 test -z "$ac_c_werror_flag" ||
175
+	 test ! -s conftest.err
176
+       } && test -s conftest.$ac_objext; then
177
+  ac_header_compiler=yes
178
+else
179
+  $as_echo "$as_me: failed program was:" >&5
180
+sed 's/^/| /' conftest.$ac_ext >&5
181
+
182
+	ac_header_compiler=no
183
+fi
184
+
185
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
186
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
187
+$as_echo "$ac_header_compiler" >&6; }
188
+
189
+# Is the header present?
190
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
191
+$as_echo_n "checking $ac_header presence... " >&6; }
192
+cat >conftest.$ac_ext <<_ACEOF
193
+/* confdefs.h.  */
194
+_ACEOF
195
+cat confdefs.h >>conftest.$ac_ext
196
+cat >>conftest.$ac_ext <<_ACEOF
197
+/* end confdefs.h.  */
198
+#include <$ac_header>
199
+_ACEOF
200
+if { (ac_try="$ac_cpp conftest.$ac_ext"
201
+case "(($ac_try" in
202
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
203
+  *) ac_try_echo=$ac_try;;
204
+esac
205
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
206
+$as_echo "$ac_try_echo") >&5
207
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
208
+  ac_status=$?
209
+  grep -v '^ *+' conftest.er1 >conftest.err
210
+  rm -f conftest.er1
211
+  cat conftest.err >&5
212
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
213
+  (exit $ac_status); } >/dev/null && {
214
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
215
+	 test ! -s conftest.err
216
+       }; then
217
+  ac_header_preproc=yes
218
+else
219
+  $as_echo "$as_me: failed program was:" >&5
220
+sed 's/^/| /' conftest.$ac_ext >&5
221
+
222
+  ac_header_preproc=no
223
+fi
224
+
225
+rm -f conftest.err conftest.$ac_ext
226
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
227
+$as_echo "$ac_header_preproc" >&6; }
228
+
229
+# So?  What about this header?
230
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
231
+  yes:no: )
232
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
233
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
234
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
235
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
236
+    ac_header_preproc=yes
237
+    ;;
238
+  no:yes:* )
239
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
240
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
241
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
242
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
243
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
244
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
245
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
246
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
247
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
248
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
249
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
250
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
251
+    ( cat <<\_ASBOX
252
+## -------------------------------------- ##
253
+## Report this to arthur@arthurdejong.org ##
254
+## -------------------------------------- ##
255
+_ASBOX
256
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
257
+    ;;
258
+esac
259
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
260
+$as_echo_n "checking for $ac_header... " >&6; }
261
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
262
+  $as_echo_n "(cached) " >&6
263
+else
264
+  eval "$as_ac_Header=\$ac_header_preproc"
265
+fi
266
+ac_res=`eval 'as_val=${'$as_ac_Header'}
267
+		 $as_echo "$as_val"'`
268
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
269
+$as_echo "$ac_res" >&6; }
270
+
271
+fi
272
+if test `eval 'as_val=${'$as_ac_Header'}
273
+		 $as_echo "$as_val"'` = yes; then
274
+  cat >>confdefs.h <<_ACEOF
275
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
276
+_ACEOF
277
+
278
+else
279
+  { { $as_echo "$as_me:$LINENO: error: libgen.h is required for nss_compat" >&5
280
+$as_echo "$as_me: error: libgen.h is required for nss_compat" >&2;}
281
+   { (exit 1); exit 1; }; }
282
+fi
283
+
284
+done
285
+
286
+
287
+cat >>confdefs.h <<\_ACEOF
288
+#define ENABLE_NSS_COMPAT 1
289
+_ACEOF
290
+
291
+fi
292
+
293
 # check the name of the configuration file
294
 
295
 # Check whether --with-ldap-conf-file was given.
(-)net/nss-pam-ldapd/files/patch-nslcd__nslcd.c (-11 lines)
Lines 1-11 Link Here
1
--- nslcd/nslcd.c.orig	2010-07-06 23:36:52.000000000 +0400
2
+++ nslcd/nslcd.c	2010-07-06 23:40:01.000000000 +0400
3
@@ -574,7 +574,7 @@
4
   char *error;
5
   int *enable_flag;
6
   /* try to load the NSS module */
7
-  handle=dlopen("libnss_ldap.so.2",RTLD_LAZY|RTLD_NODELETE);
8
+  handle=dlopen("nss_ldap.so.1",RTLD_LAZY|RTLD_NODELETE);
9
   if (handle==NULL)
10
   {
11
     log_log(LOG_WARNING,"Warning: LDAP NSS module not loaded: %s",dlerror());
(-)net/nss-pam-ldapd/files/patch-nss__ldap.map (+30 lines)
Line 0 Link Here
1
--- ./nss/nss_ldap.map.orig	2010-09-24 07:07:18.000000000 +0000
2
+++ ./nss/nss_ldap.map		2010-12-16 13:13:25.000000000 +0000
3
@@ -81,6 +78,27 @@
4
     _nss_ldap_getspent_r;
5
     _nss_ldap_endspent;
6
 
7
+    # compat 4 bsd 
8
+    __nss_compat_getgrnam_r;
9
+    __nss_compat_getgrgid_r;
10
+    __nss_compat_getgrent_r;
11
+    __nss_compat_setgrent;
12
+    __nss_compat_endgrent;
13
+
14
+    __nss_compat_getpwnam_r;
15
+    __nss_compat_getpwuid_r;
16
+    __nss_compat_getpwent_r;
17
+    __nss_compat_setpwent;
18
+    __nss_compat_endpwent;
19
+
20
+    __nss_compat_gethostbyname;
21
+    __nss_compat_gethostbyname2;
22
+    __nss_compat_gethostbyaddr;
23
+    
24
+    # module init
25
+    nss_module_register;
26
+
27
+
28
   # everything else should not be exported
29
   local:
30
     *;
(-)net/nss-pam-ldapd/files/patch-nss_ldap.map (-30 lines)
Lines 1-30 Link Here
1
--- nss/nss_ldap.map.orig	2010-06-15 23:53:21.000000000 +0400
2
+++ nss/nss_ldap.map	2010-07-06 22:57:53.000000000 +0400
3
@@ -81,6 +78,27 @@
4
     _nss_ldap_getspent_r;
5
     _nss_ldap_endspent;
6
 
7
+    # compat 4 bsd 
8
+    __nss_compat_getgrnam_r;
9
+    __nss_compat_getgrgid_r;
10
+    __nss_compat_getgrent_r;
11
+    __nss_compat_setgrent;
12
+    __nss_compat_endgrent;
13
+
14
+    __nss_compat_getpwnam_r;
15
+    __nss_compat_getpwuid_r;
16
+    __nss_compat_getpwent_r;
17
+    __nss_compat_setpwent;
18
+    __nss_compat_endpwent;
19
+
20
+    __nss_compat_gethostbyname;
21
+    __nss_compat_gethostbyname2;
22
+    __nss_compat_gethostbyaddr;
23
+    
24
+    # module init
25
+    nss_module_register;
26
+
27
+
28
   # everything else should not be exported
29
   local:
30
     *;
(-)net/nss-pam-ldapd/files/rtld_nss__nslcd.c (+20 lines)
Line 0 Link Here
1
--- nslcd/nslcd.c.orig	2011-01-09 13:45:07.000000000 +0300
2
+++ nslcd/nslcd.c	2011-01-09 13:45:55.000000000 +0300
3
@@ -574,7 +574,7 @@
4
   char *error;
5
   int *enable_flag;
6
   /* try to load the NSS module */
7
-  handle=dlopen(NSS_LDAP_SONAME,RTLD_LAZY|RTLD_NODELETE);
8
+  handle=dlopen(NSS_LDAP_SONAME,RTLD_LAZY);
9
   if (handle==NULL)
10
   {
11
     log_log(LOG_WARNING,"Warning: LDAP NSS module not loaded: %s",dlerror());
12
@@ -593,7 +593,7 @@
13
     if (__nss_configure_lookup("hosts","files dns"))
14
       log_log(LOG_ERR,"unable to override hosts lookup method: %s",strerror(errno));
15
 #endif /* HAVE___NSS_CONFIGURE_LOOKUP */
16
-    dlclose(handle);
17
+    /* Do not dlclose() to keep reference count > 0 instead of RTLD_NODELETE */
18
     return;
19
   }
20
   /* disable nss_ldap */

Return to bug 153215