[PATCH] [FreeBSD 1] nss_wins support for FreeBSD
Timur I. Bakeyev
timur at com.bat.ru
Sun Jun 7 11:50:47 GMT 2009
These patches add support for nss_wins for FreeBSD. It may sound surprising,
as it's support was claimed in early 3.0.x series, but the glue code, that
would acually make module suitable for nsdispatch(3).
patch-nsswitch__wins_freebsd.c is the glue code.
patch-source3__configure.in is the patch to configure.in that introduces
WINBIND_WINS_NSS_EXTRA_OBJS variable, similar to WINBIND_NSS_EXTRA_OBJS.
In addition, it moves NSSSONAMEVERSIONSUFFIX related code to the point,
where it actually has at least some meaning(i.e. _after_ the defenition
of this variable).
In addition, there is another build logic cleanup - NSS_MODULES ATM is
defined ONLY if a shared version of LIBWBCLIENT is build. According my
conversations on #samba-technical, it's ok(though, pointless) to link
those modules statically against LIBWBCLIENT. So, making NSS_MODULES
dependant only from HAVE_WINBIND and BLDSHARED=true.
patch-source3__Makefile.in utialises variables, defined by configure.
A bit of rearrangement of the lines is done as well, to put all
Winbind related lines closer to each other.
For WINBIND_WINS_NSS_OBJ target a non-existing NSSWINS_OBJ variable is
dropped. For the final target @WINBIND_WINS_NSS@ a missing dependancy
ZLIB_LIBS is added.
For the pam_smbpass embed version of the library into the PAM module with
added SONAMEFLAG@`basename $@`.
With regards,
Timur Bakeyev.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-nsswitch__wins_freebsd.c
Type: text/x-csrc
Size: 3680 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090607/c61daecd/patch-nsswitch__wins_freebsd.bin
-------------- next part --------------
--- ./source3/Makefile.in.orig 2009-06-02 07:30:53.000000000 +0000
+++ ./source3/Makefile.in 2009-06-07 03:34:56.000000000 +0000
@@ -48,7 +48,6 @@
LDSHFLAGS=@LDSHFLAGS@ @RELRO_LDFLAGS@ @LDFLAGS@
LDFLAGS=@PIE_LDFLAGS@ @RELRO_LDFLAGS@ @LDFLAGS@
-WINBIND_NSS_LDSHFLAGS=@WINBIND_NSS_LDSHFLAGS@ @LDFLAGS@
AWK=@AWK@
PICFLAG=@PICFLAG@
DYNEXP=@DYNEXP@
@@ -69,9 +68,13 @@
NSCD_LIBS=@NSCD_LIBS@
UUID_LIBS=@UUID_LIBS@
LIBWBCLIENT_LIBS=@LIBWBCLIENT_LIBS@
+
+WINBIND_NSS_LDSHFLAGS=@WINBIND_NSS_LDSHFLAGS@ @LDFLAGS@
WINBIND_NSS_EXTRA_LIBS=@WINBIND_NSS_EXTRA_LIBS@
-WINBIND_NSS_PTHREAD=@WINBIND_NSS_PTHREAD@
PAM_WINBIND_EXTRA_LIBS=@PAM_WINBIND_EXTRA_LIBS@
+WINBIND_WINS_NSS_EXTRA_LIBS=@WINBIND_WINS_NSS_EXTRA_LIBS@
+WINBIND_NSS_PTHREAD=@WINBIND_NSS_PTHREAD@
+
DNSSD_LIBS=@DNSSD_LIBS@
AVAHI_LIBS=@AVAHI_LIBS@
POPT_LIBS=@POPTLIBS@
@@ -848,9 +851,6 @@
$(LIBADS_OBJ) $(POPT_LIB_OBJ) \
$(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(LDB_OBJ)
-PAM_WINBIND_OBJ = ../nsswitch/pam_winbind.o localedir.o $(WBCOMMON_OBJ) \
- $(LIBREPLACE_OBJ) @BUILD_INIPARSER@
-
LIBSMBCLIENT_OBJ0 = \
libsmb/libsmb_cache.o \
libsmb/libsmb_compat.o \
@@ -1044,12 +1044,9 @@
$(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \
$(LIBNDR_GEN_OBJ0)
-WINBIND_WINS_NSS_OBJ = ../nsswitch/wins.o $(PARAM_OBJ) \
- $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ) \
- $(LIBNDR_GEN_OBJ0) $(LDB_OBJ)
-
PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
pam_smbpass/pam_smb_acct.o pam_smbpass/support.o
+
PAM_SMBPASS_OBJ = $(PAM_SMBPASS_OBJ_0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
$(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
$(LDB_OBJ)
@@ -1114,6 +1111,14 @@
WINBIND_NSS_OBJ = $(WBCOMMON_OBJ) $(LIBREPLACE_OBJ) @WINBIND_NSS_EXTRA_OBJS@
+WINBIND_WINS_NSS_OBJ = ../nsswitch/wins.o @WINBIND_WINS_NSS_EXTRA_OBJS@ \
+ $(PARAM_OBJ) $(LIBSMB_OBJ) $(LDB_OBJ) $(KRBCLIENT_OBJ) \
+ $(LIB_NONSMBD_OBJ) \
+ $(LIBNDR_GEN_OBJ0)
+
+PAM_WINBIND_OBJ = ../nsswitch/pam_winbind.o localedir.o $(WBCOMMON_OBJ) \
+ $(LIBREPLACE_OBJ) @BUILD_INIPARSER@
+
LDB_COMMON_OBJ=lib/ldb/common/ldb.o lib/ldb/common/ldb_ldif.o \
lib/ldb/common/ldb_parse.o lib/ldb/common/ldb_msg.o lib/ldb/common/ldb_utf8.o \
lib/ldb/common/ldb_debug.o lib/ldb/common/ldb_modules.o \
@@ -2385,7 +2390,8 @@
@WINBIND_WINS_NSS@: $(BINARY_PREREQS) $(WINBIND_WINS_NSS_OBJ) @LIBTALLOC_TARGET@ @LIBTDB_TARGET@
@echo "Linking $@"
@$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_OBJ) \
- $(LDAP_LIBS) $(KRB5LIBS) $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
+ $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
+ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(ZLIB_LIBS) \
@SONAMEFLAG@`basename $@`@NSSSONAMEVERSIONSUFFIX@
bin/winbind_krb5_locator. at SHLIBEXT@: $(BINARY_PREREQS) $(WINBIND_KRB5_LOCATOR_OBJ) @LIBWBCLIENT_TARGET@
@@ -2705,7 +2711,8 @@
@echo "Linking shared library $@"
@$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) -lpam $(DYNEXP) \
$(LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
- $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS)
+ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) \
+ @SONAMEFLAG@`basename $@`
bin/tdbbackup at EXEEXT@: $(BINARY_PREREQS) $(TDBBACKUP_OBJ) @LIBTALLOC_TARGET@ @LIBTDB_TARGET@
@echo Linking $@
-------------- next part --------------
--- ./source3/configure.in.orig 2009-06-02 07:30:53.000000000 +0000
+++ ./source3/configure.in 2009-06-07 03:11:35.000000000 +0000
@@ -1774,9 +1774,6 @@
AC_MSG_CHECKING([PICFLAG])
AC_MSG_RESULT([$PICFLAG])
-AC_MSG_CHECKING([NSSSONAMEVERSIONSUFFIX])
-AC_MSG_RESULT([$NSSSONAMEVERSIONSUFFIX])
-
AC_CACHE_CHECK([whether building shared libraries actually works],
[ac_cv_shlib_works],[
# try building a trivial shared library
@@ -5781,6 +5778,7 @@
NSSSONAMEVERSIONSUFFIX=".1"
WINBIND_NSS_EXTRA_OBJS="../nsswitch/winbind_nss_freebsd.o \
../nsswitch/winbind_nss_linux.o"
+ WINBIND_WINS_NSS_EXTRA_OBJS="../nsswitch/wins_freebsd.o"
WINBIND_NSS="../nsswitch/nss_winbind.$SHLIBEXT"
WINBIND_WINS_NSS="../nsswitch/nss_wins.$SHLIBEXT"
;;
@@ -5883,7 +5881,6 @@
LIBWBCLIENT_STATIC_TARGET=bin/libwbclient.a
LIBWBCLIENT_SOVER=0
if test $BLDSHARED = true -a x"$HAVE_WINBIND" = x"yes" -a x"$BUILD_LIBWBCLIENT_SHARED" = x"yes"; then
- NSS_MODULES="${WINBIND_NSS} ${WINBIND_WINS_NSS}"
## Only worry about libwbclient if we have shared
# library support
LIBWBCLIENT_SHARED=$LIBWBCLIENT_SHARED_TARGET
@@ -5905,10 +5902,13 @@
EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)"
EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd\$(EXEEXT)"
- if test $BLDSHARED = true -a x"$create_pam_modules" = x"yes"; then
+ if test $BLDSHARED = true; then
+ NSS_MODULES="${WINBIND_NSS} ${WINBIND_WINS_NSS}"
+ if test x"$create_pam_modules" = x"yes"; then
PAM_MODULES="$PAM_MODULES pam_winbind"
INSTALL_PAM_MODULES="installpammodules"
UNINSTALL_PAM_MODULES="uninstallpammodules"
+ fi
fi
else
AC_MSG_RESULT(no$winbind_no_reason)
@@ -5917,14 +5917,19 @@
AC_CHECK_LIB(pthread, pthread_mutex_lock, [WINBIND_NSS_PTHREAD="-lpthread"
AC_DEFINE(HAVE_PTHREAD, 1, [whether pthread exists])])
+AC_MSG_CHECKING([NSSSONAMEVERSIONSUFFIX])
+AC_MSG_RESULT([$NSSSONAMEVERSIONSUFFIX])
+
AC_SUBST(WINBIND_NSS_PTHREAD)
AC_SUBST(WINBIND_NSS)
-AC_SUBST(WINBIND_WINS_NSS)
AC_SUBST(WINBIND_NSS_LDSHFLAGS)
AC_SUBST(WINBIND_NSS_EXTRA_OBJS)
AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
-AC_SUBST(NSSSONAMEVERSIONSUFFIX)
AC_SUBST(PAM_WINBIND_EXTRA_LIBS)
+AC_SUBST(WINBIND_WINS_NSS)
+AC_SUBST(WINBIND_WINS_NSS_EXTRA_OBJS)
+AC_SUBST(WINBIND_WINS_NSS_EXTRA_LIBS)
+AC_SUBST(NSSSONAMEVERSIONSUFFIX)
AC_SUBST(WINBIND_KRB5_LOCATOR)
More information about the samba-technical
mailing list