diff options
author | Jacques Vidrine <nectar@FreeBSD.org> | 2003-04-17 14:20:20 +0000 |
---|---|---|
committer | Jacques Vidrine <nectar@FreeBSD.org> | 2003-04-17 14:20:20 +0000 |
commit | d0d629934500f0731ae63fe2300d0eeb5ac9967a (patch) | |
tree | b61693b100fa0721a68ba532ae2f939d0c53f2d8 /net/samba | |
parent | Remove files/patch-t-freebsd. The underlying problem has been fixed in (diff) |
Add WITH_WINBIND_NSS knob, which will cause nss_winbind to be installed.
Currently only the getpwent(3) and getgrent(3) family of functions are
supported.
Notes
Notes:
svn path=/head/; revision=79140
Diffstat (limited to 'net/samba')
-rw-r--r-- | net/samba/Makefile | 17 | ||||
-rw-r--r-- | net/samba/files/patch-configure.in | 43 | ||||
-rw-r--r-- | net/samba/files/winbind_nss_bsd.c | 59 | ||||
-rw-r--r-- | net/samba/pkg-plist | 1 |
4 files changed, 107 insertions, 13 deletions
diff --git a/net/samba/Makefile b/net/samba/Makefile index 41f718ff439b..8cc0cb009034 100644 --- a/net/samba/Makefile +++ b/net/samba/Makefile @@ -36,6 +36,7 @@ RECYCLE?= "@comment " LIBSAMBA?= "@comment " BUILD_VFS?= "@comment " WINBIND?= "@comment " +WINBIND_NSS?= "@comment " WINBIND_AUTH_CHALLENGE?= "@comment " .if defined(WITH_AUDIT) @@ -50,7 +51,6 @@ LIBSAMBA= "" BUILD_VFS= "" .endif - VARDIR= /var SAMBA_SPOOL= ${VARDIR}/spool/samba SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ @@ -116,6 +116,14 @@ CONFIGURE_ARGS+= --with-winbind WINBIND= "" .endif +.if defined(WITH_WINBIND_NSS) +.if ${OSVERSION} < 500112 +BROKEN= NSS modules only supported on FreeBSD 5.1 or later +.else +WINBIND_NSS= "" +.endif +.endif + .if defined(WITH_WINBIND_AUTH_CHALLENGE) CONFIGURE_ARGS+= --with-winbind-auth-challenge WINBIND_AUTH_CHALLENGE= "" @@ -125,8 +133,9 @@ pre-fetch: @${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.samba post-patch: - ${FIND} ${PATCH_WRKSRC} -type f -name '*.orig' -exec ${RM} {} \; + #${FIND} ${PATCH_WRKSRC} -type f -name '*.orig' -exec ${RM} {} \; ${FIND} ${PATCH_WRKSRC} -type f -empty -exec ${RM} {} \; + ${CP} ${FILESDIR}/winbind_nss_bsd.c ${WRKSRC}/nsswitch/ post-clean: @${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc @@ -172,6 +181,7 @@ PLIST_SUB= AUDIT=${AUDIT} \ LIBSAMBA=${LIBSAMBA} \ BUILD_VFS=${BUILD_VFS} \ WINBIND=${WINBIND} \ + WINBIND_NSS=${WINBIND_NSS} \ WINBIND_AUTH_CHALLENGE=${WINBIND_AUTH_CHALLENGE} .if defined(WITH_RECYCLE) || defined(WITH_AUDIT) @@ -186,6 +196,9 @@ pre-build: (cd ${WRKSRC} && make proto) post-install: +.if defined(WITH_WINBIND_NSS) + ${INSTALL_PROGRAM} ${WRKSRC}/nsswitch/libnss_winbind.so ${PREFIX}/lib/nss_winbind.so.1 +.endif .if defined(WITH_AUDIT) || defined(WITH_RECYCLE) @test -d ${SAMBA_VFSDIR} || ${MKDIR} ${SAMBA_VFSDIR} .if defined(WITH_AUDIT) diff --git a/net/samba/files/patch-configure.in b/net/samba/files/patch-configure.in index bb53a81990a1..02f346dac92c 100644 --- a/net/samba/files/patch-configure.in +++ b/net/samba/files/patch-configure.in @@ -1,11 +1,32 @@ ---- source/configure.in.orig Thu Nov 7 17:52:42 2002 -+++ source/configure.in Thu Nov 7 17:53:09 2002 -@@ -168,7 +168,7 @@ - AC_SUBST(LIBSMBCLIENT) - - # compile with optimization and without debugging by default --CFLAGS="-O ${CFLAGS}" -+CFLAGS="${CFLAGS}" - - AC_ARG_ENABLE(debug, - [ --enable-debug Turn on compiler debugging information (default=no)], +*** source/configure.in.orig Wed Apr 16 20:59:48 2003 +--- source/configure.in Wed Apr 16 21:00:36 2003 +*************** +*** 170,176 **** + AC_SUBST(LIBSMBCLIENT) + + # compile with optimization and without debugging by default +! CFLAGS="-O ${CFLAGS}" + + AC_ARG_ENABLE(debug, + [ --enable-debug Turn on compiler debugging information (default=no)], +--- 170,176 ---- + AC_SUBST(LIBSMBCLIENT) + + # compile with optimization and without debugging by default +! CFLAGS="${CFLAGS}" + + AC_ARG_ENABLE(debug, + [ --enable-debug Turn on compiler debugging information (default=no)], +*************** +*** 2954,2959 **** +--- 2954,2963 ---- + *linux*|*irix*) + HAVE_WINBIND=yes + ;; ++ *freebsd5*) ++ HAVE_WINBIND=yes ++ WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_bsd.o" ++ ;; + *solaris*) + HAVE_WINBIND=yes + WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o" diff --git a/net/samba/files/winbind_nss_bsd.c b/net/samba/files/winbind_nss_bsd.c new file mode 100644 index 000000000000..bc830a8f5ce2 --- /dev/null +++ b/net/samba/files/winbind_nss_bsd.c @@ -0,0 +1,59 @@ +#include <sys/param.h> +#include <pwd.h> +#include <grp.h> +#include <nss.h> + +extern enum nss_status _nss_winbind_getgrent_r(struct group *, char *, size_t, + int *); +extern enum nss_status _nss_winbind_getgrnam_r(const char *, struct group *, + char *, size_t, int *); +extern enum nss_status _nss_winbind_getgrgid_r(gid_t gid, struct group *, char *, + size_t, int *); +extern enum nss_status _nss_winbind_setgrent(void); +extern enum nss_status _nss_winbind_endgrent(void); + +extern enum nss_status _nss_winbind_getpwent_r(struct passwd *, char *, size_t, + int *); +extern enum nss_status _nss_winbind_getpwnam_r(const char *, struct passwd *, + char *, size_t, int *); +extern enum nss_status _nss_winbind_getpwuid_r(gid_t gid, struct passwd *, char *, + size_t, int *); +extern enum nss_status _nss_winbind_setpwent(void); +extern enum nss_status _nss_winbind_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_winbind_getgrnam_r }, +{ NSDB_GROUP, "getgrgid_r", __nss_compat_getgrgid_r, _nss_winbind_getgrgid_r }, +{ NSDB_GROUP, "getgrent_r", __nss_compat_getgrent_r, _nss_winbind_getgrent_r }, +{ NSDB_GROUP, "endgrent", __nss_compat_setgrent, _nss_winbind_setgrent }, +{ NSDB_GROUP, "setgrent", __nss_compat_endgrent, _nss_winbind_endgrent }, + +{ NSDB_PASSWD, "getpwnam_r", __nss_compat_getpwnam_r, _nss_winbind_getpwnam_r }, +{ NSDB_PASSWD, "getpwuid_r", __nss_compat_getpwuid_r, _nss_winbind_getpwuid_r }, +{ NSDB_PASSWD, "getpwent_r", __nss_compat_getpwent_r, _nss_winbind_getpwent_r }, +{ NSDB_PASSWD, "endpwent", __nss_compat_setpwent, _nss_winbind_setpwent }, +{ NSDB_PASSWD, "setpwent", __nss_compat_endpwent, _nss_winbind_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/samba/pkg-plist b/net/samba/pkg-plist index 94724fae8a3d..cb70cd93d47c 100644 --- a/net/samba/pkg-plist +++ b/net/samba/pkg-plist @@ -16,6 +16,7 @@ bin/tdbbackup bin/testparm bin/testprns %%WINBIND_AUTH_CHALLENGE%%bin/wbinfo +%%WINBIND_NSS%%lib/nss_winbind.so.1 %%WINBIND%%sbin/winbindd etc/codepages/codepage.1125 etc/codepages/unicode_map.1125 |