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

Collapse All | Expand All

(-)/home/melifaro/ports/nss-pam-ldapd/Makefile (-16 / +25 lines)
Lines 5-16 Link Here
5
# $FreeBSD: ports/net/nss_ldapd/Makefile,v 1.4 2010/05/14 13:23:00 pav Exp $
5
# $FreeBSD: ports/net/nss_ldapd/Makefile,v 1.4 2010/05/14 13:23:00 pav Exp $
6
#
6
#
7
7
8
PORTNAME=		nss_ldapd
8
PORTNAME=		nss-pam-ldapd
9
PORTVERSION=		0.7.3
9
PORTVERSION=		0.7.7
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/
13
DISTNAME=		nss-pam-ldapd-${PORTVERSION}
13
LICENSE=		LGPL21 LGPL3
14
LICENSE_COMB=		dual
14
15
15
MAINTAINER=		melifaro@ipfw.ru
16
MAINTAINER=		melifaro@ipfw.ru
16
COMMENT=		Advanced fork of nss_ldap
17
COMMENT=		Advanced fork of nss_ldap
Lines 24-32 Link Here
24
NSLCD_PIDFILE?=		/var/run/nslcd.pid
25
NSLCD_PIDFILE?=		/var/run/nslcd.pid
25
NSLCD_SOCKET?=		/var/run/nslcd.ctl
26
NSLCD_SOCKET?=		/var/run/nslcd.ctl
26
27
27
OPTIONS=		NSS_COMPAT	"Enable nss_ldap compatibility" on \
28
OPTIONS=		SASL		"Enable SASL" off \
28
			SASL		"Enable SASL" off \
29
			PAM		"Build pam_ldap" on \
29
			PAM		"Build pam_ldap" on
30
			NSS_COMPAT	"Enable nss_ldap compatibility (DEPRECATED)" off
30
31
31
USERS=			nslcd
32
USERS=			nslcd
32
GROUPS=			nslcd
33
GROUPS=			nslcd
Lines 49-59 Link Here
49
.endif
50
.endif
50
51
51
.if defined(WITH_NSS_COMPAT)
52
.if defined(WITH_NSS_COMPAT)
52
CONFIGURE_ARGS+=	--enable-nss_compat --disable-configfile-checking --with-ldap-conf-file=${PREFIX}/etc/nss_ldap.conf
53
CONFIG_FILE=		"nss_ldap.conf"
53
PLIST_SUB+=		CONFIG="nss_ldap"
54
CONFIGURE_ARGS+=	--enable-nss_compat --disable-configfile-checking --with-ldap-conf-file=${PREFIX}/etc/${CONFIG_FILE}
54
.else
55
EXTRA_PATCHES+=		${FILESDIR}/nss_patch.diff
55
CONFIGURE_ARGS+=	--with-ldap-conf-file=${PREFIX}/etc/nss_ldapd.conf
56
PLIST_SUB+=		CONFIG=${CONFIG_FILE}
56
PLIST_SUB+=		CONFIG="nss_ldapd"
57
.else
58
CONFIG_FILE=		"nslcd.conf"
59
CONFIGURE_ARGS+=	--with-ldap-conf-file=${PREFIX}/etc/${CONFIG_FILE}
60
PLIST_SUB+=		CONFIG=${CONFIG_FILE}
57
.endif
61
.endif
58
62
59
.if defined(WITH_SASL)
63
.if defined(WITH_SASL)
Lines 94-102 Link Here
94
98
95
post-extract:
99
post-extract:
96
	@${REINPLACE_CMD} -e 's/\(INSTALL_\)\(.*\)) -D /\1\2) /' ${WRKSRC}/Makefile.in ${WRKSRC}/nss/Makefile.in
100
	@${REINPLACE_CMD} -e 's/\(INSTALL_\)\(.*\)) -D /\1\2) /' ${WRKSRC}/Makefile.in ${WRKSRC}/nss/Makefile.in
97
	@${REINPLACE_CMD} -e 's/shadow.$$(OBJEXT)/shadow.$$(OBJEXT) bsdnss.$$(OBJEXT)/;s/shadow\.c/shadow.c bsdnss.c/;s/exports\.linux/exports.freebsd/' ${WRKSRC}/nss/Makefile.in
