[PATCH] Change how samba (3_0) builds libsmbclient
The following patch changes the build process for samba (3_0) to build libsmbclient.so if and only if the operating system supports shared libraries. Today the build process tries to build libsmbclient.so even when the configure script has already determined that shared libraries aren't supported. In the case where libsmbclient.so is requested, either explicitly or implicitly and cannot be built, the script substitutes libsmbclient.a. As before, if libsmbclient is suppressed (--without-libsmbclient), then neither file is built. I have tested this patch on Stratus VOS (which does not support shared libraries) and on Solaris 2.8 (which does support them). Samba (3_0) configures and builds as expected on each system. I looked in vain for any mention of libsmbclient in the documentation files, so I'm not proposing any documentation changes. ### START OF PATCH (samba 3_0) ### diff -urp old/samba_3_0/source/Makefile.in new/samba_3_0/source/Makefile.in --- old/samba_3_0/source/Makefile.inSat Jan 25 21:48:25 2003 +++ new/samba_3_0/source/Makefile.inSun Jan 26 18:14:08 2003 @@ -29,6 +29,8 @@ AUTHLIBS=@AUTHLIBS@ LINK=$(CC) $(FLAGS) $(LDFLAGS) INSTALLCMD=@INSTALL@ +INSTALLCLIENTCMD_SH=@INSTALLCLIENTCMD_SH@ +INSTALLCLIENTCMD_A=@INSTALLCLIENTCMD_A@ VPATH=@srcdir@ srcdir=@srcdir@ @@ -812,7 +814,7 @@ bin/libbigballofmud.@SHLIBEXT@: $(LIBBIG $(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_PICOBJS) $(LIBS) \ @SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR) -libsmbclient: bin/libsmbclient.a bin/libsmbclient.@SHLIBEXT@ +libsmbclient: bin/libsmbclient.a @LIBSMBCLIENT_SHARED@ nsswitch/libnss_wins.@SHLIBEXT@: $(NSS_OBJ) @echo Linking $@ @@ -916,7 +918,8 @@ installswat: installdirs @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir) installclientlib: - -$(INSTALLCMD) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib + -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib + -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib -$(INSTALLCMD) -d $(DESTDIR)${prefix}/include -$(INSTALLCMD) include/libsmbclient.h $(DESTDIR)${prefix}/include diff -urp old/samba_3_0/source/configure.in new/samba_3_0/source/configure.in --- old/samba_3_0/source/configure.in Sat Jan 25 09:36:00 2003 +++ new/samba_3_0/source/configure.in Sun Jan 26 18:16:24 2003 @@ -140,6 +140,8 @@ AC_SUBST(PICFLAG) AC_SUBST(PICSUFFIX) AC_SUBST(POBAD_CC) AC_SUBST(SHLIBEXT) +AC_SUBST(INSTALLCLIENTCMD_SH) +AC_SUBST(INSTALLCLIENTCMD_A) AC_SUBST(LIBSMBCLIENT_SHARED) AC_SUBST(LIBSMBCLIENT) AC_SUBST(PRINTLIBS) @@ -1026,14 +1028,6 @@ if test $ac_cv_shlib_works = no; then fi fi - -# this updates our target list if we can build shared libs -if test $BLDSHARED = true; then - LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT -else - LIBSMBCLIENT_SHARED= -fi - AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[ @@ -2460,26 +2454,42 @@ AC_ARG_WITH(manpages-langs, # # should we build libsmbclient? +INSTALLCLIENTCMD_SH=: +INSTALLCLIENTCMD_A=: LIBSMBCLIENT_SHARED= LIBSMBCLIENT= AC_MSG_CHECKING(whether to build the libsmbclient shared library) AC_ARG_WITH(libsmbclient, -[ --with-libsmbclient Build the libsmbclient shared library (default=yes)], +[ --with-libsmbclient Build the libsmbclient shared library (default=yes if +shared libs supported)], [ case $withval in no) AC_MSG_RESULT(no) ;; *) if test $BLDSHARED = true; then +INSTALLCLIENTCMD_SH=\$(INSTALLCMD) LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT LIBSMBCLIENT=libsmbclient AC_MSG_RESULT(yes) else -AC_MSG_RESULT(no shared library support) +INSTALLCLIENTCMD_A=\$(INSTALLCMD) +LIBSMBCLIENT=libsmbclient +AC_MSG_RESULT(no shared library support -- will supply static library) fi ;; esac ], - AC_MSG_RESULT(yes) +[ +# if unspecified, default is to built it iff possible. + if test $BLDSHARED = true; then + INSTALLCLIENTCMD_SH=\$(INSTALLCMD) + LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT + LIBSMBCLIENT=libsmbclient + AC_MSG_RESULT(yes) + else + INSTALLCLIENTCMD_A=\$(INSTALLCMD) + LIBSMBCLIENT=libsmbclient + AC_MSG_RESULT(no shared library support -- will supply static library) + fi] ) ### END OF PATCH (samba 3_0) ### Thanks PG -- Paul Green | Mail: [EMAIL PROTECTED] Senior Technical Consultant | Voice: +1 978-461-7557 Stratus Technologies| FAX: +1 978-461-3610 Maynard, MA 01754 | Disclaimer: I speak for myself, not Stratus.
[PATCH] Change how samba (head) builds libsmbclient
The following patch changes the build process for samba (head) to build libsmbclient.so if and only if the operating system supports shared libraries. Today the build process tries to build libsmbclient.so even when the configure script has already determined that shared libraries aren't supported. In the case where libsmbclient.so is requested, either explicitly or implicitly and cannot be built, the script substitutes libsmbclient.a. As before, if libsmbclient is suppressed (--without-libsmbclient), then neither file is built. I have tested this patch on Stratus VOS (which does not support shared libraries) and on Solaris 2.8 (which does support them). Samba (head) configures and builds as expected on each system. I looked in vain for any mention of libsmbclient in the documentation files, so I'm not proposing any documentation changes. I have recently been given an account on cvs.samba.org to help out with rsync maintenance. I would be happy to apply this patch and monitor its health on the build farm if (a) someone experienced approves the patch and (b) someone with the proper access grants me access to the samba cvs tree. Further, I promise not to apply any unaudited patches. As with rsync, my primary interest and focus is on build problems, not on main-line development. Patch for samba_3_0 branch to follow. ### START OF PATCH (samba head) ### diff -urp old/samba/source/Makefile.in new/samba/source/Makefile.in --- old/samba/source/Makefile.inThu Jan 23 08:28:15 2003 +++ new/samba/source/Makefile.inSun Jan 26 18:09:42 2003 @@ -30,6 +30,8 @@ AUTHLIBS=@AUTHLIBS@ LINK=$(CC) $(FLAGS) $(LDFLAGS) INSTALLCMD=@INSTALL@ +INSTALLCLIENTCMD_SH=@INSTALLCLIENTCMD_SH@ +INSTALLCLIENTCMD_A=@INSTALLCLIENTCMD_A@ VPATH=@srcdir@ srcdir=@srcdir@ @@ -892,7 +894,7 @@ bin/libbigballofmud.@SHLIBEXT@: $(LIBBIG $(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_PICOBJS) $(LIBS) \ @SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR) -libsmbclient: bin/libsmbclient.a bin/libsmbclient.@SHLIBEXT@ +libsmbclient: bin/libsmbclient.a @LIBSMBCLIENT_SHARED@ bin/librpc_lsarpc.@SHLIBEXT@: $(RPC_LSA_OBJ) @echo Linking $@ @@ -1051,7 +1053,8 @@ installswat: installdirs @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir) installclientlib: - -$(INSTALLCMD) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib + -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib + -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib -$(INSTALLCMD) -d $(DESTDIR)${prefix}/include -$(INSTALLCMD) include/libsmbclient.h $(DESTDIR)${prefix}/include diff -urp old/samba/source/configure.in new/samba/source/configure.in --- old/samba/source/configure.in Sat Jan 25 21:45:46 2003 +++ new/samba/source/configure.in Sun Jan 26 18:07:32 2003 @@ -140,6 +140,8 @@ AC_SUBST(PICFLAG) AC_SUBST(PICSUFFIX) AC_SUBST(POBAD_CC) AC_SUBST(SHLIBEXT) +AC_SUBST(INSTALLCLIENTCMD_SH) +AC_SUBST(INSTALLCLIENTCMD_A) AC_SUBST(LIBSMBCLIENT_SHARED) AC_SUBST(LIBSMBCLIENT) AC_SUBST(PRINTLIBS) @@ -1080,13 +1082,6 @@ if test $ac_cv_shlib_works = no; then fi fi -# this updates our target list if we can build shared libs -if test $BLDSHARED = true; then - LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT -else - LIBSMBCLIENT_SHARED= -fi - AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[ @@ -2523,26 +2518,42 @@ AC_ARG_WITH(manpages-langs, # # should we build libsmbclient? +INSTALLCLIENTCMD_SH=: +INSTALLCLIENTCMD_A=: LIBSMBCLIENT_SHARED= LIBSMBCLIENT= AC_MSG_CHECKING(whether to build the libsmbclient shared library) AC_ARG_WITH(libsmbclient, -[ --with-libsmbclient Build the libsmbclient shared library (default=yes)], +[ --with-libsmbclient Build the libsmbclient shared library (default=yes if +shared libs supported)], [ case $withval in no) AC_MSG_RESULT(no) ;; *) if test $BLDSHARED = true; then +INSTALLCLIENTCMD_SH=\$(INSTALLCMD) LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT LIBSMBCLIENT=libsmbclient AC_MSG_RESULT(yes) else -AC_MSG_RESULT(no shared library support) +INSTALLCLIENTCMD_A=\$(INSTALLCMD) +LIBSMBCLIENT=libsmbclient +AC_MSG_RESULT(no shared library support -- will supply static library) fi ;; esac ], - AC_MSG_RESULT(yes) +[ +# if unspecified, default is to built it iff possible. + if test $BLDSHARED = true; then + INSTALLCLIENTCMD_SH=\$(INSTALLCMD) + LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT + LIBSMBCLIENT=libsmbclient + AC_MSG_RESULT(yes) + else + INSTALLCLIENTCMD_A=\$(INSTALLCMD) + LIBSMBCLIENT=libsmbclient + AC_MSG_RESULT(no shared library support -- will supply static library) + fi] ) ### END OF PATCH (samba head) ### Thanks PG -- Paul Green
[PATCH] Fix Samba HEAD to observe executable extensions
The following patch changes the HEAD version of Samba to discover and use a required executable extension, if required by the host OS. It also changes torture/torture.c to use shm_open() if shmget() is unavailable. And it changes the only reference to bcmp in Samba to a nice standard memcmp. (I also have a patch for Samba 3.0; see separate letter). I created it because Stratus VOS has a required executable extension, and because we have POSIX not System V shared memory. I have tested this patch here on VOS. I used the version of head that existed this morning (changing and testing these files is a little like jumping on and off a moving train; they change frequently...). I tested the 3.0 version of the patch on SunOS 5.8, and these are basically the same changes, so I'm hoping I won't break head too badly... ;-). I've tested it using autoconf 2.13. The generated configure script should work properly on Unix-type systems regardless of which version of autoconf is used. I still have a problem in that the Makefile tries to build libsmbclient.so even on systems that don't support shared objects, but I'll send that change in separately, when I have it ready. ### START OF PATCH ### diff -urp old/samba/source/Makefile.in new/samba/source/Makefile.in --- old/samba/source/Makefile.inFri Nov 29 21:35:28 2002 +++ new/samba/source/Makefile.inFri Nov 29 21:35:55 2002 @@ -14,6 +14,7 @@ CC=@CC@ SHLD=@SHLD@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ +EXEEXT=@EXEEXT@ LDFLAGS=@LDFLAGS@ LDSHFLAGS=@LDSHFLAGS@ @LDFLAGS@ @CFLAGS@ AWK=@AWK@ @@ -100,14 +101,21 @@ PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\ PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\$(CONFIGFIR)\ PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS) -SBIN_PROGS = bin/smbd bin/nmbd bin/swat bin/wrepld @EXTRA_SBIN_PROGS@ +# Note that all executable programs now provide for an optional executable suffix. -BIN_PROGS1 = bin/smbclient bin/net bin/smbspool bin/testparm bin/testprns bin/smbstatus -BIN_PROGS2 = bin/smbcontrol bin/smbtree bin/tdbbackup bin/nmblookup bin/pdbedit -BIN_PROGS3 = bin/smbpasswd bin/rpcclient bin/smbcacls bin/profiles bin/smbgroupedit bin/ntlm_auth +SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ bin/swat@EXEEXT@ \ + bin/wrepld@EXEEXT@ @EXTRA_SBIN_PROGS@ -TORTURE_PROGS = bin/smbtorture bin/msgtest bin/masktest bin/locktest \ - bin/locktest2 bin/nsstest bin/vfstest +BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \ + bin/testparm@EXEEXT@ bin/testprns@EXEEXT@ bin/smbstatus@EXEEXT@ +BIN_PROGS2 = bin/smbcontrol@EXEEXT@ bin/smbtree@EXEEXT@ bin/tdbbackup@EXEEXT@ \ + bin/nmblookup@EXEEXT@ bin/pdbedit@EXEEXT@ +BIN_PROGS3 = bin/smbpasswd@EXEEXT@ bin/rpcclient@EXEEXT@ bin/smbcacls@EXEEXT@ \ + bin/profiles@EXEEXT@ bin/smbgroupedit@EXEEXT@ bin/ntlm_auth@EXEEXT@ + +TORTURE_PROGS = bin/smbtorture@EXEEXT@ bin/msgtest@EXEEXT@ \ + bin/masktest@EXEEXT@ bin/locktest@EXEEXT@ \ + bin/locktest2@EXEEXT@ bin/nsstest@EXEEXT@ bin/vfstest@EXEEXT@ BIN_PROGS = $(BIN_PROGS1) $(BIN_PROGS2) $(BIN_PROGS3) @EXTRA_BIN_PROGS@ @@ -556,27 +564,27 @@ smbwrapper : SHOWFLAGS @SMBWRAPPER@ torture : SHOWFLAGS $(TORTURE_PROGS) -smbtorture : SHOWFLAGS bin/smbtorture +smbtorture : SHOWFLAGS bin/smbtorture@EXEEXT@ -masktest : SHOWFLAGS bin/masktest +masktest : SHOWFLAGS bin/masktest@EXEEXT@ -msgtest : SHOWFLAGS bin/msgtest +msgtest : SHOWFLAGS bin/msgtest@EXEEXT@ -locktest : SHOWFLAGS bin/locktest +locktest : SHOWFLAGS bin/locktest@EXEEXT@ -smbcacls : SHOWFLAGS bin/smbcacls +smbcacls : SHOWFLAGS bin/smbcacls@EXEEXT@ -locktest2 : SHOWFLAGS bin/locktest2 +locktest2 : SHOWFLAGS bin/locktest2@EXEEXT@ -rpctorture : SHOWFLAGS bin/rpctorture +rpctorture : SHOWFLAGS bin/rpctorture@EXEEXT@ -debug2html : SHOWFLAGS bin/debug2html +debug2html : SHOWFLAGS bin/debug2html@EXEEXT@ -smbfilter : SHOWFLAGS bin/smbfilter +smbfilter : SHOWFLAGS bin/smbfilter@EXEEXT@ -talloctort : SHOWFLAGS bin/talloctort +talloctort : SHOWFLAGS bin/talloctort@EXEEXT@ -nsswitch : SHOWFLAGS bin/winbindd bin/wbinfo nsswitch/libnss_winbind.so nsswitch/pam_winbind.so +nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ +nsswitch/libnss_winbind.so nsswitch/pam_winbind.so wins : SHOWFLAGS nsswitch/libnss_wins.@SHLIBEXT@ @@ -651,149 +659,149 @@ bin/.dummy: dir=bin $(MAKEDIR); fi @: $@ || : $@ # what a fancy emoticon! -bin/smbd: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy +bin/smbd@EXEEXT@: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINTLIBS) \ $(AUTHLIBS) $(LIBS) @BUILD_POPT@ -bin/nmbd: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy +bin/nmbd@EXEEXT@: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(LIBS) @BUILD_POPT@ -bin/wrepld: $(WREPL_OBJ) bin/.dummy +bin/wrepld@EXEEXT@: $(WREPL_OBJ) bin/.dummy @echo Linking $@ @$(CC)
[PATCH] Fix 3.0 to observe executable extensions
The following patch changes the 3.0 version of Samba to discover and use a required executable extension, if required by the host OS. It also changes torture/torture.c to use shm_open() if shmget() is unavailable. This is basically the same change that I just submitted to head. I tested it on Stratus VOS and SunOS 5.8 using autoconf 2.13, and samba-3.0alpha21. It picked up the VOS suffix and did not pick any suffix for Solaris. The patch is up-to-date with the 3.0 branch as of today. ### START OF PATCH ### diff -urp old/samba_3_0/source/Makefile.in new/samba_3_0/source/Makefile.in --- old/samba_3_0/source/Makefile.inFri Nov 29 22:11:17 2002 +++ new/samba_3_0/source/Makefile.inFri Nov 29 22:11:52 2002 @@ -14,6 +14,7 @@ CC=@CC@ SHLD=@SHLD@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ +EXEEXT=@EXEEXT@ LDFLAGS=@LDFLAGS@ LDSHFLAGS=@LDSHFLAGS@ @LDFLAGS@ @CFLAGS@ AWK=@AWK@ @@ -100,14 +101,21 @@ PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\ PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\$(CONFIGFIR)\ PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS) -SBIN_PROGS = bin/smbd bin/nmbd bin/swat bin/wrepld @EXTRA_SBIN_PROGS@ +# Note that all executable programs now provide for an optional executable suffix. -BIN_PROGS1 = bin/smbclient bin/net bin/smbspool bin/testparm bin/testprns bin/smbstatus -BIN_PROGS2 = bin/smbcontrol bin/smbtree bin/tdbbackup bin/nmblookup bin/pdbedit -BIN_PROGS3 = bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbgroupedit +SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ bin/swat@EXEEXT@ \ + bin/wrepld@EXEEXT@ @EXTRA_SBIN_PROGS@ -TORTURE_PROGS = bin/smbtorture bin/msgtest bin/masktest bin/locktest \ - bin/locktest2 bin/nsstest bin/vfstest +BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \ + bin/testparm@EXEEXT@ bin/testprns@EXEEXT@ bin/smbstatus@EXEEXT@ +BIN_PROGS2 = bin/smbcontrol@EXEEXT@ bin/smbtree@EXEEXT@ bin/tdbbackup@EXEEXT@ \ + bin/nmblookup@EXEEXT@ bin/pdbedit@EXEEXT@ +BIN_PROGS3 = bin/smbpasswd@EXEEXT@ bin/rpcclient@EXEEXT@ bin/smbcacls@EXEEXT@ \ + bin/smbgroupedit@EXEEXT@ + +TORTURE_PROGS = bin/smbtorture@EXEEXT@ bin/msgtest@EXEEXT@ \ + bin/masktest@EXEEXT@ bin/locktest@EXEEXT@ \ + bin/locktest2@EXEEXT@ bin/nsstest@EXEEXT@ bin/vfstest@EXEEXT@ BIN_PROGS = $(BIN_PROGS1) $(BIN_PROGS2) $(BIN_PROGS3) @EXTRA_BIN_PROGS@ @@ -544,27 +552,27 @@ smbwrapper : SHOWFLAGS @SMBWRAPPER@ torture : SHOWFLAGS $(TORTURE_PROGS) -smbtorture : SHOWFLAGS bin/smbtorture +smbtorture : SHOWFLAGS bin/smbtorture@EXEEXT@ -masktest : SHOWFLAGS bin/masktest +masktest : SHOWFLAGS bin/masktest@EXEEXT@ -msgtest : SHOWFLAGS bin/msgtest +msgtest : SHOWFLAGS bin/msgtest@EXEEXT@ -locktest : SHOWFLAGS bin/locktest +locktest : SHOWFLAGS bin/locktest@EXEEXT@ -smbcacls : SHOWFLAGS bin/smbcacls +smbcacls : SHOWFLAGS bin/smbcacls@EXEEXT@ -locktest2 : SHOWFLAGS bin/locktest2 +locktest2 : SHOWFLAGS bin/locktest2@EXEEXT@ -rpctorture : SHOWFLAGS bin/rpctorture +rpctorture : SHOWFLAGS bin/rpctorture@EXEEXT@ -debug2html : SHOWFLAGS bin/debug2html +debug2html : SHOWFLAGS bin/debug2html@EXEEXT@ -smbfilter : SHOWFLAGS bin/smbfilter +smbfilter : SHOWFLAGS bin/smbfilter@EXEEXT@ -talloctort : SHOWFLAGS bin/talloctort +talloctort : SHOWFLAGS bin/talloctort@EXEEXT@ -nsswitch : SHOWFLAGS bin/winbindd bin/wbinfo nsswitch/libnss_winbind.so nsswitch/pam_winbind.so +nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ +nsswitch/libnss_winbind.so nsswitch/pam_winbind.so wins : SHOWFLAGS nsswitch/libnss_wins.@SHLIBEXT@ @@ -639,141 +647,141 @@ bin/.dummy: dir=bin $(MAKEDIR); fi @: $@ || : $@ # what a fancy emoticon! -bin/smbd: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy +bin/smbd@EXEEXT@: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINTLIBS) \ $(AUTHLIBS) $(LIBS) @BUILD_POPT@ -bin/nmbd: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy +bin/nmbd@EXEEXT@: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(LIBS) @BUILD_POPT@ -bin/wrepld: $(WREPL_OBJ) bin/.dummy +bin/wrepld@EXEEXT@: $(WREPL_OBJ) bin/.dummy @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(WREPL_OBJ) $(LDFLAGS) $(LIBS) -bin/swat: $(SWAT_OBJ) bin/.dummy +bin/swat@EXEEXT@: $(SWAT_OBJ) bin/.dummy @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINTLIBS) \ $(AUTHLIBS) $(LIBS) -bin/rpcclient: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy +bin/rpcclient@EXEEXT@: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(RPCCLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @BUILD_POPT@ -bin/smbclient: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy +bin/smbclient@EXEEXT@: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS)
[PATCH] samba-3.0-alpha19 for Stratus VOS
This patch corresponds to the patch I sent to samba-technical yesterday for samba-2.2.6pre2. It deals with the fact that the VOS POSIX environment does not implement Unix-style sockets. We can't build winbindd, but at least we can build the other components. There is no patch here regarding setgroups because I want to think about this issue some more in this branch. Maybe I should just go off and implement this call. Modified files: source/lib/util_sock.c source/nsswitch/wb_common.c ### START OF PATCH ### diff -urp --new-file oldsamba/source/lib/util_sock.c newsamba/source/lib/util_sock.c --- oldsamba/source/lib/util_sock.c Wed Sep 4 07:39:04 2002 +++ newsamba/source/lib/util_sock.c Wed Sep 4 07:39:12 2002 @@ -976,6 +976,7 @@ int create_pipe_sock(const char *socket_ const char *socket_name, mode_t dir_perms) { +#ifdef HAVE_UNIXSOCKET struct sockaddr_un sunaddr; struct stat st; int sock; @@ -1064,6 +1065,10 @@ int create_pipe_sock(const char *socket_ /* Success! */ return sock; +#else +DEBUG(0, (create_pipe_sock: No Unix sockets on this system\n)); +return -1; +#endif /* HAVE_UNIXSOCKET */ } /*** diff -urp --new-file oldsamba/source/nsswitch/wb_common.c newsamba/source/nsswitch/wb_common.c --- oldsamba/source/nsswitch/wb_common.cWed Sep 4 07:39:42 2002 +++ newsamba/source/nsswitch/wb_common.cWed Sep 4 07:39:35 2002 @@ -87,6 +87,7 @@ static void close_sock(void) int winbind_open_pipe_sock(void) { +#ifdef HAVE_UNIXSOCKET struct sockaddr_un sunaddr; static pid_t our_pid; struct stat st; @@ -155,6 +156,9 @@ int winbind_open_pipe_sock(void) } return winbindd_fd; +#else + return -1; +#endif /* HAVE_UNIXSOCKET */ } /* Write data to winbindd socket */ ### END OF PATCH ### Thanks PG -- Paul Green | Mail: [EMAIL PROTECTED] Senior Technical Consultant | Voice: +1 978-461-7557 FAX: +1 978-461-3610 Stratus Technologies| Video: PictureTel/ATT by request. Maynard, MA 01754 | Disclaimer: I speak for myself, not Stratus.
[PATCH] samba-2.2.6pre2 glitch
The symbol for false in Samba is named False, not FALSE... this shows up on my system because FALSE is not defined in any POSIX header. (Exists on Unix systems). ### START OF PATCH ### diff -urp sourceutilssmbpasswd.c.orig sourceutilssmbpasswd.c --- sourceutilssmbpasswd.c.orig Thu Aug 29 07:05:33 2002 +++ sourceutilssmbpasswd.c Mon Sep 2 22:52:15 2002 @@ -34,7 +34,7 @@ extern int optind; /* forced running in root-mode */ static BOOL local_mode; -static BOOL joining_domain = False, got_pass = False, got_username = False, changing_trust_pw = FALSE; +static BOOL joining_domain = False, got_pass = False, got_username = False, +changing_trust_pw = False; static int local_flags = 0; static BOOL stdin_passwd_get = False; static fstring user_name, user_password; ### END OF PATCH ### Thanks PG -- Paul Green | Mail: [EMAIL PROTECTED] Senior Technical Consultant | Voice: +1 978-461-7557 FAX: +1 978-461-3610 Stratus Technologies| Video: PictureTel/ATT by request. Maynard, MA 01754 | Disclaimer: I speak for myself, not Stratus.
[PATCH] Patches to Samba 2.2.5 for Stratus VOS
I read that you are planning a 2.2.6 release of Samba. Would it be possible for you to apply the following short patches to samba/source/profile/profile.c and samba/source/utils/status.c in the 2.2 branch ?? These are precisely the same patches that you just applied at my request in Samba 3.0-alpha19. They enable Samba to build on VOS when --with-profile is not used, by avoiding references to System V-style shared memory functions. The other issues that I ran into while building 3.0 are already resolved in the 2.2 branch. I have tested building Samba with these patches on both VOS and Solaris; no issues. The patches are after my sig. Oh, and I am making excellent progress getting rsync ported to VOS. A few more days, and I think I'll have it up and running. Then I will try to get us into the build farm. Thanks very much PG -- Paul Green | Mail: [EMAIL PROTECTED] Senior Technical Consultant | Voice: +1 978-461-7557 FAX: +1 978-461-3610 Stratus Technologies| Video: PictureTel/ATT by request. Maynard, MA 01754 | Disclaimer: I speak for myself, not Stratus. ### START OF PATCHES ### diff -urp --new-file oldsamba/source/profile/profile.c newsamba/source/profile/profile.c --- oldsamba/source/profile/profile.c Mon Aug 26 11:01:03 2002 +++ newsamba/source/profile/profile.c Mon Aug 26 11:01:13 2002 @@ -22,7 +22,9 @@ #include includes.h +#ifdef WITH_PROFILE #define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R3) | (SHM_R6)) +#endif /* WITH_PROFILE */ static int shm_id; static BOOL read_only; @@ -46,6 +48,7 @@ void profile_message(int msg_type, pid_t int level; memcpy(level, buf, sizeof(int)); +#ifdef WITH_PROFILE switch (level) { case 0: /* turn off profiling */ do_profile_flag = False; @@ -67,6 +70,9 @@ void profile_message(int msg_type, pid_t DEBUG(1,(INFO: Profiling values cleared from pid %d\n, (int)src)); break; } +#else /* ndef WITH_PROFILE */ + DEBUG(1,(INFO: Profiling support unavailable in this build.\n)); +#endif /* WITH_PROFILE */ } / @@ -88,6 +94,7 @@ void reqprofile_message(int msg_type, pi /*** open the profiling shared memory area **/ +#ifdef WITH_PROFILE BOOL profile_setup(BOOL rdonly) { struct shmid_ds shm_ds; @@ -157,4 +164,4 @@ BOOL profile_setup(BOOL rdonly) message_register(MSG_REQ_PROFILELEVEL, reqprofile_message); return True; } - +#endif /* WITH_PROFILE */ diff -urp --new-file oldsamba/source/utils/status.c newsamba/source/utils/status.c --- oldsamba/source/utils/status.c Mon Aug 26 11:01:38 2002 +++ newsamba/source/utils/status.c Mon Aug 26 11:01:31 2002 @@ -165,6 +165,7 @@ static void print_brl(SMB_DEV_T dev, SMB **/ static int profile_dump(void) { +#ifdef WITH_PROFILE if (!profile_setup(True)) { fprintf(stderr,Failed to initialise profile memory\n); return -1; @@ -501,6 +502,9 @@ static int profile_dump(void) printf(run_elections_time: %u\n, profile_p-run_elections_time); printf(election_count: %u\n, profile_p-election_count); printf(election_time: %u\n, profile_p-election_time); +#else /* ndef WITH_PROFILE */ + fprintf(stderr,Profile data unavailable\n); +#endif /* WITH_PROFILE */ return 0; } ### END OF PATCHES ###
[PATCH] Restore detection of syslog.h
OK, I think this is the fix to restore the desired behavior with respect to syslog.h. configure (both 2.2.5 and 3.0) is already looking for a header named syslog.h, so it is a simple matter to base the decision upon the right macro. Sorry for the mixup. Will be harmless here; we don't have this header (yet). (untested) Thanks PG ### START OF PATCH ### diff -urp --new-file oldsamba/source/include/includes.h newsamba/source/include/includes.h --- oldsamba/source/include/includes.h Mon Aug 26 17:12:21 2002 +++ newsamba/source/include/includes.h Mon Aug 26 17:12:28 2002 -217,7 +217,7 #include arpa/inet.h #include netdb.h -#ifdef WITH_SYSLOG +#ifdef HAVE_SYSLOG_H #include syslog.h #endif ### END OF PATCH ###
[PATCH] Clean up samba-2.2 for POSIX-96
At Jeremy's request, here is a version of the POSIX-96 cleanup patches for the Samba 2.2 branch. This is exactly the same set of source files and changes as I submitted yesterday for the 3.0 branch. The only differences are due to slight differences in the files between 2.2 and 3.0. Patch is against 2.2.4. Tested by successfully rebuilding all of 2.2.4 here on Stratus VOS. ### START OF PATCH ### diff -urp oldsamba/source/configure.in newsamba/source/configure.in --- oldsamba/source/configure.inSat Jun 1 07:56:36 2002 +++ newsamba/source/configure.inSat Jun 1 07:56:50 2002 @@ -422,8 +422,9 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h) AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h) AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h) +AC_CHECK_HEADERS(stdlib.h string.h strings.h syslog.h sys/file.h) AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h) -AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h) +AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h sys/socket.h) AC_CHECK_HEADERS(syslog.h sys/syslog.h sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h) AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h) AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h dlfcn.h synch.h pthread.h nsswitch.h) diff -urp oldsamba/source/include/includes.h newsamba/source/include/includes.h --- oldsamba/source/include/includes.h Sat Jun 1 07:47:53 2002 +++ newsamba/source/include/includes.h Sat Jun 1 07:58:05 2002 @@ -205,10 +205,14 @@ #include netinet/in.h #include arpa/inet.h #include netdb.h + #ifdef HAVE_SYSLOG_H #include syslog.h #endif + +#ifdef HAVE_SYS_FILE_H #include sys/file.h +#endif #ifdef HAVE_NETINET_TCP_H #include netinet/tcp.h diff -urp oldsamba/source/lib/interfaces.c newsamba/source/lib/interfaces.c --- oldsamba/source/lib/interfaces.cSat Jun 1 14:40:17 2002 +++ newsamba/source/lib/interfaces.cSat Jun 1 14:40:52 2002 @@ -45,7 +45,9 @@ #include net/if.h #ifndef SIOCGIFCONF +#ifdef HAVE_SYS_SOCKIO_H #include sys/sockio.h +#endif #endif #ifdef AUTOCONF_TEST diff -urp oldsamba/source/lib/util_sock.c newsamba/source/lib/util_sock.c --- oldsamba/source/lib/util_sock.c Thu May 23 15:54:34 2002 +++ newsamba/source/lib/util_sock.c Thu May 23 15:57:12 2002 @@ -931,7 +931,7 @@ static BOOL matchname(char *remotehost,s /* Look up the host address in the address list we just got. */ for (i = 0; hp-h_addr_list[i]; i++) { - if (memcmp(hp-h_addr_list[i], (caddr_t) addr, sizeof(addr)) == 0) + if (memcmp(hp-h_addr_list[i], (void *) addr, sizeof(addr)) == 0) return True; } diff -urp oldsamba/source/libsmb/clifile.c newsamba/source/libsmb/clifile.c --- oldsamba/source/libsmb/clifile.cThu May 23 15:54:46 2002 +++ newsamba/source/libsmb/clifile.cThu May 23 15:57:27 2002 @@ -77,7 +77,7 @@ static BOOL cli_link_internal(struct cli uint32 unix_perms_to_wire(mode_t perms) { -uint ret = 0; +uint32 ret = 0; ret |= ((perms S_IXOTH) ? UNIX_X_OTH : 0); ret |= ((perms S_IWOTH) ? UNIX_W_OTH : 0); @@ -95,7 +95,7 @@ uint32 unix_perms_to_wire(mode_t perms) ret |= ((perms S_ISGID) ? UNIX_SET_GID : 0); #endif #ifdef S_ISUID -ret |= ((perms S_ISVTX) ? UNIX_SET_UID : 0); +ret |= ((perms S_ISUID) ? UNIX_SET_UID : 0); #endif return ret; } diff -urp oldsamba/source/nsswitch/winbind_nss_config.h newsamba/source/nsswitch/winbind_nss_config.h --- oldsamba/source/nsswitch/winbind_nss_config.h Thu May 23 15:55:08 2002 +++ newsamba/source/nsswitch/winbind_nss_config.h Thu May 23 15:58:17 2002 @@ -38,6 +38,10 @@ #include unistd.h #endif +#ifdef HAVE_SYS_SELECT_H +#include sys/select.h +#endif + #ifdef HAVE_SYS_SOCKET_H #include sys/socket.h #endif diff -urp oldsamba/source/pam_smbpass/general.h newsamba/source/pam_smbpass/general.h --- oldsamba/source/pam_smbpass/general.h Sat Jun 1 09:02:05 2002 +++ newsamba/source/pam_smbpass/general.h Sat Jun 1 09:03:00 2002 @@ -11,11 +11,14 @@ #include stdio.h #include stdlib.h -#include syslog.h #include unistd.h #include sys/types.h #include sys/stat.h #include sys/wait.h + +#ifdef HAVE_SYSLOG_H +#include syslog.h +#endif /* * here is the string to inform the user that the new passwords they diff -urp oldsamba/source/rpc_server/srv_spoolss_nt.c newsamba/source/rpc_server/srv_spoolss_nt.c --- oldsamba/source/rpc_server/srv_spoolss_nt.c Thu May 23 15:55:38 2002 +++ newsamba/source/rpc_server/srv_spoolss_nt.c Thu May 23 15:59:14 2002 @@ -7886,7 +7886,7 @@ static WERROR getprintprocessordirectory
[PATCH] Clean up samba-3.0 for POSIX-96
The attached set of patches cleans up samba-3.0-alpha17 for systems such as Stratus VOS that implement POSIX-1996 but do not provide full Unix compatibility. I would be most grateful if this patch could be applied against samba-3.0. I can supply a version of this patch for samba-2.2 if/when anyone cares. Summary of changes by module: source/configure.in check for non-POSIX headers syslog.h and sys/file.h (and alphabetize list) source/include/includes.h conditionally include syslog.h and sys/file.h source/lib/interfaces.c conditionally include sys/time.h and sys/sockio.h (autoconf macros already exist) source/lib/util_sock.c change memcmp use of (caddr_t) type to (void *); removes only use of nonstandard caddr_t type. source/libsmb/clifile.c fix bug that references uint not uint32, fix bug that references S_ISVTX not S_ISUID. source/nsswitch/winbind_nss_config.hconditionally include sys/select.h (autoconf macro already exists) source/pam_smbpass/general.hconditionally include syslog.h source/rpc_server/srv_spoolss_nt.c change 'FALSE' to 'False' (Samba defines 'False' in smb.h; POSIX-96 does not admit to FALSE) source/rpcclient/cmd_reg.c declare optarg and optind (many other Samba source files explicitly declare these names) source/smbd/chgpasswd.c conditionally reference ONLCR macro (not in POSIX-96) source/smbd/trans2.cfix bug that references S_ISVTX not S_ISUID source/smbd/vfs-wrap.c conditionally reference fchown (autoconf HAVE_FCHOWN macro already exists) source/smbd/utils/smbcontrol.c declare optarg (many other Samba source files explicitly declare this name) Patch is against samba-3.0-alpha17. Tested by successfully rebuilding all of samba-3.0-alpha17 here on Stratus VOS. I actually needed a few other changes, but I'm not submitting them at this time. I am only submitting the changes that I am 100% sure of. Oh, and my official email address is [EMAIL PROTECTED] This odd addresss ([EMAIL PROTECTED]) is a secondary address. I use it because it is not Outlook and won't mess up the formatting of the text. ### START OF PATCH ### diff -urp oldsamba3/source/configure.in newsamba3/source/configure.in --- oldsamba3/source/configure.in Fri May 31 13:54:22 2002 +++ newsamba3/source/configure.in Fri May 31 13:54:28 2002 @@ -278,8 +278,9 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h) AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h) AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h) +AC_CHECK_HEADERS(stdlib.h string.h strings.h syslog.h sys/file.h) AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h) -AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h) +AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h sys/socket.h) AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h) AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h) AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h ldap.h lber.h) diff -urp oldsamba3/source/include/includes.h newsamba3/source/include/includes.h --- oldsamba3/source/include/includes.h Fri May 31 13:08:57 2002 +++ newsamba3/source/include/includes.h Fri May 31 13:55:27 2002 @@ -216,8 +216,14 @@ #include netinet/in.h #include arpa/inet.h #include netdb.h -/* #include syslog.h */ -/* #include sys/file.h */ + +#ifdef HAVE_SYSLOG_H +#include syslog.h +#endif + +#ifdef HAVE_SYS_FILE_H +#include sys/file.h +#endif #ifdef HAVE_NETINET_TCP_H #include netinet/tcp.h diff -urp oldsamba3/source/lib/interfaces.c newsamba3/source/lib/interfaces.c --- oldsamba3/source/lib/interfaces.c Fri May 31 13:09:54 2002 +++ newsamba3/source/lib/interfaces.c Fri May 31 13:10:13 2002 @@ -38,11 +38,15 @@ #include arpa/inet.h #include netdb.h #include sys/ioctl.h +#ifdef HAVE_SYS_TIME_H #include sys/time.h +#endif #include net/if.h #ifndef SIOCGIFCONF +#ifdef HAVE_SYS_SOCKIO_H #include sys/sockio.h +#endif #endif #ifdef AUTOCONF_TEST diff -urp oldsamba3/source/lib/util_sock.c newsamba3/source/lib/util_sock.c --- oldsamba3/source/lib/util_sock.cFri May 31 13:09:55 2002 +++ newsamba3/source/lib/util_sock.cFri May 31 13:10:21 2002 @@ -1020,7 +1020,7 @@ static BOOL matchname(char *remotehost,s /* Look up the host address in the address list we just got. */ for (i = 0; hp-h_addr_list[i]; i++) { - if (memcmp(hp-h_addr_list[i], (caddr_t) addr, sizeof(addr)) == 0) + if (memcmp(hp-h_addr_list[i], (void *) addr, sizeof(addr)) == 0) return True; } diff -urp oldsamba3/source/libsmb/clifile.c newsamba3/source/libsmb/clifile.c