summaryrefslogtreecommitdiff
path: root/net/nss_ldap/files
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2003-04-17 14:26:46 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2003-04-17 14:26:46 +0000
commit2cc92ba66e5daa9e3c1d60bb7eca7e815819c5f2 (patch)
tree4e60eb40214e89e6bde1deffb62a01a3a18be059 /net/nss_ldap/files
parentPrevious commit was (diff)
Add nss_ldap, an RFC 2307-compliant NSS module. Currently only the
getpwent(3) and getgrent(3) family of functions are supported.
Diffstat (limited to 'net/nss_ldap/files')
-rw-r--r--net/nss_ldap/files/bsdnss.c59
-rw-r--r--net/nss_ldap/files/patch-Makefile.in127
-rw-r--r--net/nss_ldap/files/patch-configure125
3 files changed, 311 insertions, 0 deletions
diff --git a/net/nss_ldap/files/bsdnss.c b/net/nss_ldap/files/bsdnss.c
new file mode 100644
index 000000000000..598bdb7fe94f
--- /dev/null
+++ b/net/nss_ldap/files/bsdnss.c
@@ -0,0 +1,59 @@
+#include <sys/param.h>
+#include <pwd.h>
+#include <grp.h>
+#include <nss.h>
+
+extern enum nss_status _nss_ldap_getgrent_r(struct group *, char *, size_t,
+ int *);
+extern enum nss_status _nss_ldap_getgrnam_r(const char *, struct group *,
+ char *, size_t, int *);
+extern enum nss_status _nss_ldap_getgrgid_r(gid_t gid, struct group *, char *,
+ size_t, int *);
+extern enum nss_status _nss_ldap_setgrent(void);
+extern enum nss_status _nss_ldap_endgrent(void);
+
+extern enum nss_status _nss_ldap_getpwent_r(struct passwd *, char *, size_t,
+ int *);
+extern enum nss_status _nss_ldap_getpwnam_r(const char *, struct passwd *,
+ char *, size_t, int *);
+extern enum nss_status _nss_ldap_getpwuid_r(gid_t gid, struct passwd *, char *,
+ size_t, int *);
+extern enum nss_status _nss_ldap_setpwent(void);
+extern enum nss_status _nss_ldap_endpwent(void);
+
+NSS_METHOD_PROTOTYPE(__nss_compat_getgrnam_r);
+NSS_METHOD_PROTOTYPE(__nss_compat_getgrgid_r);
+NSS_METHOD_PROTOTYPE(__nss_compat_getgrent_r);
+NSS_METHOD_PROTOTYPE(__nss_compat_setgrent);
+NSS_METHOD_PROTOTYPE(__nss_compat_endgrent);
+
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r);
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r);
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwent_r);
+NSS_METHOD_PROTOTYPE(__nss_compat_setpwent);
+NSS_METHOD_PROTOTYPE(__nss_compat_endpwent);
+
+static ns_mtab methods[] = {
+{ NSDB_GROUP, "getgrnam_r", __nss_compat_getgrnam_r, _nss_ldap_getgrnam_r },
+{ NSDB_GROUP, "getgrgid_r", __nss_compat_getgrgid_r, _nss_ldap_getgrgid_r },
+{ NSDB_GROUP, "getgrent_r", __nss_compat_getgrent_r, _nss_ldap_getgrent_r },
+{ NSDB_GROUP, "endgrent", __nss_compat_setgrent, _nss_ldap_setgrent },
+{ NSDB_GROUP, "setgrent", __nss_compat_endgrent, _nss_ldap_endgrent },
+
+{ NSDB_PASSWD, "getpwnam_r", __nss_compat_getpwnam_r, _nss_ldap_getpwnam_r },
+{ NSDB_PASSWD, "getpwuid_r", __nss_compat_getpwuid_r, _nss_ldap_getpwuid_r },
+{ NSDB_PASSWD, "getpwent_r", __nss_compat_getpwent_r, _nss_ldap_getpwent_r },
+{ NSDB_PASSWD, "endpwent", __nss_compat_setpwent, _nss_ldap_setpwent },
+{ NSDB_PASSWD, "setpwent", __nss_compat_endpwent, _nss_ldap_endpwent },
+
+};
+
+
+ns_mtab *
+nss_module_register(const char *source, unsigned int *mtabsize,
+ nss_module_unregister_fn *unreg)
+{
+ *mtabsize = sizeof(methods)/sizeof(methods[0]);
+ *unreg = NULL;
+ return (methods);
+}
diff --git a/net/nss_ldap/files/patch-Makefile.in b/net/nss_ldap/files/patch-Makefile.in
new file mode 100644
index 000000000000..903d3ff10e31
--- /dev/null
+++ b/net/nss_ldap/files/patch-Makefile.in
@@ -0,0 +1,127 @@
+--- Makefile.in.orig Fri Feb 14 17:19:03 2003
++++ Makefile.in Wed Apr 16 19:38:50 2003
+@@ -99,16 +99,18 @@
+ ldap.conf nss_ldap.spec nsswitch.ldap
+
+
+-nss_ldap_so_SOURCES = ldap-nss.c ldap-pwd.c ldap-grp.c ldap-netgrp.c ldap-rpc.c \
+- ldap-hosts.c ldap-network.c ldap-proto.c ldap-spwd.c \
+- ldap-alias.c ldap-service.c ldap-schema.c ldap-ethers.c \
+- ldap-bp.c util.c globals.c ltf.c snprintf.c resolve.c \
+- dnsconfig.c irs-nss.c sasl.c pagectrl.c
++nss_ldap_so_SOURCES = ldap-nss.c ldap-pwd.c ldap-grp.c \
++ \
++ ldap-schema.c \
++ util.c globals.c ltf.c snprintf.c resolve.c \
++ dnsconfig.c irs-nss.c sasl.c pagectrl.c \
++ bsdnss.c
+
+
+-NSS_LDAP_SOURCES = ldap-nss.c ldap-grp.c ldap-pwd.c ldap-netgrp.c ldap-schema.c \
++NSS_LDAP_SOURCES = ldap-nss.c ldap-pwd.c ldap-grp.c ldap-schema.c \
+ util.c globals.c ltf.c snprintf.c resolve.c dnsconfig.c \
+- irs-nss.c sasl.c pagectrl.c aix_authmeth.c
++ irs-nss.c sasl.c pagectrl.c aix_authmeth.c \
++ bsdnss.c
+
+ DEFS = @DEFS@
+
+@@ -134,23 +136,23 @@
+ PROGRAMS = $(noinst_PROGRAMS)
+
+ am_NSS_LDAP_OBJECTS = ldap-nss.$(OBJEXT) ldap-grp.$(OBJEXT) \
+- ldap-pwd.$(OBJEXT) ldap-netgrp.$(OBJEXT) ldap-schema.$(OBJEXT) \
++ ldap-pwd.$(OBJEXT) ldap-schema.$(OBJEXT) \
+ util.$(OBJEXT) globals.$(OBJEXT) ltf.$(OBJEXT) \
+ snprintf.$(OBJEXT) resolve.$(OBJEXT) dnsconfig.$(OBJEXT) \
+ irs-nss.$(OBJEXT) sasl.$(OBJEXT) pagectrl.$(OBJEXT) \
+- aix_authmeth.$(OBJEXT)
++ aix_authmeth.$(OBJEXT) bsdnss.$(OBJEXT)
+ NSS_LDAP_OBJECTS = $(am_NSS_LDAP_OBJECTS)
+ NSS_LDAP_LDADD = $(LDADD)
+ NSS_LDAP_DEPENDENCIES =
+-am_nss_ldap_so_OBJECTS = ldap-nss.$(OBJEXT) ldap-pwd.$(OBJEXT) \
+- ldap-grp.$(OBJEXT) ldap-netgrp.$(OBJEXT) ldap-rpc.$(OBJEXT) \
+- ldap-hosts.$(OBJEXT) ldap-network.$(OBJEXT) \
+- ldap-proto.$(OBJEXT) ldap-spwd.$(OBJEXT) ldap-alias.$(OBJEXT) \
+- ldap-service.$(OBJEXT) ldap-schema.$(OBJEXT) \
+- ldap-ethers.$(OBJEXT) ldap-bp.$(OBJEXT) util.$(OBJEXT) \
++am_nss_ldap_so_OBJECTS = ldap-nss.$(OBJEXT) \
++ ldap-grp.$(OBJEXT) \
++ ldap-pwd.$(OBJEXT) \
++ \
++ ldap-schema.$(OBJEXT) \
++ util.$(OBJEXT) \
+ globals.$(OBJEXT) ltf.$(OBJEXT) snprintf.$(OBJEXT) \
+ resolve.$(OBJEXT) dnsconfig.$(OBJEXT) irs-nss.$(OBJEXT) \
+- sasl.$(OBJEXT) pagectrl.$(OBJEXT)
++ sasl.$(OBJEXT) pagectrl.$(OBJEXT) bsdnss.$(OBJEXT)
+ nss_ldap_so_OBJECTS = $(am_nss_ldap_so_OBJECTS)
+ nss_ldap_so_LDADD = $(LDADD)
+ nss_ldap_so_DEPENDENCIES =
+@@ -162,15 +164,15 @@
+ am__depfiles_maybe = depfiles
+ @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/aix_authmeth.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/dnsconfig.Po ./$(DEPDIR)/globals.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/irs-nss.Po ./$(DEPDIR)/ldap-alias.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/ldap-bp.Po ./$(DEPDIR)/ldap-ethers.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/ldap-grp.Po ./$(DEPDIR)/ldap-hosts.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/ldap-netgrp.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/ldap-network.Po ./$(DEPDIR)/ldap-nss.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/ldap-proto.Po ./$(DEPDIR)/ldap-pwd.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/ldap-rpc.Po ./$(DEPDIR)/ldap-schema.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/ldap-service.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/ldap-spwd.Po ./$(DEPDIR)/ltf.Po \
++@AMDEP_TRUE@ ./$(DEPDIR)/irs-nss.Po \
++@AMDEP_TRUE@ \
++@AMDEP_TRUE@ ./$(DEPDIR)/ldap-grp.Po \
++@AMDEP_TRUE@ \
++@AMDEP_TRUE@ ./$(DEPDIR)/ldap-nss.Po \
++@AMDEP_TRUE@ \
++@AMDEP_TRUE@ ./$(DEPDIR)/ldap-schema.Po \
++@AMDEP_TRUE@ \
++@AMDEP_TRUE@ ./$(DEPDIR)/ltf.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/pagectrl.Po ./$(DEPDIR)/resolve.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/sasl.Po ./$(DEPDIR)/snprintf.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/util.Po
+@@ -193,19 +195,6 @@
+
+ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
+-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && \
+- $(AUTOMAKE) --gnu Makefile
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
+-
+-$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+- $(SHELL) ./config.status --recheck
+-$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+- cd $(srcdir) && $(AUTOCONF)
+-
+-$(ACLOCAL_M4): configure.in
+- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+ config.h: stamp-h1
+ @if test ! -f $@; then \
+@@ -243,20 +232,9 @@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsconfig.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/irs-nss.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-alias.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-bp.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-ethers.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-grp.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-hosts.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-netgrp.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-network.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-nss.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-proto.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-pwd.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-rpc.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-schema.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-service.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap-spwd.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ltf.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pagectrl.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve.Po@am__quote@
diff --git a/net/nss_ldap/files/patch-configure b/net/nss_ldap/files/patch-configure
new file mode 100644
index 000000000000..4d16951b8531
--- /dev/null
+++ b/net/nss_ldap/files/patch-configure
@@ -0,0 +1,125 @@
+*** configure.orig Sun Apr 6 12:36:16 2003
+--- configure Sun Apr 6 12:39:58 2003
+***************
+*** 3805,3810 ****
+--- 3805,3924 ----
+
+ done
+ ;;
++ freebsd*)
++ for ac_header in nss.h
++ do
++ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++ if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo "$as_me:$LINENO: checking for $ac_header" >&5
++ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++ if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++ fi
++ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++ else
++ # Is the header compilable?
++ echo "$as_me:$LINENO: checking $ac_header usability" >&5
++ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
++ cat >conftest.$ac_ext <<_ACEOF
++ #line $LINENO "configure"
++ #include "confdefs.h"
++ $ac_includes_default
++ #include <$ac_header>
++ _ACEOF
++ rm -f conftest.$ac_objext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++ else
++ echo "$as_me: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ ac_header_compiler=no
++ fi
++ rm -f conftest.$ac_objext conftest.$ac_ext
++ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++ echo "${ECHO_T}$ac_header_compiler" >&6
++
++ # Is the header present?
++ echo "$as_me:$LINENO: checking $ac_header presence" >&5
++ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
++ cat >conftest.$ac_ext <<_ACEOF
++ #line $LINENO "configure"
++ #include "confdefs.h"
++ #include <$ac_header>
++ _ACEOF
++ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ egrep -v '^ *\+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ else
++ ac_cpp_err=
++ fi
++ else
++ ac_cpp_err=yes
++ fi
++ if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++ else
++ echo "$as_me: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ ac_header_preproc=no
++ fi
++ rm -f conftest.err conftest.$ac_ext
++ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++ echo "${ECHO_T}$ac_header_preproc" >&6
++
++ # So? What about this header?
++ case $ac_header_compiler:$ac_header_preproc in
++ yes:no )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
++ no:yes )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++ echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
++ esac
++ echo "$as_me:$LINENO: checking for $ac_header" >&5
++ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++ if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++ else
++ eval "$as_ac_Header=$ac_header_preproc"
++ fi
++ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++
++ fi
++ if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++ #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++ _ACEOF
++
++ fi
++
++ done
++ ;;
+ *)
+ for ac_header in nss.h
+ do