101
	@${REINPLACE_CMD} -e 's/shadow.$$(OBJEXT)/shadow.$$(OBJEXT) bsdnss.$$(OBJEXT)/;s/shadow\.c/shadow.c bsdnss.c/' ${WRKSRC}/nss/Makefile.in
98
	@${REINPLACE_CMD} -e 's/^NSS_VERS = .*/NSS_VERS = 1/;s/libnss_ldap\.so/nss_ldap.so/' ${WRKSRC}/nss/Makefile.in
102
	@${REINPLACE_CMD} -e 's/^NSS_VERS = .*/NSS_VERS = 1/;s/libnss_ldap\.so/nss_ldap.so/' ${WRKSRC}/nss/Makefile.in
99
	@${REINPLACE_CMD} -e 's/$$(DESTDIR)$$(NSS_LDAP_PATH_CONF)/$$(DESTDIR)$$(NSS_LDAP_PATH_CONF).sample/' ${WRKSRC}/Makefile.in
103
	@${REINPLACE_CMD} -e 's/$$(DESTDIR)$$(NSS_LDAP_PATH_CONF)/$$(DESTDIR)$$(NSS_LDAP_PATH_CONF).sample/' ${WRKSRC}/Makefile.in
104
	@${REINPLACE_CMD} -e '/^$$(ACLOCAL_M4/,+2d' ${WRKSRC}/Makefile.in
105
106
post-configure:
107
	${REINPLACE_CMD} -e 's/^\(CFLAGS.*\) \-O2 \(.*\)$$/\1 -O0 \2/' ${WRKSRC}/nss/Makefile
100
108
101
post-install:
109
post-install:
102
	@${ECHO_MSG}
110
	@${ECHO_MSG}
Lines 104-119 Link Here
104
	@${ECHO_MSG}
112
	@${ECHO_MSG}
105
.if defined(WITH_NSS_COMPAT)
113
.if defined(WITH_NSS_COMPAT)
106
	@${ECHO_MSG} "                NSS_LDAP compatibility ENABLED."
114
	@${ECHO_MSG} "                NSS_LDAP compatibility ENABLED."
115
	@${ECHO_MSG} "          It is DEPRECATED now and will be removed."
107
	@${ECHO_MSG}
116
	@${ECHO_MSG}
108
	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/nss_ldap.conf"
117
	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/${CONFIG_FILE}"
109
	@${ECHO_MSG} " Secret file:             ${PREFIX}/etc/nss_ldap.secret"
118
	@${ECHO_MSG} " Secret file:             ${PREFIX}/etc/nss_ldap.secret"
110
	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/nss_ldap.conf.sample"
119
	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/${CONFIG_FILE}.sample"
111
	@${ECHO_MSG}
120
	@${ECHO_MSG}
112
	@${ECHO_MSG} " Check if you need to adjust  reconnect_* parameters"
121
	@${ECHO_MSG} " Check if you need to adjust  reconnect_* parameters"
113
	@${ECHO_MSG} " WARNING: nss_ldapd will use ONLY rootbinddn to access LDAP data"
122
	@${ECHO_MSG} " WARNING: nss_ldapd will use ONLY rootbinddn to access LDAP data"
114
.else
123
.else
115
	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/nss_ldapd.conf"
124
	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/${CONFIG_FILE}"
116
	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/nss_ldapd.conf.sample"
125
	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/${CONFIG_FILE}.sample"
117
	@${ECHO_MSG}
126
	@${ECHO_MSG}
