svn commit: samba r26551 - in branches/SAMBA_4_0/source/lib/replace: .
Author: jpeach Date: 2007-12-20 16:35:42 + (Thu, 20 Dec 2007) New Revision: 26551 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26551 Log: Make sure NULL is defined before using it to test for getifaddrs(). Patch from Timur I. Bakeyev [EMAIL PROTECTED]. Modified: branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4 Changeset: Modified: branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4 === --- branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4 2007-12-20 15:59:39 UTC (rev 26550) +++ branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4 2007-12-20 16:35:42 UTC (rev 26551) @@ -11,6 +11,10 @@ AC_TRY_COMPILE([ #include sys/socket.h #include sys/types.h +#if STDC_HEADERS +#include stdlib.h +#include stddef.h +#endif #include netinet/in.h #include arpa/inet.h #include ifaddrs.h
svn commit: samba r25432 - in branches: SAMBA_3_2/source SAMBA_3_2/source/exports SAMBA_3_2/source/modules SAMBA_3_2_0/source SAMBA_3_2_0/source/exports
Author: jpeach Date: 2007-09-29 23:54:32 + (Sat, 29 Sep 2007) New Revision: 25432 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25432 Log: Merge module linking changes from SAMBA_3_2 to SAMBA_3_2_0 to reduce spurious tree differences. Added: branches/SAMBA_3_2/source/exports/modules-darwin.syms branches/SAMBA_3_2_0/source/exports/modules-darwin.syms Removed: branches/SAMBA_3_2/source/modules/exports.darwin Modified: branches/SAMBA_3_2/source/Makefile.in branches/SAMBA_3_2/source/configure.in branches/SAMBA_3_2_0/source/Makefile.in branches/SAMBA_3_2_0/source/configure.in Changeset: Sorry, the patch is too large (580 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25432
svn commit: samba r25161 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd
Author: jpeach Date: 2007-09-14 15:08:07 + (Fri, 14 Sep 2007) New Revision: 25161 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25161 Log: Don't panic if setgroups fails in non-root mode. Modified: branches/SAMBA_3_2/source/smbd/sec_ctx.c branches/SAMBA_3_2_0/source/smbd/sec_ctx.c Changeset: Modified: branches/SAMBA_3_2/source/smbd/sec_ctx.c === --- branches/SAMBA_3_2/source/smbd/sec_ctx.c2007-09-14 14:20:46 UTC (rev 25160) +++ branches/SAMBA_3_2/source/smbd/sec_ctx.c2007-09-14 15:08:07 UTC (rev 25161) @@ -239,7 +239,7 @@ /* Start context switch */ gain_root(); #ifdef HAVE_SETGROUPS - if (sys_setgroups(gid, ngroups, groups) != 0) { + if (sys_setgroups(gid, ngroups, groups) != 0 !non_root_mode()) { smb_panic(sys_setgroups failed); } #endif @@ -280,7 +280,7 @@ if (syscall(SYS_initgroups, (ngroups max) ? max : ngroups, - groups, uid) == 1) { + groups, uid) == -1 !non_root_mode()) { DEBUG(0, (WARNING: failed to set group list (%d groups) for UID %ld: %s\n, ngroups, uid, strerror(errno))); Modified: branches/SAMBA_3_2_0/source/smbd/sec_ctx.c === --- branches/SAMBA_3_2_0/source/smbd/sec_ctx.c 2007-09-14 14:20:46 UTC (rev 25160) +++ branches/SAMBA_3_2_0/source/smbd/sec_ctx.c 2007-09-14 15:08:07 UTC (rev 25161) @@ -239,7 +239,7 @@ /* Start context switch */ gain_root(); #ifdef HAVE_SETGROUPS - if (sys_setgroups(gid, ngroups, groups) != 0) { + if (sys_setgroups(gid, ngroups, groups) != 0 !non_root_mode()) { smb_panic(sys_setgroups failed); } #endif @@ -280,7 +280,7 @@ if (syscall(SYS_initgroups, (ngroups max) ? max : ngroups, - groups, uid) == 1) { + groups, uid) == -1 !non_root_mode()) { DEBUG(0, (WARNING: failed to set group list (%d groups) for UID %ld: %s\n, ngroups, uid, strerror(errno)));
svn commit: samba r23962 - in branches/SAMBA_3_2/source/modules: .
Author: jpeach Date: 2007-07-19 04:37:38 + (Thu, 19 Jul 2007) New Revision: 23962 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23962 Log: Linux oplock support is conditional on HAVE_KERNEL_OPLOCKS_LINUX, not plain old LINUX. Modified: branches/SAMBA_3_2/source/modules/vfs_default.c Changeset: Modified: branches/SAMBA_3_2/source/modules/vfs_default.c === --- branches/SAMBA_3_2/source/modules/vfs_default.c 2007-07-19 04:00:32 UTC (rev 23961) +++ branches/SAMBA_3_2/source/modules/vfs_default.c 2007-07-19 04:37:38 UTC (rev 23962) @@ -826,10 +826,11 @@ START_PROFILE(syscall_linux_setlease); -#ifdef LINUX +#ifdef HAVE_KERNEL_OPLOCKS_LINUX /* first set the signal handler */ - if(linux_set_lease_sighandler(fd) == -1) + if(linux_set_lease_sighandler(fd) == -1) { return -1; + } result = linux_setlease(fd, leasetype); #else
svn commit: samba-docs r1129 - in trunk/smbdotconf/security: .
Author: jpeach Date: 2007-06-26 17:50:20 + (Tue, 26 Jun 2007) New Revision: 1129 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=1129 Log: Double-up on some backslashes so they don't get interpreted by nroff. Modified: trunk/smbdotconf/security/passwdchat.xml trunk/smbdotconf/security/restrictanonymous.xml Changeset: Modified: trunk/smbdotconf/security/passwdchat.xml === --- trunk/smbdotconf/security/passwdchat.xml2007-06-26 08:11:40 UTC (rev 1128) +++ trunk/smbdotconf/security/passwdchat.xml2007-06-26 17:50:20 UTC (rev 1129) @@ -30,7 +30,7 @@ paraThe string can contain the macro parameter moreinfo=none%n/parameter which is substituted for the new password. The chat sequence can also contain the standard -macros \n, \r, \t and \s to +macros \\n, \\r, \\t and \\s to give line-feed, carriage-return, tab and space. The chat sequence string can also contain a '*' which matches any sequence of characters. Double quotes can be used to collect strings with spaces in them into a single string./para @@ -41,7 +41,7 @@ paraIf the smbconfoption name=pam password change/ parameter is set to constantyes/constant, the chat pairs may be matched in any order, and success is determined by the PAM result, not any particular - output. The \n macro is ignored for PAM conversions. + output. The \\n macro is ignored for PAM conversions. /para /description Modified: trunk/smbdotconf/security/restrictanonymous.xml === --- trunk/smbdotconf/security/restrictanonymous.xml 2007-06-26 08:11:40 UTC (rev 1128) +++ trunk/smbdotconf/security/restrictanonymous.xml 2007-06-26 17:50:20 UTC (rev 1129) @@ -8,8 +8,8 @@ group list information is returned for an anonymous connection. and mirrors the effects of the programlisting -HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ - Control\LSA\RestrictAnonymous +HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\ + Control\\LSA\\RestrictAnonymous /programlisting registry key in Windows 2000 and Windows NT. When set to 0, user and group list information is returned to anyone who asks. When set
svn commit: samba r23611 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_26/source/nsswitch
Author: jpeach Date: 2007-06-26 18:18:44 + (Tue, 26 Jun 2007) New Revision: 23611 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23611 Log: Fix typo in error message. Modified: branches/SAMBA_3_0/source/nsswitch/idmap_rid.c branches/SAMBA_3_0_26/source/nsswitch/idmap_rid.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/idmap_rid.c === --- branches/SAMBA_3_0/source/nsswitch/idmap_rid.c 2007-06-26 13:45:07 UTC (rev 23610) +++ branches/SAMBA_3_0/source/nsswitch/idmap_rid.c 2007-06-26 18:18:44 UTC (rev 23611) @@ -79,7 +79,7 @@ if (lp_idmap_gid(low_gid, high_gid)) { if ((ctx-low_id != low_gid) || (ctx-high_id != high_uid)) { - DEBUG(1, (ERROR: idmap uid irange must match idmap gid range\n)); + DEBUG(1, (ERROR: idmap uid range must match idmap gid range\n)); ret = NT_STATUS_UNSUCCESSFUL; goto failed; } Modified: branches/SAMBA_3_0_26/source/nsswitch/idmap_rid.c === --- branches/SAMBA_3_0_26/source/nsswitch/idmap_rid.c 2007-06-26 13:45:07 UTC (rev 23610) +++ branches/SAMBA_3_0_26/source/nsswitch/idmap_rid.c 2007-06-26 18:18:44 UTC (rev 23611) @@ -79,7 +79,7 @@ if (lp_idmap_gid(low_gid, high_gid)) { if ((ctx-low_id != low_gid) || (ctx-high_id != high_uid)) { - DEBUG(1, (ERROR: idmap uid irange must match idmap gid range\n)); + DEBUG(1, (ERROR: idmap uid range must match idmap gid range\n)); ret = NT_STATUS_UNSUCCESSFUL; goto failed; }
svn commit: samba r23576 - in branches: SAMBA_3_0/source/lib SAMBA_3_0_26/source/lib
Author: jpeach Date: 2007-06-21 21:17:06 + (Thu, 21 Jun 2007) New Revision: 23576 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23576 Log: Fix some confusion between HAVE_BROKEN_GETGROUPS and USE_BSD_SETGROUPS. Modified: branches/SAMBA_3_0/source/lib/system.c branches/SAMBA_3_0_26/source/lib/system.c Changeset: Modified: branches/SAMBA_3_0/source/lib/system.c === --- branches/SAMBA_3_0/source/lib/system.c 2007-06-21 20:56:56 UTC (rev 23575) +++ branches/SAMBA_3_0/source/lib/system.c 2007-06-21 21:17:06 UTC (rev 23576) @@ -1022,7 +1022,7 @@ setlen = max; } -#if defined(BROKEN_GETGROUPS) +#if defined(HAVE_BROKEN_GETGROUPS) ret = sys_broken_setgroups(setlen, new_gidset ? new_gidset : gidset); #else ret = setgroups(setlen, new_gidset ? new_gidset : gidset); @@ -1063,10 +1063,10 @@ return -1; #endif /* HAVE_SETGROUPS */ -#if defined(HAVE_BROKEN_GETGROUPS) +#if defined(USE_BSD_SETGROUPS) + return sys_bsd_setgroups(primary_gid, setlen, gidset); +#elif defined(HAVE_BROKEN_GETGROUPS) return sys_broken_setgroups(setlen, gidset); -#elif defined(USE_BSD_SETGROUPS) - return sys_bsd_setgroups(primary_gid, setlen, gidset); #else return setgroups(setlen, gidset); #endif Modified: branches/SAMBA_3_0_26/source/lib/system.c === --- branches/SAMBA_3_0_26/source/lib/system.c 2007-06-21 20:56:56 UTC (rev 23575) +++ branches/SAMBA_3_0_26/source/lib/system.c 2007-06-21 21:17:06 UTC (rev 23576) @@ -1022,7 +1022,7 @@ setlen = max; } -#if defined(BROKEN_GETGROUPS) +#if defined(HAVE_BROKEN_GETGROUPS) ret = sys_broken_setgroups(setlen, new_gidset ? new_gidset : gidset); #else ret = setgroups(setlen, new_gidset ? new_gidset : gidset); @@ -1063,10 +1063,10 @@ return -1; #endif /* HAVE_SETGROUPS */ -#if defined(HAVE_BROKEN_GETGROUPS) +#if defined(USE_BSD_SETGROUPS) + return sys_bsd_setgroups(primary_gid, setlen, gidset); +#elif defined(HAVE_BROKEN_GETGROUPS) return sys_broken_setgroups(setlen, gidset); -#elif defined(USE_BSD_SETGROUPS) - return sys_bsd_setgroups(primary_gid, setlen, gidset); #else return setgroups(setlen, gidset); #endif
svn commit: samba r23541 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-06-18 16:10:00 + (Mon, 18 Jun 2007) New Revision: 23541 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23541 Log: Linking the LSA pipe module only once is probably enough. Modified: branches/SAMBA_3_0/source/Makefile.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-06-18 14:06:04 UTC (rev 23540) +++ branches/SAMBA_3_0/source/Makefile.in 2007-06-18 16:10:00 UTC (rev 23541) @@ -1419,8 +1419,6 @@ bin/[EMAIL PROTECTED]@: $(BINARY_PREREQS) $(RPC_LSA_OBJ) @echo Linking $@ @$(SHLD_MODULE) $(RPC_LSA_OBJ) - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] bin/[EMAIL PROTECTED]@: $(BINARY_PREREQS) $(RPC_SAMR_OBJ) @echo Linking $@
svn commit: samba r23510 - in branches/SAMBA_3_0/source: groupdb include lib libsmb locking nmbd nsswitch param passdb rpc_parse rpc_server smbd tests
Author: jpeach Date: 2007-06-15 21:58:49 + (Fri, 15 Jun 2007) New Revision: 23510 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23510 Log: Tidy calls to smb_panic by removing trailing newlines. Print the failed expression in SMB_ASSERT. Modified: branches/SAMBA_3_0/source/groupdb/mapping.c branches/SAMBA_3_0/source/include/smb_macros.h branches/SAMBA_3_0/source/lib/charcnv.c branches/SAMBA_3_0/source/lib/data_blob.c branches/SAMBA_3_0/source/lib/select.c branches/SAMBA_3_0/source/lib/smbldap.c branches/SAMBA_3_0/source/lib/system_smbd.c branches/SAMBA_3_0/source/lib/util.c branches/SAMBA_3_0/source/lib/util_pw.c branches/SAMBA_3_0/source/lib/util_tdb.c branches/SAMBA_3_0/source/libsmb/cliquota.c branches/SAMBA_3_0/source/locking/brlock.c branches/SAMBA_3_0/source/locking/locking.c branches/SAMBA_3_0/source/locking/posix.c branches/SAMBA_3_0/source/nmbd/nmbd.c branches/SAMBA_3_0/source/nsswitch/winbindd.c branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c branches/SAMBA_3_0/source/nsswitch/winbindd_util.c branches/SAMBA_3_0/source/param/loadparm.c branches/SAMBA_3_0/source/passdb/machine_sid.c branches/SAMBA_3_0/source/passdb/pdb_tdb.c branches/SAMBA_3_0/source/rpc_parse/parse_misc.c branches/SAMBA_3_0/source/rpc_server/srv_lsa.c branches/SAMBA_3_0/source/smbd/blocking.c branches/SAMBA_3_0/source/smbd/files.c branches/SAMBA_3_0/source/smbd/negprot.c branches/SAMBA_3_0/source/smbd/notify.c branches/SAMBA_3_0/source/smbd/nttrans.c branches/SAMBA_3_0/source/smbd/password.c branches/SAMBA_3_0/source/smbd/sec_ctx.c branches/SAMBA_3_0/source/smbd/server.c branches/SAMBA_3_0/source/smbd/share_access.c branches/SAMBA_3_0/source/tests/summary.c Changeset: Sorry, the patch is too large (1066 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23510
svn commit: samba r23511 - in branches/SAMBA_3_0_26/source: groupdb include lib libsmb locking nmbd nsswitch param passdb rpc_parse rpc_server smbd tests
Author: jpeach Date: 2007-06-15 22:06:50 + (Fri, 15 Jun 2007) New Revision: 23511 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23511 Log: Merge branches/[EMAIL PROTECTED] Tidy calls to smb_panic by removing trailing newlines. Print the failed expression in SMB_ASSERT. Modified: branches/SAMBA_3_0_26/source/groupdb/mapping.c branches/SAMBA_3_0_26/source/include/smb_macros.h branches/SAMBA_3_0_26/source/lib/charcnv.c branches/SAMBA_3_0_26/source/lib/data_blob.c branches/SAMBA_3_0_26/source/lib/select.c branches/SAMBA_3_0_26/source/lib/smbldap.c branches/SAMBA_3_0_26/source/lib/system_smbd.c branches/SAMBA_3_0_26/source/lib/util.c branches/SAMBA_3_0_26/source/lib/util_pw.c branches/SAMBA_3_0_26/source/lib/util_tdb.c branches/SAMBA_3_0_26/source/libsmb/cliquota.c branches/SAMBA_3_0_26/source/locking/brlock.c branches/SAMBA_3_0_26/source/locking/locking.c branches/SAMBA_3_0_26/source/locking/posix.c branches/SAMBA_3_0_26/source/nmbd/nmbd.c branches/SAMBA_3_0_26/source/nsswitch/winbindd.c branches/SAMBA_3_0_26/source/nsswitch/winbindd_cm.c branches/SAMBA_3_0_26/source/nsswitch/winbindd_util.c branches/SAMBA_3_0_26/source/param/loadparm.c branches/SAMBA_3_0_26/source/passdb/machine_sid.c branches/SAMBA_3_0_26/source/passdb/pdb_tdb.c branches/SAMBA_3_0_26/source/rpc_parse/parse_misc.c branches/SAMBA_3_0_26/source/rpc_server/srv_lsa.c branches/SAMBA_3_0_26/source/smbd/blocking.c branches/SAMBA_3_0_26/source/smbd/files.c branches/SAMBA_3_0_26/source/smbd/negprot.c branches/SAMBA_3_0_26/source/smbd/notify.c branches/SAMBA_3_0_26/source/smbd/nttrans.c branches/SAMBA_3_0_26/source/smbd/password.c branches/SAMBA_3_0_26/source/smbd/sec_ctx.c branches/SAMBA_3_0_26/source/smbd/server.c branches/SAMBA_3_0_26/source/smbd/share_access.c branches/SAMBA_3_0_26/source/tests/summary.c Changeset: Sorry, the patch is too large (1066 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23511
svn commit: samba r23502 - in branches/SAMBA_3_0/source/smbd: .
Author: jpeach Date: 2007-06-14 18:48:51 + (Thu, 14 Jun 2007) New Revision: 23502 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23502 Log: Restore exit-on-idle. Small refactoring for clarity. Exit if we are idle and we timed out waiting for something to do. Modified: branches/SAMBA_3_0/source/smbd/server.c Changeset: Modified: branches/SAMBA_3_0/source/smbd/server.c === --- branches/SAMBA_3_0/source/smbd/server.c 2007-06-14 15:50:47 UTC (rev 23501) +++ branches/SAMBA_3_0/source/smbd/server.c 2007-06-14 18:48:51 UTC (rev 23502) @@ -316,6 +316,16 @@ } / + Are we idle enough that we could safely exit? +/ + +static BOOL smbd_is_idle(void) +{ + /* Currently we define idle as having no client connections. */ + return count_all_current_connections() == 0; +} + +/ Open the socket communication. / @@ -414,10 +424,22 @@ r_fds, w_fds, idle_timeout, maxfd); - num = sys_select(maxfd+1,r_fds,w_fds,NULL, -timeval_is_zero(idle_timeout) ? -NULL : idle_timeout); - + if (timeval_is_zero(idle_timeout)) { + num = sys_select(maxfd + 1, r_fds, w_fds, + NULL, NULL); + } else { + num = sys_select(maxfd + 1, r_fds, w_fds, + NULL, idle_timeout); + + /* If the idle timeout fired and we are idle, exit +* gracefully. We expect to be running under a process +* controller that will restart us if necessry. +*/ + if (num == 0 smbd_is_idle()) { + exit_server_cleanly(idle timeout); + } + } + if (num == -1 errno == EINTR) { if (got_sig_term) { exit_server_cleanly(NULL); @@ -438,19 +460,6 @@ continue; } -#if 0 - Deactivated for now, this needs to become a timed event - vl - - /* If the idle timeout fired and we don't have any connected -* users, exit gracefully. We should be running under a process -* controller that will restart us if necessry. -*/ - if (num == 0 count_all_current_connections() == 0) { - exit_server_cleanly(idle timeout); - } -#endif - /* check if we need to reload services */ check_reload(time(NULL));
svn commit: samba r23470 - in branches/SAMBA_3_0/source/lib: .
Author: jpeach Date: 2007-06-13 20:40:50 + (Wed, 13 Jun 2007) New Revision: 23470 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23470 Log: Fix supplementary group list truncation for *BSD. We need to pass the correct group list length and only truncate to NGROUPS_MAX if it is too long. Modified: branches/SAMBA_3_0/source/lib/system.c Changeset: Modified: branches/SAMBA_3_0/source/lib/system.c === --- branches/SAMBA_3_0/source/lib/system.c 2007-06-13 19:01:41 UTC (rev 23469) +++ branches/SAMBA_3_0/source/lib/system.c 2007-06-13 20:40:50 UTC (rev 23470) @@ -1018,10 +1018,16 @@ setlen++; } + if (setlen max) { + DEBUG(10, (forced to truncate group list from %d to %d\n, + setlen, max)); + setlen = max; + } + #if defined(BROKEN_GETGROUPS) - ret = sys_broken_setgroups(max, new_gidset ? new_gidset : gidset); + ret = sys_broken_setgroups(setlen, new_gidset ? new_gidset : gidset); #else - ret = setgroups(max, new_gidset ? new_gidset : gidset); + ret = setgroups(setlen, new_gidset ? new_gidset : gidset); #endif if (new_gidset) {
svn commit: samba r23473 - in branches/SAMBA_3_0_26/source/lib: .
Author: jpeach Date: 2007-06-13 20:45:55 + (Wed, 13 Jun 2007) New Revision: 23473 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23473 Log: Merge Merge branches/[EMAIL PROTECTED] Fix supplementary group list truncation for *BSD. We need to pass the correct group list length and only truncate to NGROUPS_MAX if it is too long. Modified: branches/SAMBA_3_0_26/source/lib/system.c Changeset: Modified: branches/SAMBA_3_0_26/source/lib/system.c === --- branches/SAMBA_3_0_26/source/lib/system.c 2007-06-13 20:43:49 UTC (rev 23472) +++ branches/SAMBA_3_0_26/source/lib/system.c 2007-06-13 20:45:55 UTC (rev 23473) @@ -1018,10 +1018,16 @@ setlen++; } + if (setlen max) { + DEBUG(10, (forced to truncate group list from %d to %d\n, + setlen, max)); + setlen = max; + } + #if defined(BROKEN_GETGROUPS) - ret = sys_broken_setgroups(max, new_gidset ? new_gidset : gidset); + ret = sys_broken_setgroups(setlen, new_gidset ? new_gidset : gidset); #else - ret = setgroups(max, new_gidset ? new_gidset : gidset); + ret = setgroups(setlen, new_gidset ? new_gidset : gidset); #endif if (new_gidset) {
svn commit: samba r23475 - in branches/SAMBA_3_0/source/lib: .
Author: jpeach Date: 2007-06-13 21:42:31 + (Wed, 13 Jun 2007) New Revision: 23475 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23475 Log: Fix the prototype for sys_broken_setgroups and log *BSD group list truncation a bit more verbosely. Modified: branches/SAMBA_3_0/source/lib/system.c Changeset: Modified: branches/SAMBA_3_0/source/lib/system.c === --- branches/SAMBA_3_0/source/lib/system.c 2007-06-13 20:49:20 UTC (rev 23474) +++ branches/SAMBA_3_0/source/lib/system.c 2007-06-13 21:42:31 UTC (rev 23475) @@ -936,7 +936,7 @@ return ngroups; } -static int sys_broken_setgroups(gid_t primary_gid, int setlen, gid_t *gidset) +static int sys_broken_setgroups(int setlen, gid_t *gidset) { GID_T *group_list; int i ; @@ -1019,7 +1019,7 @@ } if (setlen max) { - DEBUG(10, (forced to truncate group list from %d to %d\n, + DEBUG(3, (forced to truncate group list from %d to %d\n, setlen, max)); setlen = max; }
svn commit: samba r23476 - in branches/SAMBA_3_0_26/source/lib: .
Author: jpeach Date: 2007-06-13 21:49:07 + (Wed, 13 Jun 2007) New Revision: 23476 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23476 Log: Merge branches/[EMAIL PROTECTED] Fix the prototype for sys_broken_setgroups and log *BSD group list truncation a bit more verbosely. Modified: branches/SAMBA_3_0_26/source/lib/system.c Changeset: Modified: branches/SAMBA_3_0_26/source/lib/system.c === --- branches/SAMBA_3_0_26/source/lib/system.c 2007-06-13 21:42:31 UTC (rev 23475) +++ branches/SAMBA_3_0_26/source/lib/system.c 2007-06-13 21:49:07 UTC (rev 23476) @@ -936,7 +936,7 @@ return ngroups; } -static int sys_broken_setgroups(gid_t primary_gid, int setlen, gid_t *gidset) +static int sys_broken_setgroups(int setlen, gid_t *gidset) { GID_T *group_list; int i ; @@ -1019,7 +1019,7 @@ } if (setlen max) { - DEBUG(10, (forced to truncate group list from %d to %d\n, + DEBUG(3, (forced to truncate group list from %d to %d\n, setlen, max)); setlen = max; }
svn commit: samba r23478 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-06-14 03:38:43 + (Thu, 14 Jun 2007) New Revision: 23478 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23478 Log: Change the handling of the developer CFLAGS so that they are always emited to the Makefile in the DEVELOPER_CFLAGS variable. This makes it easy to turn developer mode on and off without waiting for configure to run. The developer flags are only added to CFLAGS for the --enable-developer and --enable-krb5developer cases. Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-06-13 21:59:39 UTC (rev 23477) +++ branches/SAMBA_3_0/source/Makefile.in 2007-06-14 03:38:43 UTC (rev 23478) @@ -20,8 +20,14 @@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ + +# Add $(DEVELOPER_CFLAGS) to $(CFLAGS) to enable extra compiler +# (GCC) warnings. This is done automtically for --enable-developer +# and --enable-krb5developer. [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ CPPFLAGS=-DHAVE_CONFIG_H @CPPFLAGS@ + [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ @LDFLAGS@ [EMAIL PROTECTED]@ Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-06-13 21:59:39 UTC (rev 23477) +++ branches/SAMBA_3_0/source/configure.in 2007-06-14 03:38:43 UTC (rev 23478) @@ -435,7 +435,19 @@ AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)], [if eval test x$enable_developer = xyes; then developer=yes - DEVELOPER_CFLAGS=-gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER +fi]) + +AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)], +[if eval test x$enable_krb5developer = xyes; then +developer=yes + krb5_developer=yes +fi]) + +# Probe the gcc version for extra CFLAGS. We always stash these in +# DEVELOPER_CFLAGS, so that you can turn them on and off with a simple +# Makefile edit, avoiding the need to re-run configure. +if test x$ac_cv_prog_gcc = xyes ; then + DEVELOPER_CFLAGS=-gstabs -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER # Add -Wdeclaration-after-statement if compiler supports it AC_CACHE_CHECK( [that the C compiler understands -Wdeclaration-after-statement], @@ -448,12 +460,12 @@ samba_cv_HAVE_Wdeclaration_after_statement=yes, samba_cv_HAVE_Wdeclaration_after_statement=no, samba_cv_HAVE_Wdeclaration_after_statement=cross) + ]) - ]) - if test x$samba_cv_HAVE_Wdeclaration_after_statement = xyes; then + if test x$samba_cv_HAVE_Wdeclaration_after_statement = xyes; then DEVELOPER_CFLAGS=${DEVELOPER_CFLAGS} -Wdeclaration-after-statement - fi - # here + fi + #-Werror-implicit-function-declaration AC_CACHE_CHECK( [that the C compiler understands -Werror-implicit-function-declaration], @@ -470,13 +482,13 @@ if test x$samba_cv_HAVE_Werror_implicit_function_declaration = xyes; then DEVELOPER_CFLAGS=${DEVELOPER_CFLAGS} -Werror-implicit-function-declaration fi -fi]) -AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)], -[if eval test x$enable_krb5developer = xyes; then -developer=yes - CFLAGS=${CFLAGS} -gstabs -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER -fi]) + # krb5developer is like developer, except we don't get + # -Wstrict-prototypes. + if test x$krb5_developer ~= x$yes ; then + DEVELOPER_CFLAGS=$DEVELOPER_CFLAGS -Wstrict-prototypes + fi +fi AC_ARG_ENABLE(dmalloc, [ --enable-dmallocEnable heap debugging [default=no]]) @@ -6474,8 +6486,9 @@ AC_MSG_WARN([cannot run when cross-compiling])) dnl Merge in developer cflags from now on -if test x$developer = xyes; then -CFLAGS=${CFLAGS} ${DEVELOPER_CFLAGS} +AC_SUBST(DEVELOPER_CFLAGS) +if test x$krb5_developer = xyes -o x$developer = xyes; then +CFLAGS=${CFLAGS} $(DEVELOPER_CFLAGS) fi builddir=`pwd`
svn commit: samba r23479 - in branches/SAMBA_3_0_26/source: .
Author: jpeach Date: 2007-06-14 03:59:44 + (Thu, 14 Jun 2007) New Revision: 23479 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23479 Log: Merge branches/[EMAIL PROTECTED] Change the handling of the developer CFLAGS so that they are always emited to the Makefile in the DEVELOPER_CFLAGS variable. This makes it easy to turn developer mode on and off without waiting for configure to run. The developer flags are only added to CFLAGS for the --enable-developer and --enable-krb5developer cases. Modified: branches/SAMBA_3_0_26/source/Makefile.in branches/SAMBA_3_0_26/source/configure.in Changeset: Modified: branches/SAMBA_3_0_26/source/Makefile.in === --- branches/SAMBA_3_0_26/source/Makefile.in2007-06-14 03:38:43 UTC (rev 23478) +++ branches/SAMBA_3_0_26/source/Makefile.in2007-06-14 03:59:44 UTC (rev 23479) @@ -20,8 +20,14 @@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ + +# Add $(DEVELOPER_CFLAGS) to $(CFLAGS) to enable extra compiler +# (GCC) warnings. This is done automtically for --enable-developer +# and --enable-krb5developer. [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ CPPFLAGS=-DHAVE_CONFIG_H @CPPFLAGS@ + [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ @LDFLAGS@ [EMAIL PROTECTED]@ Modified: branches/SAMBA_3_0_26/source/configure.in === --- branches/SAMBA_3_0_26/source/configure.in 2007-06-14 03:38:43 UTC (rev 23478) +++ branches/SAMBA_3_0_26/source/configure.in 2007-06-14 03:59:44 UTC (rev 23479) @@ -405,7 +405,19 @@ AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)], [if eval test x$enable_developer = xyes; then developer=yes - CFLAGS=${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER +fi]) + +AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)], +[if eval test x$enable_krb5developer = xyes; then +developer=yes + krb5_developer=yes +fi]) + +# Probe the gcc version for extra CFLAGS. We always stash these in +# DEVELOPER_CFLAGS, so that you can turn them on and off with a simple +# Makefile edit, avoiding the need to re-run configure. +if test x$ac_cv_prog_gcc = xyes ; then + DEVELOPER_CFLAGS=-gstabs -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER # Add -Wdeclaration-after-statement if compiler supports it AC_CACHE_CHECK( [that the C compiler understands -Wdeclaration-after-statement], @@ -419,16 +431,34 @@ samba_cv_HAVE_Wdeclaration_after_statement=no, samba_cv_HAVE_Wdeclaration_after_statement=cross) ]) - if test x$samba_cv_HAVE_Wdeclaration_after_statement = xyes; then - CFLAGS=${CFLAGS} -Wdeclaration-after-statement + + if test x$samba_cv_HAVE_Wdeclaration_after_statement = xyes; then + DEVELOPER_CFLAGS=${DEVELOPER_CFLAGS} -Wdeclaration-after-statement + fi + + #-Werror-implicit-function-declaration + AC_CACHE_CHECK( + [that the C compiler understands -Werror-implicit-function-declaration], + samba_cv_HAVE_Werror_implicit_function_declaration, [ + AC_TRY_RUN_STRICT([ + int main(void) + { + return 0; + }],[-Werror-implicit-function-declaration],[$CPPFLAGS],[$LDFLAGS], + samba_cv_HAVE_Werror_implicit_function_declaration=yes, + samba_cv_HAVE_Werror_implicit_function_declaration=no, + samba_cv_HAVE_Werror_implicit_function_declaration=cross) + ]) + if test x$samba_cv_HAVE_Werror_implicit_function_declaration = xyes; then + DEVELOPER_CFLAGS=${DEVELOPER_CFLAGS} -Werror-implicit-function-declaration fi -fi]) -AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)], -[if eval test x$enable_krb5developer = xyes; then -developer=yes - CFLAGS=${CFLAGS} -gstabs -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER -fi]) + # krb5developer is like developer, except we don't get + # -Wstrict-prototypes. + if test x$krb5_developer ~= x$yes ; then + DEVELOPER_CFLAGS=$DEVELOPER_CFLAGS -Wstrict-prototypes + fi +fi AC_ARG_ENABLE(dmalloc, [ --enable-dmallocEnable heap debugging [default=no]]) @@ -6319,6 +6349,12 @@ AC_MSG_ERROR([summary failure. Aborting config]); exit 1;, AC_MSG_WARN([cannot run when cross-compiling])) +dnl Merge in developer cflags from now on +AC_SUBST(DEVELOPER_CFLAGS) +if test x$krb5_developer = xyes -o x$developer = xyes
svn commit: samba r23480 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-06-14 04:00:35 + (Thu, 14 Jun 2007) New Revision: 23480 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23480 Log: Fix DEVELOPER_CFLAGS quoting. Modified: branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-06-14 03:59:44 UTC (rev 23479) +++ branches/SAMBA_3_0/source/configure.in 2007-06-14 04:00:35 UTC (rev 23480) @@ -6488,7 +6488,7 @@ dnl Merge in developer cflags from now on AC_SUBST(DEVELOPER_CFLAGS) if test x$krb5_developer = xyes -o x$developer = xyes; then -CFLAGS=${CFLAGS} $(DEVELOPER_CFLAGS) +CFLAGS=${CFLAGS} \$(DEVELOPER_CFLAGS) fi builddir=`pwd`
svn commit: samba r23423 - in branches: SAMBA_3_0/source/modules SAMBA_3_0_25/source/modules SAMBA_3_0_26/source/modules
Author: jpeach Date: 2007-06-11 20:56:17 + (Mon, 11 Jun 2007) New Revision: 23423 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23423 Log: Use the correct structure types in the NT_ACL operations. It's not clear to my why the catia module feels it's necessary to implement these operations, but at least they're now the right type. Modified: branches/SAMBA_3_0/source/modules/vfs_catia.c branches/SAMBA_3_0_25/source/modules/vfs_catia.c branches/SAMBA_3_0_26/source/modules/vfs_catia.c Changeset: Modified: branches/SAMBA_3_0/source/modules/vfs_catia.c === --- branches/SAMBA_3_0/source/modules/vfs_catia.c 2007-06-11 15:49:57 UTC (rev 23422) +++ branches/SAMBA_3_0/source/modules/vfs_catia.c 2007-06-11 20:56:17 UTC (rev 23423) @@ -232,7 +232,7 @@ static size_t catia_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, - struct security_descriptor **ppdesc) + struct security_descriptor_info **ppdesc) { return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc); @@ -240,7 +240,7 @@ static BOOL catia_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, -struct security_descriptor *psd) +struct security_descriptor_info *psd) { return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); Modified: branches/SAMBA_3_0_25/source/modules/vfs_catia.c === --- branches/SAMBA_3_0_25/source/modules/vfs_catia.c2007-06-11 15:49:57 UTC (rev 23422) +++ branches/SAMBA_3_0_25/source/modules/vfs_catia.c2007-06-11 20:56:17 UTC (rev 23423) @@ -222,7 +222,7 @@ static size_t catia_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, - struct security_descriptor **ppdesc) + struct security_descriptor_info **ppdesc) { return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc); @@ -230,7 +230,7 @@ static BOOL catia_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, -struct security_descriptor *psd) +struct security_descriptor_info *psd) { return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); Modified: branches/SAMBA_3_0_26/source/modules/vfs_catia.c === --- branches/SAMBA_3_0_26/source/modules/vfs_catia.c2007-06-11 15:49:57 UTC (rev 23422) +++ branches/SAMBA_3_0_26/source/modules/vfs_catia.c2007-06-11 20:56:17 UTC (rev 23423) @@ -232,7 +232,7 @@ static size_t catia_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, - struct security_descriptor **ppdesc) + struct security_descriptor_info **ppdesc) { return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc); @@ -240,7 +240,7 @@ static BOOL catia_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, -struct security_descriptor *psd) +struct security_descriptor_info *psd) { return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd);
svn commit: samba r23393 - in branches/SAMBA_3_0/source: lib smbd
Author: jpeach Date: 2007-06-08 22:25:55 + (Fri, 08 Jun 2007) New Revision: 23393 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23393 Log: Support BSD group semantics by making sure that the effective GID is always passed as the first GID when calling setgroups(2). Modified: branches/SAMBA_3_0/source/lib/system.c branches/SAMBA_3_0/source/lib/system_smbd.c branches/SAMBA_3_0/source/smbd/sec_ctx.c Changeset: Modified: branches/SAMBA_3_0/source/lib/system.c === --- branches/SAMBA_3_0/source/lib/system.c 2007-06-08 21:48:09 UTC (rev 23392) +++ branches/SAMBA_3_0/source/lib/system.c 2007-06-08 22:25:55 UTC (rev 23393) @@ -889,15 +889,13 @@ } /** - Wrapper for getgroups. Deals with broken (int) case. + Wrap setgroups and getgroups for systems that declare getgroups() as + returning an array of gid_t, but actuall return an array of int. / -int sys_getgroups(int setlen, gid_t *gidset) +#if defined(HAVE_BROKEN_GETGROUPS) +static int sys_broken_getgroups(int setlen, gid_t *gidset) { -#if !defined(HAVE_BROKEN_GETGROUPS) - return getgroups(setlen, gidset); -#else - GID_T gid; GID_T *group_list; int i, ngroups; @@ -919,7 +917,7 @@ if (setlen == 0) setlen = groups_max(); - if((group_list = (GID_T *)malloc(setlen * sizeof(GID_T))) == NULL) { + if((group_list = SMB_MALLOC_ARRAY(GID_T, setlen)) == NULL) { DEBUG(0,(sys_getgroups: Malloc fail.\n)); return -1; } @@ -936,26 +934,10 @@ SAFE_FREE(group_list); return ngroups; -#endif /* HAVE_BROKEN_GETGROUPS */ } - -/** - Wrapper for setgroups. Deals with broken (int) case. Automatically used - if we have broken getgroups. -/ - -int sys_setgroups(int setlen, gid_t *gidset) +static int sys_broken_setgroups(gid_t primary_gid, int setlen, gid_t *gidset) { -#if !defined(HAVE_SETGROUPS) - errno = ENOSYS; - return -1; -#endif /* HAVE_SETGROUPS */ - -#if !defined(HAVE_BROKEN_GETGROUPS) - return setgroups(setlen, gidset); -#else - GID_T *group_list; int i ; @@ -972,7 +954,7 @@ * GID_T array of size setlen. */ - if((group_list = (GID_T *)malloc(setlen * sizeof(GID_T))) == NULL) { + if((group_list = SMB_MALLOC_ARRAY(GID_T, setlen)) == NULL) { DEBUG(0,(sys_setgroups: Malloc fail.\n)); return -1; } @@ -989,10 +971,104 @@ SAFE_FREE(group_list); return 0 ; +} + #endif /* HAVE_BROKEN_GETGROUPS */ + +/* This is a list of systems that require the first GID passed to setgroups(2) + * to be the effective GID. If your system is one of these, add it here. + */ +#if defined (FREEBSD) || defined (DARWINOS) +#define USE_BSD_SETGROUPS +#endif + +#if defined(USE_BSD_SETGROUPS) +/* Depending on the particular BSD implementation, the first GID that is + * passed to setgroups(2) will either be ignored or will set the credential's + * effective GID. In either case, the right thing to do is to guarantee that + * gidset[0] is the effective GID. + */ +static int sys_bsd_setgroups(gid_t primary_gid, int setlen, const gid_t *gidset) +{ + gid_t *new_gidset = NULL; + int max; + int ret; + + /* setgroups(2) will fail with EINVAL if we pass too many groups. */ + max = groups_max(); + + /* No group list, just make sure we are setting the efective GID. */ + if (setlen == 0) { + return setgroups(1, primary_gid); + } + + /* If the primary gid is not the first array element, grow the array +* and insert it at the front. +*/ + if (gidset[0] != primary_gid) { + gid_t *new_gidset; + + new_gidset = SMB_MALLOC_ARRAY(gid_t, setlen + 1); + if (new_gidset == NULL) { + return -1; + } + + memcpy(new_gidset + 1, gidset, ((setlen + 1) * sizeof(gid_t))); + new_gidset[0] = primary_gid; + setlen++; + } + +#if defined(BROKEN_GETGROUPS) + ret = sys_broken_setgroups(max, new_gidset ? new_gidset : gidset); +#else + ret = setgroups(max, new_gidset ? new_gidset : gidset); +#endif + + if (new_gidset) { + int errsav = errno; + SAFE_FREE(new_gidset); + errno = errsav; + } + + return ret; } +#endif /* USE_BSD_SETGROUPS */ + /** + Wrapper for getgroups. Deals with broken (int) case
svn commit: samba r23395 - in branches/SAMBA_3_0_26/source: lib smbd
Author: jpeach Date: 2007-06-08 22:39:04 + (Fri, 08 Jun 2007) New Revision: 23395 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23395 Log: Merge branches/[EMAIL PROTECTED] Support BSD group semantics by making sure that the effective GID is always passed as the first GID when calling setgroups(2). Modified: branches/SAMBA_3_0_26/source/lib/system.c branches/SAMBA_3_0_26/source/lib/system_smbd.c branches/SAMBA_3_0_26/source/smbd/sec_ctx.c Changeset: Modified: branches/SAMBA_3_0_26/source/lib/system.c === --- branches/SAMBA_3_0_26/source/lib/system.c 2007-06-08 22:36:46 UTC (rev 23394) +++ branches/SAMBA_3_0_26/source/lib/system.c 2007-06-08 22:39:04 UTC (rev 23395) @@ -889,15 +889,13 @@ } /** - Wrapper for getgroups. Deals with broken (int) case. + Wrap setgroups and getgroups for systems that declare getgroups() as + returning an array of gid_t, but actuall return an array of int. / -int sys_getgroups(int setlen, gid_t *gidset) +#if defined(HAVE_BROKEN_GETGROUPS) +static int sys_broken_getgroups(int setlen, gid_t *gidset) { -#if !defined(HAVE_BROKEN_GETGROUPS) - return getgroups(setlen, gidset); -#else - GID_T gid; GID_T *group_list; int i, ngroups; @@ -919,7 +917,7 @@ if (setlen == 0) setlen = groups_max(); - if((group_list = (GID_T *)malloc(setlen * sizeof(GID_T))) == NULL) { + if((group_list = SMB_MALLOC_ARRAY(GID_T, setlen)) == NULL) { DEBUG(0,(sys_getgroups: Malloc fail.\n)); return -1; } @@ -936,26 +934,10 @@ SAFE_FREE(group_list); return ngroups; -#endif /* HAVE_BROKEN_GETGROUPS */ } - -/** - Wrapper for setgroups. Deals with broken (int) case. Automatically used - if we have broken getgroups. -/ - -int sys_setgroups(int setlen, gid_t *gidset) +static int sys_broken_setgroups(gid_t primary_gid, int setlen, gid_t *gidset) { -#if !defined(HAVE_SETGROUPS) - errno = ENOSYS; - return -1; -#endif /* HAVE_SETGROUPS */ - -#if !defined(HAVE_BROKEN_GETGROUPS) - return setgroups(setlen, gidset); -#else - GID_T *group_list; int i ; @@ -972,7 +954,7 @@ * GID_T array of size setlen. */ - if((group_list = (GID_T *)malloc(setlen * sizeof(GID_T))) == NULL) { + if((group_list = SMB_MALLOC_ARRAY(GID_T, setlen)) == NULL) { DEBUG(0,(sys_setgroups: Malloc fail.\n)); return -1; } @@ -989,10 +971,104 @@ SAFE_FREE(group_list); return 0 ; +} + #endif /* HAVE_BROKEN_GETGROUPS */ + +/* This is a list of systems that require the first GID passed to setgroups(2) + * to be the effective GID. If your system is one of these, add it here. + */ +#if defined (FREEBSD) || defined (DARWINOS) +#define USE_BSD_SETGROUPS +#endif + +#if defined(USE_BSD_SETGROUPS) +/* Depending on the particular BSD implementation, the first GID that is + * passed to setgroups(2) will either be ignored or will set the credential's + * effective GID. In either case, the right thing to do is to guarantee that + * gidset[0] is the effective GID. + */ +static int sys_bsd_setgroups(gid_t primary_gid, int setlen, const gid_t *gidset) +{ + gid_t *new_gidset = NULL; + int max; + int ret; + + /* setgroups(2) will fail with EINVAL if we pass too many groups. */ + max = groups_max(); + + /* No group list, just make sure we are setting the efective GID. */ + if (setlen == 0) { + return setgroups(1, primary_gid); + } + + /* If the primary gid is not the first array element, grow the array +* and insert it at the front. +*/ + if (gidset[0] != primary_gid) { + gid_t *new_gidset; + + new_gidset = SMB_MALLOC_ARRAY(gid_t, setlen + 1); + if (new_gidset == NULL) { + return -1; + } + + memcpy(new_gidset + 1, gidset, ((setlen + 1) * sizeof(gid_t))); + new_gidset[0] = primary_gid; + setlen++; + } + +#if defined(BROKEN_GETGROUPS) + ret = sys_broken_setgroups(max, new_gidset ? new_gidset : gidset); +#else + ret = setgroups(max, new_gidset ? new_gidset : gidset); +#endif + + if (new_gidset) { + int errsav = errno; + SAFE_FREE(new_gidset); + errno = errsav; + } + + return ret; } +#endif /* USE_BSD_SETGROUPS */ + /** + Wrapper for getgroups. Deals
svn commit: samba r23394 - in branches/SAMBA_3_0_26/source: .
Author: jpeach Date: 2007-06-08 22:36:46 + (Fri, 08 Jun 2007) New Revision: 23394 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23394 Log: Fix missing $ in variable expansion. Modified: branches/SAMBA_3_0_26/source/Makefile.in Changeset: Modified: branches/SAMBA_3_0_26/source/Makefile.in === --- branches/SAMBA_3_0_26/source/Makefile.in2007-06-08 22:25:55 UTC (rev 23393) +++ branches/SAMBA_3_0_26/source/Makefile.in2007-06-08 22:36:46 UTC (rev 23394) @@ -1502,7 +1502,7 @@ @$(SHLD) $(LDSHFLAGS) -o $@ $(CP437_OBJ) \ @[EMAIL PROTECTED] [EMAIL PROTECTED] -bin/[EMAIL PROTECTED]@: $(BINARY_PREREQS) (CHARSET_MACOSXFS_OBJ) +bin/[EMAIL PROTECTED]@: $(BINARY_PREREQS) $(CHARSET_MACOSXFS_OBJ) @echo Building plugin $@ @$(SHLD) $(LDSHFLAGS) -o $@ $(CHARSET_MACOSXFS_OBJ) \ -framework CoreFoundation @[EMAIL PROTECTED] [EMAIL PROTECTED]
svn commit: samba r23397 - in branches/SAMBA_3_0_26/source/modules: .
Author: jpeach Date: 2007-06-08 23:13:04 + (Fri, 08 Jun 2007) New Revision: 23397 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23397 Log: Merge branches/[EMAIL PROTECTED] Make VFS callbacks static. Mark operations as OPAQUE because they do not pass through. Modified: branches/SAMBA_3_0_26/source/modules/vfs_zfsacl.c Changeset: Modified: branches/SAMBA_3_0_26/source/modules/vfs_zfsacl.c === --- branches/SAMBA_3_0_26/source/modules/vfs_zfsacl.c 2007-06-08 23:08:41 UTC (rev 23396) +++ branches/SAMBA_3_0_26/source/modules/vfs_zfsacl.c 2007-06-08 23:13:04 UTC (rev 23397) @@ -133,14 +133,15 @@ zfs_process_smbacl); } -size_t zfsacl_fget_nt_acl(struct vfs_handle_struct *handle, +static size_t zfsacl_fget_nt_acl(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 security_info, struct security_descriptor **ppdesc) { return zfs_get_nt_acl(fsp, security_info, ppdesc); } -size_t zfsacl_get_nt_acl(struct vfs_handle_struct *handle, + +static size_t zfsacl_get_nt_acl(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, uint32 security_info, struct security_descriptor **ppdesc) @@ -148,7 +149,7 @@ return zfs_get_nt_acl(fsp, security_info, ppdesc); } -BOOL zfsacl_fset_nt_acl(vfs_handle_struct *handle, +static BOOL zfsacl_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd) @@ -156,7 +157,7 @@ return zfs_set_nt_acl(handle, fsp, security_info_sent, psd); } -BOOL zfsacl_set_nt_acl(vfs_handle_struct *handle, +static BOOL zfsacl_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd) @@ -168,13 +169,13 @@ static vfs_op_tuple zfsacl_ops[] = { {SMB_VFS_OP(zfsacl_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, -SMB_VFS_LAYER_TRANSPARENT}, +SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(zfsacl_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, -SMB_VFS_LAYER_TRANSPARENT}, +SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(zfsacl_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, -SMB_VFS_LAYER_TRANSPARENT}, +SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(zfsacl_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, -SMB_VFS_LAYER_TRANSPARENT}, +SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} };
svn commit: samba r23396 - in branches/SAMBA_3_0/source/modules: .
Author: jpeach Date: 2007-06-08 23:08:41 + (Fri, 08 Jun 2007) New Revision: 23396 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23396 Log: Make VFS callbacks static. Mark operations as OPAQUE because they do not pass through. Modified: branches/SAMBA_3_0/source/modules/vfs_zfsacl.c Changeset: Modified: branches/SAMBA_3_0/source/modules/vfs_zfsacl.c === --- branches/SAMBA_3_0/source/modules/vfs_zfsacl.c 2007-06-08 22:39:04 UTC (rev 23395) +++ branches/SAMBA_3_0/source/modules/vfs_zfsacl.c 2007-06-08 23:08:41 UTC (rev 23396) @@ -133,14 +133,15 @@ zfs_process_smbacl); } -size_t zfsacl_fget_nt_acl(struct vfs_handle_struct *handle, +static size_t zfsacl_fget_nt_acl(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 security_info, struct security_descriptor **ppdesc) { return zfs_get_nt_acl(fsp, security_info, ppdesc); } -size_t zfsacl_get_nt_acl(struct vfs_handle_struct *handle, + +static size_t zfsacl_get_nt_acl(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, uint32 security_info, struct security_descriptor **ppdesc) @@ -148,7 +149,7 @@ return zfs_get_nt_acl(fsp, security_info, ppdesc); } -BOOL zfsacl_fset_nt_acl(vfs_handle_struct *handle, +static BOOL zfsacl_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd) @@ -156,7 +157,7 @@ return zfs_set_nt_acl(handle, fsp, security_info_sent, psd); } -BOOL zfsacl_set_nt_acl(vfs_handle_struct *handle, +static BOOL zfsacl_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd) @@ -168,13 +169,13 @@ static vfs_op_tuple zfsacl_ops[] = { {SMB_VFS_OP(zfsacl_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, -SMB_VFS_LAYER_TRANSPARENT}, +SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(zfsacl_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, -SMB_VFS_LAYER_TRANSPARENT}, +SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(zfsacl_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, -SMB_VFS_LAYER_TRANSPARENT}, +SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(zfsacl_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, -SMB_VFS_LAYER_TRANSPARENT}, +SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} };
svn commit: samba r23398 - in branches/SAMBA_3_0/source: . smbd
Author: jpeach Date: 2007-06-09 00:10:26 + (Sat, 09 Jun 2007) New Revision: 23398 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23398 Log: Support membership of 16 groups on Darwin by making sure we opt in to the dynamic group resolution mechanism when switching UNIX credentials. Modified: branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0/source/smbd/sec_ctx.c Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-06-08 23:13:04 UTC (rev 23397) +++ branches/SAMBA_3_0/source/configure.in 2007-06-09 00:10:26 UTC (rev 23398) @@ -3100,7 +3100,22 @@ fi fi +AC_CACHE_CHECK([for the Darwin initgroups system call], + samba_cv_DARWIN_INITGROUPS, + AC_TRY_LINK([ +#include sys/syscall.h +#include unistd.h + ], + [ syscall(SYS_initgroups, 16, NULL, NULL, 0); ], + samba_cv_DARWIN_INITGROUPS=yes, + samba_cv_DARWIN_INITGROUPS=no) +) +if test x$samba_cv_DARWIN_INITGROUPS = xyes ; then +AC_DEFINE(HAVE_DARWIN_INITGROUPS, 1, + [Whether to use the Darwin-specific initgroups system call]) +fi + AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[ AC_TRY_RUN([#include ${srcdir-.}/tests/shared_mmap.c], samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)]) Modified: branches/SAMBA_3_0/source/smbd/sec_ctx.c === --- branches/SAMBA_3_0/source/smbd/sec_ctx.c2007-06-08 23:13:04 UTC (rev 23397) +++ branches/SAMBA_3_0/source/smbd/sec_ctx.c2007-06-09 00:10:26 UTC (rev 23398) @@ -231,6 +231,10 @@ Change UNIX security context. Calls panic if not successful so no return value. / +#ifndef HAVE_DARWIN_INITGROUPS + +/* Normal credential switch path. */ + static void set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups) { /* Start context switch */ @@ -242,6 +246,51 @@ /* end context switch */ } +#else /* HAVE_DARWIN_INITGROUPS */ + +/* The Darwin groups implementation is a little unusual. The list of +* groups in the kernel credential is not exhaustive, but more like +* a cache. The full group list is held in userspace and checked +* dynamically. +* +* This is an optional mechanism, and setgroups(2) opts out +* of it. That is, if you call setgroups, then the list of groups you +* set are the only groups that are ever checked. This is not what we +* want. We want to opt in to the dynamic resolution mechanism, so we +* need to specify the uid of the user whose group list (cache) we are +* setting. +* +* The Darwin rules are: +* 1. Thou shalt setegid, initgroups and seteuid IN THAT ORDER +* 2. Thou shalt not pass more that NGROUPS_MAX to initgroups +* 3. Thou shalt leave the first entry in the groups list well alone +*/ + +#include sys/syscall.h + +static void set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups) +{ + int max = groups_max(); + + /* Start context switch */ + gain_root(); + + become_gid(gid); + + + if (syscall(SYS_initgroups, (ngroups max) ? max : ngroups, + groups, uid) == 1) { + DEBUG(0, (WARNING: failed to set group list + (%d groups) for UID %ld: %s\n, + ngroups, uid, strerror(errno))); + } + + become_uid(uid); + /* end context switch */ +} + +#endif /* HAVE_DARWIN_INITGROUPS */ + / Set the current security context to a given user. /
svn commit: samba r23399 - in branches/SAMBA_3_0_26/source: . smbd
Author: jpeach Date: 2007-06-09 00:11:42 + (Sat, 09 Jun 2007) New Revision: 23399 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23399 Log: Merge branches/[EMAIL PROTECTED] Support membership of 16 groups on Darwin by making sure we opt in to the dynamic group resolution mechanism when switching UNIX credentials. Modified: branches/SAMBA_3_0_26/source/configure.in branches/SAMBA_3_0_26/source/smbd/sec_ctx.c Changeset: Modified: branches/SAMBA_3_0_26/source/configure.in === --- branches/SAMBA_3_0_26/source/configure.in 2007-06-09 00:10:26 UTC (rev 23398) +++ branches/SAMBA_3_0_26/source/configure.in 2007-06-09 00:11:42 UTC (rev 23399) @@ -2956,7 +2956,22 @@ fi fi +AC_CACHE_CHECK([for the Darwin initgroups system call], + samba_cv_DARWIN_INITGROUPS, + AC_TRY_LINK([ +#include sys/syscall.h +#include unistd.h + ], + [ syscall(SYS_initgroups, 16, NULL, NULL, 0); ], + samba_cv_DARWIN_INITGROUPS=yes, + samba_cv_DARWIN_INITGROUPS=no) +) +if test x$samba_cv_DARWIN_INITGROUPS = xyes ; then +AC_DEFINE(HAVE_DARWIN_INITGROUPS, 1, + [Whether to use the Darwin-specific initgroups system call]) +fi + AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[ AC_TRY_RUN([#include ${srcdir-.}/tests/shared_mmap.c], samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)]) Modified: branches/SAMBA_3_0_26/source/smbd/sec_ctx.c === --- branches/SAMBA_3_0_26/source/smbd/sec_ctx.c 2007-06-09 00:10:26 UTC (rev 23398) +++ branches/SAMBA_3_0_26/source/smbd/sec_ctx.c 2007-06-09 00:11:42 UTC (rev 23399) @@ -231,6 +231,10 @@ Change UNIX security context. Calls panic if not successful so no return value. / +#ifndef HAVE_DARWIN_INITGROUPS + +/* Normal credential switch path. */ + static void set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups) { /* Start context switch */ @@ -242,6 +246,51 @@ /* end context switch */ } +#else /* HAVE_DARWIN_INITGROUPS */ + +/* The Darwin groups implementation is a little unusual. The list of +* groups in the kernel credential is not exhaustive, but more like +* a cache. The full group list is held in userspace and checked +* dynamically. +* +* This is an optional mechanism, and setgroups(2) opts out +* of it. That is, if you call setgroups, then the list of groups you +* set are the only groups that are ever checked. This is not what we +* want. We want to opt in to the dynamic resolution mechanism, so we +* need to specify the uid of the user whose group list (cache) we are +* setting. +* +* The Darwin rules are: +* 1. Thou shalt setegid, initgroups and seteuid IN THAT ORDER +* 2. Thou shalt not pass more that NGROUPS_MAX to initgroups +* 3. Thou shalt leave the first entry in the groups list well alone +*/ + +#include sys/syscall.h + +static void set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups) +{ + int max = groups_max(); + + /* Start context switch */ + gain_root(); + + become_gid(gid); + + + if (syscall(SYS_initgroups, (ngroups max) ? max : ngroups, + groups, uid) == 1) { + DEBUG(0, (WARNING: failed to set group list + (%d groups) for UID %ld: %s\n, + ngroups, uid, strerror(errno))); + } + + become_uid(uid); + /* end context switch */ +} + +#endif /* HAVE_DARWIN_INITGROUPS */ + / Set the current security context to a given user. /
svn commit: samba r23352 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-06-05 06:10:09 + (Tue, 05 Jun 2007) New Revision: 23352 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23352 Log: Don't generate stamp-h. AFAICT it is never used. Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-06-05 05:35:39 UTC (rev 23351) +++ branches/SAMBA_3_0/source/Makefile.in 2007-06-05 06:10:09 UTC (rev 23352) @@ -2026,7 +2026,6 @@ -rm -f script/installbin.sh script/uninstallbin.sh distclean: realclean - -rm -f include/stamp-h -rm -f smbadduser -rm -f include/config.h Makefile -rm -f config.status config.cache so_locations Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-06-05 05:35:39 UTC (rev 23351) +++ branches/SAMBA_3_0/source/configure.in 2007-06-05 06:10:09 UTC (rev 23352) @@ -6487,7 +6487,7 @@ SMBD_LIBS=$samba_dmapi_libs AC_SUBST(SMBD_LIBS) -AC_OUTPUT(include/stamp-h Makefile script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh) +AC_OUTPUT(Makefile script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh) # # Print very concise instructions on building/use
svn commit: samba r23353 - in branches/SAMBA_3_0_26/source: .
Author: jpeach Date: 2007-06-05 06:12:48 + (Tue, 05 Jun 2007) New Revision: 23353 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23353 Log: Merge r23352 from SAMBA_3_0. Don't generate stamp-h. AFAICT it is never used. Modified: branches/SAMBA_3_0_26/source/Makefile.in branches/SAMBA_3_0_26/source/configure.in Changeset: Modified: branches/SAMBA_3_0_26/source/Makefile.in === --- branches/SAMBA_3_0_26/source/Makefile.in2007-06-05 06:10:09 UTC (rev 23352) +++ branches/SAMBA_3_0_26/source/Makefile.in2007-06-05 06:12:48 UTC (rev 23353) @@ -2003,7 +2003,6 @@ -rm -f script/installbin.sh script/uninstallbin.sh distclean: realclean - -rm -f include/stamp-h -rm -f include/config.h Makefile -rm -f config.status config.cache so_locations -rm -rf .deps TAGS Modified: branches/SAMBA_3_0_26/source/configure.in === --- branches/SAMBA_3_0_26/source/configure.in 2007-06-05 06:10:09 UTC (rev 23352) +++ branches/SAMBA_3_0_26/source/configure.in 2007-06-05 06:12:48 UTC (rev 23353) @@ -6328,7 +6328,7 @@ SMBD_LIBS=$samba_dmapi_libs AC_SUBST(SMBD_LIBS) -AC_OUTPUT(include/stamp-h Makefile script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh) +AC_OUTPUT(Makefile script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh) # # Print very concise instructions on building/use
svn commit: samba r23312 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_26/source/nsswitch
Author: jpeach Date: 2007-06-02 21:12:47 + (Sat, 02 Jun 2007) New Revision: 23312 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23312 Log: As per Volker, rename the windbind:ads parameter winbind:rpc only. Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c === --- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-06-02 11:38:27 UTC (rev 23311) +++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-06-02 21:12:47 UTC (rev 23312) @@ -133,9 +133,6 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain) { struct winbind_cache *ret = wcache; -#ifdef HAVE_ADS - struct winbindd_domain *our_domain = domain; -#endif /* We have to know what type of domain we are dealing with first. */ @@ -163,6 +160,8 @@ if (!domain-backend) { #ifdef HAVE_ADS + struct winbindd_domain *our_domain = domain; + /* find our domain first so we can figure out if we are joined to a kerberized domain */ @@ -171,7 +170,7 @@ if ((our_domain-active_directory || IS_DC) domain-active_directory -lp_parm_bool(-1, winbind, ads, True)) { +!lp_parm_bool(-1, winbind, rpc only, False)) { DEBUG(5,(get_cache: Setting ADS methods for domain %s\n, domain-name)); domain-backend = ads_methods; } else { Modified: branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c === --- branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c 2007-06-02 11:38:27 UTC (rev 23311) +++ branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c 2007-06-02 21:12:47 UTC (rev 23312) @@ -133,9 +133,6 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain) { struct winbind_cache *ret = wcache; -#ifdef HAVE_ADS - struct winbindd_domain *our_domain = domain; -#endif /* We have to know what type of domain we are dealing with first. */ @@ -163,6 +160,8 @@ if (!domain-backend) { #ifdef HAVE_ADS + struct winbindd_domain *our_domain = domain; + /* find our domain first so we can figure out if we are joined to a kerberized domain */ @@ -171,7 +170,7 @@ if ((our_domain-active_directory || IS_DC) domain-active_directory -lp_parm_bool(-1, winbind, ads, True)) { +!lp_parm_bool(-1, winbind, rpc only, False)) { DEBUG(5,(get_cache: Setting ADS methods for domain %s\n, domain-name)); domain-backend = ads_methods; } else {
svn commit: samba-docs r1118 - in trunk/manpages-3: .
Author: jpeach Date: 2007-06-02 21:13:20 + (Sat, 02 Jun 2007) New Revision: 1118 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=1118 Log: Document the winbind:rpc only parameter. Modified: trunk/manpages-3/winbindd.8.xml Changeset: Modified: trunk/manpages-3/winbindd.8.xml === --- trunk/manpages-3/winbindd.8.xml 2007-05-23 15:32:08 UTC (rev 1117) +++ trunk/manpages-3/winbindd.8.xml 2007-06-02 21:13:20 UTC (rev 1118) @@ -248,6 +248,12 @@ smbconfoption name=template shell//para/listitem listitempara smbconfoption name=winbind use default domain//para/listitem + listitempara + smbconfoption name=winbind: rpc only/ + Setting this parameter forces winbindd to use RPC + instead of LDAP to retrieve information from Domain + Controllers. + /para/listitem /itemizedlist /refsect1
svn commit: samba r23295 - in branches: SAMBA_3_0/source SAMBA_3_0_26/source
Author: jpeach Date: 2007-06-01 16:06:40 + (Fri, 01 Jun 2007) New Revision: 23295 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23295 Log: Apply proto_exists and bin/.dummy dependencies consistently for all binaries. Fix vfs_zfsacl build rule in SAMBA_3_0. Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0_26/source/Makefile.in Changeset: Sorry, the patch is too large (1473 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23295
svn commit: samba r23298 - in branches/SAMBA_3_0_26/source: .
Author: jpeach Date: 2007-06-01 19:28:13 + (Fri, 01 Jun 2007) New Revision: 23298 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23298 Log: Fix bad merge. Modified: branches/SAMBA_3_0_26/source/Makefile.in Changeset: Modified: branches/SAMBA_3_0_26/source/Makefile.in === --- branches/SAMBA_3_0_26/source/Makefile.in2007-06-01 18:39:50 UTC (rev 23297) +++ branches/SAMBA_3_0_26/source/Makefile.in2007-06-01 19:28:13 UTC (rev 23298) @@ -1193,7 +1193,7 @@ @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) -bin/[EMAIL PROTECTED](BINARY_PREREQS) @: $(RPCTORTURE_OBJ) +bin/[EMAIL PROTECTED]@: $(BINARY_PREREQS) $(RPCTORTURE_OBJ) @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(RPCTORTURE_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
svn commit: samba r23299 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_26/source/smbd
Author: jpeach Date: 2007-06-01 19:34:08 + (Fri, 01 Jun 2007) New Revision: 23299 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23299 Log: Fix the build for !WITH_SENDFILE. Modified: branches/SAMBA_3_0/source/smbd/reply.c branches/SAMBA_3_0_26/source/smbd/reply.c Changeset: Modified: branches/SAMBA_3_0/source/smbd/reply.c === --- branches/SAMBA_3_0/source/smbd/reply.c 2007-06-01 19:28:13 UTC (rev 23298) +++ branches/SAMBA_3_0/source/smbd/reply.c 2007-06-01 19:34:08 UTC (rev 23299) @@ -2246,11 +2246,10 @@ return; } - - normal_readbraw: - #endif +normal_readbraw: + if (nread 0) { ret = read_file(fsp,outbuf+4,startpos,nread); #if 0 /* mincount appears to be ignored in a W2K server. JRA. */ @@ -2646,7 +2645,7 @@ #endif - normal_read: +normal_read: if ((smb_maxcnt 0xFF) 0x1) { int sendlen = setup_readX_header(inbuf,outbuf,smb_maxcnt) - smb_maxcnt; Modified: branches/SAMBA_3_0_26/source/smbd/reply.c === --- branches/SAMBA_3_0_26/source/smbd/reply.c 2007-06-01 19:28:13 UTC (rev 23298) +++ branches/SAMBA_3_0_26/source/smbd/reply.c 2007-06-01 19:34:08 UTC (rev 23299) @@ -2246,10 +2246,10 @@ return; } - normal_readbraw: - #endif +normal_readbraw: + if (nread 0) { ret = read_file(fsp,outbuf+4,startpos,nread); #if 0 /* mincount appears to be ignored in a W2K server. JRA. */ @@ -2641,11 +2641,10 @@ /* Returning -1 here means successful sendfile. */ return -1; } - - normal_read: - #endif +normal_read: + if ((smb_maxcnt 0xFF) 0x1) { int sendlen = setup_readX_header(outbuf,smb_maxcnt) - smb_maxcnt; /* Send out the header. */
svn commit: samba r23300 - in branches: SAMBA_3_0/source/include SAMBA_3_0_26/source/include
Author: jpeach Date: 2007-06-01 19:42:23 + (Fri, 01 Jun 2007) New Revision: 23300 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23300 Log: AFAICT these are not needed. Jerry, can you please review and revert if this is not correct. Removed: branches/SAMBA_3_0/source/include/core/ branches/SAMBA_3_0_26/source/include/core/ Changeset:
svn commit: samba r23093 - in branches: SAMBA_3_0/source/script SAMBA_3_0_26/source/script
Author: jpeach Date: 2007-05-23 19:10:04 + (Wed, 23 May 2007) New Revision: 23093 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23093 Log: Allow modules with the same name but different types. Modified: branches/SAMBA_3_0/source/script/installmodules.sh branches/SAMBA_3_0_26/source/script/installmodules.sh Changeset: Modified: branches/SAMBA_3_0/source/script/installmodules.sh === --- branches/SAMBA_3_0/source/script/installmodules.sh 2007-05-23 15:28:47 UTC (rev 23092) +++ branches/SAMBA_3_0/source/script/installmodules.sh 2007-05-23 19:10:04 UTC (rev 23093) @@ -19,11 +19,19 @@ fi done +# We expect the last component of LIBDIR to be the module type, eg. idmap, +# pdb. By stripping this from the installation name, you can have multiple +# modules of the same name but different types by creating eg. idmap_foo +# and pdb_foo. This makes the most sense for idmap and pdb module, where +# they need to be consistent. +mtype=`basename $LIBDIR` + for p in $*; do p2=`basename $p` - echo Installing $p as $DESTDIR/$LIBDIR/$p2 - cp -f $p $DESTDIR/$LIBDIR/ - chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$p2 + name=`echo $p2 | sed -es/${mtype}_//` + echo Installing $p as $DESTDIR/$LIBDIR/$name + cp -f $p $DESTDIR/$LIBDIR/$name + chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$name done exit 0 Modified: branches/SAMBA_3_0_26/source/script/installmodules.sh === --- branches/SAMBA_3_0_26/source/script/installmodules.sh 2007-05-23 15:28:47 UTC (rev 23092) +++ branches/SAMBA_3_0_26/source/script/installmodules.sh 2007-05-23 19:10:04 UTC (rev 23093) @@ -19,11 +19,19 @@ fi done +# We expect the last component of LIBDIR to be the module type, eg. idmap, +# pdb. By stripping this from the installation name, you can have multiple +# modules of the same name but different types by creating eg. idmap_foo +# and pdb_foo. This makes the most sense for idmap and pdb module, where +# they need to be consistent. +mtype=`basename $LIBDIR` + for p in $*; do p2=`basename $p` - echo Installing $p as $DESTDIR/$LIBDIR/$p2 - cp -f $p $DESTDIR/$LIBDIR/ - chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$p2 + name=`echo $p2 | sed -es/${mtype}_//` + echo Installing $p as $DESTDIR/$LIBDIR/$name + cp -f $p $DESTDIR/$LIBDIR/$name + chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$name done exit 0
svn commit: samba r23094 - in branches: SAMBA_3_0/source SAMBA_3_0/source/m4 SAMBA_3_0_26/source
Author: jpeach Date: 2007-05-23 19:57:13 + (Wed, 23 May 2007) New Revision: 23094 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23094 Log: Update the iconv detection to handle cross-compiles better. If we are cross-compiling, we accept the first iconv library that we find (with a warning). Modified: branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0/source/m4/aclocal.m4 branches/SAMBA_3_0_26/source/aclocal.m4 branches/SAMBA_3_0_26/source/configure.in Changeset: Sorry, the patch is too large (551 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23094
svn commit: samba r23095 - in branches: SAMBA_3_0/source SAMBA_3_0/source/auth SAMBA_3_0/source/lib SAMBA_3_0/source/nsswitch SAMBA_3_0/source/pam_smbpass SAMBA_3_0_26/source SAMBA_3_0_26/source/auth
Author: jpeach Date: 2007-05-23 20:31:28 + (Wed, 23 May 2007) New Revision: 23095 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23095 Log: Support systems that have their PAM headers in /usr/include/pam. Modified: branches/SAMBA_3_0/source/auth/pampass.c branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0/source/lib/pam_errors.c branches/SAMBA_3_0/source/nsswitch/pam_winbind.h branches/SAMBA_3_0/source/pam_smbpass/general.h branches/SAMBA_3_0/source/pam_smbpass/pam_smb_acct.c branches/SAMBA_3_0/source/pam_smbpass/pam_smb_auth.c branches/SAMBA_3_0/source/pam_smbpass/pam_smb_passwd.c branches/SAMBA_3_0_26/source/auth/pampass.c branches/SAMBA_3_0_26/source/configure.in branches/SAMBA_3_0_26/source/lib/pam_errors.c branches/SAMBA_3_0_26/source/nsswitch/pam_winbind.h branches/SAMBA_3_0_26/source/pam_smbpass/general.h branches/SAMBA_3_0_26/source/pam_smbpass/pam_smb_acct.c branches/SAMBA_3_0_26/source/pam_smbpass/pam_smb_auth.c branches/SAMBA_3_0_26/source/pam_smbpass/pam_smb_passwd.c Changeset: Modified: branches/SAMBA_3_0/source/auth/pampass.c === --- branches/SAMBA_3_0/source/auth/pampass.c2007-05-23 19:57:13 UTC (rev 23094) +++ branches/SAMBA_3_0/source/auth/pampass.c2007-05-23 20:31:28 UTC (rev 23095) @@ -41,7 +41,11 @@ * which determines what actions/limitations/allowances become affected. */ +#if defined(HAVE_SECURITY_PAM_APPL_H) #include security/pam_appl.h +#elif defined(HAVE_PAM_PAM_APPL_H) +#include pam/pam_appl.h +#endif /* * Structure used to communicate between the conversation function Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-23 19:57:13 UTC (rev 23094) +++ branches/SAMBA_3_0/source/configure.in 2007-05-23 20:31:28 UTC (rev 23095) @@ -4399,7 +4399,11 @@ # -# check for a PAM clear-text auth, accounts, password and session support +# Check for a PAM clear-text auth, accounts, password +# and session support. Most PAM implementations keep their +# headers in /usr/include/security. Darwin keeps its in +# /usr/include/pam. + with_pam_for_crypt=no try_pam=no AC_MSG_CHECKING(whether to try PAM support) @@ -4419,10 +4423,13 @@ use_pam=yes create_pam_modules=yes - AC_CHECK_HEADERS(security/pam_appl.h) - if test x$ac_cv_header_security_pam_appl_h != xyes; then + # Most systems have PAM headers in /usr/include/security, but Darwin + # has them in /usr/include/pam. + AC_CHECK_HEADERS(security/pam_appl.h pam/pam_appl.h) + if test x$ac_cv_header_security_pam_appl_h != xyes -a \ + x$ac_cv_header_pam_pam_appl_h != xyes; then if test x${try_pam} = xyes;then - AC_MSG_ERROR([--with-pam=yes but security/pam_appl.h not found]) + AC_MSG_ERROR([--with-pam=yes but pam_appl.h not found]) fi use_pam=no create_pam_modules=no @@ -4437,14 +,18 @@ create_pam_modules=no fi - AC_CHECK_HEADERS(security/pam_modules.h,,,[[ + AC_CHECK_HEADERS(security/pam_modules.h pam/pam_modules.h,,,[[ #if HAVE_SECURITY_PAM_APPL_H #include security/pam_appl.h #endif + #if HAVE_PAM_PAM_APPL_H + #include pam/pam_appl.h + #endif ]]) - if test x$ac_cv_header_security_pam_modules_h = xno; then + if test x$ac_cv_header_security_pam_modules_h = xno -a \ + x$ac_cv_header_pam_pam_modules_h = xno ; then if test x${try_pam} = xyes;then - AC_MSG_ERROR([--with-pam=yes but security/pam_modules.h not found]) + AC_MSG_ERROR([--with-pam=yes but pam_modules.h not found]) fi create_pam_modules=no fi @@ -4460,6 +4471,7 @@ # this checks are optional, # we don't care about the results here AC_CHECK_HEADERS(security/pam_ext.h security/_pam_macros.h) + AC_CHECK_HEADERS(pam/pam_ext.h pam/_pam_macros.h) AC_CHECK_FUNC_EXT(pam_vsyslog,$PAM_LIBS) else AC_MSG_WARN([PAM support detected but PAM MODULES support is missing]) Modified: branches/SAMBA_3_0/source/lib/pam_errors.c === --- branches/SAMBA_3_0/source/lib/pam_errors.c 2007-05-23 19:57:13 UTC (rev 23094) +++ branches/SAMBA_3_0/source/lib/pam_errors.c 2007-05-23 20:31:28 UTC (rev 23095) @@ -21,7 +21,11 @@ #include
svn commit: samba r23096 - in branches: SAMBA_3_0/source/locking SAMBA_3_0_26/source/locking
Author: jpeach Date: 2007-05-23 20:38:14 + (Wed, 23 May 2007) New Revision: 23096 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23096 Log: Make the lock failure message prettier. Modified: branches/SAMBA_3_0/source/locking/posix.c branches/SAMBA_3_0_26/source/locking/posix.c Changeset: Modified: branches/SAMBA_3_0/source/locking/posix.c === --- branches/SAMBA_3_0/source/locking/posix.c 2007-05-23 20:31:28 UTC (rev 23095) +++ branches/SAMBA_3_0/source/locking/posix.c 2007-05-23 20:38:14 UTC (rev 23096) @@ -195,8 +195,8 @@ DEBUG(0,(posix_fcntl_lock: WARNING: lock request at offset %.0f, length %.0f returned\n, (double)offset,(double)count)); - DEBUG(0,(an %s error. This can happen when using 64 bit lock offsets\n, strerror(errno))); - DEBUG(0,(on 32 bit NFS mounted file systems.\n)); + DEBUGADD(0,(an %s error. This can happen when using 64 bit lock offsets\n, strerror(errno))); + DEBUGADD(0,(on 32 bit NFS mounted file systems.\n)); /* * If the offset is 0x7FFF then this will cause problems on @@ -240,8 +240,8 @@ DEBUG(0,(posix_fcntl_getlock: WARNING: lock request at offset %.0f, length %.0f returned\n, (double)*poffset,(double)*pcount)); - DEBUG(0,(an %s error. This can happen when using 64 bit lock offsets\n, strerror(errno))); - DEBUG(0,(on 32 bit NFS mounted file systems.\n)); + DEBUGADD(0,(an %s error. This can happen when using 64 bit lock offsets\n, strerror(errno))); + DEBUGADD(0,(on 32 bit NFS mounted file systems.\n)); /* * If the offset is 0x7FFF then this will cause problems on Modified: branches/SAMBA_3_0_26/source/locking/posix.c === --- branches/SAMBA_3_0_26/source/locking/posix.c2007-05-23 20:31:28 UTC (rev 23095) +++ branches/SAMBA_3_0_26/source/locking/posix.c2007-05-23 20:38:14 UTC (rev 23096) @@ -195,8 +195,8 @@ DEBUG(0,(posix_fcntl_lock: WARNING: lock request at offset %.0f, length %.0f returned\n, (double)offset,(double)count)); - DEBUG(0,(an %s error. This can happen when using 64 bit lock offsets\n, strerror(errno))); - DEBUG(0,(on 32 bit NFS mounted file systems.\n)); + DEBUGADD(0,(an %s error. This can happen when using 64 bit lock offsets\n, strerror(errno))); + DEBUGADD(0,(on 32 bit NFS mounted file systems.\n)); /* * If the offset is 0x7FFF then this will cause problems on @@ -240,8 +240,8 @@ DEBUG(0,(posix_fcntl_getlock: WARNING: lock request at offset %.0f, length %.0f returned\n, (double)*poffset,(double)*pcount)); - DEBUG(0,(an %s error. This can happen when using 64 bit lock offsets\n, strerror(errno))); - DEBUG(0,(on 32 bit NFS mounted file systems.\n)); + DEBUGADD(0,(an %s error. This can happen when using 64 bit lock offsets\n, strerror(errno))); + DEBUGADD(0,(on 32 bit NFS mounted file systems.\n)); /* * If the offset is 0x7FFF then this will cause problems on
svn commit: samba r23097 - in branches: SAMBA_3_0/source SAMBA_3_0_26/source
Author: jpeach Date: 2007-05-23 20:46:07 + (Wed, 23 May 2007) New Revision: 23097 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23097 Log: Add a new configure option to disable building SWAT (it is still built by default). Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0_26/source/Makefile.in branches/SAMBA_3_0_26/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-05-23 20:38:14 UTC (rev 23096) +++ branches/SAMBA_3_0/source/Makefile.in 2007-05-23 20:46:07 UTC (rev 23097) @@ -155,7 +155,7 @@ # Note that all executable programs now provide for an optional executable suffix. -SBIN_PROGS = bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ @EXTRA_SBIN_PROGS@ +SBIN_PROGS = bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@ ROOT_SBIN_PROGS = @CIFSMOUNT_PROGS@ @@ -1713,7 +1713,7 @@ @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(DYNEXP) script/tests/timelimit.o -install: installservers installbin @INSTALL_CIFSMOUNT@ installman installscripts installdat installswat installmodules @INSTALL_LIBSMBCLIENT@ @INSTALL_LIBMSRPC@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@ +install: installservers installbin @INSTALL_CIFSMOUNT@ installman installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ @INSTALL_LIBSMBCLIENT@ @INSTALL_LIBMSRPC@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@ install-everything: install installmodules Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-23 20:38:14 UTC (rev 23096) +++ branches/SAMBA_3_0/source/configure.in 2007-05-23 20:46:07 UTC (rev 23097) @@ -338,6 +338,21 @@ m4_include(lib/socket_wrapper/config.m4) + +AC_ARG_ENABLE(swat, +[ --enable-swat Build the SWAT tool (default=yes)], +[ +case $enable_swat in + no) ;; + *) + SWAT_SBIN_TARGETS='bin/swat$(EXEEXT)' + SWAT_INSTALL_TARGETS=installswat + ;; +esac +AC_SUBST(SWAT_SBIN_TARGETS) +AC_SUBST(SWAT_INSTALL_TARGETS) +]) + # # set prefix for 'make test' selftest_prefix=./ Modified: branches/SAMBA_3_0_26/source/Makefile.in === --- branches/SAMBA_3_0_26/source/Makefile.in2007-05-23 20:38:14 UTC (rev 23096) +++ branches/SAMBA_3_0_26/source/Makefile.in2007-05-23 20:46:07 UTC (rev 23097) @@ -148,7 +148,7 @@ # Note that all executable programs now provide for an optional executable suffix. -SBIN_PROGS = bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ @EXTRA_SBIN_PROGS@ +SBIN_PROGS = bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@ ROOT_SBIN_PROGS = @CIFSMOUNT_PROGS@ @@ -1593,7 +1593,7 @@ @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(DYNEXP) script/tests/timelimit.o -install: installservers installbin @INSTALL_CIFSMOUNT@ installman installscripts installdat installswat installmodules @INSTALL_LIBSMBCLIENT@ @INSTALL_LIBMSRPC@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@ +install: installservers installbin @INSTALL_CIFSMOUNT@ installman installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ @INSTALL_LIBSMBCLIENT@ @INSTALL_LIBMSRPC@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@ install-everything: install installmodules Modified: branches/SAMBA_3_0_26/source/configure.in === --- branches/SAMBA_3_0_26/source/configure.in 2007-05-23 20:38:14 UTC (rev 23096) +++ branches/SAMBA_3_0_26/source/configure.in 2007-05-23 20:46:07 UTC (rev 23097) @@ -337,6 +337,21 @@ m4_include(lib/socket_wrapper/config.m4) + +AC_ARG_ENABLE(swat, +[ --enable-swat Build the SWAT tool (default=yes)], +[ +case $enable_swat in + no) ;; + *) + SWAT_SBIN_TARGETS='bin/swat$(EXEEXT)' + SWAT_INSTALL_TARGETS=installswat + ;; +esac +AC_SUBST(SWAT_SBIN_TARGETS) +AC_SUBST(SWAT_INSTALL_TARGETS) +]) + # # set prefix for 'make test' selftest_prefix=./
svn commit: samba r23098 - in branches: SAMBA_3_0/source/modules SAMBA_3_0_26/source/modules
Author: jpeach Date: 2007-05-23 20:48:53 + (Wed, 23 May 2007) New Revision: 23098 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23098 Log: Fix the case of the #include statements so this module can be built on a case-sensitive filesystem. Modified: branches/SAMBA_3_0/source/modules/charset_macosxfs.c branches/SAMBA_3_0_26/source/modules/charset_macosxfs.c Changeset: Modified: branches/SAMBA_3_0/source/modules/charset_macosxfs.c === --- branches/SAMBA_3_0/source/modules/charset_macosxfs.c2007-05-23 20:46:07 UTC (rev 23097) +++ branches/SAMBA_3_0/source/modules/charset_macosxfs.c2007-05-23 20:48:53 UTC (rev 23098) @@ -41,8 +41,8 @@ * See if autoconf has found us the internal headers in some form. */ #if HAVE_COREFOUNDATION_CFSTRINGENCODINGCONVERTER_H -# include Corefoundation/CFStringEncodingConverter.h -# include Corefoundation/CFUnicodePrecomposition.h +# include CoreFoundation/CFStringEncodingConverter.h +# include CoreFoundation/CFUnicodePrecomposition.h # define USE_INTERNAL_API 1 #elif HAVE_CFSTRINGENCODINGCONVERTER_H # include CFStringEncodingConverter.h Modified: branches/SAMBA_3_0_26/source/modules/charset_macosxfs.c === --- branches/SAMBA_3_0_26/source/modules/charset_macosxfs.c 2007-05-23 20:46:07 UTC (rev 23097) +++ branches/SAMBA_3_0_26/source/modules/charset_macosxfs.c 2007-05-23 20:48:53 UTC (rev 23098) @@ -41,8 +41,8 @@ * See if autoconf has found us the internal headers in some form. */ #if HAVE_COREFOUNDATION_CFSTRINGENCODINGCONVERTER_H -# include Corefoundation/CFStringEncodingConverter.h -# include Corefoundation/CFUnicodePrecomposition.h +# include CoreFoundation/CFStringEncodingConverter.h +# include CoreFoundation/CFUnicodePrecomposition.h # define USE_INTERNAL_API 1 #elif HAVE_CFSTRINGENCODINGCONVERTER_H # include CFStringEncodingConverter.h
svn commit: samba r23009 - in branches: SAMBA_3_0/source/utils SAMBA_3_0_26/source/utils
Author: jpeach Date: 2007-05-19 04:23:04 + (Sat, 19 May 2007) New Revision: 23009 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23009 Log: Both contains a strchr_m(server,'/') few lines after replacing all / with \. This patch removes this dead code. Patch from Pascal Terjan [EMAIL PROTECTED] for bug #2313. Modified: branches/SAMBA_3_0/source/utils/smbcacls.c branches/SAMBA_3_0/source/utils/smbcquotas.c branches/SAMBA_3_0_26/source/utils/smbcacls.c branches/SAMBA_3_0_26/source/utils/smbcquotas.c Changeset: Modified: branches/SAMBA_3_0/source/utils/smbcacls.c === --- branches/SAMBA_3_0/source/utils/smbcacls.c 2007-05-19 02:52:14 UTC (rev 23008) +++ branches/SAMBA_3_0/source/utils/smbcacls.c 2007-05-19 04:23:04 UTC (rev 23009) @@ -902,11 +902,8 @@ fstrcpy(server,path+2); share = strchr_m(server,'\\'); if (!share) { - share = strchr_m(server,'/'); - if (!share) { - printf(Invalid argument: %s\n, share); - return -1; - } + printf(Invalid argument: %s\n, share); + return -1; } *share = 0; Modified: branches/SAMBA_3_0/source/utils/smbcquotas.c === --- branches/SAMBA_3_0/source/utils/smbcquotas.c2007-05-19 02:52:14 UTC (rev 23008) +++ branches/SAMBA_3_0/source/utils/smbcquotas.c2007-05-19 04:23:04 UTC (rev 23009) @@ -500,11 +500,8 @@ pstrcpy(server,path+2); share = strchr_m(server,'\\'); if (!share) { - share = strchr_m(server,'/'); - if (!share) { - printf(Invalid argument: %s\n, share); - exit(EXIT_PARSE_ERROR); - } + printf(Invalid argument: %s\n, share); + exit(EXIT_PARSE_ERROR); } *share = 0; Modified: branches/SAMBA_3_0_26/source/utils/smbcacls.c === --- branches/SAMBA_3_0_26/source/utils/smbcacls.c 2007-05-19 02:52:14 UTC (rev 23008) +++ branches/SAMBA_3_0_26/source/utils/smbcacls.c 2007-05-19 04:23:04 UTC (rev 23009) @@ -902,11 +902,8 @@ fstrcpy(server,path+2); share = strchr_m(server,'\\'); if (!share) { - share = strchr_m(server,'/'); - if (!share) { - printf(Invalid argument: %s\n, share); - return -1; - } + printf(Invalid argument: %s\n, share); + return -1; } *share = 0; Modified: branches/SAMBA_3_0_26/source/utils/smbcquotas.c === --- branches/SAMBA_3_0_26/source/utils/smbcquotas.c 2007-05-19 02:52:14 UTC (rev 23008) +++ branches/SAMBA_3_0_26/source/utils/smbcquotas.c 2007-05-19 04:23:04 UTC (rev 23009) @@ -500,11 +500,8 @@ pstrcpy(server,path+2); share = strchr_m(server,'\\'); if (!share) { - share = strchr_m(server,'/'); - if (!share) { - printf(Invalid argument: %s\n, share); - exit(EXIT_PARSE_ERROR); - } + printf(Invalid argument: %s\n, share); + exit(EXIT_PARSE_ERROR); } *share = 0;
svn commit: samba r23010 - in branches: SAMBA_3_0/source/utils SAMBA_3_0_26/source/utils
Author: jpeach Date: 2007-05-19 04:59:00 + (Sat, 19 May 2007) New Revision: 23010 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23010 Log: Make the output of smbcontrol --help match that of smbcontrol help. Bug #3181. Modified: branches/SAMBA_3_0/source/utils/smbcontrol.c branches/SAMBA_3_0_26/source/utils/smbcontrol.c Changeset: Modified: branches/SAMBA_3_0/source/utils/smbcontrol.c === --- branches/SAMBA_3_0/source/utils/smbcontrol.c2007-05-19 04:23:04 UTC (rev 23009) +++ branches/SAMBA_3_0/source/utils/smbcontrol.c2007-05-19 04:59:00 UTC (rev 23010) @@ -1062,11 +1062,11 @@ /* Display usage information */ -static void usage(poptContext *pc) +static void usage(poptContext pc) { int i; - poptPrintHelp(*pc, stderr, 0); + poptPrintHelp(pc, stderr, 0); fprintf(stderr, \n); fprintf(stderr, destination is one of \nmbd\, \smbd\, \winbindd\ or a @@ -1160,6 +1160,29 @@ return False; } +static void smbcontrol_help(poptContext pc, + enum poptCallbackReason preason, + struct poptOption * poption, + const char * parg, + void * pdata) +{ + if (poption-shortName != '?') { + poptPrintUsage(pc, stdout, 0); + } else { + usage(pc); + } + + exit(0); +} + +struct poptOption help_options[] = { + { NULL, '\0', POPT_ARG_CALLBACK, (void *)smbcontrol_help, '\0', + NULL, NULL }, + { help, '?', 0, NULL, '?', Show this help message, NULL }, + { usage, '\0', 0, NULL, 'u', Display brief usage message, NULL }, + { NULL } +} ; + /* Main program */ int main(int argc, const char **argv) @@ -1170,7 +1193,9 @@ struct messaging_context *msg_ctx; static struct poptOption long_options[] = { - POPT_AUTOHELP + /* POPT_AUTOHELP */ + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, help_options, + 0, Help options:, NULL }, { timeout, 't', POPT_ARG_INT, timeout, 't', Set timeout value in seconds, TIMEOUT }, @@ -1191,7 +1216,7 @@ parameters); if (argc == 1) - usage(pc); + usage(pc); while ((opt = poptGetNextOpt(pc)) != -1) { switch(opt) { @@ -1215,7 +1240,7 @@ } if (argc == 1) - usage(pc); + usage(pc); lp_load(dyn_CONFIGFILE,False,False,False,True); Modified: branches/SAMBA_3_0_26/source/utils/smbcontrol.c === --- branches/SAMBA_3_0_26/source/utils/smbcontrol.c 2007-05-19 04:23:04 UTC (rev 23009) +++ branches/SAMBA_3_0_26/source/utils/smbcontrol.c 2007-05-19 04:59:00 UTC (rev 23010) @@ -1062,11 +1062,11 @@ /* Display usage information */ -static void usage(poptContext *pc) +static void usage(poptContext pc) { int i; - poptPrintHelp(*pc, stderr, 0); + poptPrintHelp(pc, stderr, 0); fprintf(stderr, \n); fprintf(stderr, destination is one of \nmbd\, \smbd\, \winbindd\ or a @@ -1160,6 +1160,29 @@ return False; } +static void smbcontrol_help(poptContext pc, + enum poptCallbackReason preason, + struct poptOption * poption, + const char * parg, + void * pdata) +{ + if (poption-shortName != '?') { + poptPrintUsage(pc, stdout, 0); + } else { + usage(pc); + } + + exit(0); +} + +struct poptOption help_options[] = { + { NULL, '\0', POPT_ARG_CALLBACK, (void *)smbcontrol_help, '\0', + NULL, NULL }, + { help, '?', 0, NULL, '?', Show this help message, NULL }, + { usage, '\0', 0, NULL, 'u', Display brief usage message, NULL }, + { NULL } +} ; + /* Main program */ int main(int argc, const char **argv) @@ -1170,7 +1193,9 @@ struct messaging_context *msg_ctx; static struct poptOption long_options[] = { - POPT_AUTOHELP + /* POPT_AUTOHELP */ + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, help_options, + 0, Help options:, NULL }, { timeout, 't', POPT_ARG_INT, timeout, 't', Set timeout value in seconds, TIMEOUT }, @@ -1191,7 +1216,7 @@ parameters); if (argc == 1) - usage(pc); + usage(pc); while ((opt = poptGetNextOpt(pc)) != -1) { switch(opt) { @@ -1215,7 +1240,7 @@ } if (argc == 1) - usage(pc); + usage(pc); lp_load(dyn_CONFIGFILE,False,False,False,True);
svn commit: samba r22952 - in branches/SAMBA_4_0/source/lib/ldb: .
Author: jpeach Date: 2007-05-16 19:23:08 + (Wed, 16 May 2007) New Revision: 22952 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22952 Log: Make sure we look at extra_cflags when building custom targets. Modified: branches/SAMBA_4_0/source/lib/ldb/config.mk Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/config.mk === --- branches/SAMBA_4_0/source/lib/ldb/config.mk 2007-05-16 17:30:00 UTC (rev 22951) +++ branches/SAMBA_4_0/source/lib/ldb/config.mk 2007-05-16 19:23:08 UTC (rev 22952) @@ -149,9 +149,13 @@ # End MODULE ldb_tdb +# NOTE: this rule is broken for some systems when $builddir != $srcdir because +# it hardcodes the use of $. See smb_build/makefile.pm. ./lib/ldb/common/ldb_modules.o: lib/ldb/common/ldb_modules.c Makefile @echo Compiling $ - @$(CC) -Iinclude $(CFLAGS) -Ilib/replace -Ilib/talloc -Ilib/ldb/include $(PICFLAG) -DLDBMODULESDIR=\$(MODULESDIR)/ldb\ -DSHLIBEXT=\$(SHLIBEXT)\ -c $ -o $@ + @$(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] $(CFLAGS) $(PICFLAG) \ + -DLDBMODULESDIR=\$(MODULESDIR)/ldb\ -DSHLIBEXT=\$(SHLIBEXT)\ \ + -c $ -o $@ # Start SUBSYSTEM ldb
svn commit: samba r22955 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-05-16 22:34:58 + (Wed, 16 May 2007) New Revision: 22955 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22955 Log: Disable dependency tracking by default. Modified: branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-16 20:56:39 UTC (rev 22954) +++ branches/SAMBA_3_0/source/configure.in 2007-05-16 22:34:58 UTC (rev 22955) @@ -624,6 +624,12 @@ AM_DEP_TRACK() _AM_DEPENDENCIES(CC) +# As per vl, disable dependency tracking by default until we don't need +# to use make proto' -- jpeach +if test x$enable_dependency_tracking != xyes; then +ifGNUmake='#' +fi + # Figure out the flags to support named structure initializers
svn commit: samba-docs r1114 - in trunk/smbdotconf/filename: .
Author: jpeach Date: 2007-05-15 04:02:34 + (Tue, 15 May 2007) New Revision: 1114 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=1114 Log: Fix default for store dos attributes. Bugzilla #3777. Modified: trunk/smbdotconf/filename/storedosattributes.xml Changeset: Modified: trunk/smbdotconf/filename/storedosattributes.xml === --- trunk/smbdotconf/filename/storedosattributes.xml2007-05-14 14:52:24 UTC (rev 1113) +++ trunk/smbdotconf/filename/storedosattributes.xml2007-05-15 04:02:34 UTC (rev 1114) @@ -16,5 +16,5 @@ extended attributes to work, also extended attributes must be compiled into the Linux kernel. /para /description -value type=defaultyes/value +value type=defaultno/value /samba:parameter
svn commit: samba r22878 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-05-15 04:28:20 + (Tue, 15 May 2007) New Revision: 22878 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22878 Log: Warn in $PATH contains /usr/ucb. Bugzilla #4295. Modified: branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-15 03:49:21 UTC (rev 22877) +++ branches/SAMBA_3_0/source/configure.in 2007-05-15 04:28:20 UTC (rev 22878) @@ -6,6 +6,12 @@ AC_CONFIG_HEADER(include/config.h) AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h]) +case $PATH in +*/usr/ucb*) + AC_MSG_WARN([\$PATH contains /usr/ucb - build errors may follow]) + ;; +esac + SMB_VERSION_STRING=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '' -f2` echo SAMBA VERSION: ${SMB_VERSION_STRING}
svn commit: samba r22879 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-05-15 05:25:10 + (Tue, 15 May 2007) New Revision: 22879 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22879 Log: Tidy the build rules for targets that need the installation paths. Modified: branches/SAMBA_3_0/source/Makefile.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-05-15 04:28:20 UTC (rev 22878) +++ branches/SAMBA_3_0/source/Makefile.in 2007-05-15 05:25:10 UTC (rev 22879) @@ -139,15 +139,19 @@ FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) FLAGS = $(ISA) $(FLAGS5) -I$(srcdir)/lib -D_SAMBA_BUILD_=3 -PASSWD_FLAGS = -DSMB_PASSWD_FILE=\$(SMB_PASSWD_FILE)\ -DPRIVATE_DIR=\$(PRIVATE_DIR)\ -PATH_FLAGS1 = -DCONFIGFILE=\$(CONFIGFILE)\ -DSBINDIR=\$(SBINDIR)\ -PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\$(BINDIR)\ -PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\$(LMHOSTSFILE)\ -PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\$(SWATDIR)\ -DLOCKDIR=\$(LOCKDIR)\ -DPIDDIR=\$(PIDDIR)\ -PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\$(LIBDIR)\ \ - -DLOGFILEBASE=\$(LOGFILEBASE)\ -DSHLIBEXT=\@[EMAIL PROTECTED] -PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\$(CONFIGDIR)\ -PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS) +PATH_FLAGS = -DSMB_PASSWD_FILE=\$(SMB_PASSWD_FILE)\ \ + -DPRIVATE_DIR=\$(PRIVATE_DIR)\ \ + -DCONFIGFILE=\$(CONFIGFILE)\ \ + -DSBINDIR=\$(SBINDIR)\ \ + -DBINDIR=\$(BINDIR)\ \ + -DLMHOSTSFILE=\$(LMHOSTSFILE)\ \ + -DSWATDIR=\$(SWATDIR)\ \ + -DLOCKDIR=\$(LOCKDIR)\ \ + -DPIDDIR=\$(PIDDIR)\ \ + -DLIBDIR=\$(LIBDIR)\ \ + -DLOGFILEBASE=\$(LOGFILEBASE)\ \ + -DSHLIBEXT=\@[EMAIL PROTECTED] \ + -DCONFIGDIR=\$(CONFIGDIR)\ # Note that all executable programs now provide for an optional executable suffix. @@ -1012,8 +1016,12 @@ mkdir $$dir || \ exec false; fi || exec false +# Run a static checker. CHECK_CC = $(CC_CHECKER) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $ -o $@ +# Compile a source file. COMPILE_CC = $(CC) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $ -o $@ +# Compile a source file with the installation paths defined. +COMPILE_CC_PATH = $(CC) -I. -I$(srcdir) $(PATH_FLAGS) $(FLAGS) $(PICFLAG) -c $ -o $@ COMPILE = $(COMPILE_CC) @@ -1069,22 +1077,31 @@ dynconfig.o: dynconfig.c Makefile @echo Compiling $*.c - @$(CC) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/dynconfig.c -o $@ exit 0;\ + @$(COMPILE_CC_PATH) exit 0;\ echo The following command failed: 12;\ - echo $(CC) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/dynconfig.c -o $@ 12;\ - $(CC) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/dynconfig.c -o $@ /dev/null 21 + echo $(COMPILE_CC_PATH) 12;\ + $(COMPILE_CC_PATH) /dev/null 21 lib/pidfile.o: lib/pidfile.c @echo Compiling $*.c - @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/lib/pidfile.c -o $@ + @$(COMPILE_CC_PATH) exit 0;\ + echo The following command failed: 12;\ + echo $(COMPILE_CC_PATH) 12;\ + $(COMPILE_CC_PATH) /dev/null 21 lib/version.o: lib/version.c include/version.h @echo Compiling $*.c - @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/lib/version.c -o $@ + @$(COMPILE_CC_PATH) exit 0;\ + echo The following command failed: 12;\ + echo $(COMPILE_CC_PATH) 12;\ + $(COMPILE_CC_PATH) /dev/null 21 smbd/build_options.o: smbd/build_options.c Makefile include/config.h include/build_env.h include/proto.h @echo Compiling $*.c - @$(CC) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c smbd/build_options.c -o $@ + @$(COMPILE_CC_PATH) exit 0;\ + echo The following command failed: 12;\ + echo $(COMPILE_CC_PATH) 12;\ + $(COMPILE_CC_PATH) /dev/null 21 smbd/build_options.c: include/config.h.in script/mkbuildoptions.awk @echo Generating $@
svn commit: samba r22880 - in branches/SAMBA_3_0_26/source: .
Author: jpeach Date: 2007-05-15 05:38:33 + (Tue, 15 May 2007) New Revision: 22880 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22880 Log: Merger r22877:22879 from SAMBA_3_0. Modified: branches/SAMBA_3_0_26/source/Makefile.in branches/SAMBA_3_0_26/source/configure.in Changeset: Modified: branches/SAMBA_3_0_26/source/Makefile.in === --- branches/SAMBA_3_0_26/source/Makefile.in2007-05-15 05:25:10 UTC (rev 22879) +++ branches/SAMBA_3_0_26/source/Makefile.in2007-05-15 05:38:33 UTC (rev 22880) @@ -132,15 +132,19 @@ FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) FLAGS = $(ISA) $(FLAGS5) -I$(srcdir)/lib -D_SAMBA_BUILD_=3 -PASSWD_FLAGS = -DSMB_PASSWD_FILE=\$(SMB_PASSWD_FILE)\ -DPRIVATE_DIR=\$(PRIVATE_DIR)\ -PATH_FLAGS1 = -DCONFIGFILE=\$(CONFIGFILE)\ -DSBINDIR=\$(SBINDIR)\ -PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\$(BINDIR)\ -PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\$(LMHOSTSFILE)\ -PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\$(SWATDIR)\ -DLOCKDIR=\$(LOCKDIR)\ -DPIDDIR=\$(PIDDIR)\ -PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\$(LIBDIR)\ \ - -DLOGFILEBASE=\$(LOGFILEBASE)\ -DSHLIBEXT=\@[EMAIL PROTECTED] -PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\$(CONFIGDIR)\ -PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS) +PATH_FLAGS = -DSMB_PASSWD_FILE=\$(SMB_PASSWD_FILE)\ \ + -DPRIVATE_DIR=\$(PRIVATE_DIR)\ \ + -DCONFIGFILE=\$(CONFIGFILE)\ \ + -DSBINDIR=\$(SBINDIR)\ \ + -DBINDIR=\$(BINDIR)\ \ + -DLMHOSTSFILE=\$(LMHOSTSFILE)\ \ + -DSWATDIR=\$(SWATDIR)\ \ + -DLOCKDIR=\$(LOCKDIR)\ \ + -DPIDDIR=\$(PIDDIR)\ \ + -DLIBDIR=\$(LIBDIR)\ \ + -DLOGFILEBASE=\$(LOGFILEBASE)\ \ + -DSHLIBEXT=\@[EMAIL PROTECTED] \ + -DCONFIGDIR=\$(CONFIGDIR)\ # Note that all executable programs now provide for an optional executable suffix. @@ -909,6 +913,9 @@ mkdir $$dir || \ exec false; fi || exec false +# Compile a source file with the installation paths defined. +COMPILE_CC_PATH = $(CC) -I. -I$(srcdir) $(PATH_FLAGS) $(FLAGS) $(PICFLAG) -c $ -o $@ + .c.o: @if (: $@ || : $@) /dev/null 21; then rm -f $@; else \ dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi @@ -937,22 +944,31 @@ dynconfig.o: dynconfig.c Makefile @echo Compiling $*.c - @$(CC) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/dynconfig.c -o $@ exit 0;\ + @$(COMPILE_CC_PATH) exit 0;\ echo The following command failed: 12;\ - echo $(CC) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/dynconfig.c -o $@ 12;\ - $(CC) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/dynconfig.c -o $@ /dev/null 21 + echo $(COMPILE_CC_PATH) 12;\ + $(COMPILE_CC_PATH) /dev/null 21 lib/pidfile.o: lib/pidfile.c @echo Compiling $*.c - @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/lib/pidfile.c -o $@ + @$(COMPILE_CC_PATH) exit 0;\ + echo The following command failed: 12;\ + echo $(COMPILE_CC_PATH) 12;\ + $(COMPILE_CC_PATH) /dev/null 21 lib/version.o: lib/version.c include/version.h @echo Compiling $*.c - @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c $(srcdir)/lib/version.c -o $@ + @$(COMPILE_CC_PATH) exit 0;\ + echo The following command failed: 12;\ + echo $(COMPILE_CC_PATH) 12;\ + $(COMPILE_CC_PATH) /dev/null 21 smbd/build_options.o: smbd/build_options.c Makefile include/config.h include/build_env.h include/proto.h @echo Compiling $*.c - @$(CC) $(FLAGS) $(PATH_FLAGS) $(PICFLAG) -c smbd/build_options.c -o $@ + @$(COMPILE_CC_PATH) exit 0;\ + echo The following command failed: 12;\ + echo $(COMPILE_CC_PATH) 12;\ + $(COMPILE_CC_PATH) /dev/null 21 smbd/build_options.c: include/config.h.in script/mkbuildoptions.awk @echo Generating $@ Modified: branches/SAMBA_3_0_26/source/configure.in === --- branches/SAMBA_3_0_26/source/configure.in 2007-05-15 05:25:10 UTC (rev 22879) +++ branches/SAMBA_3_0_26/source/configure.in 2007-05-15 05:38:33 UTC (rev 22880) @@ -6,6 +6,12 @@ AC_CONFIG_HEADER(include/config.h) AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h]) +case $PATH in +*/usr/ucb*) + AC_MSG_WARN([\$PATH contains /usr/ucb - build errors may follow]) + ;; +esac + SMB_VERSION_STRING=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '' -f2` echo SAMBA VERSION: ${SMB_VERSION_STRING}
svn commit: samba r22826 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-05-13 15:45:50 + (Sun, 13 May 2007) New Revision: 22826 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22826 Log: Fix the gettimeofday test that I broke in rev 22821. Modified: branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-13 12:59:42 UTC (rev 22825) +++ branches/SAMBA_3_0/source/configure.in 2007-05-13 15:45:50 UTC (rev 22826) @@ -2216,12 +2216,11 @@ AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[ AC_TRY_LINK([ #include sys/time.h -#include unistd.h], [ -int main() { struct timeval tv; return gettimeofday(tv, NULL);}], +#include unistd.h], [struct timeval tv; return gettimeofday(tv, NULL);], samba_cv_HAVE_GETTIMEOFDAY_TZ=yes, samba_cv_HAVE_GETTIMEOFDAY_TZ=no)]) if test x$samba_cv_HAVE_GETTIMEOFDAY_TZ = xyes; then -AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available]) +AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday takes a tz argument]) fi if test x$samba_cv_WITH_PROFILE = xyes; then
svn commit: samba r22828 - in branches/SAMBA_3_0/source/utils: .
Author: jpeach Date: 2007-05-13 20:51:39 + (Sun, 13 May 2007) New Revision: 22828 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22828 Log: Fix typo. Bugzilla #4589. Modified: branches/SAMBA_3_0/source/utils/pdbedit.c Changeset: Modified: branches/SAMBA_3_0/source/utils/pdbedit.c === --- branches/SAMBA_3_0/source/utils/pdbedit.c 2007-05-13 15:53:59 UTC (rev 22827) +++ branches/SAMBA_3_0/source/utils/pdbedit.c 2007-05-13 20:51:39 UTC (rev 22828) @@ -96,7 +96,7 @@ return 1; } - printf(Importing accout for %s..., user-username); + printf(Importing account for %s..., user-username); if ( !NT_STATUS_IS_OK(out-getsampwnam( out, account, user-username )) ) { status = out-add_sam_account(out, user); } else {
svn commit: samba r22820 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-05-13 04:08:26 + (Sun, 13 May 2007) New Revision: 22820 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22820 Log: Move FAM libraries from smbd to vfs_fam_notify. Should fix bugzilla #4426. Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-05-12 19:53:47 UTC (rev 22819) +++ branches/SAMBA_3_0/source/Makefile.in 2007-05-13 04:08:26 UTC (rev 22820) @@ -1620,7 +1620,7 @@ bin/[EMAIL PROTECTED]@: $(VFS_NOTIFY_FAM_OBJ) @echo Building plugin $@ - @$(SHLD_MODULE) $(VFS_NOTIFY_FAM_OBJ) + @$(SHLD_MODULE) $(VFS_NOTIFY_FAM_OBJ) @SMB_FAM_LIBS@ bin/[EMAIL PROTECTED]@: $(VFS_READAHEAD_OBJ) @echo Building plugin $@ Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-12 19:53:47 UTC (rev 22819) +++ branches/SAMBA_3_0/source/configure.in 2007-05-13 04:08:26 UTC (rev 22820) @@ -2645,13 +2645,13 @@ # On IRIX, libfam requires libC, but other FAM implementations # might not need it. AC_CHECK_LIB(fam, FAMOpen2, -[samba_cv_HAVE_LIBFAM=yes; samba_fam_libs=-lfam], +[samba_cv_HAVE_LIBFAM=yes; SMB_FAM_LIBS=-lfam], [samba_cv_HAVE_LIBFAM=no]) if test x$samba_cv_HAVE_LIBFAM = xno ; then samba_fam_xtra=-lC AC_CHECK_LIB_EXT(fam, samba_fam_xtra, FAMOpen2, -[samba_cv_HAVE_LIBFAM=yes; samba_fam_libs=-lfam -lC], +[samba_cv_HAVE_LIBFAM=yes; SMB_FAM_LIBS=-lfam -lC], [samba_cv_HAVE_LIBFAM=no]) unset samba_fam_xtra fi @@ -2671,6 +2671,8 @@ fi fi +AC_SUBST(SMB_FAM_LIBS) + # # Check for DMAPI interfaces in libdm/libjfsdm/libxsdm @@ -6376,7 +6378,7 @@ # Stuff the smbd-only libraries at the end of the smbd link # path (if we have them). -SMBD_LIBS=$samba_fam_libs $samba_dmapi_libs +SMBD_LIBS=$samba_dmapi_libs AC_SUBST(SMBD_LIBS) AC_OUTPUT(include/stamp-h Makefile script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh)
svn commit: samba r22821 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-05-13 04:38:44 + (Sun, 13 May 2007) New Revision: 22821 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22821 Log: Replace unnecessary AC_TRY_RUN with AC_TRY_LINK. Fixes bug #2287. Modified: branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-13 04:08:26 UTC (rev 22820) +++ branches/SAMBA_3_0/source/configure.in 2007-05-13 04:38:44 UTC (rev 22821) @@ -2214,11 +2214,12 @@ fi AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[ -AC_TRY_RUN([ +AC_TRY_LINK([ #include sys/time.h -#include unistd.h +#include unistd.h], [ int main() { struct timeval tv; return gettimeofday(tv, NULL);}], - samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)]) + samba_cv_HAVE_GETTIMEOFDAY_TZ=yes, + samba_cv_HAVE_GETTIMEOFDAY_TZ=no)]) if test x$samba_cv_HAVE_GETTIMEOFDAY_TZ = xyes; then AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available]) fi
svn commit: samba r22648 - in branches/SAMBA_3_0/source/param: .
Author: jpeach Date: 2007-05-03 16:14:22 + (Thu, 03 May 2007) New Revision: 22648 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22648 Log: Fix comment to match the code. Modified: branches/SAMBA_3_0/source/param/loadparm.c Changeset: Modified: branches/SAMBA_3_0/source/param/loadparm.c === --- branches/SAMBA_3_0/source/param/loadparm.c 2007-05-03 12:29:32 UTC (rev 22647) +++ branches/SAMBA_3_0/source/param/loadparm.c 2007-05-03 16:14:22 UTC (rev 22648) @@ -2577,7 +2577,7 @@ } /*** - Convert a string to uppercase and remove whitespaces. + Canonicalize by converting to lowercase. ***/ static char *canonicalize_servicename(const char *src)
svn commit: samba r22631 - in branches/SAMBA_3_0/source/passdb: .
Author: jpeach Date: 2007-05-01 20:03:44 + (Tue, 01 May 2007) New Revision: 22631 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22631 Log: Remove the possibility of sid_check_is_domain and sid_check_is_in_our_domain getting out of sync. Modified: branches/SAMBA_3_0/source/passdb/machine_sid.c Changeset: Modified: branches/SAMBA_3_0/source/passdb/machine_sid.c === --- branches/SAMBA_3_0/source/passdb/machine_sid.c 2007-05-01 16:49:00 UTC (rev 22630) +++ branches/SAMBA_3_0/source/passdb/machine_sid.c 2007-05-01 20:03:44 UTC (rev 22631) @@ -220,6 +220,5 @@ sid_copy(dom_sid, sid); sid_split_rid(dom_sid, rid); - - return sid_equal(dom_sid, get_global_sam_sid()); + return sid_check_is_domain(dom_sid); }
svn commit: samba r22633 - in branches/SAMBA_3_0/source/nsswitch: .
Author: jpeach Date: 2007-05-01 21:22:55 + (Tue, 01 May 2007) New Revision: 22633 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22633 Log: Fix typo in debug message. Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_sid.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_sid.c === --- branches/SAMBA_3_0/source/nsswitch/winbindd_sid.c 2007-05-01 20:57:54 UTC (rev 22632) +++ branches/SAMBA_3_0/source/nsswitch/winbindd_sid.c 2007-05-01 21:22:55 UTC (rev 22633) @@ -270,7 +270,7 @@ DOM_SID sid; if (!success) { - DEBUG(5, (sid2gid_lookupsid_recv: Could not convert get sid type for %s\n, + DEBUG(5, (sid2gid_lookupsid_recv: Could not get sid type for %s\n, state-request.data.sid)); request_error(state); return;
svn commit: samba r22527 - in branches/SAMBA_3_0/docs: .
Author: jpeach Date: 2007-04-26 17:36:19 + (Thu, 26 Apr 2007) New Revision: 22527 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22527 Log: note the svn location of samba-docs on svnanon.samba.org Modified: branches/SAMBA_3_0/docs/README-NOW Changeset: Modified: branches/SAMBA_3_0/docs/README-NOW === --- branches/SAMBA_3_0/docs/README-NOW 2007-04-26 17:23:33 UTC (rev 22526) +++ branches/SAMBA_3_0/docs/README-NOW 2007-04-26 17:36:19 UTC (rev 22527) @@ -7,3 +7,5 @@ See http://svn.samba.org/samba/subversion.html for details on accessing Samba svn trees. +For anonymous access to samba-docs, point svn here: +svn://svnanon.samba.org/samba-docs/trunk
svn commit: samba r22507 - in branches/SAMBA_3_0/source: . nsswitch
Author: jpeach Date: 2007-04-24 18:19:13 + (Tue, 24 Apr 2007) New Revision: 22507 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22507 Log: Wrap the method of obtaining sockets to listen on. Added: branches/SAMBA_3_0/source/nsswitch/winbindd_sockinit.c Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/nsswitch/winbindd.c branches/SAMBA_3_0/source/nsswitch/winbindd_util.c Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-04-24 18:02:23 UTC (rev 22506) +++ branches/SAMBA_3_0/source/Makefile.in 2007-04-24 18:19:13 UTC (rev 22507) @@ -811,6 +811,7 @@ WINBINDD_OBJ1 = \ nsswitch/winbindd.o \ + nsswitch/winbindd_sockinit.o \ nsswitch/winbindd_user.o \ nsswitch/winbindd_group.o \ nsswitch/winbindd_util.o \ Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.c === --- branches/SAMBA_3_0/source/nsswitch/winbindd.c 2007-04-24 18:02:23 UTC (rev 22506) +++ branches/SAMBA_3_0/source/nsswitch/winbindd.c 2007-04-24 18:19:13 UTC (rev 22507) @@ -26,7 +26,6 @@ #include includes.h #include winbindd.h -#include smb_launchd.h #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND @@ -34,7 +33,6 @@ BOOL opt_nocache = False; extern BOOL override_logfile; -static BOOL unlink_winbindd_socket = True; struct event_context *winbind_event_context(void) { @@ -121,15 +119,8 @@ static void terminate(void) { - pstring path; - /* Remove socket file */ - if (unlink_winbindd_socket) { - pstr_sprintf(path, %s/%s, -WINBINDD_SOCKET_DIR, WINBINDD_SOCKET_NAME); - unlink(path); - } - + winbindd_release_sockets(); idmap_close(); trustdom_cache_shutdown(); @@ -719,43 +710,6 @@ return False; } -static BOOL winbindd_init_sockets(int *public_sock, int *priv_sock, - int *idle_timeout_sec) -{ - struct smb_launch_info linfo; - - if (smb_launchd_checkin_names(linfo, WinbindPublicPipe, - WinbindPrivilegedPipe, NULL)) { - if (linfo.num_sockets != 2) { - DEBUG(0, (invalid launchd configuration, - expected 2 sockets but got %d\n, - linfo.num_sockets)); - return False; - } - - *public_sock = linfo.socket_list[0]; - *priv_sock = linfo.socket_list[1]; - *idle_timeout_sec = linfo.idle_timeout_secs; - - unlink_winbindd_socket = False; - - smb_launchd_checkout(linfo); - return True; - } else { - *public_sock = open_winbindd_socket(); - *priv_sock = open_winbindd_priv_socket(); - *idle_timeout_sec = -1; - - if (*public_sock == -1 || *priv_sock == -1) { - DEBUG(0, (failed to open winbindd pipes: %s\n, - errno ? strerror(errno) : unknown error)); - return False; - } - - return True; - } -} - /* Process incoming clients on listen_sock. We use a tricky non-blocking, non-forking, non-threaded model which allows us to handle many simultaneous connections while remaining impervious to many denial of Added: branches/SAMBA_3_0/source/nsswitch/winbindd_sockinit.c === --- branches/SAMBA_3_0/source/nsswitch/winbindd_sockinit.c 2007-04-24 18:02:23 UTC (rev 22506) +++ branches/SAMBA_3_0/source/nsswitch/winbindd_sockinit.c 2007-04-24 18:19:13 UTC (rev 22507) @@ -0,0 +1,127 @@ +/* + Unix SMB/CIFS implementation. + Copyright (C) Tim Potter 2000-2001 + Copyright (C) 2001 by Martin Pool [EMAIL PROTECTED] + Copyright (C) James Peach 2007 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include includes.h +#include winbindd.h +#include smb_launchd.h + +#undef DBGC_CLASS +#define DBGC_CLASS
svn commit: samba r22495 - in branches/SAMBA_3_0/source: . smbd
Author: jpeach Date: 2007-04-23 22:17:06 + (Mon, 23 Apr 2007) New Revision: 22495 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22495 Log: Create wrapper to hide the details of obtaining a set of sockets to listen on. Added: branches/SAMBA_3_0/source/smbd/sockinit.c Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/smbd/server.c Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-04-23 21:56:23 UTC (rev 22494) +++ branches/SAMBA_3_0/source/Makefile.in 2007-04-23 22:17:06 UTC (rev 22495) @@ -498,7 +498,8 @@ smbd/change_trust_pw.o smbd/fake_file.o \ smbd/quotas.o smbd/ntquotas.o $(AFS_OBJ) smbd/msdfs.o \ $(AFS_SETTOKEN_OBJ) smbd/aio.o smbd/statvfs.o \ - smbd/dmapi.o lib/launchd.o $(MANGLE_OBJ) @VFS_STATIC@ + smbd/dmapi.o lib/launchd.o smbd/sockinit.o \ + $(MANGLE_OBJ) @VFS_STATIC@ SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \ $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(SECRETS_OBJ) \ Modified: branches/SAMBA_3_0/source/smbd/server.c === --- branches/SAMBA_3_0/source/smbd/server.c 2007-04-23 21:56:23 UTC (rev 22494) +++ branches/SAMBA_3_0/source/smbd/server.c 2007-04-23 22:17:06 UTC (rev 22495) @@ -22,7 +22,6 @@ */ #include includes.h -#include smb_launchd.h static_decl_rpc; @@ -298,153 +297,6 @@ return num_children max_processes; } -static int init_sockets_smbd(const char *smb_ports, - int fd_listenset[FD_SETSIZE]) -{ - int num_interfaces = iface_count(); - char * ports; - int num_sockets = 0; - int i, s; - - /* use a reasonable default set of ports - listing on 445 and 139 */ - if (!smb_ports) { - ports = lp_smb_ports(); - if (!ports || !*ports) { - ports = smb_xstrdup(SMB_PORTS); - } else { - ports = smb_xstrdup(ports); - } - } else { - ports = smb_xstrdup(smb_ports); - } - - if (lp_interfaces() lp_bind_interfaces_only()) { - /* We have been given an interfaces line, and been - told to only bind to those interfaces. Create a - socket per interface and bind to only these. - */ - - /* Now open a listen socket for each of the - interfaces. */ - for(i = 0; i num_interfaces; i++) { - struct in_addr *ifip = iface_n_ip(i); - fstring tok; - const char *ptr; - - if(ifip == NULL) { - DEBUG(0,(init_sockets_smbd: interface %d has NULL IP address !\n, i)); - continue; - } - - for (ptr=ports; next_token(ptr, tok, \t,, sizeof(tok)); ) { - unsigned port = atoi(tok); - if (port == 0) { - continue; - } - s = fd_listenset[num_sockets] = open_socket_in(SOCK_STREAM, port, 0, ifip-s_addr, True); - if(s == -1) - return 0; - - /* ready to listen */ - set_socket_options(s,SO_KEEPALIVE); - set_socket_options(s,user_socket_options); - - /* Set server socket to non-blocking for the accept. */ - set_blocking(s,False); - - if (listen(s, SMBD_LISTEN_BACKLOG) == -1) { - DEBUG(0,(listen: %s\n,strerror(errno))); - close(s); - return 0; - } - - num_sockets++; - if (num_sockets = FD_SETSIZE) { - DEBUG(0,(init_sockets_smbd: Too many sockets to bind to\n)); - return 0; - } - } - } - } else { - /* Just bind to 0.0.0.0 - accept connections - from anywhere. */ - - fstring tok; - const char *ptr; - - num_interfaces = 1; - - for (ptr=ports; next_token(ptr, tok, \t,, sizeof(tok)); ) { - unsigned port = atoi(tok); - if (port == 0
svn commit: samba r22441 - in branches/SAMBA_3_0/source: . m4
Author: jpeach Date: 2007-04-22 03:17:31 + (Sun, 22 Apr 2007) New Revision: 22441 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22441 Log: Add automatic dependency tracking. The dependency generation is toolchain independent, but since there's no portable method for doing makefile includes, we can actually use the dependencies with GNU make. It's easy to add this for other makes, but I don't have any to test. This also moves as much m4 as possible into the m4 directory where no-one has to look at it. AFAICT, there's no way to hide depcomp in there too, which is unfortunate. Added: branches/SAMBA_3_0/source/depcomp branches/SAMBA_3_0/source/m4/ branches/SAMBA_3_0/source/m4/aclocal.m4 branches/SAMBA_3_0/source/m4/check_gnu_make.m4 branches/SAMBA_3_0/source/m4/cond.m4 branches/SAMBA_3_0/source/m4/depend.m4 branches/SAMBA_3_0/source/m4/depout.m4 branches/SAMBA_3_0/source/m4/lead-dot.m4 branches/SAMBA_3_0/source/m4/make.m4 branches/SAMBA_3_0/source/m4/substnot.m4 Removed: branches/SAMBA_3_0/source/aclocal.m4 Modified: branches/SAMBA_3_0/source/ branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/autogen.sh branches/SAMBA_3_0/source/configure.in Changeset: Sorry, the patch is too large (2071 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22441
svn commit: samba r22413 - in branches/SAMBA_3_0/source: . modules
Author: jpeach Date: 2007-04-20 16:07:16 + (Fri, 20 Apr 2007) New Revision: 22413 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22413 Log: Simplify the build rules for plugin modules. Add support for per-platform exports files. Fix the shared library build pf pdb_ldap. Added: branches/SAMBA_3_0/source/modules/exports.darwin Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-04-20 12:23:36 UTC (rev 22412) +++ branches/SAMBA_3_0/source/Makefile.in 2007-04-20 16:07:16 UTC (rev 22413) @@ -26,6 +26,11 @@ [EMAIL PROTECTED]@ @LDFLAGS@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ @LDFLAGS@ + +# The MODULE_EXPORTS variable conatins the platform-specific linker flags +# needed to restrict the exports for VFS, IDMAP, RPC and PASSDB modules. [EMAIL PROTECTED]@ + [EMAIL PROTECTED]@ @LDFLAGS@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ @@ -1320,85 +1325,75 @@ libmsrpc: $(LIBMSRPC) libaddns: $(LIBADDNS) +# Linker command to link a RPC, VFS, AUTH, CHARSET or PASSDB module. +SHLD_MODULE = $(SHLD) $(LDSHFLAGS) $(MODULE_EXPORTS) \ + -o $@ @[EMAIL PROTECTED] [EMAIL PROTECTED] + bin/[EMAIL PROTECTED]@: proto_exists $(RPC_LSA_OBJ) @echo Linking $@ + @$(SHLD_MODULE) $(RPC_LSA_OBJ) @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_OBJ) -lc \ @[EMAIL PROTECTED] [EMAIL PROTECTED] bin/[EMAIL PROTECTED]@: proto_exists $(RPC_SAMR_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SAMR_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_SAMR_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_UNIXINFO_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_UNIXINFO_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_UNIXINFO_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_EPMAPPER_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_EPMAPPER_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_SVC_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_SVC_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVC_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_SVC_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_SVCCTL_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVCCTL_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_SVCCTL_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_NTSVCS_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_NTSVCS_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_NTSVCS_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_WKS_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_WKS_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_WKS_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_NETLOG_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_NETLOG_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_NETLOG_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_REG_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_REG_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_REG_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_INITSHUTDOWN_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_INITSHUTDOWN_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_INITSHUTDOWN_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_LSA_DS_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_DS_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_LSA_DS_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_SPOOLSS_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SPOOLSS_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_SPOOLSS_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_EVENTLOG_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_EVENTLOG_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_EVENTLOG_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_DFS_OBJ) @echo Linking $@ - @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_DFS_OBJ) -lc \ - @[EMAIL PROTECTED] [EMAIL PROTECTED] + @$(SHLD_MODULE) $(RPC_DFS_OBJ) bin/[EMAIL PROTECTED]@: proto_exists $(RPC_ECHO_OBJ) @echo Linking
svn commit: samba r22415 - in branches: SAMBA_3_0_25/source/lib/replace/test SAMBA_4_0/source/lib/replace/test
Author: jpeach Date: 2007-04-20 17:55:36 + (Fri, 20 Apr 2007) New Revision: 22415 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22415 Log: Remove test directory once we are finished. Merge -r 22393:22394 from SAMBA_3_0. Modified: branches/SAMBA_3_0_25/source/lib/replace/test/os2_delete.c branches/SAMBA_4_0/source/lib/replace/test/os2_delete.c Changeset: Modified: branches/SAMBA_3_0_25/source/lib/replace/test/os2_delete.c === --- branches/SAMBA_3_0_25/source/lib/replace/test/os2_delete.c 2007-04-20 17:13:52 UTC (rev 22414) +++ branches/SAMBA_3_0_25/source/lib/replace/test/os2_delete.c 2007-04-20 17:55:36 UTC (rev 22415) @@ -111,5 +111,7 @@ rmdir(TESTDIR) == 0 || FAILED(rmdir); + system(rm -rf TESTDIR); + return test_readdir_os2_delete_ret; } Modified: branches/SAMBA_4_0/source/lib/replace/test/os2_delete.c === --- branches/SAMBA_4_0/source/lib/replace/test/os2_delete.c 2007-04-20 17:13:52 UTC (rev 22414) +++ branches/SAMBA_4_0/source/lib/replace/test/os2_delete.c 2007-04-20 17:55:36 UTC (rev 22415) @@ -111,5 +111,7 @@ rmdir(TESTDIR) == 0 || FAILED(rmdir); + system(rm -rf TESTDIR); + return test_readdir_os2_delete_ret; }
svn commit: samba r22416 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-04-20 18:12:07 + (Fri, 20 Apr 2007) New Revision: 22416 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22416 Log: Remove precompiled headers on clean. Modified: branches/SAMBA_3_0/source/Makefile.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in === --- branches/SAMBA_3_0/source/Makefile.in 2007-04-20 17:55:36 UTC (rev 22415) +++ branches/SAMBA_3_0/source/Makefile.in 2007-04-20 18:12:07 UTC (rev 22416) @@ -1021,11 +1021,13 @@ $(CC) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $ -o $@ /dev/null 21 @BROKEN_CC@-mv `echo $@ | sed 's%^.*/%%g'` $@ +PRECOMPILED_HEADER = $(builddir)/include/includes.h.gch + # this adds support for precompiled headers. To use it, install a snapshot # of gcc-3.4 and run 'make pch' before you do the main build. pch: proto_exists - rm -f $(builddir)/include/includes.h.gch - $(CC) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $(srcdir)/include/includes.h -o $(builddir)/include/includes.h.gch + rm -f $(PRECOMPILED_HEADER) + $(CC) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $(srcdir)/include/includes.h -o $(PRECOMPILED_HEADER) # These dependencies are only approximately correct: we want to make # sure Samba's paths are updated if ./configure is re-run. Really it @@ -1857,6 +1859,7 @@ TOPFILES=dynconfig.o clean: delheaders python_clean + -rm -f $(PRECOMPILED_HEADER) -rm -f core */*~ *~ */*.o */*/*.o */*/*/*.o \ */[EMAIL PROTECTED]@ */*/[EMAIL PROTECTED]@ */*/*/[EMAIL PROTECTED]@ \ $(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(ROOT_SBIN_PROGS) \
svn commit: samba r22417 - in branches/SAMBA_3_0/source: include libsmb nmbd nsswitch smbd
Author: jpeach Date: 2007-04-20 18:34:33 + (Fri, 20 Apr 2007) New Revision: 22417 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22417 Log: Refactor the various daemon run-mode options to make the semantics of the various flags explicit. Modified: branches/SAMBA_3_0/source/include/popt_common.h branches/SAMBA_3_0/source/libsmb/namequery.c branches/SAMBA_3_0/source/nmbd/nmbd.c branches/SAMBA_3_0/source/nmbd/nmbd_lmhosts.c branches/SAMBA_3_0/source/nsswitch/winbindd.c branches/SAMBA_3_0/source/smbd/server.c Changeset: Modified: branches/SAMBA_3_0/source/include/popt_common.h === --- branches/SAMBA_3_0/source/include/popt_common.h 2007-04-20 18:12:07 UTC (rev 22416) +++ branches/SAMBA_3_0/source/include/popt_common.h 2007-04-20 18:34:33 UTC (rev 22417) @@ -50,6 +50,17 @@ int signing_state; }; +enum smb_server_mode { + /* Daemonize and manage our own sockets */ + SERVER_MODE_DAEMON, + /* Don't daemonize or manage sockets */ + SERVER_MODE_INETD, + /* Don't daemonize, but do manage sockets */ + SERVER_MODE_FOREGROUND, + /* Run in the foreground, log to stdout, don't fork children */ + SERVER_MODE_INTERACTIVE +}; + extern struct user_auth_info cmdline_auth_info; #endif /* _POPT_COMMON_H */ Modified: branches/SAMBA_3_0/source/libsmb/namequery.c === --- branches/SAMBA_3_0/source/libsmb/namequery.c2007-04-20 18:12:07 UTC (rev 22416) +++ branches/SAMBA_3_0/source/libsmb/namequery.c2007-04-20 18:34:33 UTC (rev 22417) @@ -651,7 +651,7 @@ Start parsing the lmhosts file. */ -XFILE *startlmhosts(char *fname) +XFILE *startlmhosts(const char *fname) { XFILE *fp = x_fopen(fname,O_RDONLY, 0); if (!fp) { Modified: branches/SAMBA_3_0/source/nmbd/nmbd.c === --- branches/SAMBA_3_0/source/nmbd/nmbd.c 2007-04-20 18:12:07 UTC (rev 22416) +++ branches/SAMBA_3_0/source/nmbd/nmbd.c 2007-04-20 18:34:33 UTC (rev 22417) @@ -33,15 +33,6 @@ extern BOOL override_logfile; -/* are we running as a daemon ? */ -static BOOL is_daemon; - -/* fork or run in foreground ? */ -static BOOL Fork = True; - -/* log to standard output ? */ -static BOOL log_stdout; - /* have we found LanMan clients yet? */ BOOL found_lm_clients = False; @@ -578,7 +569,7 @@ Open the socket communication. */ -static BOOL open_sockets(BOOL isdaemon, int port) +static BOOL open_sockets(enum smb_server_mode server_mode, int port) { /* * The sockets opened here will be used to receive broadcast @@ -588,12 +579,13 @@ * now deprecated. */ - if ( isdaemon ) + if ( server_mode == SERVER_MODE_INETD ) { + ClientNMB = 0; + } else { ClientNMB = open_socket_in(SOCK_DGRAM, port, 0, interpret_addr(lp_socket_address()), True); - else - ClientNMB = 0; + } ClientDGRAM = open_socket_in(SOCK_DGRAM, DGRAM_PORT, 3, interpret_addr(lp_socket_address()), @@ -622,15 +614,20 @@ int main(int argc, const char *argv[]) { pstring logfile; - static BOOL opt_interactive; poptContext pc; - static char *p_lmhosts = dyn_LMHOSTSFILE; - static BOOL no_process_group = False; + const char *p_lmhosts = dyn_LMHOSTSFILE; + BOOL no_process_group = False; + BOOL log_stdout = False; + enum smb_server_mode server_mode = SERVER_MODE_DAEMON; + struct poptOption long_options[] = { POPT_AUTOHELP - {daemon, 'D', POPT_ARG_VAL, is_daemon, True, Become a daemon(default) }, - {interactive, 'i', POPT_ARG_VAL, opt_interactive, True, Run interactive (not a daemon) }, - {foreground, 'F', POPT_ARG_VAL, Fork, False, Run daemon in foreground (for daemontools etc) }, + {daemon, 'D', POPT_ARG_VAL, server_mode, SERVER_MODE_DAEMON, + Become a daemon(default) }, + {interactive, 'i', POPT_ARG_VAL, server_mode, + SERVER_MODE_INTERACTIVE, Run interactive (not a daemon) }, + {foreground, 'F', POPT_ARG_VAL, server_mode, + SERVER_MODE_FOREGROUND, Run daemon in foreground (for daemontools etc) }, {no-process-group, 0, POPT_ARG_VAL, no_process_group, True, Don't create a new process group }, {log-stdout, 'S', POPT_ARG_VAL, log_stdout, True, Log to stdout }, {hosts, 'H', POPT_ARG_STRING, p_lmhosts, 'H', Load a netbios hosts file}, @@ -680,12 +677,11 @@ BlockSignals(True, SIGUSR2); #endif
svn commit: samba r22418 - in branches/SAMBA_3_0/source: . include lib nsswitch smbd
Author: jpeach Date: 2007-04-20 21:09:44 + (Fri, 20 Apr 2007) New Revision: 22418 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22418 Log: Support running under launchd. We abstract the method of obtaining sockets to listen on a little, because in the launchd case these are provided for us. We also add an idle timeout so that a daemon can exit after a period of inactivity. Added: branches/SAMBA_3_0/source/include/smb_launchd.h branches/SAMBA_3_0/source/lib/launchd.c Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0/source/nsswitch/winbindd.c branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h branches/SAMBA_3_0/source/smbd/connection.c branches/SAMBA_3_0/source/smbd/server.c Changeset: Sorry, the patch is too large (914 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22418
svn commit: samba r22419 - in branches/SAMBA_3_0/source: . tests
Author: jpeach Date: 2007-04-20 21:31:04 + (Fri, 20 Apr 2007) New Revision: 22419 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22419 Log: Update configure so that we only need one copy of os2_delete.c Removed: branches/SAMBA_3_0/source/tests/os2_delete.c Modified: branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-04-20 21:09:44 UTC (rev 22418) +++ branches/SAMBA_3_0/source/configure.in 2007-04-20 21:31:04 UTC (rev 22419) @@ -2813,7 +2813,12 @@ fi AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[ - AC_TRY_RUN([#include ${srcdir-.}/tests/os2_delete.c], + AC_TRY_RUN([ +#include ${srcdir-.}/lib/replace/test/os2_delete.c +int main(void) { +return test_readdir_os2_delete(); +} +], [samba_cv_HAVE_BROKEN_READDIR=no], [samba_cv_HAVE_BROKEN_READDIR=yes], [samba_cv_HAVE_BROKEN_READDIR=assuming not])]) @@ -2822,7 +2827,10 @@ AC_CACHE_CHECK([for replacing readdir],samba_cv_REPLACE_READDIR,[ AC_TRY_RUN([ #include ${srcdir-.}/lib/repdir.c -#include ${srcdir-.}/tests/os2_delete.c], +#include ${srcdir-.}/lib/replace/test/os2_delete.c +int main(void) { +return test_readdir_os2_delete(); +], samba_cv_REPLACE_READDIR=yes,samba_cv_REPLACE_READDIR=no)]) fi Deleted: branches/SAMBA_3_0/source/tests/os2_delete.c === --- branches/SAMBA_3_0/source/tests/os2_delete.c2007-04-20 21:09:44 UTC (rev 22418) +++ branches/SAMBA_3_0/source/tests/os2_delete.c2007-04-20 21:31:04 UTC (rev 22419) @@ -1,107 +0,0 @@ -/* - test readdir/unlink pattern that OS/2 uses - [EMAIL PROTECTED] July 2005 -*/ - -#include stdio.h -#include stdlib.h -#include sys/stat.h -#include unistd.h -#include sys/types.h -#include dirent.h -#include errno.h -#include string.h -#include fcntl.h - -#define NUM_FILES 700 -#define READDIR_SIZE 100 -#define DELETE_SIZE 4 - -#define TESTDIR test.dir - -#define FAILED(d) (fprintf(stderr, Failed for %s - %s\n, d, strerror(errno)), exit(1), 1) - -#ifndef MIN -#define MIN(a,b) ((a)(b)?(a):(b)) -#endif - -static void cleanup(void) -{ - /* I'm a lazy bastard */ - system(rm -rf TESTDIR); - mkdir(TESTDIR, 0700) == 0 || FAILED(mkdir); -} - -static void create_files() -{ - int i; - for (i=0;iNUM_FILES;i++) { - char fname[40]; - sprintf(fname, TESTDIR /test%u.txt, i); - close(open(fname, O_CREAT|O_RDWR, 0600)) == 0 || FAILED(close); - } -} - -static int os2_delete(DIR *d) -{ - off_t offsets[READDIR_SIZE]; - int i, j; - struct dirent *de; - char names[READDIR_SIZE][30]; - - /* scan, remembering offsets */ - for (i=0, de=readdir(d); -de i READDIR_SIZE; -de=readdir(d), i++) { - offsets[i] = telldir(d); - strcpy(names[i], de-d_name); - } - - if (i == 0) { - return 0; - } - - /* delete the first few */ - for (j=0; jMIN(i, DELETE_SIZE); j++) { - char fname[40]; - sprintf(fname, TESTDIR /%s, names[j]); - unlink(fname) == 0 || FAILED(unlink); - } - - /* seek to just after the deletion */ - seekdir(d, offsets[j-1]); - - /* return number deleted */ - return j; -} - -int main(void) -{ - int total_deleted = 0; - DIR *d; - struct dirent *de; - - cleanup(); - create_files(); - - d = opendir(TESTDIR); - - /* skip past . and .. */ - de = readdir(d); - strcmp(de-d_name, .) == 0 || FAILED(match .); - de = readdir(d); - strcmp(de-d_name, ..) == 0 || FAILED(match ..); - - while (1) { - int n = os2_delete(d); - if (n == 0) break; - total_deleted += n; - } - closedir(d); - - printf(Deleted %d files of %d\n, total_deleted, NUM_FILES); - - rmdir(TESTDIR) == 0 || FAILED(rmdir); - - return 0; -}
svn commit: samba r22394 - in branches/SAMBA_3_0/source/lib/replace/test: .
Author: jpeach Date: 2007-04-19 23:47:55 + (Thu, 19 Apr 2007) New Revision: 22394 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22394 Log: Remove test directory once we are finished. Modified: branches/SAMBA_3_0/source/lib/replace/test/os2_delete.c Changeset: Modified: branches/SAMBA_3_0/source/lib/replace/test/os2_delete.c === --- branches/SAMBA_3_0/source/lib/replace/test/os2_delete.c 2007-04-19 23:25:37 UTC (rev 22393) +++ branches/SAMBA_3_0/source/lib/replace/test/os2_delete.c 2007-04-19 23:47:55 UTC (rev 22394) @@ -111,5 +111,7 @@ rmdir(TESTDIR) == 0 || FAILED(rmdir); + system(rm -rf TESTDIR); + return test_readdir_os2_delete_ret; }
svn commit: samba r22127 - in branches/SAMBA_3_0/source: .
Author: jpeach Date: 2007-04-07 21:13:29 + (Sat, 07 Apr 2007) New Revision: 22127 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22127 Log: Wrap the AC_TRY_RUN detection for Linux getgrouplist in an AC_CACHE_CHECK, so it can be cross-compiled. Modified: branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-04-07 19:35:13 UTC (rev 22126) +++ branches/SAMBA_3_0/source/configure.in 2007-04-07 21:13:29 UTC (rev 22127) @@ -1378,23 +1378,33 @@ case $host_os in *linux*) # glibc = 2.3.2 has a broken getgrouplist - AC_TRY_RUN([ +AC_CACHE_CHECK([for a broken Linux getgrouplist API], + linux_getgrouplist_ok, + [ + AC_TRY_RUN([ #include unistd.h #include sys/utsname.h -main() { - /* glibc up to 2.3 has a broken getgrouplist */ + + main() { + /* glibc up to 2.3 has a broken getgrouplist */ #if defined(__GLIBC__) defined(__GLIBC_MINOR__) - int libc_major = __GLIBC__; - int libc_minor = __GLIBC_MINOR__; + int libc_major = __GLIBC__; + int libc_minor = __GLIBC_MINOR__; - if (libc_major 2) - exit(1); - if ((libc_major == 2) (libc_minor = 3)) - exit(1); + if (libc_major 2) + exit(1); + if ((libc_major == 2) (libc_minor = 3)) + exit(1); #endif - exit(0); -} -], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no]) + exit(0); + } + + ], + [linux_getgrouplist_ok=yes], + [linux_getgrouplist_ok=no], + [linux_getgrouplist_ok=cross]) + ]) + if test x$linux_getgrouplist_ok = xyes; then AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist]) fi
svn commit: samba r22107 - in branches: SAMBA_3_0/source/lib SAMBA_3_0_25/source/lib
Author: jpeach Date: 2007-04-06 19:17:15 + (Fri, 06 Apr 2007) New Revision: 22107 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22107 Log: Fix typo. Modified: branches/SAMBA_3_0/source/lib/fault.c branches/SAMBA_3_0_25/source/lib/fault.c Changeset: Modified: branches/SAMBA_3_0/source/lib/fault.c === --- branches/SAMBA_3_0/source/lib/fault.c 2007-04-06 19:09:53 UTC (rev 22106) +++ branches/SAMBA_3_0/source/lib/fault.c 2007-04-06 19:17:15 UTC (rev 22107) @@ -156,7 +156,7 @@ * turned on in smb.conf and the relevant daemon is not restarted. */ if (!lp_enable_core_files()) { - DEBUG(0, (Exiting on internal error (core file administratively disabled\n)); + DEBUG(0, (Exiting on internal error (core file administratively disabled)\n)); exit(1); } Modified: branches/SAMBA_3_0_25/source/lib/fault.c === --- branches/SAMBA_3_0_25/source/lib/fault.c2007-04-06 19:09:53 UTC (rev 22106) +++ branches/SAMBA_3_0_25/source/lib/fault.c2007-04-06 19:17:15 UTC (rev 22107) @@ -156,7 +156,7 @@ * turned on in smb.conf and the relevant daemon is not restarted. */ if (!lp_enable_core_files()) { - DEBUG(0, (Exiting on internal error (core file administratively disabled\n)); + DEBUG(0, (Exiting on internal error (core file administratively disabled)\n)); exit(1); }
svn commit: samba r22094 - in branches/SAMBA_3_0/source/modules: .
Author: jpeach Date: 2007-04-05 19:49:29 + (Thu, 05 Apr 2007) New Revision: 22094 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22094 Log: Clarify that SMB_VFS_LOCK should not be used to get lock status. Modified: branches/SAMBA_3_0/source/modules/vfs_default.c Changeset: Modified: branches/SAMBA_3_0/source/modules/vfs_default.c === --- branches/SAMBA_3_0/source/modules/vfs_default.c 2007-04-05 12:36:10 UTC (rev 22093) +++ branches/SAMBA_3_0/source/modules/vfs_default.c 2007-04-05 19:49:29 UTC (rev 22094) @@ -781,6 +781,9 @@ { BOOL result; + /* SMB_VFS_GETLOCK should be used to query lock status. */ + SMB_ASSERT(op != SMB_F_GETLK); + START_PROFILE(syscall_fcntl_lock); result = fcntl_lock(fd, op, offset, count, type); END_PROFILE(syscall_fcntl_lock);
svn commit: samba r22027 - in branches/SAMBA_4_0/source: .
Author: jpeach Date: 2007-04-02 17:02:52 + (Mon, 02 Apr 2007) New Revision: 22027 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22027 Log: Allow separate build and source directories. Don't follow symlinks when copying hemidal_build since this leads to traversal loops. Modified: branches/SAMBA_4_0/source/configure.ac Changeset: Modified: branches/SAMBA_4_0/source/configure.ac === --- branches/SAMBA_4_0/source/configure.ac 2007-04-02 12:52:08 UTC (rev 22026) +++ branches/SAMBA_4_0/source/configure.ac 2007-04-02 17:02:52 UTC (rev 22027) @@ -78,6 +78,10 @@ AC_SUBST(ac_default_prefix) +for d in build/smb_build bin include ; do +test -d ${builddir}/$d || AS_MKDIR_P(${builddir}/$d) +done + echo configure: creating build/smb_build/config.pm cat build/smb_build/config.pmCEOF # config.pm - Autogenerate by configure. DO NOT EDIT! @@ -107,15 +111,30 @@ CEOF AC_OUTPUT_COMMANDS( -[test x$ac_abs_srcdir != x$ac_abs_builddir - (cd $builddir; - test -d heimdal || cp -r $srcdir/heimdal $builddir/ - test -d heimdal_build || cp -r $srcdir/heimdal_build $builddir/ - test -d build || samba_builddir=$builddir samba_srcdir=$srcdir $PERL $srcdir/script/buildtree.pl - test -f $builddir/include/smb.h || cp $srcdir/include/smb.h $builddir/include +[ +test x$ac_abs_srcdir != x$ac_abs_builddir ( + cd $builddir; + # NOTE: We *must* use -R so we don't follow symlinks (at least on BSD + # systems). + test -d heimdal || cp -R $srcdir/heimdal $builddir/ + test -d heimdal_build || cp -R $srcdir/heimdal_build $builddir/ + test -d build || builddir=$builddir \ + srcdir=$srcdir \ + $PERL ${srcdir}/script/buildtree.pl ) -$PERL -I${builddir} -I${srcdir} -I${srcdir}/build ${srcdir}/build/smb_build/main.pl || exit $?],[ -PERL=$PERL;export PERL;export srcdir; export builddir; + +$PERL -I${builddir} -I${builddir}/build \ +-I${srcdir} -I${srcdir}/build \ +${srcdir}/build/smb_build/main.pl || exit $? +], +[ +srcdir=$srcdir +builddir=$builddir +PERL=$PERL + +export PERL +export srcdir +export builddir ]) AC_OUTPUT
svn commit: samba r22028 - in branches/SAMBA_4_0/source/lib/ldb/include: .
Author: jpeach Date: 2007-04-02 17:03:30 + (Mon, 02 Apr 2007) New Revision: 22028 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22028 Log: Fix include path for the srcidr != builddir case. Modified: branches/SAMBA_4_0/source/lib/ldb/include/includes.h Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/include/includes.h === --- branches/SAMBA_4_0/source/lib/ldb/include/includes.h2007-04-02 17:02:52 UTC (rev 22027) +++ branches/SAMBA_4_0/source/lib/ldb/include/includes.h2007-04-02 17:03:30 UTC (rev 22028) @@ -25,7 +25,7 @@ #include system/filesys.h #include system/network.h #include system/time.h -#include talloc.h +#include talloc/talloc.h #include ldb.h #include ldb_errors.h #include ldb_private.h
svn commit: samba r22029 - in branches/SAMBA_4_0/source: . lib/registry lib/replace pidl/lib/Parse/Pidl
Author: jpeach Date: 2007-04-02 17:06:14 + (Mon, 02 Apr 2007) New Revision: 22029 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22029 Log: Make sure we respect $srcdir correctly for the srcdir != builddir case. Modified: branches/SAMBA_4_0/source/lib/registry/config.mk branches/SAMBA_4_0/source/lib/replace/samba.m4 branches/SAMBA_4_0/source/main.mk branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm Changeset: Modified: branches/SAMBA_4_0/source/lib/registry/config.mk === --- branches/SAMBA_4_0/source/lib/registry/config.mk2007-04-02 17:03:30 UTC (rev 22028) +++ branches/SAMBA_4_0/source/lib/registry/config.mk2007-04-02 17:06:14 UTC (rev 22029) @@ -20,7 +20,7 @@ $(srcdir)/lib/registry/reg_backend_nt4.c: lib/registry/tdr_regf.c lib/registry/tdr_regf.h: lib/registry/tdr_regf.c lib/registry/tdr_regf.c: $(srcdir)/lib/registry/regf.idl - @CPP=$(CPP) $(PERL) $(srcdir)/pidl/pidl $(PIDL_ARGS) \ + @CPP=$(CPP) srcdir=$(srcdir) $(PERL) $(srcdir)/pidl/pidl $(PIDL_ARGS) \ --header --outputdir=lib/registry \ --tdr-parser -- $(srcdir)/lib/registry/regf.idl Modified: branches/SAMBA_4_0/source/lib/replace/samba.m4 === --- branches/SAMBA_4_0/source/lib/replace/samba.m4 2007-04-02 17:03:30 UTC (rev 22028) +++ branches/SAMBA_4_0/source/lib/replace/samba.m4 2007-04-02 17:06:14 UTC (rev 22029) @@ -3,8 +3,16 @@ SMB_EXT_LIB(LIBREPLACE_EXT, [${LIBDL}]) SMB_ENABLE(LIBREPLACE_EXT) +# remove leading ./ LIBREPLACE_DIR=`echo ${libreplacedir} |sed -e 's/^\.\///g'` +# remove leading srcdir .. we are looking for the relative +# path within the samba source tree or wherever libreplace is. +# We need to make sure the object is not forced to end up in +# the source directory because we might be using a separate +# build directory. +LIBREPLACE_DIR=`echo ${LIBREPLACE_DIR} | sed -e s|^$srcdir/||g` + LIBREPLACE_OBJS= for obj in ${LIBREPLACEOBJ}; do LIBREPLACE_OBJS=${LIBREPLACE_OBJS} ${LIBREPLACE_DIR}/${obj} Modified: branches/SAMBA_4_0/source/main.mk === --- branches/SAMBA_4_0/source/main.mk 2007-04-02 17:03:30 UTC (rev 22028) +++ branches/SAMBA_4_0/source/main.mk 2007-04-02 17:06:14 UTC (rev 22029) @@ -283,7 +283,11 @@ check:: test -SELFTEST = $(srcdir)/script/tests/selftest.pl --prefix=${selftest_prefix} --builddir=$(builddir) --srcdir=$(srcdir) --expected-failures=samba4-knownfail --skip=samba4-skip $(TEST_OPTIONS) +SELFTEST = $(srcdir)/script/tests/selftest.pl --prefix=${selftest_prefix} \ +--builddir=$(builddir) --srcdir=$(srcdir) \ +--expected-failures=$(srcdir)/samba4-knownfail \ +--skip=$(srcdir)/samba4-skip \ +$(TEST_OPTIONS) test: all libraries $(SELFTEST) $(DEFAULT_TEST_OPTIONS) $(TESTS) --immediate Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm === --- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm 2007-04-02 17:03:30 UTC (rev 22028) +++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm 2007-04-02 17:06:14 UTC (rev 22029) @@ -18,8 +18,10 @@ sub is_intree() { - return 4 if (-f kdc/kdc.c); - return 3 if (-f include/smb.h); + my $srcdir = $ENV{srcdir}; + $srcdir = $srcdir ? $srcdir/ : ; + return 4 if (-f ${srcdir}kdc/kdc.c); + return 3 if (-f ${srcdir}include/smb.h); return 0; }
svn commit: samba r22030 - in branches/SAMBA_4_0/source/build/smb_build: .
Author: jpeach Date: 2007-04-02 17:08:21 + (Mon, 02 Apr 2007) New Revision: 22030 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22030 Log: Simplify include parsing for config.mk files, making sure we get it right for the srcdir != builddir case. Emit some comment lines that can be used to figure out which parts of the Makefile output is generated from which config files. Modified: branches/SAMBA_4_0/source/build/smb_build/config_mk.pm Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/config_mk.pm === --- branches/SAMBA_4_0/source/build/smb_build/config_mk.pm 2007-04-02 17:06:14 UTC (rev 22029) +++ branches/SAMBA_4_0/source/build/smb_build/config_mk.pm 2007-04-02 17:08:21 UTC (rev 22030) @@ -114,6 +114,64 @@ @parsed_files = (); +sub _read_config_file +{ + use File::Basename; + use Cwd; + + my $srcdir = shift; + my $builddir = shift; + my $filename = shift; + my @dirlist; + + # We need to change our working directory because config.mk files can + # give shell commands as the argument to include. These shell + # commands can take arguments that are relative paths and we don't have + # a way of sensibly rewriting these. + my $cwd = getcwd; + chomp $cwd; + + if ($srcdir ne $builddir) { + # Push the builddir path on the front, so we prefer builddir + # to srcdir when the file exists in both. + @dirlist = ($builddir, $srcdir); + } else { + @dirlist = ($srcdir); + } + + foreach my $d (@dirlist) { + my @lines; + my $basedir; + + chdir $cwd; + chdir $d; + + # We need to catch the exception from open in the case where + # the filename is actually a shell pipeline. Why is this + # different to opening a regular file? Because this is perl! + eval { + open(CONFIG_MK, ./$filename); + @lines = CONFIG_MK; + close(CONFIG_MK); + }; + + chdir $cwd; + next unless (@lines); + + # I blame abartlett for this crazy hack -- jpeach + if ($filename =~ /\|$/) { + $basedir = $builddir; + } else { + $basedir = dirname($filename); + } + $basedir =~ s!^($builddir|$srcdir)[/]!!; + return ($filename, $basedir, @lines); + } + + chdir $cwd; + return; +} + ### # The parsing function which parses the file # @@ -131,46 +189,28 @@ my $section = GLOBAL; my $makefile = ; - my $parsing_file = $filename; - my $retry_parsing_file = undef; my $basedir; - $ENV{samba_builddir} = $builddir; - $ENV{samba_srcdir} = $srcdir; + my $parsing_file; + my @lines; - if (($srcdir ne .) or ($builddir ne .)) { - $parsing_file = $builddir./.$filename; - $retry_parsing_file = $srcdir./.$filename; - } + $ENV{builddir} = $builddir; + $ENV{srcdir} = $srcdir; - if (open(CONFIG_MK, $parsing_file)) { - $retry_parsing_file = undef; - } else { - die(Can't open $parsing_file) unless defined($retry_parsing_file); - } + ($parsing_file, $basedir, @lines) = + _read_config_file($srcdir, $builddir, $filename); - if (defined($retry_parsing_file)) { - if (open(CONFIG_MK, $parsing_file)) { - $parsing_file = $retry_parsing_file; - $retry_parsing_file = undef; - } else { - die(Can't open neither '$parsing_file' nor '$retry_parsing_file'\n); - } - } + die ($0: can't open '$filename') + unless ($parsing_file and $basedir and @lines); -if ($parsing_file =~ /\|$/) { - $basedir = $builddir; - } else { - $basedir = dirname($filename); - push (@parsed_files, $parsing_file); - } - - my @lines = CONFIG_MK; - close(CONFIG_MK); - my $line = ; my $prev = ; + # Emit a line that lets us match up final makefile output with the + # corresponding input files. The curlies are so you can match the + # BEGIN/END pairs in a text editor. + $makefile .= # BEGIN{ $parsing_file\n; + foreach (@lines) { $linenum++; @@ -230,6 +270,8 @@ die($parsing_file:$linenum: Bad line while parsing $parsing_file); } + $makefile .= # }END $parsing_file\n; + foreach my $section (keys %{$result}) { my ($type
svn commit: samba r22031 - in branches/SAMBA_4_0/source/build/smb_build: .
Author: jpeach Date: 2007-04-02 17:11:36 + (Mon, 02 Apr 2007) New Revision: 22031 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22031 Log: Make sure we rewrite the include directives in CFLAGS to contain paths from builddir and srcdir. builddir has precedence. Modified: branches/SAMBA_4_0/source/build/smb_build/cflags.pm branches/SAMBA_4_0/source/build/smb_build/main.pl Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/cflags.pm === --- branches/SAMBA_4_0/source/build/smb_build/cflags.pm 2007-04-02 17:08:21 UTC (rev 22030) +++ branches/SAMBA_4_0/source/build/smb_build/cflags.pm 2007-04-02 17:11:36 UTC (rev 22031) @@ -6,9 +6,12 @@ package cflags; use strict; -sub create_cflags($$) +sub create_cflags() { - my ($CTX, $file) = @_; + my $CTX = shift; + my $srcdir = shift; + my $builddir = shift; + my $file = shift; open(CFLAGS_TXT,$file) || die (Can't open `$file'\n); @@ -18,7 +21,18 @@ next unless defined ($key-{FINAL_CFLAGS}); next unless ($#{$key-{FINAL_CFLAGS}} = 0); - my $cflags = join(' ', @{$key-{FINAL_CFLAGS}}); + # Rewrite CFLAGS so that both the source and the build + # directories are in the path. + my $cflags = ; + foreach my $flag (@{$key-{FINAL_CFLAGS}}) { + my $dir; + if (($dir) = ($flag =~ /^-I([^\/].*)$/)) { + $cflags .= -I$builddir/$dir; + $cflags .= -I$srcdir/$dir; + } else { + $cflags .= $flag; + } + } foreach (@{$key-{OBJ_LIST}}) { my $ofile = $_; Modified: branches/SAMBA_4_0/source/build/smb_build/main.pl === --- branches/SAMBA_4_0/source/build/smb_build/main.pl 2007-04-02 17:08:21 UTC (rev 22030) +++ branches/SAMBA_4_0/source/build/smb_build/main.pl 2007-04-02 17:11:36 UTC (rev 22031) @@ -71,8 +71,10 @@ $mkenv-write(Makefile); header::create_smb_build_h($OUTPUT, include/build.h); -cflags::create_cflags($OUTPUT, extra_cflags.txt); +cflags::create_cflags($OUTPUT, $config::config{srcdir}, + $config::config{builddir}, extra_cflags.txt); + summary::show($OUTPUT, \%config::config); 1;
svn commit: samba r22034 - in branches/SAMBA_4_0/source/script: .
Author: jpeach Date: 2007-04-02 17:17:40 + (Mon, 02 Apr 2007) New Revision: 22034 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22034 Log: Use builddir and srcdir instead on samba_builddir and samba_srcdir. Modified: branches/SAMBA_4_0/source/script/buildtree.pl Changeset: Modified: branches/SAMBA_4_0/source/script/buildtree.pl === --- branches/SAMBA_4_0/source/script/buildtree.pl 2007-04-02 17:16:14 UTC (rev 22033) +++ branches/SAMBA_4_0/source/script/buildtree.pl 2007-04-02 17:17:40 UTC (rev 22034) @@ -15,8 +15,8 @@ *name = *File::Find::name; *dir= *File::Find::dir; *prune = *File::Find::prune; -my $builddir = abs_path($ENV{samba_builddir}); -my $srcdir = abs_path($ENV{samba_srcdir}); +my $builddir = abs_path($ENV{builddir}); +my $srcdir = abs_path($ENV{srcdir}); sub wanted;
svn commit: samba r22035 - in branches/SAMBA_4_0/source/build: m4 smb_build
Author: jpeach Date: 2007-04-02 17:23:23 + (Mon, 02 Apr 2007) New Revision: 22035 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22035 Log: Introduce HOSTLD which is needed to link the asn1 compiler when cross compiling. Modified: branches/SAMBA_4_0/source/build/m4/check_ld.m4 branches/SAMBA_4_0/source/build/smb_build/makefile.pm Changeset: Modified: branches/SAMBA_4_0/source/build/m4/check_ld.m4 === --- branches/SAMBA_4_0/source/build/m4/check_ld.m4 2007-04-02 17:17:40 UTC (rev 22034) +++ branches/SAMBA_4_0/source/build/m4/check_ld.m4 2007-04-02 17:23:23 UTC (rev 22035) @@ -36,6 +36,17 @@ SONAMEFLAG= PICFLAG= +# allow for --with-hostld=gcc +AC_ARG_WITH(hostld,[ --with-hostld=linkerchoose host linker], +[HOSTLD=$withval], +[ +if test z$cross_compiling = yes; then + HOSTLD='$(HOSTCC)' +else + HOSTLD='$(LD)' +fi +]) + AC_MSG_CHECKING([ability to build shared libraries]) # and these are for particular systems @@ -144,6 +155,8 @@ AC_MSG_CHECKING([LDFLAGS]) AC_MSG_RESULT([$LDFLAGS]) +AC_SUBST(HOSTLD) + AC_MSG_CHECKING([STLD]) AC_MSG_RESULT([$STLD]) AC_MSG_CHECKING([STLD_FLAGS]) Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm === --- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2007-04-02 17:17:40 UTC (rev 22034) +++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2007-04-02 17:23:23 UTC (rev 22035) @@ -141,6 +141,9 @@ LD=$self-{config}-{LD} LDFLAGS=$self-{config}-{LDFLAGS} -L$libdir +HOSTLD=$self-{config}-{HOSTLD} +# It's possible that we ought to have HOSTLD_LDFLAGS as well + STLD=$self-{config}-{STLD} STLD_FLAGS=$self-{config}-{STLD_FLAGS} @@ -387,11 +390,23 @@ $self-output( __EOD__ $installdir/$ctx-{BINARY}: \$($ctx-{TYPE}_$ctx-{NAME}_DEPEND_LIST) \$($ctx-{TYPE}_$ctx-{NAME}_FULL_OBJ_LIST) [EMAIL PROTECTED] Linking \$\@ +__EOD__ + ); + + if ($ctx-{USE_HOSTCC} =~ m/yes/i) { + $self-output( __EOD__ + [EMAIL PROTECTED](HOSTLD) \$(LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ + \$\($ctx-{TYPE}_$ctx-{NAME}_LINK_FLAGS) +__EOD__ + ); + } else { + $self-output( __EOD__ [EMAIL PROTECTED](LD) \$(LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ \$\($ctx-{TYPE}_$ctx-{NAME}_LINK_FLAGS) __EOD__ -); + ); + } } sub Manpage($$)
svn commit: samba r22036 - in branches/SAMBA_4_0/source/build/smb_build: .
Author: jpeach Date: 2007-04-02 17:26:18 + (Mon, 02 Apr 2007) New Revision: 22036 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22036 Log: Make sure both srcdir and builddir are in VPATH. Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm === --- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2007-04-02 17:23:23 UTC (rev 22035) +++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2007-04-02 17:26:18 UTC (rev 22036) @@ -71,11 +71,13 @@ prefix = $self-{config}-{prefix} exec_prefix = $self-{config}-{exec_prefix} selftest_prefix = $self-{config}-{selftest_prefix} + +builddir = $self-{config}-{builddir} srcdir = $self-{config}-{srcdir} -VPATH = \$(srcdir):heimdal_build:heimdal/lib/asn1:heimdal/lib/krb5:heimdal/lib/gssapi:heimdal/lib/hdb:heimdal/lib/roken:heimdal/lib/des -builddir = $self-{config}-{builddir} datarootdir = $self-{config}-{datarootdir} +VPATH = \$(builddir):\$(srcdir):heimdal_build:heimdal/lib/asn1:heimdal/lib/krb5:heimdal/lib/gssapi:heimdal/lib/hdb:heimdal/lib/roken:heimdal/lib/des + BASEDIR = $self-{config}-{prefix} BINDIR = $self-{config}-{bindir} SBINDIR = $self-{config}-{sbindir} @@ -329,7 +331,7 @@ $self-_prepare_list($ctx, FULL_OBJ_LIST); push(@{$self-{all_objs}}, \$($ctx-{TYPE}_$ctx-{NAME}_FULL_OBJ_LIST)); - + $self-output( __EOD__ # $ctx-{TARGET_STATIC_LIBRARY}: \$($ctx-{TYPE}_$ctx-{NAME}_FULL_OBJ_LIST)
svn commit: samba r22037 - in branches/SAMBA_4_0/source/build/smb_build: .
Author: jpeach Date: 2007-04-02 17:29:03 + (Mon, 02 Apr 2007) New Revision: 22037 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22037 Log: Make sure STATICDIR exists before linking a static archive. Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm === --- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2007-04-02 17:26:18 UTC (rev 22036) +++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2007-04-02 17:29:03 UTC (rev 22037) @@ -337,6 +337,7 @@ $ctx-{TARGET_STATIC_LIBRARY}: \$($ctx-{TYPE}_$ctx-{NAME}_FULL_OBJ_LIST) [EMAIL PROTECTED] Linking \$@ [EMAIL PROTECTED] -f \$@ + [EMAIL PROTECTED] -p $ctx-{STATICDIR} [EMAIL PROTECTED](STLD) \$(STLD_FLAGS) \$@ \$($ctx-{TYPE}_$ctx-{NAME}_FULL_OBJ_LIST) __EOD__
svn commit: samba r22040 - in branches/SAMBA_4_0/source: .
Author: jpeach Date: 2007-04-02 18:43:31 + (Mon, 02 Apr 2007) New Revision: 22040 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22040 Log: Use $ to specify the immediate prerequisit instead of $*. This is needed for VPATH to find the correct files when srcdir != builddir. This checkin is a test to see which platforms this change will break. Modified: branches/SAMBA_4_0/source/main.mk Changeset: Modified: branches/SAMBA_4_0/source/main.mk === --- branches/SAMBA_4_0/source/main.mk 2007-04-02 18:42:56 UTC (rev 22039) +++ branches/SAMBA_4_0/source/main.mk 2007-04-02 18:43:31 UTC (rev 22040) @@ -377,23 +377,27 @@ # if it also exists. So better use $* which is foo/bar # and append .c manually to get foo/bar.c # +# But if srcdir != builddir, $* does not contain the filename +# that was found be traversing VPATH. So we are back to $. +# -- jpeach +# # Run a static analysis checker CHECK = $(CC_CHECKER) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $*.c -o $@ +$(CFLAGS) $(PICFLAG) -c $ -o $@ # Run the configured compiler COMPILE = $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $*.c -o $@ +$(CFLAGS) $(PICFLAG) -c $ -o $@ # Run the compiler for the build host HCOMPILE = $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(HOSTCC_CFLAGS) -c $*.c -o $@ +$(HOSTCC_CFLAGS) -c $ -o $@ # Precompile headers PCHCOMPILE = @$(CC) -Ilib/replace \ `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $*.c -o $@ +$(CFLAGS) $(PICFLAG) -c $ -o $@ .c.o: @if test -n $(CC_CHECKER); then \
svn commit: samba r22046 - in branches/SAMBA_4_0/source: .
Author: jpeach Date: 2007-04-02 20:19:00 + (Mon, 02 Apr 2007) New Revision: 22046 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22046 Log: Rever r22040, which breaks the build on FreeBSD 5.4 (BSD make). Modified: branches/SAMBA_4_0/source/main.mk Changeset: Modified: branches/SAMBA_4_0/source/main.mk === --- branches/SAMBA_4_0/source/main.mk 2007-04-02 20:10:21 UTC (rev 22045) +++ branches/SAMBA_4_0/source/main.mk 2007-04-02 20:19:00 UTC (rev 22046) @@ -377,27 +377,23 @@ # if it also exists. So better use $* which is foo/bar # and append .c manually to get foo/bar.c # -# But if srcdir != builddir, $* does not contain the filename -# that was found be traversing VPATH. So we are back to $. -# -- jpeach -# # Run a static analysis checker CHECK = $(CC_CHECKER) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $ -o $@ +$(CFLAGS) $(PICFLAG) -c $*.c -o $@ # Run the configured compiler COMPILE = $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $ -o $@ +$(CFLAGS) $(PICFLAG) -c $*.c -o $@ # Run the compiler for the build host HCOMPILE = $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(HOSTCC_CFLAGS) -c $ -o $@ +$(HOSTCC_CFLAGS) -c $*.c -o $@ # Precompile headers PCHCOMPILE = @$(CC) -Ilib/replace \ `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $ -o $@ +$(CFLAGS) $(PICFLAG) -c $*.c -o $@ .c.o: @if test -n $(CC_CHECKER); then \
svn commit: samba r22047 - in branches/SAMBA_4_0/source/build/smb_build: .
Author: jpeach Date: 2007-04-02 21:21:56 + (Mon, 02 Apr 2007) New Revision: 22047 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22047 Log: Move suffix rules into smb_build. Enable $ if we are building with GNU Make. This lets GNU Make users bild with $srcdir != $builddir. Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm === --- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2007-04-02 20:19:00 UTC (rev 22046) +++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2007-04-02 21:21:56 UTC (rev 22047) @@ -46,6 +46,7 @@ $self-output(default: all\n\n); $self-_prepare_path_vars(); + $self-_prepare_suffix_rules(); $self-_prepare_compiler_linker(); if (!$self-{automatic_deps}) { @@ -104,6 +105,57 @@ ); } +sub _prepare_suffix_rules($) +{ + my ($self) = @_; + my $first_prereq = '$*.c'; + + if ($self-{config}-{GNU_MAKE} eq 'yes') { + $first_prereq = '$'; + } + + $self-output( __EOD__ +# Dependencies command +DEPENDS = \$(CC) -M -MG -MP -MT \$(:.c=.o) -MT \$@ \\ +`\$(PERL) \$(srcdir)/script/cflags.pl [EMAIL PROTECTED] \\ +\$(CFLAGS) $first_prereq-o \$@ +# Dependencies for host objects +HDEPENDS = \$(CC) -M -MG -MP -MT \$(:.c=.ho) -MT \$@ \\ +`\$(PERL) \$(srcdir)/script/cflags.pl [EMAIL PROTECTED] \\ +\$(HOSTCC_CFLAGS) $first_prereq -o \$@ +# Dependencies for precompiled headers +PCHDEPENDS = \$(CC) -M -MG -MT include/includes.h.gch -MT \$@ \\ +\$(CFLAGS) $first_prereq -o \$@ + +# \$ is broken in older BSD versions: +# when \$@ is foo/bar.o, \$ could be torture/foo/bar.c +# if it also exists. So better use \$* which is foo/bar +# and append .c manually to get foo/bar.c +# +# If we have GNU Make, it is safe to use \$, which also lets +# building with \$srcdir != \$builddir work. + +# Run a static analysis checker +CHECK = \$(CC_CHECKER) `\$(PERL) \$(srcdir)/script/cflags.pl [EMAIL PROTECTED] \\ +\$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@ + +# Run the configured compiler +COMPILE = \$(CC) `\$(PERL) \$(srcdir)/script/cflags.pl [EMAIL PROTECTED] \\ +\$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@ + +# Run the compiler for the build host +HCOMPILE = \$(HOSTCC) `\$(PERL) \$(srcdir)/script/cflags.pl [EMAIL PROTECTED] \\ +\$(HOSTCC_CFLAGS) -c $first_prereq -o \$@ + +# Precompile headers +PCHCOMPILE = @\$(CC) -Ilib/replace \\ +`\$(PERL) \$(srcdir)/script/cflags.pl [EMAIL PROTECTED] \\ +\$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@ + +__EOD__ +); +} + sub _prepare_compiler_linker($) { my ($self) = @_;
svn commit: samba r22048 - in branches/SAMBA_4_0/source: .
Author: jpeach Date: 2007-04-02 21:26:32 + (Mon, 02 Apr 2007) New Revision: 22048 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22048 Log: Sigh. Commit the other half of r22047. Modified: branches/SAMBA_4_0/source/main.mk Changeset: Modified: branches/SAMBA_4_0/source/main.mk === --- branches/SAMBA_4_0/source/main.mk 2007-04-02 21:21:56 UTC (rev 22047) +++ branches/SAMBA_4_0/source/main.mk 2007-04-02 21:26:32 UTC (rev 22048) @@ -349,16 +349,6 @@ .SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .$(SHLIBEXT) .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml .8 .8.xml .ho .idl .hd -# Dependencies command -DEPENDS = $(CC) -M -MG -MP -MT $(:.c=.o) -MT $@ \ -`$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] $(CFLAGS) $ -o $@ -# Dependencies for host objects -HDEPENDS = $(CC) -M -MG -MP -MT $(:.c=.ho) -MT $@ \ -`$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] $(HOSTCC_CFLAGS) $ -o $@ -# Dependencies for precompiled headers -PCHDEPENDS = $(CC) -M -MG -MT include/includes.h.gch -MT $@ \ -$(CFLAGS) $ -o $@ - .c.d: @echo Generating dependencies for $ @$(DEPENDS) @@ -371,30 +361,6 @@ @echo Generating dependencies for $ @$(PCHDEPENDS) -# -# $ is broken in older BSD versions: -# when $@ is foo/bar.o, $ could be torture/foo/bar.c -# if it also exists. So better use $* which is foo/bar -# and append .c manually to get foo/bar.c -# - -# Run a static analysis checker -CHECK = $(CC_CHECKER) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $*.c -o $@ - -# Run the configured compiler -COMPILE = $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $*.c -o $@ - -# Run the compiler for the build host -HCOMPILE = $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(HOSTCC_CFLAGS) -c $*.c -o $@ - -# Precompile headers -PCHCOMPILE = @$(CC) -Ilib/replace \ -`$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \ -$(CFLAGS) $(PICFLAG) -c $*.c -o $@ - .c.o: @if test -n $(CC_CHECKER); then \ echo Checking $ with '$(CC_CHECKER)'; \
svn commit: samba r21949 - in branches/SAMBA_4_0/source: libcli/raw torture/unix
Author: jpeach Date: 2007-03-23 19:24:21 + (Fri, 23 Mar 2007) New Revision: 21949 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21949 Log: After discussion with the Apple and Linux client maintainers, changing the FindFirst response for the UNIX_INFO2 level to include a length field before the name. The name is not required to be null terminated. the lenght field does not count any null. Modified: branches/SAMBA_4_0/source/libcli/raw/interfaces.h branches/SAMBA_4_0/source/libcli/raw/rawsearch.c branches/SAMBA_4_0/source/torture/unix/unix_info2.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/raw/interfaces.h === --- branches/SAMBA_4_0/source/libcli/raw/interfaces.h 2007-03-23 19:12:08 UTC (rev 21948) +++ branches/SAMBA_4_0/source/libcli/raw/interfaces.h 2007-03-23 19:24:21 UTC (rev 21949) @@ -2576,7 +2576,7 @@ NTTIME create_time; uint32_t file_flags; uint32_t flags_mask; - const char *name; + struct smb_wire_string name; } unix_info2; }; Modified: branches/SAMBA_4_0/source/libcli/raw/rawsearch.c === --- branches/SAMBA_4_0/source/libcli/raw/rawsearch.c2007-03-23 19:12:08 UTC (rev 21948) +++ branches/SAMBA_4_0/source/libcli/raw/rawsearch.c2007-03-23 19:24:21 UTC (rev 21949) @@ -607,7 +607,12 @@ return ofs; case RAW_SEARCH_DATA_UNIX_INFO2: - if (blob-length (116 + 8 + 1)) { + /* 8 - size of ofs + file_index +* 116 - size of unix_info2 +* 4 - size of name length +* 2 - . is the shortest name +*/ + if (blob-length (116 + 8 + 4 + 2)) { return -1; } @@ -630,11 +635,16 @@ data-unix_info2.file_flags = IVAL(blob-data, 116); data-unix_info2.flags_mask = IVAL(blob-data, 120); - /* There is no length field for this name but we know it's null terminated. */ - len = smbcli_blob_pull_unix_string(tree-session, mem_ctx, blob, - data-unix_info2.name, 116 + 8, 0); + /* There is a 4 byte length field for this name. The length +* does not include the NULL terminator. +*/ + len = smbcli_blob_pull_string(tree-session, mem_ctx, blob, + data-unix_info2.name, + 8 + 116, /* offset to length */ + 8 + 116 + 4, /* offset to string */ + 0); - if (ofs != 0 ofs (116 + 8 + len)) { + if (ofs != 0 ofs (8 + 116 + 4 + len)) { return -1; } Modified: branches/SAMBA_4_0/source/torture/unix/unix_info2.c === --- branches/SAMBA_4_0/source/torture/unix/unix_info2.c 2007-03-23 19:12:08 UTC (rev 21948) +++ branches/SAMBA_4_0/source/torture/unix/unix_info2.c 2007-03-23 19:24:21 UTC (rev 21949) @@ -298,7 +298,7 @@ if (info2.file_flags smb_fmask) { torture_assert_ntstatus_equal(torture, status, NT_STATUS_OK, - setting UNIX_INFO2 flags); + setting valid UNIX_INFO2 flag); if (!query_path_info2(mem_ctx, torture, cli, fname, info2)) { @@ -314,7 +314,7 @@ */ torture_assert_ntstatus_equal(torture, status, NT_STATUS_INVALID_PARAMETER, - setting UNIX_INFO2 flags); + setting invalid UNIX_INFO2 flag); } }
svn commit: samba r21950 - in branches/SAMBA_3_0/source: . modules script/tests smbd
Author: jpeach Date: 2007-03-23 19:31:11 + (Fri, 23 Mar 2007) New Revision: 21950 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21950 Log: After discussion with the Apple and Linux client maintainers, changing the FindFirst response for the UNIX_INFO2 level to include a length field before the name. The name is not required to be null terminated. The length field does not count any null. Also add call to chflags(2) in the default VFS module so that this will work be default on BSD-derived platform. Add UNIX-INFO2 test to the build farm to get some non-BSD coverage. Jeremy and Jerry, please review for inclusion in 3.0.25. Modified: branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0/source/modules/vfs_default.c branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh branches/SAMBA_3_0/source/smbd/trans2.c Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-03-23 19:24:21 UTC (rev 21949) +++ branches/SAMBA_3_0/source/configure.in 2007-03-23 19:31:11 UTC (rev 21950) @@ -1225,7 +1225,8 @@ AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strerror chown fchown chmod fchmod chroot link mknod mknod64) AC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtouq __strtoull) -AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync memset strlcpy strlcat setpgid) +AC_CHECK_FUNCS(fstat strchr utime utimes chflags) +AC_CHECK_FUNCS(getrlimit fsync memset strlcpy strlcat setpgid) AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid) AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent) AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf realpath) Modified: branches/SAMBA_3_0/source/modules/vfs_default.c === --- branches/SAMBA_3_0/source/modules/vfs_default.c 2007-03-23 19:24:21 UTC (rev 21949) +++ branches/SAMBA_3_0/source/modules/vfs_default.c 2007-03-23 19:31:11 UTC (rev 21950) @@ -905,8 +905,12 @@ static int vfswrap_chflags(vfs_handle_struct *handle, const char *path, int flags) { +#ifdef HAVE_CHFLAGS + return chflags(path, flags); +#else errno = ENOSYS; return -1; +#endif } static size_t vfswrap_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc) Modified: branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh === --- branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh 2007-03-23 19:24:21 UTC (rev 21949) +++ branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh 2007-03-23 19:31:11 UTC (rev 21950) @@ -36,11 +36,16 @@ rpc=RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC rpc=$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC +# NOTE: to enable the UNIX-WHOAMI test, we need to change the default share +# config to allow guest access. I'm not sure whether this would break other +# tests, so leaving it alone for now -- jpeach +unix=UNIX-INFO2 + if test x$RUN_FROM_BUILD_FARM = xyes; then rpc=$rpc RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME fi -tests=$base $raw $rpc +tests=$base $raw $rpc $unix skipped=BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE BASE-OPENATTR BASE-TCONDEV skipped=$skipped RAW-ACLS RAW-COMPOSITE RAW-CONTEXT RAW-EAS Modified: branches/SAMBA_3_0/source/smbd/trans2.c === --- branches/SAMBA_3_0/source/smbd/trans2.c 2007-03-23 19:24:21 UTC (rev 21949) +++ branches/SAMBA_3_0/source/smbd/trans2.c 2007-03-23 19:31:11 UTC (rev 21950) @@ -1601,13 +1601,17 @@ DEBUG(10,(get_lanman2_dir_entry: SMB_FIND_FILE_UNIX\n)); p = store_file_unix_basic(conn, p, NULL, sbuf); + len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE); } else { DEBUG(10,(get_lanman2_dir_entry: SMB_FIND_FILE_UNIX_INFO2\n)); p = store_file_unix_basic_info2(conn, p, NULL, sbuf); + nameptr = p; + p += 4; + len = srvstr_push(outbuf, p, fname, -1, 0); + SIVAL(nameptr, 0, len); } - len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE); p += len; SIVAL(p,0,0); /* Ensure any padding is null. */
svn commit: samba r21951 - in branches/SAMBA_4_0/source/torture/unix: .
Author: jpeach Date: 2007-03-23 20:28:45 + (Fri, 23 Mar 2007) New Revision: 21951 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21951 Log: Hopefully fix valgrind warning. Modified: branches/SAMBA_4_0/source/torture/unix/unix_info2.c Changeset: Modified: branches/SAMBA_4_0/source/torture/unix/unix_info2.c === --- branches/SAMBA_4_0/source/torture/unix/unix_info2.c 2007-03-23 19:31:11 UTC (rev 21950) +++ branches/SAMBA_4_0/source/torture/unix/unix_info2.c 2007-03-23 20:28:45 UTC (rev 21951) @@ -99,6 +99,7 @@ { union smb_setfileinfo sfinfo; + ZERO_STRUCT(sfinfo.basic_info.in); sfinfo.generic.level = RAW_SFILEINFO_UNIX_INFO2; sfinfo.generic.in.file.path = fname;
svn commit: samba r21881 - in branches/SAMBA_3_0/source: nsswitch passdb
Author: jpeach Date: 2007-03-20 00:13:42 + (Tue, 20 Mar 2007) New Revision: 21881 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21881 Log: Make sure we are very specific when testing whether a backand can handle a particular SID. Make sure that the passdb backend will accept the same set range of local SIDs that the idmap system sends it. Simo, Jerry - this is a 3_0_25 candidate. Can you please review? Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_util.c branches/SAMBA_3_0/source/passdb/pdb_interface.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_util.c === --- branches/SAMBA_3_0/source/nsswitch/winbindd_util.c 2007-03-19 22:45:35 UTC (rev 21880) +++ branches/SAMBA_3_0/source/nsswitch/winbindd_util.c 2007-03-20 00:13:42 UTC (rev 21881) @@ -599,12 +599,18 @@ struct winbindd_domain *find_domain_from_sid_noinit(const DOM_SID *sid) { struct winbindd_domain *domain; + uint32 discard; /* Search through list */ for (domain = domain_list(); domain != NULL; domain = domain-next) { - if (sid_compare_domain(sid, domain-sid) == 0) + /* We need to use sid_peek_check_rid, because we want +* to make sure that the SIDs we send to the backends are +* as specific as possible. +*/ + if (sid_peek_check_rid(domain-sid, sid, discard) == 0) { return domain; + } } /* Not found */ Modified: branches/SAMBA_3_0/source/passdb/pdb_interface.c === --- branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-03-19 22:45:35 UTC (rev 21880) +++ branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-03-20 00:13:42 UTC (rev 21881) @@ -1305,7 +1305,8 @@ goto done; } - if (sid_peek_check_rid(global_sid_Builtin, sid, rid)) { + if (sid_check_is_in_builtin(sid) || + sid_check_is_in_wellknown_domain(sid)) { /* Here we only have aliases */ GROUP_MAP map; if (!NT_STATUS_IS_OK(methods-getgrsid(methods, map, *sid))) {
svn commit: samba r21778 - in branches/SAMBA_3_0/source: . include libads libsmb
Author: jpeach Date: 2007-03-09 18:51:48 + (Fri, 09 Mar 2007) New Revision: 21778 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21778 Log: Wrap calls to krb5_get_init_creds_opt_free to handle the different calling convention in the latest MIT changes. Apparantly Heimdal is also changing to this calling convention. Modified: branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0/source/include/includes.h branches/SAMBA_3_0/source/libads/kerberos.c branches/SAMBA_3_0/source/libsmb/clikrb5.c Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-03-09 18:33:16 UTC (rev 21777) +++ branches/SAMBA_3_0/source/configure.in 2007-03-09 18:51:48 UTC (rev 21778) @@ -3549,6 +3549,26 @@ [Whether the krb5_ticket structure contains the kvno and enctype]) fi + AC_CACHE_CHECK(whether krb5_get_init_creds_opt_free takes a context argument, + smb_krb5_creds_opt_free_context, + [ + AC_TRY_COMPILE([ + #include krb5.h], + [ + krb5_context ctx; + krb5_get_init_creds_opt *opt = NULL; + krb5_get_init_creds_opt_free(ctx, opt); + ], + [smb_krb5_creds_opt_free_context=yes], + [smb_krb5_creds_opt_free_context=no] + ) + ]) + + if test x$smb_krb5_creds_opt_free_context = xyes ; then + AC_DEFINE(KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT, 1, + [Whether krb5_get_init_creds_opt_free takes a context argument]) + fi + AC_CACHE_CHECK(whether krb5_verify_checksum takes 7 arguments, smb_krb5_verify_checksum, [ AC_TRY_COMPILE([ #include krb5.h], Modified: branches/SAMBA_3_0/source/include/includes.h === --- branches/SAMBA_3_0/source/include/includes.h2007-03-09 18:33:16 UTC (rev 21777) +++ branches/SAMBA_3_0/source/include/includes.h2007-03-09 18:51:48 UTC (rev 21778) @@ -1176,8 +1176,11 @@ void smb_krb5_free_error(krb5_context context, krb5_error *krberror); krb5_error_code handle_krberror_packet(krb5_context context, krb5_data *packet); -void krb5_get_init_creds_opt_free(krb5_get_init_creds_opt *opt); -krb5_error_code krb5_get_init_creds_opt_alloc(krb5_context context, krb5_get_init_creds_opt **opt); + +void smb_krb5_get_init_creds_opt_free(krb5_context context, + krb5_get_init_creds_opt *opt); +krb5_error_code smb_krb5_get_init_creds_opt_alloc(krb5_context context, + krb5_get_init_creds_opt **opt); #endif /* HAVE_KRB5 */ Modified: branches/SAMBA_3_0/source/libads/kerberos.c === --- branches/SAMBA_3_0/source/libads/kerberos.c 2007-03-09 18:33:16 UTC (rev 21777) +++ branches/SAMBA_3_0/source/libads/kerberos.c 2007-03-09 18:51:48 UTC (rev 21778) @@ -140,7 +140,7 @@ if ((code = krb5_get_init_creds_password(ctx, my_creds, me, CONST_DISCARD(char *,password), kerb_prompter, NULL, 0, NULL, opt))) { - krb5_get_init_creds_opt_free(opt); + smb_krb5_get_init_creds_opt_free(ctx, opt); smb_krb5_free_addresses(ctx, addr); krb5_cc_close(ctx, cc); krb5_free_principal(ctx, me); @@ -148,7 +148,7 @@ return code; } - krb5_get_init_creds_opt_free(opt); + smb_krb5_get_init_creds_opt_free(ctx, opt); if ((code = krb5_cc_initialize(ctx, cc, me))) { smb_krb5_free_addresses(ctx, addr); Modified: branches/SAMBA_3_0/source/libsmb/clikrb5.c === --- branches/SAMBA_3_0/source/libsmb/clikrb5.c 2007-03-09 18:33:16 UTC (rev 21777) +++ branches/SAMBA_3_0/source/libsmb/clikrb5.c 2007-03-09 18:51:48 UTC (rev 21778) @@ -1389,9 +1389,14 @@ return ret; } -#ifndef HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC - krb5_error_code krb5_get_init_creds_opt_alloc(krb5_context context, krb5_get_init_creds_opt **opt) + krb5_error_code smb_krb5_get_init_creds_opt_alloc(krb5_context context, + krb5_get_init_creds_opt **opt) { +#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC + /* Heimdal or modern MIT version */ + return krb5_get_init_creds_opt_alloc(context, opt); +#else + /* Historical MIT version */ krb5_get_init_creds_opt *my_opt; *opt = NULL; @@ -1404,16 +1409,28 @@ *opt = my_opt; return 0; +#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC */ } + + void smb_krb5_get_init_creds_opt_free(krb5_context context
svn commit: samba r21779 - in branches/SAMBA_3_0/source/libads: .
Author: jpeach Date: 2007-03-09 19:28:35 + (Fri, 09 Mar 2007) New Revision: 21779 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21779 Log: I missd a call to krb5_get_init_creds_opt_alloc in r21778. Modified: branches/SAMBA_3_0/source/libads/kerberos.c Changeset: Modified: branches/SAMBA_3_0/source/libads/kerberos.c === --- branches/SAMBA_3_0/source/libads/kerberos.c 2007-03-09 18:51:48 UTC (rev 21778) +++ branches/SAMBA_3_0/source/libads/kerberos.c 2007-03-09 19:28:35 UTC (rev 21779) @@ -101,7 +101,7 @@ return code; } - code = krb5_get_init_creds_opt_alloc(ctx, opt); + code = smb_krb5_get_init_creds_opt_alloc(ctx, opt); if (code) { krb5_cc_close(ctx, cc); krb5_free_context(ctx);
svn commit: samba r21781 - in branches/SAMBA_3_0_25: examples/VFS source source/include source/modules source/smbd
Author: jpeach Date: 2007-03-09 23:57:53 + (Fri, 09 Mar 2007) New Revision: 21781 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21781 Log: Add support for the UNIX_INFO2 info level. Merge the following SAMBA_3_0 revisions: r21756:21757 r21761:21762 r21762:21763 r21764:21767 Added: branches/SAMBA_3_0_25/examples/VFS/config.guess branches/SAMBA_3_0_25/examples/VFS/config.sub Modified: branches/SAMBA_3_0_25/examples/VFS/Makefile.in branches/SAMBA_3_0_25/examples/VFS/configure.in branches/SAMBA_3_0_25/examples/VFS/skel_opaque.c branches/SAMBA_3_0_25/examples/VFS/skel_transparent.c branches/SAMBA_3_0_25/source/configure.in branches/SAMBA_3_0_25/source/include/trans2.h branches/SAMBA_3_0_25/source/include/vfs.h branches/SAMBA_3_0_25/source/include/vfs_macros.h branches/SAMBA_3_0_25/source/modules/vfs_default.c branches/SAMBA_3_0_25/source/modules/vfs_full_audit.c branches/SAMBA_3_0_25/source/smbd/trans2.c Changeset: Sorry, the patch is too large (851 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21781
svn commit: samba r21762 - in branches/SAMBA_3_0/examples/VFS: .
Author: jpeach Date: 2007-03-08 17:06:16 + (Thu, 08 Mar 2007) New Revision: 21762 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21762 Log: Fix the build by enabling shared modules and adding the config.* files. Add norify_watch and chflags operations. Fix a bunch of warnings. Added: branches/SAMBA_3_0/examples/VFS/config.guess branches/SAMBA_3_0/examples/VFS/config.sub Modified: branches/SAMBA_3_0/examples/VFS/Makefile.in branches/SAMBA_3_0/examples/VFS/configure.in branches/SAMBA_3_0/examples/VFS/skel_opaque.c branches/SAMBA_3_0/examples/VFS/skel_transparent.c Changeset: Sorry, the patch is too large (3248 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21762
svn commit: samba r21763 - in branches/SAMBA_3_0/source: . include smbd
Author: jpeach Date: 2007-03-08 18:05:55 + (Thu, 08 Mar 2007) New Revision: 21763 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21763 Log: Add support for the UNIX_INFO2 infolevel. Modified: branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0/source/include/trans2.h branches/SAMBA_3_0/source/smbd/trans2.c Changeset: Sorry, the patch is too large (516 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21763
svn commit: samba r21765 - in branches/SAMBA_3_0/source/smbd: .
Author: jpeach Date: 2007-03-08 18:45:44 + (Thu, 08 Mar 2007) New Revision: 21765 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21765 Log: Fix the build for HP-UX. Modified: branches/SAMBA_3_0/source/smbd/trans2.c Changeset: Modified: branches/SAMBA_3_0/source/smbd/trans2.c === --- branches/SAMBA_3_0/source/smbd/trans2.c 2007-03-08 18:43:39 UTC (rev 21764) +++ branches/SAMBA_3_0/source/smbd/trans2.c 2007-03-08 18:45:44 UTC (rev 21765) @@ -3038,9 +3038,14 @@ #endif #ifdef UF_HIDDEN -{ UF_HIDDEN, EXT_HIDDEN } +{ UF_HIDDEN, EXT_HIDDEN }, #endif +/* Do not remove. We need to guarantee that this array has at least one + * entry to build on HP-UX. + */ +{ 0, 0 } + }; static void map_info2_flags_from_sbuf(const SMB_STRUCT_STAT *psbuf,
svn commit: samba r21766 - in branches/SAMBA_3_0/source: modules script/tests smbd
Author: jpeach Date: 2007-03-08 20:54:13 + (Thu, 08 Mar 2007) New Revision: 21766 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21766 Log: Fix compiler warning. Modified: branches/SAMBA_3_0/source/modules/vfs_default.c branches/SAMBA_3_0/source/script/tests/selftest.sh branches/SAMBA_3_0/source/script/tests/test_functions.sh branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh branches/SAMBA_3_0/source/script/tests/tests_all.sh branches/SAMBA_3_0/source/smbd/trans2.c Changeset: Modified: branches/SAMBA_3_0/source/modules/vfs_default.c === --- branches/SAMBA_3_0/source/modules/vfs_default.c 2007-03-08 18:45:44 UTC (rev 21765) +++ branches/SAMBA_3_0/source/modules/vfs_default.c 2007-03-08 20:54:13 UTC (rev 21766) @@ -905,8 +905,7 @@ static int vfswrap_chflags(vfs_handle_struct *handle, const char *path, int flags) { - errno = ENOSYS; - return -1; + return chflags(path, flags); } static size_t vfswrap_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc) Modified: branches/SAMBA_3_0/source/script/tests/selftest.sh === --- branches/SAMBA_3_0/source/script/tests/selftest.sh 2007-03-08 18:45:44 UTC (rev 21765) +++ branches/SAMBA_3_0/source/script/tests/selftest.sh 2007-03-08 20:54:13 UTC (rev 21766) @@ -1,5 +1,6 @@ #!/bin/sh +set -x if [ $# != 3 ]; then echo $0 directory all | quick smbtorture4 exit 1 @@ -93,7 +94,6 @@ pid directory = $PIDDIR lock directory = $LOCKDIR log file = $LOGDIR/log.%m - log level = 0 name resolve order = bcast EOF @@ -120,6 +120,7 @@ cat $SERVERCONFFILEEOF [global] + log level = 10 netbios name = $SERVER interfaces = $SERVER_IP/8 bind interfaces only = yes @@ -146,6 +147,7 @@ map hidden = yes map system = yes create mask = 755 + guest ok = yes [hideunread] copy = tmp hide unreadable = yes Modified: branches/SAMBA_3_0/source/script/tests/test_functions.sh === --- branches/SAMBA_3_0/source/script/tests/test_functions.sh2007-03-08 18:45:44 UTC (rev 21765) +++ branches/SAMBA_3_0/source/script/tests/test_functions.sh2007-03-08 20:54:13 UTC (rev 21766) @@ -45,7 +45,7 @@ fi MAKE_TEST_BINARY=$BINDIR/nmbd export MAKE_TEST_BINARY - timelimit $NMBD_MAXTIME $NMBD_VALGRIND $BINDIR/nmbd -F -S --no-process-group -d0 -s $SERVERCONFFILE $NMBD_TEST_LOG 21 + timelimit $NMBD_MAXTIME $NMBD_VALGRIND $BINDIR/nmbd -F -S --no-process-group -s $SERVERCONFFILE $NMBD_TEST_LOG 21 TIMELIMIT_NMBD_PID=$! MAKE_TEST_BINARY= echo $TIMELIMIT_NMBD_PID $PIDDIR/timelimit.nmbd.pid @@ -77,7 +77,7 @@ fi MAKE_TEST_BINARY=$BINDIR/smbd export MAKE_TEST_BINARY - timelimit $SMBD_MAXTIME $SMBD_VALGRIND $BINDIR/smbd -F -S --no-process-group -d0 -s $SERVERCONFFILE $SMBD_TEST_LOG 21 + timelimit $SMBD_MAXTIME $SMBD_VALGRIND $BINDIR/smbd -F --no-process-group -s $SERVERCONFFILE -l $SOCKET_WRAPPER_DIR $SMBD_TEST_LOG 21 TIMELIMIT_SMBD_PID=$! MAKE_TEST_BINARY= echo $TIMELIMIT_SMBD_PID $PIDDIR/timelimit.smbd.pid Modified: branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh === --- branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh 2007-03-08 18:45:44 UTC (rev 21765) +++ branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh 2007-03-08 20:54:13 UTC (rev 21766) @@ -36,11 +36,18 @@ rpc=RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC rpc=$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC +base= +raw= +rpc= +unix=UNIX-WHOAMI UNIX-INFO2 + +RUN_FROM_BUILD_FARM=no + if test x$RUN_FROM_BUILD_FARM = xyes; then rpc=$rpc RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME fi -tests=$base $raw $rpc +tests=$base $raw $rpc $unix skipped=BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE BASE-OPENATTR BASE-TCONDEV skipped=$skipped RAW-ACLS RAW-COMPOSITE RAW-CONTEXT RAW-EAS Modified: branches/SAMBA_3_0/source/script/tests/tests_all.sh === --- branches/SAMBA_3_0/source/script/tests/tests_all.sh 2007-03-08 18:45:44 UTC (rev 21765) +++ branches/SAMBA_3_0/source/script/tests/tests_all.sh 2007-03-08 20:54:13 UTC (rev 21766) @@ -1,7 +1,7 @@ -$SCRIPTDIR/test_local_s3.sh || failed=`expr
svn commit: samba r21767 - in branches/SAMBA_3_0/source: modules script/tests
Author: jpeach Date: 2007-03-08 21:30:15 + (Thu, 08 Mar 2007) New Revision: 21767 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21767 Log: Revert all the bits I accidentally committed in r21766. Modified: branches/SAMBA_3_0/source/modules/vfs_default.c branches/SAMBA_3_0/source/script/tests/selftest.sh branches/SAMBA_3_0/source/script/tests/test_functions.sh branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh branches/SAMBA_3_0/source/script/tests/tests_all.sh Changeset: Modified: branches/SAMBA_3_0/source/modules/vfs_default.c === --- branches/SAMBA_3_0/source/modules/vfs_default.c 2007-03-08 20:54:13 UTC (rev 21766) +++ branches/SAMBA_3_0/source/modules/vfs_default.c 2007-03-08 21:30:15 UTC (rev 21767) @@ -905,7 +905,8 @@ static int vfswrap_chflags(vfs_handle_struct *handle, const char *path, int flags) { - return chflags(path, flags); + errno = ENOSYS; + return -1; } static size_t vfswrap_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc) Modified: branches/SAMBA_3_0/source/script/tests/selftest.sh === --- branches/SAMBA_3_0/source/script/tests/selftest.sh 2007-03-08 20:54:13 UTC (rev 21766) +++ branches/SAMBA_3_0/source/script/tests/selftest.sh 2007-03-08 21:30:15 UTC (rev 21767) @@ -1,6 +1,5 @@ #!/bin/sh -set -x if [ $# != 3 ]; then echo $0 directory all | quick smbtorture4 exit 1 @@ -94,6 +93,7 @@ pid directory = $PIDDIR lock directory = $LOCKDIR log file = $LOGDIR/log.%m + log level = 0 name resolve order = bcast EOF @@ -120,7 +120,6 @@ cat $SERVERCONFFILEEOF [global] - log level = 10 netbios name = $SERVER interfaces = $SERVER_IP/8 bind interfaces only = yes @@ -147,7 +146,6 @@ map hidden = yes map system = yes create mask = 755 - guest ok = yes [hideunread] copy = tmp hide unreadable = yes Modified: branches/SAMBA_3_0/source/script/tests/test_functions.sh === --- branches/SAMBA_3_0/source/script/tests/test_functions.sh2007-03-08 20:54:13 UTC (rev 21766) +++ branches/SAMBA_3_0/source/script/tests/test_functions.sh2007-03-08 21:30:15 UTC (rev 21767) @@ -45,7 +45,7 @@ fi MAKE_TEST_BINARY=$BINDIR/nmbd export MAKE_TEST_BINARY - timelimit $NMBD_MAXTIME $NMBD_VALGRIND $BINDIR/nmbd -F -S --no-process-group -s $SERVERCONFFILE $NMBD_TEST_LOG 21 + timelimit $NMBD_MAXTIME $NMBD_VALGRIND $BINDIR/nmbd -F -S --no-process-group -d0 -s $SERVERCONFFILE $NMBD_TEST_LOG 21 TIMELIMIT_NMBD_PID=$! MAKE_TEST_BINARY= echo $TIMELIMIT_NMBD_PID $PIDDIR/timelimit.nmbd.pid @@ -77,7 +77,7 @@ fi MAKE_TEST_BINARY=$BINDIR/smbd export MAKE_TEST_BINARY - timelimit $SMBD_MAXTIME $SMBD_VALGRIND $BINDIR/smbd -F --no-process-group -s $SERVERCONFFILE -l $SOCKET_WRAPPER_DIR $SMBD_TEST_LOG 21 + timelimit $SMBD_MAXTIME $SMBD_VALGRIND $BINDIR/smbd -F -S --no-process-group -d0 -s $SERVERCONFFILE $SMBD_TEST_LOG 21 TIMELIMIT_SMBD_PID=$! MAKE_TEST_BINARY= echo $TIMELIMIT_SMBD_PID $PIDDIR/timelimit.smbd.pid Modified: branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh === --- branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh 2007-03-08 20:54:13 UTC (rev 21766) +++ branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh 2007-03-08 21:30:15 UTC (rev 21767) @@ -36,18 +36,11 @@ rpc=RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC rpc=$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC -base= -raw= -rpc= -unix=UNIX-WHOAMI UNIX-INFO2 - -RUN_FROM_BUILD_FARM=no - if test x$RUN_FROM_BUILD_FARM = xyes; then rpc=$rpc RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME fi -tests=$base $raw $rpc $unix +tests=$base $raw $rpc skipped=BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE BASE-OPENATTR BASE-TCONDEV skipped=$skipped RAW-ACLS RAW-COMPOSITE RAW-CONTEXT RAW-EAS Modified: branches/SAMBA_3_0/source/script/tests/tests_all.sh === --- branches/SAMBA_3_0/source/script/tests/tests_all.sh 2007-03-08 20:54:13 UTC (rev 21766) +++ branches/SAMBA_3_0/source/script/tests/tests_all.sh 2007-03-08 21:30:15 UTC (rev 21767) @@ -1,7 +1,7 @@ -#$SCRIPTDIR/test_local_s3.sh || failed=`expr $failed
svn commit: samba r21757 - in branches/SAMBA_3_0/source: include modules
Author: jpeach Date: 2007-03-08 01:40:49 + (Thu, 08 Mar 2007) New Revision: 21757 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21757 Log: Add SMB_VFS_CHFLAGS operation. Modified: branches/SAMBA_3_0/source/include/vfs.h branches/SAMBA_3_0/source/include/vfs_macros.h branches/SAMBA_3_0/source/modules/vfs_default.c branches/SAMBA_3_0/source/modules/vfs_full_audit.c Changeset: Modified: branches/SAMBA_3_0/source/include/vfs.h === --- branches/SAMBA_3_0/source/include/vfs.h 2007-03-07 23:58:40 UTC (rev 21756) +++ branches/SAMBA_3_0/source/include/vfs.h 2007-03-08 01:40:49 UTC (rev 21757) @@ -69,7 +69,8 @@ Also included linux setlease call - jmcd */ /* Changed to version 20, use ntimes call instead of utime (greater * timestamp resolition. JRA. */ -#define SMB_VFS_INTERFACE_VERSION 20 +/* Changed to version21 to add chflags operation -- jpeach */ +#define SMB_VFS_INTERFACE_VERSION 21 /* to bug old modules which are trying to compile with the old functions */ @@ -158,6 +159,7 @@ SMB_VFS_OP_MKNOD, SMB_VFS_OP_REALPATH, SMB_VFS_OP_NOTIFY_WATCH, + SMB_VFS_OP_CHFLAGS, /* NT ACL operations. */ @@ -289,6 +291,7 @@ void *private_data, struct notify_event *ev), void *private_data, void *handle_p); + int (*chflags)(struct vfs_handle_struct *handle, const char *path, uint flags); /* NT ACL operations. */ @@ -406,6 +409,7 @@ struct vfs_handle_struct *mknod; struct vfs_handle_struct *realpath; struct vfs_handle_struct *notify_watch; + struct vfs_handle_struct *chflags; /* NT ACL operations. */ Modified: branches/SAMBA_3_0/source/include/vfs_macros.h === --- branches/SAMBA_3_0/source/include/vfs_macros.h 2007-03-07 23:58:40 UTC (rev 21756) +++ branches/SAMBA_3_0/source/include/vfs_macros.h 2007-03-08 01:40:49 UTC (rev 21757) @@ -79,6 +79,7 @@ #define SMB_VFS_MKNOD(conn, path, mode, dev) ((conn)-vfs.ops.mknod((conn)-vfs.handles.mknod, (path), (mode), (dev))) #define SMB_VFS_REALPATH(conn, path, resolved_path) ((conn)-vfs.ops.realpath((conn)-vfs.handles.realpath, (path), (resolved_path))) #define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)-vfs.ops.notify_watch((conn)-vfs.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) +#define SMB_VFS_CHFLAGS(conn, path, flags) ((conn)-vfs.ops.chflags((conn)-vfs.handles.chflags, (path), (flags))) /* NT ACL operations. */ #define SMB_VFS_FGET_NT_ACL(fsp, fd, security_info, ppdesc) ((fsp)-conn-vfs.ops.fget_nt_acl((fsp)-conn-vfs.handles.fget_nt_acl, (fsp), (fd), (security_info), (ppdesc))) @@ -194,6 +195,7 @@ #define SMB_VFS_OPAQUE_MKNOD(conn, path, mode, dev) ((conn)-vfs_opaque.ops.mknod((conn)-vfs_opaque.handles.mknod, (path), (mode), (dev))) #define SMB_VFS_OPAQUE_REALPATH(conn, path, resolved_path) ((conn)-vfs_opaque.ops.realpath((conn)-vfs_opaque.handles.realpath, (path), (resolved_path))) #define SMB_VFS_OPAQUE_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)-vfs_opaque.ops.notify_watch((conn)-vfs_opaque.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) +#define SMB_VFS_OPAQUE_CHFLAGS(conn, path, flags) ((conn)-vfs_opaque.ops.chflags((conn)-vfs_opaque.handles.chflags, (path), (flags))) /* NT ACL operations. */ #define SMB_VFS_OPAQUE_FGET_NT_ACL(fsp, fd, security_info, ppdesc) ((fsp)-conn-vfs_opaque.ops.fget_nt_acl((fsp)-conn-vfs_opaque.handles.fget_nt_acl, (fsp), (fd), (security_info), (ppdesc))) @@ -310,6 +312,7 @@ #define SMB_VFS_NEXT_MKNOD(handle, path, mode, dev) ((handle)-vfs_next.ops.mknod((handle)-vfs_next.handles.mknod, (path), (mode), (dev))) #define SMB_VFS_NEXT_REALPATH(handle, path, resolved_path) ((handle)-vfs_next.ops.realpath((handle)-vfs_next.handles.realpath, (path), (resolved_path))) #define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)-vfs_next.ops.notify_watch((conn)-vfs_next.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) +#define SMB_VFS_NEXT_CHFLAGS(handle, path, flags) ((handle)-vfs_next.ops.chflags((handle)-vfs_next.handles.chflags, (path), (flags))) /* NT ACL operations. */ #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, ppdesc) ((handle)-vfs_next.ops.fget_nt_acl((handle)-vfs_next.handles.fget_nt_acl, (fsp), (fd), (security_info), (ppdesc))) Modified: branches/SAMBA_3_0/source/modules/vfs_default.c === --- branches
svn commit: samba-docs r1060 - in trunk/manpages-3: .
Author: jpeach Date: 2007-03-08 01:42:35 + (Thu, 08 Mar 2007) New Revision: 1060 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=1060 Log: Add chflags to the list of audited operations and sort the list. Modified: trunk/manpages-3/vfs_full_audit.8.xml Changeset: Modified: trunk/manpages-3/vfs_full_audit.8.xml === --- trunk/manpages-3/vfs_full_audit.8.xml 2007-03-07 07:37:48 UTC (rev 1059) +++ trunk/manpages-3/vfs_full_audit.8.xml 2007-03-08 01:42:35 UTC (rev 1060) @@ -35,99 +35,100 @@ complete set of Samba VFS operations:/para simplelist +memberaio_cancel/member +memberaio_error/member +memberaio_fsync/member +memberaio_read/member +memberaio_return/member +memberaio_suspend/member +memberaio_write/member +memberchdir/member +memberchflags/member +memberchmod/member +memberchmod_acl/member +memberchown/member +memberclose/member +memberclosedir/member memberconnect/member memberdisconnect/member memberdisk_free/member +memberfchmod/member +memberfchmod_acl/member +memberfchown/member +memberfget_nt_acl/member +memberfgetxattr/member +memberflistxattr/member +memberfremovexattr/member +memberfset_nt_acl/member +memberfsetxattr/member +memberfstat/member +memberfsync/member +memberftruncate/member +memberget_nt_acl/member memberget_quota/member -memberset_quota/member memberget_shadow_copy_data/member -memberstatvfs/member +membergetlock/member +membergetwd/member +membergetxattr/member +memberkernel_flock/member +memberlgetxattr/member +memberlink/member +memberlinux_setlease/member +memberlistxattr/member +memberllistxattr/member +memberlock/member +memberlremovexattr/member +memberlseek/member +memberlsetxattr/member +memberlstat/member +membermkdir/member +membermknod/member +memberopen/member memberopendir/member +memberpread/member +memberpwrite/member +memberread/member memberreaddir/member -memberseekdir/member -membertelldir/member +memberreadlink/member +memberrealpath/member +memberremovexattr/member +memberrename/member memberrewinddir/member -membermkdir/member memberrmdir/member -memberclosedir/member -memberopen/member -memberclose/member -memberread/member -memberpread/member -memberwrite/member -memberpwrite/member -memberlseek/member +memberseekdir/member membersendfile/member -memberrename/member -memberfsync/member +memberset_nt_acl/member +memberset_quota/member +membersetxattr/member memberstat/member -memberfstat/member -memberlstat/member -memberunlink/member -memberchmod/member -memberfchmod/member -memberchown/member -memberfchown/member -memberchdir/member -membergetwd/member -memberutime/member -memberftruncate/member -memberlock/member -memberkernel_flock/member -memberlinux_setlease/member -membergetlock/member +memberstatvfs/member membersymlink/member -memberreadlink/member -memberlink/member -membermknod/member -memberrealpath/member -memberfget_nt_acl/member -memberget_nt_acl/member -memberfset_nt_acl/member -memberset_nt_acl/member -memberchmod_acl/member -memberfchmod_acl/member +membersys_acl_add_perm/member +membersys_acl_clear_perms/member +membersys_acl_create_entry/member +membersys_acl_delete_def_file/member +membersys_acl_free_acl/member +membersys_acl_free_qualifier/member +membersys_acl_free_text/member membersys_acl_get_entry/member -membersys_acl_get_tag_type/member +membersys_acl_get_fd/member +membersys_acl_get_file/member +membersys_acl_get_perm/member membersys_acl_get_permset/member membersys_acl_get_qualifier/member -membersys_acl_get_file/member -membersys_acl_get_fd/member -membersys_acl_clear_perms/member -membersys_acl_add_perm/member -membersys_acl_to_text/member +membersys_acl_get_tag_type/member membersys_acl_init/member -membersys_acl_create_entry/member +membersys_acl_set_fd/member +membersys_acl_set_file/member +membersys_acl_set_permset/member
svn commit: samba r21738 - in branches: SAMBA_3_0/source/passdb SAMBA_3_0_25/source/passdb
Author: jpeach Date: 2007-03-07 05:09:37 + (Wed, 07 Mar 2007) New Revision: 21738 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21738 Log: Remove unused file. Removed: branches/SAMBA_3_0/source/passdb/pdb_plugin.c branches/SAMBA_3_0_25/source/passdb/pdb_plugin.c Changeset: Deleted: branches/SAMBA_3_0/source/passdb/pdb_plugin.c === --- branches/SAMBA_3_0/source/passdb/pdb_plugin.c 2007-03-07 04:25:52 UTC (rev 21737) +++ branches/SAMBA_3_0/source/passdb/pdb_plugin.c 2007-03-07 05:09:37 UTC (rev 21738) @@ -1,80 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Loadable passdb module interface. - Copyright (C) Jelmer Vernooij 2002 - Copyright (C) Andrew Bartlett 2002 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include includes.h - -#undef DBGC_CLASS -#define DBGC_CLASS DBGC_PASSDB - -NTSTATUS pdb_init_plugin(struct pdb_methods **pdb_method, const char *location) -{ - void * dl_handle; - char *plugin_location, *plugin_name, *p; - pdb_init_function plugin_init; - int (*plugin_version)(void); - - if (location == NULL) { - DEBUG(0, (The plugin module needs an argument!\n)); - return NT_STATUS_UNSUCCESSFUL; - } - - plugin_name = smb_xstrdup(location); - p = strchr(plugin_name, ':'); - if (p) { - *p = 0; - plugin_location = p+1; - trim_char(plugin_location, ' ', ' '); - } else { - plugin_location = NULL; - } - trim_char(plugin_name, ' ', ' '); - - DEBUG(5, (Trying to load sam plugin %s\n, plugin_name)); - dl_handle = sys_dlopen(plugin_name, RTLD_NOW ); - if (!dl_handle) { - DEBUG(0, (Failed to load sam plugin %s using sys_dlopen (%s)\n, plugin_name, sys_dlerror())); - return NT_STATUS_UNSUCCESSFUL; - } - - plugin_version = sys_dlsym(dl_handle, pdb_version); - if (!plugin_version) { - sys_dlclose(dl_handle); - DEBUG(0, (Failed to find function 'pdb_version' using sys_dlsym in sam plugin %s (%s)\n, plugin_name, sys_dlerror())); - return NT_STATUS_UNSUCCESSFUL; - } - - if (plugin_version() != PASSDB_INTERFACE_VERSION) { - sys_dlclose(dl_handle); - DEBUG(0, (Wrong PASSDB_INTERFACE_VERSION! sam plugin has version %d and version %d is needed! Please update!\n, - plugin_version(),PASSDB_INTERFACE_VERSION)); - return NT_STATUS_UNSUCCESSFUL; - } - - plugin_init = sys_dlsym(dl_handle, pdb_init); - if (!plugin_init) { - sys_dlclose(dl_handle); - DEBUG(0, (Failed to find function 'pdb_init' using sys_dlsym in sam plugin %s (%s)\n, plugin_name, sys_dlerror())); - return NT_STATUS_UNSUCCESSFUL; - } - - DEBUG(5, (Starting sam plugin %s with location %s\n, plugin_name, plugin_location)); - return plugin_init(pdb_method, plugin_location); -} Deleted: branches/SAMBA_3_0_25/source/passdb/pdb_plugin.c === --- branches/SAMBA_3_0_25/source/passdb/pdb_plugin.c2007-03-07 04:25:52 UTC (rev 21737) +++ branches/SAMBA_3_0_25/source/passdb/pdb_plugin.c2007-03-07 05:09:37 UTC (rev 21738) @@ -1,80 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Loadable passdb module interface. - Copyright (C) Jelmer Vernooij 2002 - Copyright (C) Andrew Bartlett 2002 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free
svn commit: samba r21710 - in branches/SAMBA_4_0/source: libcli/raw torture torture/nbench torture/raw torture/unix
Author: jpeach Date: 2007-03-05 22:26:38 + (Mon, 05 Mar 2007) New Revision: 21710 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21710 Log: Add client support for the UNIX_INFO2 info level in the QueryFile, QueryPath and FindFirst calls. Add a new torture test to verify the server side. Added: branches/SAMBA_4_0/source/torture/unix/unix_info2.c Modified: branches/SAMBA_4_0/source/libcli/raw/interfaces.h branches/SAMBA_4_0/source/libcli/raw/rawfileinfo.c branches/SAMBA_4_0/source/libcli/raw/rawsearch.c branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c branches/SAMBA_4_0/source/libcli/raw/trans2.h branches/SAMBA_4_0/source/torture/config.mk branches/SAMBA_4_0/source/torture/nbench/nbio.c branches/SAMBA_4_0/source/torture/raw/search.c branches/SAMBA_4_0/source/torture/ui.h branches/SAMBA_4_0/source/torture/unix/unix.c Changeset: Sorry, the patch is too large (1017 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21710
svn commit: samba r21717 - in branches/SAMBA_3_0/source: include smbd
Author: jpeach Date: 2007-03-06 00:54:05 + (Tue, 06 Mar 2007) New Revision: 21717 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21717 Log: Support the SMB_QUERY_POSIX_WHOAMI info level on QueryFsInfo. Modified: branches/SAMBA_3_0/source/include/trans2.h branches/SAMBA_3_0/source/smbd/trans2.c Changeset: Modified: branches/SAMBA_3_0/source/include/trans2.h === --- branches/SAMBA_3_0/source/include/trans2.h 2007-03-06 00:45:30 UTC (rev 21716) +++ branches/SAMBA_3_0/source/include/trans2.h 2007-03-06 00:54:05 UTC (rev 21717) @@ -579,6 +579,37 @@ */ +#define SMB_QUERY_POSIX_WHOAMI 0x202 + +enum smb_whoami_flags { +SMB_WHOAMI_GUEST = 0x1 /* Logged in as (or squashed to) guest */ +}; + +/* Mask of which WHOAMI bits are valid. This should make it easier for clients + * to cope with servers that have different sets of WHOAMI flags (as more get + * added). + */ +#define SMB_WHOAMI_MASK 0x0001 + +/* + SMBWhoami - Query the user mapping performed by the server for the + connected tree. This is a subcommand of the TRANS2_QFSINFO. + + Returns: + 4 bytes unsigned - mapping flags (smb_whoami_flags) + 4 bytes unsigned - flags mask + + 8 bytes unsigned - primary UID + 8 bytes unsigned - primary GID + 4 bytes unsigned - number of supplementary GIDs + 4 bytes unsigned - number of SIDs + 4 bytes unsigned - SID list byte count + 4 bytes - pad / reserved (must be zero) + + 8 bytes unsigned[] -list of GIDs (may be empty) + DOM_SID[] - list of SIDs (may be empty) +*/ + /* The query/set info levels for POSIX ACLs. */ #define SMB_QUERY_POSIX_ACL 0x204 #define SMB_SET_POSIX_ACL 0x204 Modified: branches/SAMBA_3_0/source/smbd/trans2.c === --- branches/SAMBA_3_0/source/smbd/trans2.c 2007-03-06 00:45:30 UTC (rev 21716) +++ branches/SAMBA_3_0/source/smbd/trans2.c 2007-03-06 00:54:05 UTC (rev 21717) @@ -5,6 +5,7 @@ Copyright (C) Stefan (metze) Metzmacher 2003 Copyright (C) Volker Lendecke 2005 Copyright (C) Steve French 2005 + Copyright (C) James Peach 2007 Extensively modified by Andrew Tridgell, 1995 @@ -2232,7 +2233,7 @@ char **pparams, int total_params, char **ppdata, int total_data, unsigned int max_data_bytes) { - char *pdata = *ppdata; + char *pdata; char *params = *pparams; uint16 info_level; int data_len, len; @@ -2566,6 +2567,114 @@ break; } + case SMB_QUERY_POSIX_WHOAMI: + { + uint32_t flags = 0; + uint32_t sid_bytes; + int i; + + if (!lp_unix_extensions()) { + return ERROR_NT(NT_STATUS_INVALID_LEVEL); + } + + if (max_data_bytes 40) { + return ERROR_NT(NT_STATUS_BUFFER_TOO_SMALL); + } + + /* We ARE guest if global_sid_Builtin_Guests is +* in our list of SIDs. +*/ + if (nt_token_check_sid(global_sid_Builtin_Guests, + current_user.nt_user_token)) { + flags |= SMB_WHOAMI_GUEST; + } + + /* We are NOT guest if global_sid_Authenticated_Users +* is in our list of SIDs. +*/ + if (nt_token_check_sid(global_sid_Authenticated_Users, + current_user.nt_user_token)) { + flags = ~SMB_WHOAMI_GUEST; + } + + /* NOTE: 8 bytes for UID/GID, irrespective of native +* platform size. This matches +* SMB_QUERY_FILE_UNIX_BASIC and friends. +*/ + data_len = 4 /* flags */ + + 4 /* flag mask */ + + 8 /* uid */ + + 8 /* gid */ + + 4 /* ngroups */ + + 4 /* num_sids */ + + 4 /* SID bytes */ + + 4 /* pad/reserved */ + + (current_user.ut.ngroups * 8) + /* groups list */ + + (current_user.nt_user_token-num_sids * + SID_MAX_SIZE) + /* SID list
svn commit: samba r21718 - in branches/SAMBA_3_0_25/source: include smbd
Author: jpeach Date: 2007-03-06 01:04:00 + (Tue, 06 Mar 2007) New Revision: 21718 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=21718 Log: Merge -r21716:21717 from SAMBA_3_0: Support the SMB_QUERY_POSIX_WHOAMI info level on QueryFsInfo. Modified: branches/SAMBA_3_0_25/source/include/trans2.h branches/SAMBA_3_0_25/source/smbd/trans2.c Changeset: Modified: branches/SAMBA_3_0_25/source/include/trans2.h === --- branches/SAMBA_3_0_25/source/include/trans2.h 2007-03-06 00:54:05 UTC (rev 21717) +++ branches/SAMBA_3_0_25/source/include/trans2.h 2007-03-06 01:04:00 UTC (rev 21718) @@ -564,6 +564,37 @@ */ +#define SMB_QUERY_POSIX_WHOAMI 0x202 + +enum smb_whoami_flags { +SMB_WHOAMI_GUEST = 0x1 /* Logged in as (or squashed to) guest */ +}; + +/* Mask of which WHOAMI bits are valid. This should make it easier for clients + * to cope with servers that have different sets of WHOAMI flags (as more get + * added). + */ +#define SMB_WHOAMI_MASK 0x0001 + +/* + SMBWhoami - Query the user mapping performed by the server for the + connected tree. This is a subcommand of the TRANS2_QFSINFO. + + Returns: + 4 bytes unsigned - mapping flags (smb_whoami_flags) + 4 bytes unsigned - flags mask + + 8 bytes unsigned - primary UID + 8 bytes unsigned - primary GID + 4 bytes unsigned - number of supplementary GIDs + 4 bytes unsigned - number of SIDs + 4 bytes unsigned - SID list byte count + 4 bytes - pad / reserved (must be zero) + + 8 bytes unsigned[] -list of GIDs (may be empty) + DOM_SID[] - list of SIDs (may be empty) +*/ + /* The query/set info levels for POSIX ACLs. */ #define SMB_QUERY_POSIX_ACL 0x204 #define SMB_SET_POSIX_ACL 0x204 Modified: branches/SAMBA_3_0_25/source/smbd/trans2.c === --- branches/SAMBA_3_0_25/source/smbd/trans2.c 2007-03-06 00:54:05 UTC (rev 21717) +++ branches/SAMBA_3_0_25/source/smbd/trans2.c 2007-03-06 01:04:00 UTC (rev 21718) @@ -5,6 +5,7 @@ Copyright (C) Stefan (metze) Metzmacher 2003 Copyright (C) Volker Lendecke 2005 Copyright (C) Steve French 2005 + Copyright (C) James Peach 2007 Extensively modified by Andrew Tridgell, 1995 @@ -2232,7 +2233,7 @@ char **pparams, int total_params, char **ppdata, int total_data, unsigned int max_data_bytes) { - char *pdata = *ppdata; + char *pdata; char *params = *pparams; uint16 info_level; int data_len, len; @@ -2566,6 +2567,114 @@ break; } + case SMB_QUERY_POSIX_WHOAMI: + { + uint32_t flags = 0; + uint32_t sid_bytes; + int i; + + if (!lp_unix_extensions()) { + return ERROR_NT(NT_STATUS_INVALID_LEVEL); + } + + if (max_data_bytes 40) { + return ERROR_NT(NT_STATUS_BUFFER_TOO_SMALL); + } + + /* We ARE guest if global_sid_Builtin_Guests is +* in our list of SIDs. +*/ + if (nt_token_check_sid(global_sid_Builtin_Guests, + current_user.nt_user_token)) { + flags |= SMB_WHOAMI_GUEST; + } + + /* We are NOT guest if global_sid_Authenticated_Users +* is in our list of SIDs. +*/ + if (nt_token_check_sid(global_sid_Authenticated_Users, + current_user.nt_user_token)) { + flags = ~SMB_WHOAMI_GUEST; + } + + /* NOTE: 8 bytes for UID/GID, irrespective of native +* platform size. This matches +* SMB_QUERY_FILE_UNIX_BASIC and friends. +*/ + data_len = 4 /* flags */ + + 4 /* flag mask */ + + 8 /* uid */ + + 8 /* gid */ + + 4 /* ngroups */ + + 4 /* num_sids */ + + 4 /* SID bytes */ + + 4 /* pad/reserved */ + + (current_user.ut.ngroups * 8) + /* groups list */ + + (current_user.nt_user_token-num_sids * + SID_MAX_SIZE