118
.endif
127
.endif
119
.if !defined(WITHOUT_NSS)
128
.if !defined(WITHOUT_NSS)
(-)/home/melifaro/ports/nss-pam-ldapd/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (nss-pam-ldapd-0.7.3.tar.gz) = 688833d959f1878a139d484e980d160e
1
MD5 (nss-pam-ldapd-0.7.7.tar.gz) = 7b37cc13b465495f90248e1209a05595
2
SHA256 (nss-pam-ldapd-0.7.3.tar.gz) = db300db75fdf7ab74fae8fcb7cfecb5adace49ecf715d308581b22575bc128da
2
SHA256 (nss-pam-ldapd-0.7.7.tar.gz) = fd6397990595243d3116fed2da409f582187329cc42794af2e47943a66ed363d
3
SIZE (nss-pam-ldapd-0.7.3.tar.gz) = 443042
3
SIZE (nss-pam-ldapd-0.7.7.tar.gz) = 457607
(-)/home/melifaro/ports/nss-pam-ldapd/files/nss_patch.diff (+212 lines)
Lines 81-83 Link Here
81
     }
81
     }
82
     /* SASL authentication options */
82
     /* SASL authentication options */
83
     else if (strcasecmp(keyword,"sasl_authcid")==0)
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.
(-)/home/melifaro/ports/nss-pam-ldapd/files/patch-Makefile.in (+18 lines)
Line 0 Link Here
1
--- Makefile.in.orig	2010-06-29 23:25:51.000000000 +0400
2
+++ Makefile.in	2010-06-29 23:26:53.000000000 +0400
3
@@ -759,13 +759,14 @@
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
 	  $(INSTALL_DATA) $(srcdir)/nslcd.conf $(DESTDIR)$(NSLCD_CONF_PATH) || true; \
12
 	fi
13
 uninstall-nslcd_conf:
14
-	-rm -f $(DESTDIR)$(NSLCD_CONF_PATH)
15
+	-rm -f $(DESTDIR)$(NSLCD_CONF_PATH).sample
16
 
17
 # target for easily creating a Debian package
18
 # the find is an ugly hack to fix a bug if being built on an nfs filesystem
(-)/home/melifaro/ports/nss-pam-ldapd/files/patch-configure (-212 lines)
Lines 1-212 Link Here
1
--- config.h.in.orig	2009-12-20 17:49:41.000000000 +0300
2
+++ config.h.in	2009-12-20 17:41:46.000000000 +0300
3
@@ -3,6 +3,9 @@
4
 /* Whether to check configfile options. */
5
 #undef ENABLE_CONFIGFILE_CHECKING
6
 
7
+/* Whether to check nss_compat options. */
8
+#undef ENABLE_NSS_COMPAT
9
+
10
 /* Define to 1 if you have the <aliases.h> header file. */
11
 #undef HAVE_ALIASES_H
12
 
13
--- configure.orig	2010-02-27 09:17:45.000000000 -0600
14
+++ configure	2010-04-29 07:28:11.044647697 -0500
15
@@ -738,6 +738,7 @@
16
 enable_sasl
17
 enable_kerberos
18
 enable_configfile_checking
19
+enable_nss_compat
20
 with_ldap_conf_file
21
 with_bindpw_file
22
 with_nslcd_pidfile
23
@@ -1386,6 +1387,7 @@
24
   --disable-kerberos      disable Kerberos support [[default=enabled]]
25
   --disable-configfile-checking
26
                           check configfile options [[default=enabled]]
27
+  --enable-nss_compat     check nss_compat option [[default=disabled]]
28
 
29
 Optional Packages:
30
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
31
@@ -4782,6 +4784,181 @@
32
 
33
 fi
34
 
35
+# check whether nss_compat options should be checked
36
+{ $as_echo "$as_me:$LINENO: checking whether to check nss_compat option" >&5
37
+$as_echo_n "checking whether to check nss_compat option... " >&6; }
38
+# Check whether --enable-nss_compat was given.
39
+if test "${enable_nss_compat+set}" = set; then
40
+  enableval=$enable_nss_compat; nss_compat=$enableval
41
+else
42
+  nss_compat="no"
43
+fi
44
+
45
+{ $as_echo "$as_me:$LINENO: result: $nss_compat" >&5
46
+$as_echo "$nss_compat" >&6; }
47
+if test "x$nss_compat" = "xyes"
48
+then
49
+
50
+for ac_header in libgen.h
51
+do
52
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
53
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
54
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
55
+$as_echo_n "checking for $ac_header... " >&6; }
56
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
57
+  $as_echo_n "(cached) " >&6
58
+fi
59
+ac_res=`eval 'as_val=${'$as_ac_Header'}
60
+		 $as_echo "$as_val"'`
61
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
62
+$as_echo "$ac_res" >&6; }
63
+else
64
+  # Is the header compilable?
65
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
66
+$as_echo_n "checking $ac_header usability... " >&6; }
67
+cat >conftest.$ac_ext <<_ACEOF
68
+/* confdefs.h.  */
69
+_ACEOF
70
+cat confdefs.h >>conftest.$ac_ext
71
+cat >>conftest.$ac_ext <<_ACEOF
72
+/* end confdefs.h.  */
73
+$ac_includes_default
74
+#include <$ac_header>
75
+_ACEOF
76
+rm -f conftest.$ac_objext
77
+if { (ac_try="$ac_compile"
78
+case "(($ac_try" in
79
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
80
+  *) ac_try_echo=$ac_try;;
81
+esac
82
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
83
+$as_echo "$ac_try_echo") >&5
84
+  (eval "$ac_compile") 2>conftest.er1
85
+  ac_status=$?
86
+  grep -v '^ *+' conftest.er1 >conftest.err
87
+  rm -f conftest.er1
88
+  cat conftest.err >&5
89
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
90
+  (exit $ac_status); } && {
91
+	 test -z "$ac_c_werror_flag" ||
92
+	 test ! -s conftest.err
93
+       } && test -s conftest.$ac_objext; then
94
+  ac_header_compiler=yes
95
+else
96
+  $as_echo "$as_me: failed program was:" >&5
97
+sed 's/^/| /' conftest.$ac_ext >&5
98
+
99
+	ac_header_compiler=no
100
+fi
101
+
102
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
103
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
104
+$as_echo "$ac_header_compiler" >&6; }
105
+
106
+# Is the header present?
107
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
108
+$as_echo_n "checking $ac_header presence... " >&6; }
109
+cat >conftest.$ac_ext <<_ACEOF
110
+/* confdefs.h.  */
111
+_ACEOF
112
+cat confdefs.h >>conftest.$ac_ext
113
+cat >>conftest.$ac_ext <<_ACEOF
114
+/* end confdefs.h.  */
115
+#include <$ac_header>
116
+_ACEOF
117
+if { (ac_try="$ac_cpp conftest.$ac_ext"
118
+case "(($ac_try" in
119
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
120
+  *) ac_try_echo=$ac_try;;
121
+esac
122
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
123
+$as_echo "$ac_try_echo") >&5
124
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
125
+  ac_status=$?
126
+  grep -v '^ *+' conftest.er1 >conftest.err
127
+  rm -f conftest.er1
128
+  cat conftest.err >&5
129
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
130
+  (exit $ac_status); } >/dev/null && {
131
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
132
+	 test ! -s conftest.err
133
+       }; then
134
+  ac_header_preproc=yes
135
+else
136
+  $as_echo "$as_me: failed program was:" >&5
137
+sed 's/^/| /' conftest.$ac_ext >&5
138
+
139
+  ac_header_preproc=no
140
+fi
141
+
142
+rm -f conftest.err conftest.$ac_ext
143
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
144
+$as_echo "$ac_header_preproc" >&6; }
145
+
146
+# So?  What about this header?
147
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
148
+  yes:no: )
149
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
150
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
151
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
152
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
153
+    ac_header_preproc=yes
154
+    ;;
155
+  no:yes:* )
156
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
157
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
158
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
159
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
160
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
161
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
162
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
163
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
164
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
165
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
166
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
167
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
168
+    ( cat <<\_ASBOX
169
+## -------------------------------------- ##
170
+## Report this to arthur@arthurdejong.org ##
171
+## -------------------------------------- ##
172
+_ASBOX
173
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
174
+    ;;
175
+esac
176
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
177
+$as_echo_n "checking for $ac_header... " >&6; }
178
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
179
+  $as_echo_n "(cached) " >&6
180
+else
181
+  eval "$as_ac_Header=\$ac_header_preproc"
182
+fi
183
+ac_res=`eval 'as_val=${'$as_ac_Header'}
184
+		 $as_echo "$as_val"'`
185
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
186
+$as_echo "$ac_res" >&6; }
187
+
188
+fi
189
+if test `eval 'as_val=${'$as_ac_Header'}
190
+		 $as_echo "$as_val"'` = yes; then
191
+  cat >>confdefs.h <<_ACEOF
192
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
193
+_ACEOF
194
+
195
+else
196
+  { { $as_echo "$as_me:$LINENO: error: libgen.h is required for nss_compat" >&5
197
+$as_echo "$as_me: error: libgen.h is required for nss_compat" >&2;}
198
+   { (exit 1); exit 1; }; }
199
+fi
200
+
201
+done
202
+
203
+
204
+cat >>confdefs.h <<\_ACEOF
205
+#define ENABLE_NSS_COMPAT 1
206
+_ACEOF
207
+
208
+fi
209
+
210
 # check the name of the configuration file
211
 
212
 # Check whether --with-ldap-conf-file was given.
(-)/home/melifaro/ports/nss-pam-ldapd/files/patch-nslcd__cfg.c (-60 lines)
Lines 1-60 Link Here
1
--- nslcd/cfg.c.orig	2009-10-05 21:47:47.000000000 +0400
2
+++ nslcd/cfg.c	2009-12-20 18:10:37.000000000 +0300
3
@@ -33,6 +33,9 @@
4
 #include <sys/types.h>
5
 #include <sys/stat.h>
6
 #include <unistd.h>
7
+#ifdef ENABLE_NSS_COMPAT
8
+#include <libgen.h>
9
+#endif
10
 #include <errno.h>
11
 #include <netdb.h>
12
 #include <sys/socket.h>
13
@@ -665,6 +668,25 @@
14
   int rc;
15
   char *value;
16
 #endif
17
+#ifdef ENABLE_NSS_COMPAT
18
+  /* get secret password */
19
+  snprintf(linebuf, sizeof(linebuf), "%s/nss_ldap.secret", dirname(filename));
20
+  if ((fp=fopen(linebuf,"r"))==NULL)
21
+  {
22
+    log_log(LOG_ERR,"cannot open secret file (%s): %s",linebuf,strerror(errno));
23
+    /* exit(EXIT_FAILURE); */
24
+  }
25
+  else if (fgets(linebuf,MAX_LINE_LENGTH,fp)!=NULL)
26
+  {
27
+    i=strlen(linebuf);
28
+    if (i>0)
29
+      linebuf[i-1]='\0';
30
+    cfg->ldc_bindpw=strdup(linebuf);
31
+  }
32
+  if (fp!=NULL)
33
+    fclose(fp);
34
+#endif
35
+
36
   /* open config file */
37
   if ((fp=fopen(filename,"r"))==NULL)
38
   {
39
@@ -733,13 +755,20 @@
40
       get_int(filename,lnr,keyword,&line,&cfg->ldc_version);
41
       get_eol(filename,lnr,keyword,&line);
42
     }
43
+#ifdef ENABLE_NSS_COMPAT
44
+    else if (strcasecmp(keyword,"rootbinddn")==0)
45
+#else
46
     else if (strcasecmp(keyword,"binddn")==0)
47
+#endif
48
     {
49
       get_restdup(filename,lnr,keyword,&line,&cfg->ldc_binddn);
50
     }
51
     else if (strcasecmp(keyword,"bindpw")==0)
52
     {
53
-      get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw);
54
+#ifdef ENABLE_NSS_COMPAT
55
+      if (cfg->ldc_bindpw == NULL)
56
+#endif
57
+        get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw);
58
     }
59
     /* SASL authentication options */
60
     else if (strcasecmp(keyword,"sasl_authcid")==0)
(-)/home/melifaro/ports/nss-pam-ldapd/files/patch-nslcd__nslcd.c (+11 lines)
Line 0 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());
(-)/home/melifaro/ports/nss-pam-ldapd/files/patch-nss__exports.freebsd (-109 lines)
Lines 1-109 Link Here
1
--- nss/exports.freebsd.orig	2009-12-20 15:58:25.000000000 +0300
2
+++ nss/exports.freebsd	2009-12-20 15:57:47.000000000 +0300
3
@@ -0,0 +1,106 @@
4
+EXPORTED {
5
+
6
+  # published NSS service functions
7
+  global:
8
+
9
+    # aliases - mail aliases
10
+    _nss_ldap_getaliasbyname_r;
11
+    _nss_ldap_setaliasent;
12
+    _nss_ldap_getaliasent_r;
13
+    _nss_ldap_endaliasent;
14
+
15
+    # ethers - ethernet numbers
16
+    _nss_ldap_gethostton_r;
17
+    _nss_ldap_getntohost_r;
18
+    _nss_ldap_setetherent;
19
+    _nss_ldap_getetherent_r;
20
+    _nss_ldap_endetherent;
21
+
22
+    # group - groups of users
23
+    _nss_ldap_getgrnam_r;
24
+    _nss_ldap_getgrgid_r;
25
+    _nss_ldap_initgroups_dyn;
26
+    _nss_ldap_setgrent;
27
+    _nss_ldap_getgrent_r;
28
+    _nss_ldap_endgrent;
29
+
30
+    # hosts - host names and numbers
31
+    _nss_ldap_gethostbyname_r;
32
+    _nss_ldap_gethostbyname2_r;
33
+    _nss_ldap_gethostbyaddr_r;
34
+    _nss_ldap_sethostent;
35
+    _nss_ldap_gethostent_r;
36
+    _nss_ldap_endhostent;
37
+
38
+    # netgroup - list of host and users
39
+    _nss_ldap_setnetgrent;
40
+    _nss_ldap_getnetgrent_r;
41
+    _nss_ldap_endnetgrent;
42
+
43
+    # networks - network names and numbers
44
+    _nss_ldap_getnetbyname_r;
45
+    _nss_ldap_getnetbyaddr_r;
46
+    _nss_ldap_setnetent;
47
+    _nss_ldap_getnetent_r;
48
+    _nss_ldap_endnetent;
49
+
50
+    # passwd - user database and passwords
51
+    _nss_ldap_getpwnam_r;
52
+    _nss_ldap_getpwuid_r;
53
+    _nss_ldap_setpwent;
54
+    _nss_ldap_getpwent_r;
55
+    _nss_ldap_endpwent;
56
+
57
+    # protocols - network protocols
58
+    _nss_ldap_getprotobyname_r;
59
+    _nss_ldap_getprotobynumber_r;
60
+    _nss_ldap_setprotoent;
61
+    _nss_ldap_getprotoent_r;
62
+    _nss_ldap_endprotoent;
63
+
64
+    # rpc - remote procedure call names and numbers
65
+    _nss_ldap_getrpcbyname_r;
66
+    _nss_ldap_getrpcbynumber_r;
67
+    _nss_ldap_setrpcent;
68
+    _nss_ldap_getrpcent_r;
69
+    _nss_ldap_endrpcent;
70
+
71
+    # services - network services
72
+    _nss_ldap_getservbyname_r;
73
+    _nss_ldap_getservbyport_r;
74
+    _nss_ldap_setservent;
75
+    _nss_ldap_getservent_r;
76
+    _nss_ldap_endservent;
77
+
78
+    # shadow - extended user information
79
+    _nss_ldap_getspnam_r;
80
+    _nss_ldap_setspent;
81
+    _nss_ldap_getspent_r;
82
+    _nss_ldap_endspent;
83
+
84
+    # compat 4 bsd 
85
+    __nss_compat_getgrnam_r;
86
+    __nss_compat_getgrgid_r;
87
+    __nss_compat_getgrent_r;
88
+    __nss_compat_setgrent;
89
+    __nss_compat_endgrent;
90
+
91
+    __nss_compat_getpwnam_r;
92
+    __nss_compat_getpwuid_r;
93
+    __nss_compat_getpwent_r;
94
+    __nss_compat_setpwent;
95
+    __nss_compat_endpwent;
96
+
97
+    __nss_compat_gethostbyname;
98
+    __nss_compat_gethostbyname2;
99
+    __nss_compat_gethostbyaddr;
100
+    
101
+    # module init
102
+    nss_module_register;
103
+
104
+
105
+  # everything else should not be exported
106
+  local:
107
+    *;
108
+
109
+};
(-)/home/melifaro/ports/nss-pam-ldapd/files/patch-nss__prototypes.h (-43 lines)
Lines 1-43 Link Here
1
--- nss/prototypes.h.orig	2009-09-04 15:55:35.000000000 +0400
2
+++ nss/prototypes.h	2009-12-20 15:37:57.000000000 +0300
3
@@ -84,6 +86,27 @@
4
   void *nip; /* changed from `service_user *nip' */
5
 };
6
 
7
+#ifdef __FreeBSD__
8
+/* 
9
+ * Import from aliases.h
10
+ */
11
+struct aliasent
12
+  {
13
+    char *alias_name;
14
+    size_t alias_members_len;
15
+    char **alias_members;
16
+    int alias_local;
17
+  };
18
+
19
+struct rpcent
20
+{
21
+  char *r_name;         /* Name of server for this rpc program.  */
22
+  char **r_aliases;     /* Alias list.  */
23
+  int r_number;         /* RPC program number.  */
24
+};
25
+
26
+#endif
27
+
28
 /*
29
    These are prototypes for functions exported from the ldap NSS module.
30
    For more complete definitions of these functions check the GLIBC
31
@@ -166,10 +189,12 @@
32
 enum nss_status _nss_ldap_getservent_r(struct servent *result,char *buffer,size_t buflen,int *errnop);
33
 enum nss_status _nss_ldap_endservent(void);
34
 
35
+#ifdef HAVE_SHADOW_H
36
 /* shadow - extended user information */
37
 enum nss_status _nss_ldap_getspnam_r(const char *name,struct spwd *result,char *buffer,size_t buflen,int *errnop);
38
 enum nss_status _nss_ldap_setspent(int stayopen);
39
 enum nss_status _nss_ldap_getspent_r(struct spwd *result,char *buffer,size_t buflen,int *errnop);
40
 enum nss_status _nss_ldap_endspent(void);
41
+#endif
42
 
43
 #endif /* not NSS_EXPORTS */
(-)/home/melifaro/ports/nss-pam-ldapd/files/patch-nss_ldap.map (+30 lines)
Line 0 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
     *;
(-)/home/melifaro/ports/nss-pam-ldapd/pkg-descr (-8 / +11 lines)
Lines 1-11 Link Here
1
nss_ldapd is a NSS module which provides an LDAP backend for C library
1
nss-pam-ldapd, a Name Service Switch (NSS) module and Pluggable Authentication 
2
functions such as getpwnam(3), getgrnam(3), and gethostbyname(3).  It
2
Module (PAM) that allows your LDAP server to provide user account, group, host 
3
is compliant with RFC 2307, ``An Approach for Using LDAP as a Network
3
name, alias, netgroup, and basically any other information that you would 
4
Information Service''.
4
normally get from /etc flat files or NIS. It also alows you to do 
5
authentication to an LDAP server. 
5
6
6
Key differences from nss_ldap:
7
Key differences from nss_ldap:
7
* lighter nss library (no ldap* dependings)
8
* lighter NSS library
8
* server-side connection caching
9
* lighter PAM library
10
* simpler internal semantics
11
* clear separation between NSS, PAM and LDAP code (the server part could easily be implemented in another language)
12
* less connections to the LDAP server
9
13
10
14
WWW: http://arthurdejong.org/nss-pam-ldapd/
11
WWW: http://arthurdejong.org/nss-ldapd/
(-)/home/melifaro/ports/nss-pam-ldapd/pkg-plist (-1 / +1 lines)
Lines 1-4 Link Here
1
etc/%%CONFIG%%.conf
1
etc/%%CONFIG%%.sample
2
%%NSS%%lib/nss_ldap.so.1
2
%%NSS%%lib/nss_ldap.so.1
3
%%NSLCD%%sbin/nslcd
3
%%NSLCD%%sbin/nslcd
4
%%PAM%%lib/pam_ldap.so
4
%%PAM%%lib/pam_ldap.so

Return to bug 147293