Rev 164: - added a --torture option to all ctdb tools. This sets in http://samba.org/~tridge/ctdb
revno: 164 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Thu 2007-04-19 16:27:56 +1000 message: - added a --torture option to all ctdb tools. This sets CTDB_FLAG_TORTURE, which forces some race conditions to be much more likely. For example a 20% chance of not getting the lock on the first try in the daemon - abstraced the ctdb_ltdb_lock_fetch_requeue() code to allow it to work with both inter-node packets and client-daemon packets - fixed a bug left over in ctdb_call from when the client updated the header on a call reply - removed CTDB_FLAG_CONNECT_WAIT flag (not needed any more) modified: common/cmdline.c cmdline.c-20070416041216-w1zvz91bkdsgjckw-1 common/ctdb.c ctdb.c-20061127094323-t50f58d65iaao5of-2 common/ctdb_call.c ctdb_call.c-20061128065342-to93h6eejj5kon81-1 common/ctdb_client.c ctdb_client.c-20070411010216-3kd8v37k61steeya-1 common/ctdb_daemon.c ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1 common/ctdb_ltdb.c ctdb_ltdb.c-20061128065342-to93h6eejj5kon81-2 include/ctdb.h ctdb.h-20061117234101-o3qt14umlg9en8z0-11 include/ctdb_private.h ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13 tcp/tcp_init.c tcp_init.c-20061128004937-x70q1cu5xzg5g2tm-2 Diff too large for email (471, the limit is 200).
svn commit: samba r22359 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 07:39:45 + (Thu, 19 Apr 2007) New Revision: 22359 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22359 Log: try to fix the start failures in the build-farm by creating the prefix dir before using abs_path() metze Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl Changeset: Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl === --- branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 01:26:38 UTC (rev 22358) +++ branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 07:39:45 UTC (rev 22359) @@ -444,19 +444,20 @@ $prefix =~ s+/./+/+; $prefix =~ s+/$++; +die(using an empty prefix isn't allowed) unless $prefix ne ; + +#Ensure we have the test prefix around +mkdir $prefix unless -d $prefix; + my $prefix_abs = abs_path($prefix); my $srcdir_abs = abs_path($srcdir); -die(using an empty prefix isn't allowed) unless $prefix ne ; die(using an empty absolute prefix isn't allowed) unless $prefix_abs ne ; die(using '/' as absolute prefix isn't allowed) unless $prefix_abs ne /; $ENV{PREFIX} = $prefix; $ENV{SRCDIR} = $srcdir; -#Ensure we have the test prefix around -mkdir $prefix unless -d $prefix; - my $tls_enabled = not $opt_quick; my $from_build_farm = (defined($ENV{RUN_FROM_BUILD_FARM}) and ($ENV{RUN_FROM_BUILD_FARM} eq yes));
Rev 165: - split out ctdb_ltdb_lock_fetch_requeue() into a simpler in http://samba.org/~tridge/ctdb
revno: 165 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Thu 2007-04-19 17:43:27 +1000 message: - split out ctdb_ltdb_lock_fetch_requeue() into a simpler ctdb_ltdb_lock_requeue() and a small wrapper - use ctdb_ltdb_lock_requeue() to fix a possible hang in ctdb_reply_dmaster(), where the ctdb_ltdb_store() could hang waiting for a client. We now requeue the reply_dmaster packet until we have the lock modified: common/ctdb_call.c ctdb_call.c-20061128065342-to93h6eejj5kon81-1 common/ctdb_ltdb.c ctdb_ltdb.c-20061128065342-to93h6eejj5kon81-2 include/ctdb_private.h ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13 === modified file 'common/ctdb_call.c' --- a/common/ctdb_call.c2007-04-19 06:27:56 + +++ b/common/ctdb_call.c2007-04-19 07:43:27 + @@ -314,7 +314,9 @@ memcpy(r-data[0], data.dptr, data.dsize); if (r-hdr.destnode == r-hdr.srcnode) { - ctdb_reply_dmaster(ctdb, r-hdr); + /* inject the packet back into the input queue */ + talloc_steal(ctdb, r); + ctdb_recv_pkt(ctdb, (uint8_t *)r-hdr, r-hdr.length); } else { ctdb_queue_packet(ctdb, r-hdr); } @@ -456,6 +458,7 @@ struct ctdb_call_state *state; struct ctdb_db_context *ctdb_db; TDB_DATA data; + int ret; state = idr_find_type(ctdb-idr, hdr-reqid, struct ctdb_call_state); if (state == NULL) { @@ -464,6 +467,16 @@ ctdb_db = state-ctdb_db; + ret = ctdb_ltdb_lock_requeue(ctdb_db, state-call.key, hdr, +ctdb_recv_raw_pkt, ctdb); + if (ret == -2) { + return; + } + if (ret != 0) { + DEBUG(0,(__location__ Failed to get lock in ctdb_reply_dmaster\n)); + return; + } + data.dptr = c-data; data.dsize = c-datalen; @@ -474,12 +487,15 @@ state-header.dmaster = ctdb-vnn; if (ctdb_ltdb_store(ctdb_db, state-call.key, state-header, data) != 0) { + ctdb_ltdb_unlock(ctdb_db, state-call.key); ctdb_fatal(ctdb, ctdb_reply_dmaster store failed\n); return; } ctdb_call_local(ctdb_db, state-call, state-header, data, ctdb-vnn); + ctdb_ltdb_unlock(ctdb_db, state-call.key); + talloc_steal(state, state-call.reply_data.dptr); state-state = CTDB_CALL_DONE; === modified file 'common/ctdb_ltdb.c' --- a/common/ctdb_ltdb.c2007-04-19 06:27:56 + +++ b/common/ctdb_ltdb.c2007-04-19 07:43:27 + @@ -244,14 +244,14 @@ DEBUG(2,(__location__ PACKET REQUEUED\n)); } + /* - do a non-blocking ltdb_fetch with a locked record, deferring this - ctdb request until we have the chainlock + do a non-blocking ltdb_lock, deferring this ctdb request until we + have the chainlock It does the following: - 1) tries to get the chainlock. If it succeeds, then it fetches the record, and - returns 0 + 1) tries to get the chainlock. If it succeeds, then it returns 0 2) if it fails to get a chainlock immediately then it sets up a non-blocking chainlock via ctdb_lockwait, and when it gets the @@ -269,11 +269,10 @@ -1:means that it failed to get the lock, and won't retry -2:means that it failed to get the lock immediately, but will retry */ -int ctdb_ltdb_lock_fetch_requeue(struct ctdb_db_context *ctdb_db, -TDB_DATA key, struct ctdb_ltdb_header *header, -struct ctdb_req_header *hdr, TDB_DATA *data, -void (*recv_pkt)(void *, uint8_t *, uint32_t ), -void *recv_context) +int ctdb_ltdb_lock_requeue(struct ctdb_db_context *ctdb_db, + TDB_DATA key, struct ctdb_req_header *hdr, + void (*recv_pkt)(void *, uint8_t *, uint32_t ), + void *recv_context) { int ret; struct tdb_context *tdb = ctdb_db-ltdb-tdb; @@ -297,11 +296,7 @@ /* first the non-contended path */ if (ret == 0) { - ret = ctdb_ltdb_fetch(ctdb_db, key, header, hdr, data); - if (ret != 0) { - tdb_chainunlock(tdb, key); - } - return ret; + return 0; } state = talloc(ctdb_db, struct lock_fetch_state); @@ -325,3 +320,24 @@ /* now tell the caller than we will retry asynchronously */ return -2; } + +/* + a varient of ctdb_ltdb_lock_requeue that also fetches the record + */ +int ctdb_ltdb_lock_fetch_requeue(struct ctdb_db_context *ctdb_db, +TDB_DATA key, struct
svn commit: samba r22360 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 08:04:35 + (Thu, 19 Apr 2007) New Revision: 22360 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22360 Log: print out the name of the PCAP file and move setup and cleanup of pcap files into functions metze Modified: branches/SAMBA_4_0/source/script/tests/SocketWrapper.pm branches/SAMBA_4_0/source/script/tests/selftest.pl Changeset: Modified: branches/SAMBA_4_0/source/script/tests/SocketWrapper.pm === --- branches/SAMBA_4_0/source/script/tests/SocketWrapper.pm 2007-04-19 07:39:45 UTC (rev 22359) +++ branches/SAMBA_4_0/source/script/tests/SocketWrapper.pm 2007-04-19 08:04:35 UTC (rev 22360) @@ -12,17 +12,30 @@ use strict; use FindBin qw($RealBin); -sub setup_dir($) +sub setup_dir($$) { - my ($dir) = @_; + my ($dir, $pcap) = @_; + my $pcap_dir = undef; + if (defined($dir)) { if ( -d $dir ) { unlink $dir/*; } else { mkdir($dir); } + + if ($pcap) { + $pcap_dir = $dir./pcap; + + if ( -d $pcap_dir ) { + unlink $pcap_dir/*; + } else { + mkdir($pcap_dir); + } + } } + $ENV{SOCKET_WRAPPER_PCAP_DIR} = $pcap_dir; $ENV{SOCKET_WRAPPER_DIR} = $dir; return $dir; } Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl === --- branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 07:39:45 UTC (rev 22359) +++ branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 08:04:35 UTC (rev 22360) @@ -219,6 +219,8 @@ $out .= $test_output-{$state-{NAME}}; } + $out .= PCAP FILE: $state-{PCAP_FILE}\n if defined($state-{PCAP_FILE}); + $out .= getlog_env($state-{ENVNAME}); $out .= ==\n; @@ -270,16 +272,23 @@ sub plain_end_msg($$$) { my ($state, $expected_ret, $ret) = @_; + my $out = ; if ($ret != $expected_ret) { plain_output_msg($state, ERROR: $ret\n); } if ($ret != $expected_ret and ($opt_immediate or $opt_one) and not $opt_verbose) { - print $test_output-{$state-{NAME}}.\n; + $out .= $test_output-{$state-{NAME}}; } - print getlog_env($state-{ENVNAME}); + if (not $opt_socket_wrapper_keep_pcap and defined($state-{PCAP_FILE})) { + $out .= PCAP FILE: $state-{PCAP_FILE}\n; + } + + $out .= getlog_env($state-{ENVNAME}); + + print $out; } my $plain_msg_ops = { @@ -288,9 +297,39 @@ end_msg = \plain_end_msg }; +sub setup_pcap($) +{ + my ($state) = @_; + + return unless ($opt_socket_wrapper_pcap); + return unless defined($ENV{SOCKET_WRAPPER_PCAP_DIR}); + + my $fname = sprintf(t%03u_%s, $state-{INDEX}, $state-{NAME}); + $fname =~ s%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\-]%_%g; + + $state-{PCAP_FILE} = $ENV{SOCKET_WRAPPER_PCAP_DIR}/$fname.pcap; + + SocketWrapper::setup_pcap($state-{PCAP_FILE}); +} + +sub cleanup_pcap($$$) +{ + my ($state, $expected_ret, $ret) = @_; + + return unless ($opt_socket_wrapper_pcap); + return if ($opt_socket_wrapper_keep_pcap); + return unless ($expected_ret == $ret); + return unless defined($state-{PCAP_FILE}); + + unlink($state-{PCAP_FILE}); + $state-{PCAP_FILE} = undef; +} + sub run_test($$) { my ($envname, $name, $cmd, $i, $totalsuites, $msg_ops) = @_; + my $expected_ret = 1; + my $open_tests = {}; my $msg_state = { ENVNAME = $envname, NAME= $name, @@ -299,10 +338,12 @@ TOTAL = $totalsuites, START = time() }; + + setup_pcap($msg_state); + $msg_ops-{start_msg}($msg_state); + open(RESULT, $cmd 21|); - my $expected_ret = 1; - my $open_tests = {}; while (RESULT) { $msg_ops-{output_msg}($msg_state, $_); if (/^test: (.+)\n/) { @@ -338,7 +379,11 @@ $statistics-{TESTS_ERROR}++; } my $ret = close(RESULT); + + cleanup_pcap($msg_state, $expected_ret, $ret); + $msg_ops-{end_msg}($msg_state, $expected_ret, $ret); + if ($ret != $expected_ret) { push(@$suitesfailed, $name); $statistics-{SUITES_FAIL}++; @@ -473,17 +518,15 @@ $ENV{PKG_CONFIG_PATH} = $old_pwd/bin/pkgconfig:$ENV{PKG_CONFIG_PATH}; $ENV{PATH} = $old_pwd/bin:$ENV{PATH}; -my $pcap_dir = $prefix/pcap; if ($opt_socket_wrapper_pcap) { - mkdir($pcap_dir); #
Rev 166: fixed a bug found by volker - initialse the record on disk when initialised in memory in http://samba.org/~tridge/ctdb
revno: 166 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Thu 2007-04-19 18:31:49 +1000 message: fixed a bug found by volker - initialse the record on disk when initialised in memory modified: common/ctdb_ltdb.c ctdb_ltdb.c-20061128065342-to93h6eejj5kon81-2 === modified file 'common/ctdb_ltdb.c' --- a/common/ctdb_ltdb.c2007-04-19 07:43:27 + +++ b/common/ctdb_ltdb.c2007-04-19 08:31:49 + @@ -156,13 +156,15 @@ rec = tdb_fetch(ctdb_db-ltdb-tdb, key); if (rec.dsize sizeof(*header)) { + TDB_DATA d2; /* return an initial header */ - free(rec.dptr); + if (rec.dptr) free(rec.dptr); ltdb_initial_header(ctdb_db, key, header); + ZERO_STRUCT(d2); if (data) { - data-dptr = NULL; - data-dsize = 0; + *data = d2; } + ctdb_ltdb_store(ctdb_db, key, header, d2); return 0; }
svn commit: samba r22361 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 08:37:16 + (Thu, 19 Apr 2007) New Revision: 22361 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22361 Log: warnings.pm isn't available on solaris 8 metze Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl Changeset: Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl === --- branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 08:04:35 UTC (rev 22360) +++ branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 08:37:16 UTC (rev 22361) @@ -107,7 +107,6 @@ =cut use strict; -use warnings; use FindBin qw($RealBin $Script); use File::Spec;
svn commit: samba r22362 - in branches/SAMBA_3_0/source/libsmb: .
Author: metze Date: 2007-04-19 08:45:29 + (Thu, 19 Apr 2007) New Revision: 22362 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22362 Log: fix the build on othersystems metze Modified: branches/SAMBA_3_0/source/libsmb/clifsinfo.c Changeset: Modified: branches/SAMBA_3_0/source/libsmb/clifsinfo.c === --- branches/SAMBA_3_0/source/libsmb/clifsinfo.c2007-04-19 08:37:16 UTC (rev 22361) +++ branches/SAMBA_3_0/source/libsmb/clifsinfo.c2007-04-19 08:45:29 UTC (rev 22362) @@ -483,6 +483,9 @@ OM_uint32 ret_flags = 0; NTSTATUS status = NT_STATUS_OK; + gss_OID_desc nt_hostbased_service = + {10, CONST_DISCARD(char *,\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04)}; + memset(tok_out, '\0', sizeof(tok_out)); /* Get a ticket for the [EMAIL PROTECTED] */ @@ -496,7 +499,7 @@ ret = gss_import_name(min, input_name, - GSS_C_NT_HOSTBASED_SERVICE, + nt_hostbased_service, srv_name); if (ret != GSS_S_COMPLETE) {
svn commit: samba r22363 - in branches/SAMBA_3_0/source/lib/tdb/tools: .
Author: metze Date: 2007-04-19 08:49:09 + (Thu, 19 Apr 2007) New Revision: 22363 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22363 Log: merge from samba4: fix compiler warning metze Modified: branches/SAMBA_3_0/source/lib/tdb/tools/tdbdump.c Changeset: Modified: branches/SAMBA_3_0/source/lib/tdb/tools/tdbdump.c === --- branches/SAMBA_3_0/source/lib/tdb/tools/tdbdump.c 2007-04-19 08:45:29 UTC (rev 22362) +++ branches/SAMBA_3_0/source/lib/tdb/tools/tdbdump.c 2007-04-19 08:49:09 UTC (rev 22363) @@ -65,7 +65,7 @@ if (!keyname) { tdb_traverse(tdb, traverse_fn, NULL); } else { - key.dptr = (unsigned char *)keyname; + key.dptr = discard_const_p(uint8_t,keyname); key.dsize = strlen( keyname); value = tdb_fetch(tdb, key); if (!value.dptr) {
svn commit: samba r22364 - in branches/SAMBA_3_0/source/lib/tdb: . include
Author: metze Date: 2007-04-19 08:50:14 + (Thu, 19 Apr 2007) New Revision: 22364 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22364 Log: sync lib/tdb/ with samba4 there's no code change here... metze Added: branches/SAMBA_3_0/source/lib/tdb/config.guess branches/SAMBA_3_0/source/lib/tdb/config.sub branches/SAMBA_3_0/source/lib/tdb/configure.ac branches/SAMBA_3_0/source/lib/tdb/install-sh branches/SAMBA_3_0/source/lib/tdb/libtdb.m4 Removed: branches/SAMBA_3_0/source/lib/tdb/config.m4 branches/SAMBA_3_0/source/lib/tdb/configure.in branches/SAMBA_3_0/source/lib/tdb/include/tdbconfig.h.in Modified: branches/SAMBA_3_0/source/lib/tdb/Makefile.in branches/SAMBA_3_0/source/lib/tdb/autogen.sh branches/SAMBA_3_0/source/lib/tdb/config.mk branches/SAMBA_3_0/source/lib/tdb/tdb.pc.in Changeset: Sorry, the patch is too large (3623 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22364
svn commit: samba r22366 - in branches/SAMBA_3_0/source/lib/talloc: .
Author: metze Date: 2007-04-19 09:08:53 + (Thu, 19 Apr 2007) New Revision: 22366 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22366 Log: sync lib/talloc/ with samba4 metze Modified: branches/SAMBA_3_0/source/lib/talloc/config.mk branches/SAMBA_3_0/source/lib/talloc/talloc.h branches/SAMBA_3_0/source/lib/talloc/talloc.pc.in branches/SAMBA_3_0/source/lib/talloc/testsuite.c Changeset: Modified: branches/SAMBA_3_0/source/lib/talloc/config.mk === --- branches/SAMBA_3_0/source/lib/talloc/config.mk 2007-04-19 09:08:30 UTC (rev 22365) +++ branches/SAMBA_3_0/source/lib/talloc/config.mk 2007-04-19 09:08:53 UTC (rev 22366) @@ -11,8 +11,3 @@ # # End LIBRARY LIBTALLOC - -[BINARY::TALLOC] -OBJ_FILES = testsuite.o -PRIVATE_DEPENDENCIES = LIBTALLOC -INSTALLDIR = TORTUREDIR/LOCAL Modified: branches/SAMBA_3_0/source/lib/talloc/talloc.h === --- branches/SAMBA_3_0/source/lib/talloc/talloc.h 2007-04-19 09:08:30 UTC (rev 22365) +++ branches/SAMBA_3_0/source/lib/talloc/talloc.h 2007-04-19 09:08:53 UTC (rev 22366) @@ -26,6 +26,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include stdlib.h +#include stdio.h +#include stdarg.h + /* this is only needed for compatibility with the old talloc */ typedef void TALLOC_CTX; Modified: branches/SAMBA_3_0/source/lib/talloc/talloc.pc.in === --- branches/SAMBA_3_0/source/lib/talloc/talloc.pc.in 2007-04-19 09:08:30 UTC (rev 22365) +++ branches/SAMBA_3_0/source/lib/talloc/talloc.pc.in 2007-04-19 09:08:53 UTC (rev 22366) @@ -6,5 +6,6 @@ Name: talloc Description: A hierarchical pool based memory system with destructors Version: 4.0 -Libs: @LIBS@ -L${libdir} -ltalloc -Cflags: -I${includedir} @CFLAGS@ +Libs: -L${libdir} -ltalloc +Cflags: -I${includedir} +URL: http://talloc.samba.org/ Modified: branches/SAMBA_3_0/source/lib/talloc/testsuite.c === --- branches/SAMBA_3_0/source/lib/talloc/testsuite.c2007-04-19 09:08:30 UTC (rev 22365) +++ branches/SAMBA_3_0/source/lib/talloc/testsuite.c2007-04-19 09:08:53 UTC (rev 22366) @@ -1012,6 +1012,8 @@ static bool test_autofree(void) { +#if _SAMBA_BUILD_ 4 + /* autofree test would kill smbtorture */ void *p; printf(test: autofree [\nTALLOC AUTOFREE CONTEXT\n]\n); @@ -1022,13 +1024,17 @@ talloc_free(p); printf(success: autofree\n); +#endif return true; } -int main(void) +struct torture_context; +bool torture_local_talloc(struct torture_context *tctx) { bool ret = true; + setlinebuf(stdout); + talloc_disable_null_tracking(); talloc_enable_null_tracking(); @@ -1055,7 +1061,15 @@ } ret = test_autofree(); + return ret; +} + +#if _SAMBA_BUILD_ 4 +int main(void) +{ + bool ret = torture_local_talloc(NULL); if (!ret) return -1; return 0; } +#endif
svn commit: samba r22367 - in branches/SAMBA_4_0/source/lib/socket_wrapper: .
Author: metze Date: 2007-04-19 09:15:55 + (Thu, 19 Apr 2007) New Revision: 22367 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22367 Log: prepare merge to samba3 metze Modified: branches/SAMBA_4_0/source/lib/socket_wrapper/config.m4 Changeset: Modified: branches/SAMBA_4_0/source/lib/socket_wrapper/config.m4 === --- branches/SAMBA_4_0/source/lib/socket_wrapper/config.m4 2007-04-19 09:08:53 UTC (rev 22366) +++ branches/SAMBA_4_0/source/lib/socket_wrapper/config.m4 2007-04-19 09:15:55 UTC (rev 22367) @@ -12,7 +12,11 @@ AC_DEFINE(SOCKET_WRAPPER,1,[Use socket wrapper library]) DEFAULT_TEST_OPTIONS=--socket-wrapper HAVE_SOCKET_WRAPPER=yes + + # this is only used for samba3 + SOCKET_WRAPPER_OBJS=lib/socket_wrapper/socket_wrapper.o fi AC_SUBST(DEFAULT_TEST_OPTIONS) AC_SUBST(HAVE_SOCKET_WRAPPER) +AC_SUBST(SOCKET_WRAPPER_OBJS)
svn commit: samba r22368 - in branches/SAMBA_4_0/source/lib/cmdline: .
Author: metze Date: 2007-04-19 09:26:03 + (Thu, 19 Apr 2007) New Revision: 22368 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22368 Log: remove unused header maybe this fixes th ebuild on some hosts metze Modified: branches/SAMBA_4_0/source/lib/cmdline/popt_credentials.c Changeset: Modified: branches/SAMBA_4_0/source/lib/cmdline/popt_credentials.c === --- branches/SAMBA_4_0/source/lib/cmdline/popt_credentials.c2007-04-19 09:15:55 UTC (rev 22367) +++ branches/SAMBA_4_0/source/lib/cmdline/popt_credentials.c2007-04-19 09:26:03 UTC (rev 22368) @@ -23,7 +23,6 @@ #include lib/cmdline/popt_common.h #include lib/cmdline/credentials.h #include auth/credentials/credentials.h -#include auth/credentials/credentials_krb5.h #include auth/gensec/gensec.h /* Handle command line options:
svn commit: samba r22369 - in branches/SAMBA_4_0/source/lib/util: .
Author: metze Date: 2007-04-19 12:51:04 + (Thu, 19 Apr 2007) New Revision: 22369 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22369 Log: add ZERO_STRUCT() ... macros to lib/util/util.h again to fix the openchange build... we need to remove them from libreplace, but I'll think about that next week. metze Modified: branches/SAMBA_4_0/source/lib/util/util.h Changeset: Modified: branches/SAMBA_4_0/source/lib/util/util.h === --- branches/SAMBA_4_0/source/lib/util/util.h 2007-04-19 09:26:03 UTC (rev 22368) +++ branches/SAMBA_4_0/source/lib/util/util.h 2007-04-19 12:51:04 UTC (rev 22369) @@ -82,4 +82,45 @@ #define strlen(x) valgrind_strlen(x) #endif +/** + * zero a structure + */ +#ifndef ZERO_STRUCT +#define ZERO_STRUCT(x) memset((char *)(x), 0, sizeof(x)) +#endif + +/** + * zero a structure given a pointer to the structure + */ +#ifndef ZERO_STRUCTP +#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0) +#endif + +/** + * zero a structure given a pointer to the structure - no zero check + */ +#ifndef ZERO_STRUCTPN +#define ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x))) +#endif + +/* zero an array - note that sizeof(array) must work - ie. it must not be a + pointer */ +#ifndef ZERO_ARRAY +#define ZERO_ARRAY(x) memset((char *)(x), 0, sizeof(x)) +#endif + +/** + * work out how many elements there are in a static array + */ +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) +#endif + +/** + * pointer difference macro + */ +#ifndef PTR_DIFF +#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2))) +#endif + #endif /* _SAMBA_UTIL_H_ */
svn commit: samba r22370 - in branches/SAMBA_3_0_25/source: . include libads libsmb
Author: gd Date: 2007-04-19 13:13:09 + (Thu, 19 Apr 2007) New Revision: 22370 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22370 Log: Merge -r21777:21779 from 3_0 to fix the build with Heimdal 0.8. Guenther Modified: branches/SAMBA_3_0_25/source/configure.in branches/SAMBA_3_0_25/source/include/includes.h branches/SAMBA_3_0_25/source/libads/kerberos.c branches/SAMBA_3_0_25/source/libsmb/clikrb5.c Changeset: Modified: branches/SAMBA_3_0_25/source/configure.in === --- branches/SAMBA_3_0_25/source/configure.in 2007-04-19 12:51:04 UTC (rev 22369) +++ branches/SAMBA_3_0_25/source/configure.in 2007-04-19 13:13:09 UTC (rev 22370) @@ -3564,6 +3564,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_25/source/include/includes.h === --- branches/SAMBA_3_0_25/source/include/includes.h 2007-04-19 12:51:04 UTC (rev 22369) +++ branches/SAMBA_3_0_25/source/include/includes.h 2007-04-19 13:13:09 UTC (rev 22370) @@ -1191,8 +1191,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); krb5_error_code smb_krb5_mk_error(krb5_context context, krb5_error_code error_code, const krb5_principal server, Modified: branches/SAMBA_3_0_25/source/libads/kerberos.c === --- branches/SAMBA_3_0_25/source/libads/kerberos.c 2007-04-19 12:51:04 UTC (rev 22369) +++ branches/SAMBA_3_0_25/source/libads/kerberos.c 2007-04-19 13:13:09 UTC (rev 22370) @@ -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); @@ -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_25/source/libsmb/clikrb5.c === --- branches/SAMBA_3_0_25/source/libsmb/clikrb5.c 2007-04-19 12:51:04 UTC (rev 22369) +++ branches/SAMBA_3_0_25/source/libsmb/clikrb5.c 2007-04-19 13:13:09 UTC (rev 22370) @@ -1399,9 +1399,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
svn commit: samba r22371 - in branches/SAMBA_4_0/source/lib/util: .
Author: metze Date: 2007-04-19 13:30:07 + (Thu, 19 Apr 2007) New Revision: 22371 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22371 Log: readd discard_const() to lib/util/util.h metze Modified: branches/SAMBA_4_0/source/lib/util/util.h Changeset: Modified: branches/SAMBA_4_0/source/lib/util/util.h === --- branches/SAMBA_4_0/source/lib/util/util.h 2007-04-19 13:13:09 UTC (rev 22370) +++ branches/SAMBA_4_0/source/lib/util/util.h 2007-04-19 13:30:07 UTC (rev 22371) @@ -42,6 +42,33 @@ #include lib/util/util_proto.h /** + this is a warning hack. The idea is to use this everywhere that we + get the discarding const warning from gcc. That doesn't actually + fix the problem of course, but it means that when we do get to + cleaning them up we can do it by searching the code for + discard_const. + + It also means that other error types aren't as swamped by the noise + of hundreds of const warnings, so we are more likely to notice when + we get new errors. + + Please only add more uses of this macro when you find it + _really_ hard to fix const warnings. Our aim is to eventually use + this function in only a very few places. + + Also, please call this via the discard_const_p() macro interface, as that + makes the return type safe. +*/ +#ifndef discard_const +#define discard_const(ptr) ((void *)((intptr_t)(ptr))) +#endif + +/** Type-safe version of discard_const */ +#ifndef discard_const_p +#define discard_const_p(type, ptr) ((type *)discard_const(ptr)) +#endif + +/** * assert macros */ #define SMB_ASSERT(b) do { if (!(b)) { \
svn commit: samba r22372 - in branches/SAMBA_4_0/source/lib/util: .
Author: metze Date: 2007-04-19 14:14:11 + (Thu, 19 Apr 2007) New Revision: 22372 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22372 Log: split out become_daemon() into it's own function this remove the dependency of util.o to swrap_close which causes sometrouble with the pidl tests on some hosts metze Modified: branches/SAMBA_4_0/source/lib/util/config.mk branches/SAMBA_4_0/source/lib/util/util.c Changeset: Modified: branches/SAMBA_4_0/source/lib/util/config.mk === --- branches/SAMBA_4_0/source/lib/util/config.mk2007-04-19 13:30:07 UTC (rev 22371) +++ branches/SAMBA_4_0/source/lib/util/config.mk2007-04-19 14:14:11 UTC (rev 22372) @@ -26,7 +26,8 @@ ms_fnmatch.o \ mutex.o \ idtree.o \ - module.o + module.o \ + become_daemon.o PUBLIC_DEPENDENCIES = \ LIBTALLOC LIBCRYPTO \ SOCKET_WRAPPER EXT_NSL \ Modified: branches/SAMBA_4_0/source/lib/util/util.c === --- branches/SAMBA_4_0/source/lib/util/util.c 2007-04-19 13:30:07 UTC (rev 22371) +++ branches/SAMBA_4_0/source/lib/util/util.c 2007-04-19 14:14:11 UTC (rev 22372) @@ -141,42 +141,6 @@ } -/*** - Close the low 3 fd's and open dev/null in their place. -/ -static void close_low_fds(BOOL stderr_too) -{ -#ifndef VALGRIND - int fd; - int i; - - close(0); - close(1); - - if (stderr_too) - close(2); - - /* try and use up these file descriptors, so silly - library routines writing to stdout etc won't cause havoc */ - for (i=0;i3;i++) { - if (i == 2 !stderr_too) - continue; - - fd = open(/dev/null,O_RDWR,0); - if (fd 0) - fd = open(/dev/null,O_WRONLY,0); - if (fd 0) { - DEBUG(0,(Can't open /dev/null\n)); - return; - } - if (fd != i) { - DEBUG(0,(Didn't get file descriptor %d\n,i)); - return; - } - } -#endif -} - /** Set a fd into blocking/nonblocking mode. Uses POSIX O_NONBLOCK if available, else @@ -224,36 +188,6 @@ } /** - Become a daemon, discarding the controlling terminal. -**/ - -_PUBLIC_ void become_daemon(BOOL Fork) -{ - if (Fork) { - if (fork()) { - _exit(0); - } - } - - /* detach from the terminal */ -#ifdef HAVE_SETSID - setsid(); -#elif defined(TIOCNOTTY) - { - int i = open(/dev/tty, O_RDWR, 0); - if (i != -1) { - ioctl(i, (int) TIOCNOTTY, (char *)0); - close(i); - } - } -#endif /* HAVE_SETSID */ - - /* Close fd's 0,1,2. Needed if started by rsh */ - close_low_fds(False); /* Don't close stderr, let the debug system - attach it to the logfile */ -} - -/** Get my own name, return in malloc'ed storage. **/
svn commit: samba r22373 - in branches/SAMBA_4_0/source/lib/util: .
Author: metze Date: 2007-04-19 14:21:56 + (Thu, 19 Apr 2007) New Revision: 22373 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22373 Log: move in_list() to util_strlist.c to remove the dependency from util.o to next_token() and strcasecmp_m() with this the pidl tests link better on some hosts metze Modified: branches/SAMBA_4_0/source/lib/util/util_str.c branches/SAMBA_4_0/source/lib/util/util_strlist.c Changeset: Modified: branches/SAMBA_4_0/source/lib/util/util_str.c === --- branches/SAMBA_4_0/source/lib/util/util_str.c 2007-04-19 14:14:11 UTC (rev 22372) +++ branches/SAMBA_4_0/source/lib/util/util_str.c 2007-04-19 14:21:56 UTC (rev 22373) @@ -25,7 +25,6 @@ #include includes.h #include libcli/raw/smb.h #include pstring.h -#include lib/ldb/include/ldb.h #include system/locale.h /** @@ -247,29 +246,6 @@ } /** - Check if a string is part of a list. -**/ -_PUBLIC_ BOOL in_list(const char *s, const char *list, BOOL casesensitive) -{ - pstring tok; - const char *p=list; - - if (!list) - return(False); - - while (next_token(p,tok,LIST_SEP,sizeof(tok))) { - if (casesensitive) { - if (strcmp(tok,s) == 0) - return(True); - } else { - if (strcasecmp_m(tok,s) == 0) - return(True); - } - } - return(False); -} - -/** Set a string value, allocing the space for the string **/ static BOOL string_init(char **dest,const char *src) Modified: branches/SAMBA_4_0/source/lib/util/util_strlist.c === --- branches/SAMBA_4_0/source/lib/util/util_strlist.c 2007-04-19 14:14:11 UTC (rev 22372) +++ branches/SAMBA_4_0/source/lib/util/util_strlist.c 2007-04-19 14:21:56 UTC (rev 22373) @@ -20,6 +20,8 @@ */ #include includes.h +#include pstring.h +#include system/locale.h /** * @file @@ -298,3 +300,26 @@ } return False; } + +/** + Check if a string is part of a list. +**/ +_PUBLIC_ BOOL in_list(const char *s, const char *list, BOOL casesensitive) +{ + pstring tok; + const char *p=list; + + if (!list) + return(False); + + while (next_token(p,tok,LIST_SEP,sizeof(tok))) { + if (casesensitive) { + if (strcmp(tok,s) == 0) + return(True); + } else { + if (strcasecmp_m(tok,s) == 0) + return(True); + } + } + return(False); +}
svn commit: samba r22374 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 14:51:46 + (Thu, 19 Apr 2007) New Revision: 22374 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22374 Log: fix perl warnings metze Modified: branches/SAMBA_4_0/source/script/tests/SocketWrapper.pm Changeset: Modified: branches/SAMBA_4_0/source/script/tests/SocketWrapper.pm === --- branches/SAMBA_4_0/source/script/tests/SocketWrapper.pm 2007-04-19 14:21:56 UTC (rev 22373) +++ branches/SAMBA_4_0/source/script/tests/SocketWrapper.pm 2007-04-19 14:51:46 UTC (rev 22374) @@ -35,8 +35,18 @@ } } - $ENV{SOCKET_WRAPPER_PCAP_DIR} = $pcap_dir; - $ENV{SOCKET_WRAPPER_DIR} = $dir; + if (defined($pcap_dir)) { + $ENV{SOCKET_WRAPPER_PCAP_DIR} = $pcap_dir; + } else { + delete $ENV{SOCKET_WRAPPER_PCAP_DIR}; + } + + if (defined($dir)) { + $ENV{SOCKET_WRAPPER_DIR} = $dir; + } else { + delete $ENV{SOCKET_WRAPPER_DIR}; + } + return $dir; }
svn commit: samba r22375 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 14:54:09 + (Thu, 19 Apr 2007) New Revision: 22375 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22375 Log: implement check_env() logic in the frontend metze Modified: branches/SAMBA_4_0/source/script/tests/Samba3.pm branches/SAMBA_4_0/source/script/tests/Samba4.pm branches/SAMBA_4_0/source/script/tests/selftest.pl Changeset: Modified: branches/SAMBA_4_0/source/script/tests/Samba3.pm === --- branches/SAMBA_4_0/source/script/tests/Samba3.pm2007-04-19 14:51:46 UTC (rev 22374) +++ branches/SAMBA_4_0/source/script/tests/Samba3.pm2007-04-19 14:54:09 UTC (rev 22375) @@ -47,6 +47,14 @@ return ; } +sub check_env($$) +{ + my ($self, $envvars) = @_; + + # TODO ... + return 1; +} + sub setup_env($$$) { my ($self, $envname, $path) = @_; Modified: branches/SAMBA_4_0/source/script/tests/Samba4.pm === --- branches/SAMBA_4_0/source/script/tests/Samba4.pm2007-04-19 14:51:46 UTC (rev 22374) +++ branches/SAMBA_4_0/source/script/tests/Samba4.pm2007-04-19 14:54:09 UTC (rev 22375) @@ -675,6 +675,14 @@ return $out; } +sub check_env($$) +{ + my ($self, $envvars) = @_; + + # TODO ... + return 1; +} + sub setup_env($$$) { my ($self, $envname, $path) = @_; Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl === --- branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 14:51:46 UTC (rev 22374) +++ branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 14:54:09 UTC (rev 22375) @@ -679,11 +679,17 @@ my $testenv_vars; if (defined($running_envs{$envname})) { $testenv_vars = $running_envs{$envname}; + if (not $target-check_env($testenv_vars)) { + $testenv_vars = undef; + } } elsif ($envname eq none) { $testenv_vars = {}; } else { $testenv_vars = $target-setup_env($envname, $prefix); } + + return undef unless defined($testenv_vars); + write_clientconf($conffile, $testenv_vars); foreach (PASSWORD, DOMAIN, SERVER, USERNAME, NETBIOSNAME, KRB5_CONFIG, REALM) { @@ -707,6 +713,13 @@ return $target-getlog_env($running_envs{$envname}); } +sub check_env($) +{ + my ($envname) = @_; + return 1 if ($envname eq none); + return $target-check_env($running_envs{$envname}); +} + sub teardown_env($) { my ($envname) = @_; @@ -750,7 +763,14 @@ next; } - setup_env($envname); + my $envvars = setup_env($envname); + if (not defined($envvars)) { + push(@$suitesfailed, $name); + $statistics-{SUITES_FAIL}++; + $statistics-{TESTS_ERROR}++; + print FAIL: $name (ENV[$envname] not available!)\n; + next; + } run_test($envname, $name, $cmd, $i, $suitestotal, $msg_ops);
svn commit: samba r22376 - in branches: SAMBA_3_0/source SAMBA_3_0_25/source
Author: gd Date: 2007-04-19 14:58:22 + (Thu, 19 Apr 2007) New Revision: 22376 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22376 Log: Make sure we use krb5 when we identify just an older heimdal lib (0.6.x) Timur, please check. Guenther Modified: branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0_25/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-04-19 14:54:09 UTC (rev 22375) +++ branches/SAMBA_3_0/source/configure.in 2007-04-19 14:58:22 UTC (rev 22376) @@ -3548,6 +3548,7 @@ AC_CHECK_FUNC_EXT(krb5_crypto_destroy, $KRB5_LIBS) AC_CHECK_FUNC_EXT(krb5_decode_ap_req, $KRB5_LIBS) AC_CHECK_FUNC_EXT(free_AP_REQ, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_verify_checksum, $KRB5_LIBS) AC_CHECK_FUNC_EXT(krb5_c_verify_checksum, $KRB5_LIBS) AC_CHECK_FUNC_EXT(krb5_principal_compare_any_realm, $KRB5_LIBS) AC_CHECK_FUNC_EXT(krb5_parse_name_norealm, $KRB5_LIBS) Modified: branches/SAMBA_3_0_25/source/configure.in === --- branches/SAMBA_3_0_25/source/configure.in 2007-04-19 14:54:09 UTC (rev 22375) +++ branches/SAMBA_3_0_25/source/configure.in 2007-04-19 14:58:22 UTC (rev 22376) @@ -3526,6 +3526,7 @@ AC_CHECK_FUNC_EXT(krb5_crypto_destroy, $KRB5_LIBS) AC_CHECK_FUNC_EXT(krb5_decode_ap_req, $KRB5_LIBS) AC_CHECK_FUNC_EXT(free_AP_REQ, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_verify_checksum, $KRB5_LIBS) AC_CHECK_FUNC_EXT(krb5_c_verify_checksum, $KRB5_LIBS) AC_CHECK_FUNC_EXT(krb5_principal_compare_any_realm, $KRB5_LIBS) AC_CHECK_FUNC_EXT(krb5_parse_name_norealm, $KRB5_LIBS)
svn commit: samba r22377 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 15:03:35 + (Thu, 19 Apr 2007) New Revision: 22377 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22377 Log: implement check_env() for samba4 metze Modified: branches/SAMBA_4_0/source/script/tests/Samba4.pm Changeset: Modified: branches/SAMBA_4_0/source/script/tests/Samba4.pm === --- branches/SAMBA_4_0/source/script/tests/Samba4.pm2007-04-19 14:58:22 UTC (rev 22376) +++ branches/SAMBA_4_0/source/script/tests/Samba4.pm2007-04-19 15:03:35 UTC (rev 22377) @@ -679,8 +679,9 @@ { my ($self, $envvars) = @_; - # TODO ... - return 1; + return 1 if (-p $envvars-{SMBD_TEST_FIFO}); + + return 0; } sub setup_env($$$)
svn commit: samba r22378 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 15:05:59 + (Thu, 19 Apr 2007) New Revision: 22378 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22378 Log: none needs to be checked first metze Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl Changeset: Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl === --- branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 15:03:35 UTC (rev 22377) +++ branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 15:05:59 UTC (rev 22378) @@ -677,13 +677,13 @@ my ($envname) = @_; my $testenv_vars; - if (defined($running_envs{$envname})) { + if ($envname eq none) { + $testenv_vars = {}; + } elsif (defined($running_envs{$envname})) { $testenv_vars = $running_envs{$envname}; if (not $target-check_env($testenv_vars)) { $testenv_vars = undef; } - } elsif ($envname eq none) { - $testenv_vars = {}; } else { $testenv_vars = $target-setup_env($envname, $prefix); }
svn commit: samba r22379 - in branches/SAMBA_4_0/source/lib/util: .
Author: metze Date: 2007-04-19 15:56:44 + (Thu, 19 Apr 2007) New Revision: 22379 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22379 Log: add missing file metze Added: branches/SAMBA_4_0/source/lib/util/become_daemon.c Changeset: Added: branches/SAMBA_4_0/source/lib/util/become_daemon.c === --- branches/SAMBA_4_0/source/lib/util/become_daemon.c 2007-04-19 15:05:59 UTC (rev 22378) +++ branches/SAMBA_4_0/source/lib/util/become_daemon.c 2007-04-19 15:56:44 UTC (rev 22379) @@ -0,0 +1,94 @@ +/* + Unix SMB/CIFS implementation. + Samba utility functions + Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) Jeremy Allison 2001-2002 + Copyright (C) Simo Sorce 2001 + Copyright (C) Jim McDonough ([EMAIL PROTECTED]) 2003. + Copyright (C) James J Myers 2003 + + 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 system/filesys.h +#include system/locale.h + +/*** + Close the low 3 fd's and open dev/null in their place. +/ +static void close_low_fds(BOOL stderr_too) +{ +#ifndef VALGRIND + int fd; + int i; + + close(0); + close(1); + + if (stderr_too) + close(2); + + /* try and use up these file descriptors, so silly + library routines writing to stdout etc won't cause havoc */ + for (i=0;i3;i++) { + if (i == 2 !stderr_too) + continue; + + fd = open(/dev/null,O_RDWR,0); + if (fd 0) + fd = open(/dev/null,O_WRONLY,0); + if (fd 0) { + DEBUG(0,(Can't open /dev/null\n)); + return; + } + if (fd != i) { + DEBUG(0,(Didn't get file descriptor %d\n,i)); + return; + } + } +#endif +} + +/** + Become a daemon, discarding the controlling terminal. +**/ + +_PUBLIC_ void become_daemon(BOOL Fork) +{ + if (Fork) { + if (fork()) { + _exit(0); + } + } + + /* detach from the terminal */ +#ifdef HAVE_SETSID + setsid(); +#elif defined(TIOCNOTTY) + { + int i = open(/dev/tty, O_RDWR, 0); + if (i != -1) { + ioctl(i, (int) TIOCNOTTY, (char *)0); + close(i); + } + } +#endif /* HAVE_SETSID */ + + /* Close fd's 0,1,2. Needed if started by rsh */ + close_low_fds(False); /* Don't close stderr, let the debug system + attach it to the logfile */ +} +
svn commit: samba r22380 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 16:37:11 + (Thu, 19 Apr 2007) New Revision: 22380 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22380 Log: get the output of the exited smbd... this shows all the memory leaks now... metze Modified: branches/SAMBA_4_0/source/script/tests/Samba4.pm Changeset: Modified: branches/SAMBA_4_0/source/script/tests/Samba4.pm === --- branches/SAMBA_4_0/source/script/tests/Samba4.pm2007-04-19 15:56:44 UTC (rev 22379) +++ branches/SAMBA_4_0/source/script/tests/Samba4.pm2007-04-19 16:37:11 UTC (rev 22380) @@ -652,6 +652,8 @@ $self-slapd_stop($envvars) if ($self-{ldap}); + print $self-getlog_env($envvars); + return $failed; } @@ -681,6 +683,8 @@ return 1 if (-p $envvars-{SMBD_TEST_FIFO}); + print $self-getlog_env($envvars); + return 0; }
svn commit: samba r22381 - in branches/SAMBA_4_0/source/smb_server/smb: .
Author: metze Date: 2007-04-19 16:50:16 + (Thu, 19 Apr 2007) New Revision: 22381 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22381 Log: fix memory leak metze Modified: branches/SAMBA_4_0/source/smb_server/smb/service.c Changeset: Modified: branches/SAMBA_4_0/source/smb_server/smb/service.c === --- branches/SAMBA_4_0/source/smb_server/smb/service.c 2007-04-19 16:37:11 UTC (rev 22380) +++ branches/SAMBA_4_0/source/smb_server/smb/service.c 2007-04-19 16:50:16 UTC (rev 22381) @@ -174,7 +174,7 @@ if (con-generic.level == RAW_TCON_TCON) { DATA_BLOB password; - password = data_blob(con-tcon.in.password, strlen(con-tcon.in.password) + 1); + password = data_blob_string_const(con-tcon.in.password); status = make_connection(req, con-tcon.in.service, password, con-tcon.in.dev);
svn commit: samba r22382 - in branches/SAMBA_4_0/source/wrepl_server: .
Author: metze Date: 2007-04-19 17:00:15 + (Thu, 19 Apr 2007) New Revision: 22382 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22382 Log: fix memory leak metze Modified: branches/SAMBA_4_0/source/wrepl_server/wrepl_server.c Changeset: Modified: branches/SAMBA_4_0/source/wrepl_server/wrepl_server.c === --- branches/SAMBA_4_0/source/wrepl_server/wrepl_server.c 2007-04-19 16:50:16 UTC (rev 22381) +++ branches/SAMBA_4_0/source/wrepl_server/wrepl_server.c 2007-04-19 17:00:15 UTC (rev 22382) @@ -127,7 +127,7 @@ struct wreplsrv_partner *partner; struct ldb_result *res = NULL; int ret; - TALLOC_CTX *tmp_ctx = talloc_new(service); + TALLOC_CTX *tmp_ctx; int i; uint64_t new_seqnumber; @@ -138,6 +138,9 @@ return NT_STATUS_OK; } + tmp_ctx = talloc_new(service); + NT_STATUS_HAVE_NO_MEMORY(tmp_ctx); + service-config.seqnumber = new_seqnumber; /* find the record in the WINS database */
svn commit: samba r22383 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 17:29:57 + (Thu, 19 Apr 2007) New Revision: 22383 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22383 Log: maybe this fixes the mkdir not enough args failure on sun1 metze Modified: branches/SAMBA_4_0/source/script/tests/Samba3.pm Changeset: Modified: branches/SAMBA_4_0/source/script/tests/Samba3.pm === --- branches/SAMBA_4_0/source/script/tests/Samba3.pm2007-04-19 17:00:15 UTC (rev 22382) +++ branches/SAMBA_4_0/source/script/tests/Samba3.pm2007-04-19 17:29:57 UTC (rev 22383) @@ -8,6 +8,7 @@ use strict; use Cwd qw(abs_path); use FindBin qw($RealBin); +use POSIX; sub binpath($$) {
svn commit: samba r22384 - in branches/SAMBA_4_0/source/script/tests: .
Author: metze Date: 2007-04-19 17:50:57 + (Thu, 19 Apr 2007) New Revision: 22384 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22384 Log: print out the total selftest runtime and the time for each test we hit the max runtime of smbd on some hosts metze Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl Changeset: Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl === --- branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 17:29:57 UTC (rev 22383) +++ branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 17:50:57 UTC (rev 22384) @@ -191,6 +191,7 @@ $out .= Running test $state-{NAME} (level 0 stdout)\n; $out .= --==--==--==--==--==--==--==--==--==--==--\n; $out .= scalar(localtime()).\n; + $out .= SELFTEST RUNTIME: . ($state-{START} - $start) . s; $out .= NAME: $state-{NAME}\n; $out .= CMD: $state-{CMD}\n; @@ -211,6 +212,8 @@ my ($state, $expected_ret, $ret) = @_; my $out = ; + $out .= TEST RUNTIME: . (time() - $state-{START}) . s; + if ($ret == $expected_ret) { $out .= ALL OK\n; } else {
svn commit: samba r22385 - in branches/SAMBA_4_0/source/auth: .
Author: metze Date: 2007-04-19 17:52:31 + (Thu, 19 Apr 2007) New Revision: 22385 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22385 Log: remove unused include metze Modified: branches/SAMBA_4_0/source/auth/auth_util.c Changeset: Modified: branches/SAMBA_4_0/source/auth/auth_util.c === --- branches/SAMBA_4_0/source/auth/auth_util.c 2007-04-19 17:50:57 UTC (rev 22384) +++ branches/SAMBA_4_0/source/auth/auth_util.c 2007-04-19 17:52:31 UTC (rev 22385) @@ -28,7 +28,6 @@ #include libcli/auth/libcli_auth.h #include dsdb/samdb/samdb.h #include auth/credentials/credentials.h -#include auth/credentials/credentials_krb5.h /* this default function can be used by mostly all backends * which don't want to set a challenge
svn commit: samba r22386 - in branches/SAMBA_4_0/source/librpc/rpc: .
Author: metze Date: 2007-04-19 17:52:56 + (Thu, 19 Apr 2007) New Revision: 22386 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22386 Log: another unused include metze Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c === --- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c 2007-04-19 17:52:31 UTC (rev 22385) +++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c 2007-04-19 17:52:56 UTC (rev 22386) @@ -32,7 +32,6 @@ #include libcli/smb2/smb2_calls.h #include librpc/rpc/dcerpc.h #include auth/credentials/credentials.h -#include auth/credentials/credentials_krb5.h struct pipe_np_smb_state {
svn commit: samba r22387 - in branches/SAMBA_4_0/source/auth/credentials: .
Author: metze Date: 2007-04-19 17:55:52 + (Thu, 19 Apr 2007) New Revision: 22387 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22387 Log: see if this fixes the build on the aix1 hosts metze Modified: branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.h Changeset: Modified: branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.h === --- branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.h 2007-04-19 17:52:56 UTC (rev 22386) +++ branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.h 2007-04-19 17:55:52 UTC (rev 22387) @@ -21,7 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include heimdal/lib/gssapi/gssapi/gssapi.h +#include gssapi/gssapi.h struct ccache_container;
svn commit: samba r22388 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/nsswitch
Author: idra Date: 2007-04-19 20:00:40 + (Thu, 19 Apr 2007) New Revision: 22388 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22388 Log: clearer message, thanks David Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c branches/SAMBA_3_0_25/source/nsswitch/pam_winbind.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c === --- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-04-19 17:55:52 UTC (rev 22387) +++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-04-19 20:00:40 UTC (rev 22388) @@ -921,7 +921,7 @@ } else if (PAM_WB_CACHED_LOGON(info3_user_flgs)) { _make_remark(pamh, ctrl, PAM_ERROR_MSG, - Domain Controller unreachable, using cached credentials. Network resources may be unavailable); + Domain Controller unreachable, using cached credentials instead. Network resources may be unavailable); _pam_log_debug(pamh, ctrl, LOG_DEBUG, User %s logged on using cached account\n, username); } Modified: branches/SAMBA_3_0_25/source/nsswitch/pam_winbind.c === --- branches/SAMBA_3_0_25/source/nsswitch/pam_winbind.c 2007-04-19 17:55:52 UTC (rev 22387) +++ branches/SAMBA_3_0_25/source/nsswitch/pam_winbind.c 2007-04-19 20:00:40 UTC (rev 22388) @@ -921,7 +921,7 @@ } else if (PAM_WB_CACHED_LOGON(info3_user_flgs)) { _make_remark(pamh, ctrl, PAM_ERROR_MSG, - Domain Controller unreachable, using cached credentials. Network resources may be unavailable); + Domain Controller unreachable, using cached credentials instead. Network resources may be unavailable); _pam_log_debug(pamh, ctrl, LOG_DEBUG, User %s logged on using cached credentials\n, username); }
svn commit: samba r22389 - in branches/SAMBA_3_0/source: lib libsmb smbd
Author: jra Date: 2007-04-19 20:50:49 + (Thu, 19 Apr 2007) New Revision: 22389 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22389 Log: Start preparing for multiple encryption contexts in the server. Allow server to reflect back to calling client the encryption context that was sent. Jeremy. Modified: branches/SAMBA_3_0/source/lib/util.c branches/SAMBA_3_0/source/libsmb/smb_seal.c branches/SAMBA_3_0/source/smbd/aio.c branches/SAMBA_3_0/source/smbd/blocking.c branches/SAMBA_3_0/source/smbd/process.c branches/SAMBA_3_0/source/smbd/reply.c Changeset: Modified: branches/SAMBA_3_0/source/lib/util.c === --- branches/SAMBA_3_0/source/lib/util.c2007-04-19 20:00:40 UTC (rev 22388) +++ branches/SAMBA_3_0/source/lib/util.c2007-04-19 20:50:49 UTC (rev 22389) @@ -533,14 +533,20 @@ Set the length and marker of an smb packet. / -void smb_setlen(char *buf,int len) +void smb_setlen(char *buf,int len,const char *frombuf) { _smb_setlen(buf,len); - SCVAL(buf,4,0xFF); - SCVAL(buf,5,'S'); - SCVAL(buf,6,'M'); - SCVAL(buf,7,'B'); + if (frombuf) { + if (buf != frombuf) { + memcpy(buf+4, frombuf+4, 4); + } + } else { + SCVAL(buf,4,0xFF); + SCVAL(buf,5,'S'); + SCVAL(buf,6,'M'); + SCVAL(buf,7,'B'); + } } /*** @@ -554,7 +560,7 @@ } SCVAL(buf,smb_wct,num_words); SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes); - smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4); + smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4, NULL); return (smb_size + num_words*2 + num_bytes); } @@ -566,7 +572,7 @@ { int num_words = CVAL(buf,smb_wct); SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes); - smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4); + smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4, NULL); return (smb_size + num_words*2 + num_bytes); } Modified: branches/SAMBA_3_0/source/libsmb/smb_seal.c === --- branches/SAMBA_3_0/source/libsmb/smb_seal.c 2007-04-19 20:00:40 UTC (rev 22388) +++ branches/SAMBA_3_0/source/libsmb/smb_seal.c 2007-04-19 20:50:49 UTC (rev 22389) @@ -93,10 +93,11 @@ } memcpy(buf + 8, inbuf + 8 + NTLMSSP_SIG_SIZE, data_len); - SAFE_FREE(inbuf); /* Reset the length. */ - smb_setlen(buf, data_len + 4); + smb_setlen(buf, data_len + 4, inbuf); + + SAFE_FREE(inbuf); return NT_STATUS_OK; } @@ -203,7 +204,7 @@ } memcpy(buf + 8, out_buf.value, out_buf.length); - smb_setlen(buf, out_buf.length + 4); + smb_setlen(buf, out_buf.length + 4, out_buf.value); gss_release_buffer(minor, out_buf); return NT_STATUS_OK; Modified: branches/SAMBA_3_0/source/smbd/aio.c === --- branches/SAMBA_3_0/source/smbd/aio.c2007-04-19 20:00:40 UTC (rev 22388) +++ branches/SAMBA_3_0/source/smbd/aio.c2007-04-19 20:50:49 UTC (rev 22389) @@ -49,8 +49,10 @@ of the aio_read call. */ -static struct aio_extra *create_aio_ex_read(files_struct *fsp, size_t buflen, - uint16 mid) +static struct aio_extra *create_aio_ex_read(files_struct *fsp, + size_t buflen, + uint16 mid, + const char *inbuf) { struct aio_extra *aio_ex = SMB_MALLOC_P(struct aio_extra); @@ -66,6 +68,14 @@ SAFE_FREE(aio_ex); return NULL; } + /* Save the first 8 bytes of inbuf for possible enc data. */ + aio_ex-inbuf = SMB_MALLOC_ARRAY(char, 8); + if (!aio_ex-inbuf) { + SAFE_FREE(aio_ex-outbuf); + SAFE_FREE(aio_ex); + return NULL; + } + memcpy(aio_ex-inbuf, inbuf, 8); DLIST_ADD(aio_list_head, aio_ex); aio_ex-fsp = fsp; aio_ex-read_req = True; @@ -408,7 +418,7 @@ aio_ex-acb.aio_nbytes, (int)nread ) ); } - smb_setlen(outbuf,outsize - 4); + smb_setlen(outbuf,outsize - 4,aio_ex-inbuf); show_msg(outbuf); if (!send_smb(smbd_server_fd(),outbuf)) { exit_server_cleanly(handle_aio_read_complete: send_smb Modified: branches/SAMBA_3_0/source/smbd/blocking.c === ---
Rev 168: merged fix from volker (thanks!) in http://samba.org/~tridge/ctdb
revno: 168 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Fri 2007-04-20 07:50:34 +1000 message: merged fix from volker (thanks!) modified: common/ctdb_daemon.c ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1 merged: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Volker Lendecke [EMAIL PROTECTED] branch nick: vl-ctdb timestamp: Thu 2007-04-19 17:44:45 +0200 message: The remote node needs to get the IMMEDIATE_MIGRATION flag to actually send the record === modified file 'common/ctdb_daemon.c' --- a/common/ctdb_daemon.c 2007-04-19 21:47:37 + +++ b/common/ctdb_daemon.c 2007-04-19 21:50:34 + @@ -361,6 +361,7 @@ call-key = key; call-call_data.dptr = c-data + c-keylen; call-call_data.dsize = c-calldatalen; + call-flags = c-flags; if (header.dmaster == ctdb-vnn !(ctdb-flags CTDB_FLAG_SELF_CONNECT)) { state = ctdb_call_local_send(ctdb_db, call, header, data);
Rev 167: minor debug changes in http://samba.org/~tridge/ctdb
revno: 167 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Fri 2007-04-20 07:47:37 +1000 message: minor debug changes modified: common/ctdb_daemon.c ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1 common/ctdb_message.c ctdb_message.c-20070208224107-9dnio7x7z33prrmt-1 === modified file 'common/ctdb_daemon.c' --- a/common/ctdb_daemon.c 2007-04-19 06:27:56 + +++ b/common/ctdb_daemon.c 2007-04-19 21:47:37 + @@ -121,6 +121,9 @@ if (res != 0) { DEBUG(0,(__location__ Failed to register handler %u in daemon\n, c-srvid)); + } else { + DEBUG(2,(__location__ Registered message handler for srvid=%u\n, +c-srvid)); } } === modified file 'common/ctdb_message.c' --- a/common/ctdb_message.c 2007-04-17 12:27:17 + +++ b/common/ctdb_message.c 2007-04-19 21:47:37 + @@ -42,7 +42,7 @@ if (ml-srvid == srvid || ml-srvid == CTDB_SRVID_ALL) break; } if (ml == NULL) { - DEBUG(0,(__location__ daemon vnn:%d no msg handler for srvid=%u\n, + DEBUG(1,(__location__ daemon vnn:%d no msg handler for srvid=%u\n, ctdb_get_vnn(ctdb), srvid)); /* no registered message handler */ return -1;
svn commit: samba r22390 - in branches: SAMBA_3_0/source/auth SAMBA_3_0/source/include SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/auth SAMBA_3_0_25/source/include SAMBA_3_0_25/source/nsswitch
Author: jerry Date: 2007-04-19 22:26:09 + (Thu, 19 Apr 2007) New Revision: 22390 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22390 Log: Patchset sent to samba-technical to address the winbind loop when allocating a new id for a SID: auth_util.patch Revert create_local_token() to the 3.0.24 codebase idmap_type.patchHave the caller fillin the id_map.xid.type field when resolving a SID so that if we allocate a new id, we know what type to use winbindd_api.patch Remove the WINBINDD_SIDS_TO_XIDS calls from the public winbindd interface for the 3.0.25 release idmap_rid.patch Cleanup the idmap_rid backend to not call back into winbindd to resolve the SID in order to verify it's type. Modified: branches/SAMBA_3_0/source/auth/auth_util.c branches/SAMBA_3_0/source/include/idmap.h branches/SAMBA_3_0/source/include/smb.h branches/SAMBA_3_0/source/nsswitch/idmap.c branches/SAMBA_3_0/source/nsswitch/idmap_rid.c branches/SAMBA_3_0/source/nsswitch/idmap_util.c branches/SAMBA_3_0/source/nsswitch/winbindd.c branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c branches/SAMBA_3_0_25/source/auth/auth_util.c branches/SAMBA_3_0_25/source/include/idmap.h branches/SAMBA_3_0_25/source/include/smb.h branches/SAMBA_3_0_25/source/nsswitch/idmap.c branches/SAMBA_3_0_25/source/nsswitch/idmap_rid.c branches/SAMBA_3_0_25/source/nsswitch/idmap_util.c branches/SAMBA_3_0_25/source/nsswitch/winbindd.c branches/SAMBA_3_0_25/source/nsswitch/winbindd_dual.c Changeset: Sorry, the patch is too large (907 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22390
svn commit: samba r22391 - in branches/SAMBA_3_0/source: include lib libsmb nmbd smbd
Author: jra Date: 2007-04-19 22:40:32 + (Thu, 19 Apr 2007) New Revision: 22391 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22391 Log: Looks bigger than it is. Make inbuf available to all callers of smb_setlen (via set_message() calls). This will allow the server to reflect back the correct encryption context. Jeremy. Modified: branches/SAMBA_3_0/source/include/smb_macros.h branches/SAMBA_3_0/source/lib/util.c branches/SAMBA_3_0/source/libsmb/cliconnect.c branches/SAMBA_3_0/source/libsmb/clidgram.c branches/SAMBA_3_0/source/libsmb/clientgen.c branches/SAMBA_3_0/source/libsmb/clifile.c branches/SAMBA_3_0/source/libsmb/clilist.c branches/SAMBA_3_0/source/libsmb/climessage.c branches/SAMBA_3_0/source/libsmb/clioplock.c branches/SAMBA_3_0/source/libsmb/cliprint.c branches/SAMBA_3_0/source/libsmb/clireadwrite.c branches/SAMBA_3_0/source/libsmb/clitrans.c branches/SAMBA_3_0/source/libsmb/smb_seal.c branches/SAMBA_3_0/source/nmbd/nmbd_packets.c branches/SAMBA_3_0/source/smbd/aio.c branches/SAMBA_3_0/source/smbd/blocking.c branches/SAMBA_3_0/source/smbd/error.c branches/SAMBA_3_0/source/smbd/ipc.c branches/SAMBA_3_0/source/smbd/lanman.c branches/SAMBA_3_0/source/smbd/message.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/oplock.c branches/SAMBA_3_0/source/smbd/pipes.c branches/SAMBA_3_0/source/smbd/process.c branches/SAMBA_3_0/source/smbd/reply.c branches/SAMBA_3_0/source/smbd/sesssetup.c branches/SAMBA_3_0/source/smbd/trans2.c Changeset: Sorry, the patch is too large (2435 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22391
svn commit: samba r22392 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/nsswitch
Author: idra Date: 2007-04-19 23:15:33 + (Thu, 19 Apr 2007) New Revision: 22392 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22392 Log: Remove leftover potentially segfaulty code. Check we are online before actually trying to connect anywhere Modified: branches/SAMBA_3_0/source/nsswitch/idmap_ad.c branches/SAMBA_3_0_25/source/nsswitch/idmap_ad.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/idmap_ad.c === --- branches/SAMBA_3_0/source/nsswitch/idmap_ad.c 2007-04-19 22:40:32 UTC (rev 22391) +++ branches/SAMBA_3_0/source/nsswitch/idmap_ad.c 2007-04-19 23:15:33 UTC (rev 22392) @@ -695,9 +695,6 @@ ad_map_type = WB_POSIX_MAP_SFU; - if ( !ad_idmap_ads ) - return idmap_ad_initialize(NULL); - return NT_STATUS_OK; } @@ -716,9 +713,6 @@ ad_map_type = WB_POSIX_MAP_RFC2307; - if ( !ad_idmap_ads ) - return idmap_ad_initialize(NULL); - return NT_STATUS_OK; } @@ -737,6 +731,11 @@ { ADS_STRUCT *ads_internal = NULL; + /* Only do query if we are online */ + if (idmap_is_offline()) { + return NT_STATUS_FILE_IS_OFFLINE; + } + /* We are assuming that the internal ADS_STRUCT is for the same forest as the incoming *ads pointer */ Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap_ad.c === --- branches/SAMBA_3_0_25/source/nsswitch/idmap_ad.c2007-04-19 22:40:32 UTC (rev 22391) +++ branches/SAMBA_3_0_25/source/nsswitch/idmap_ad.c2007-04-19 23:15:33 UTC (rev 22392) @@ -695,9 +695,6 @@ ad_map_type = WB_POSIX_MAP_SFU; - if ( !ad_idmap_ads ) - return idmap_ad_initialize(NULL); - return NT_STATUS_OK; } @@ -716,9 +713,6 @@ ad_map_type = WB_POSIX_MAP_RFC2307; - if ( !ad_idmap_ads ) - return idmap_ad_initialize(NULL); - return NT_STATUS_OK; } @@ -737,6 +731,11 @@ { ADS_STRUCT *ads_internal = NULL; + /* Only do query if we are online */ + if (idmap_is_offline()) { + return NT_STATUS_FILE_IS_OFFLINE; + } + /* We are assuming that the internal ADS_STRUCT is for the same forest as the incoming *ads pointer */
svn commit: samba r22393 - in branches/SAMBA_3_0/source/nsswitch: .
Author: idra Date: 2007-04-19 23:25:37 + (Thu, 19 Apr 2007) New Revision: 22393 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22393 Log: fix cutpaste error Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c === --- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-04-19 23:15:33 UTC (rev 22392) +++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2007-04-19 23:25:37 UTC (rev 22393) @@ -923,7 +923,7 @@ _make_remark(pamh, ctrl, PAM_ERROR_MSG, Domain Controller unreachable, using cached credentials instead. Network resources may be unavailable); _pam_log_debug(pamh, ctrl, LOG_DEBUG, - User %s logged on using cached account\n, username); + User %s logged on using cached credentials\n, username); } }
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 r22395 - in branches: SAMBA_3_0/source/profile SAMBA_3_0/source/smbd SAMBA_3_0_25/source/profile SAMBA_3_0_25/source/smbd
Author: herb Date: 2007-04-20 01:52:44 + (Fri, 20 Apr 2007) New Revision: 22395 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22395 Log: allow profiling level to be set on startup Modified: branches/SAMBA_3_0/source/profile/profile.c branches/SAMBA_3_0/source/smbd/server.c branches/SAMBA_3_0_25/source/profile/profile.c branches/SAMBA_3_0_25/source/smbd/server.c Changeset: Modified: branches/SAMBA_3_0/source/profile/profile.c === --- branches/SAMBA_3_0/source/profile/profile.c 2007-04-19 23:47:55 UTC (rev 22394) +++ branches/SAMBA_3_0/source/profile/profile.c 2007-04-20 01:52:44 UTC (rev 22395) @@ -42,14 +42,10 @@ BOOL do_profile_times = False; / -receive a set profile level message +Set a profiling level. / -void profile_message(int msg_type, struct process_id src, -void *buf, size_t len, void *private_data) +void set_profile_level(int level, struct process_id src) { -int level; - - memcpy(level, buf, sizeof(int)); #ifdef WITH_PROFILE switch (level) { case 0: /* turn off profiling */ @@ -95,6 +91,17 @@ } / +receive a set profile level message +/ +void profile_message(int msg_type, struct process_id src, void *buf, size_t len, void *private_data) +{ +int level; + + memcpy(level, buf, sizeof(int)); + set_profile_level(level, src); +} + +/ receive a request profile level message / void reqprofile_message(int msg_type, struct process_id src, Modified: branches/SAMBA_3_0/source/smbd/server.c === --- branches/SAMBA_3_0/source/smbd/server.c 2007-04-19 23:47:55 UTC (rev 22394) +++ branches/SAMBA_3_0/source/smbd/server.c 2007-04-20 01:52:44 UTC (rev 22395) @@ -863,6 +863,7 @@ static BOOL no_process_group = False; static BOOL log_stdout = False; static char *ports = NULL; + static char *profile_level = NULL; int opt; poptContext pc; @@ -875,6 +876,7 @@ {log-stdout, 'S', POPT_ARG_VAL, log_stdout, True, Log to stdout }, {build-options, 'b', POPT_ARG_NONE, NULL, 'b', Print build options }, {port, 'p', POPT_ARG_STRING, ports, 0, Listen on the specified ports}, + {profiling-level, 'P', POPT_ARG_STRING, profile_level, 0, Set profiling level,PROFILE_LEVEL}, POPT_COMMON_SAMBA POPT_COMMON_DYNCONFIG POPT_TABLEEND @@ -997,6 +999,14 @@ DEBUG(0,(ERROR: failed to setup profiling\n)); return -1; } + if (profile_level != NULL) { + int pl = atoi(profile_level); + struct process_id src; + + DEBUG(1, (setting profiling level: %s\n,profile_level)); + src.pid = getpid(); + set_profile_level(pl, src); + } #endif DEBUG(3,( loaded services\n)); Modified: branches/SAMBA_3_0_25/source/profile/profile.c === --- branches/SAMBA_3_0_25/source/profile/profile.c 2007-04-19 23:47:55 UTC (rev 22394) +++ branches/SAMBA_3_0_25/source/profile/profile.c 2007-04-20 01:52:44 UTC (rev 22395) @@ -42,13 +42,10 @@ BOOL do_profile_times = False; / -receive a set profile level message +Set a profiling level. / -void profile_message(int msg_type, struct process_id src, void *buf, size_t len, void *private_data) +void set_profile_level(int level, struct process_id src) { -int level; - - memcpy(level, buf, sizeof(int)); #ifdef WITH_PROFILE switch (level) { case 0: /* turn off profiling */ @@ -94,6 +91,17 @@ } / +receive a set profile level message +/ +void profile_message(int msg_type, struct process_id src, void *buf, size_t len, void *private_data) +{ +int level; + + memcpy(level, buf, sizeof(int)); + set_profile_level(level, src); +} + +/ receive a request profile level message / void
Re: svn commit: samba r22394 - in branches/SAMBA_3_0/source/lib/replace/test: .
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] schrieb: 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; } Hi James, please merge this to 4_0 and 3_0_25 metze -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFGKFSPm70gjA5TCD8RAhueAKDJD1t79+HxntifWsNBInR6r/4v3ACeI7rQ iPwZSvflgeYsoGSYW1Sf2Gk= =VDwG -END PGP SIGNATURE-
svn commit: samba r22396 - in branches/SAMBA_4_0/source/torture/rpc: .
Author: metze Date: 2007-04-20 05:56:22 + (Fri, 20 Apr 2007) New Revision: 22396 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22396 Log: remove unused vars metze Modified: branches/SAMBA_4_0/source/torture/rpc/dssync.c Changeset: Modified: branches/SAMBA_4_0/source/torture/rpc/dssync.c === --- branches/SAMBA_4_0/source/torture/rpc/dssync.c 2007-04-20 01:52:44 UTC (rev 22395) +++ branches/SAMBA_4_0/source/torture/rpc/dssync.c 2007-04-20 05:56:22 UTC (rev 22396) @@ -747,11 +747,7 @@ { NTSTATUS status; BOOL ret = True; - int i, y = 0; - uint64_t highest_usn = 0; - const char *partition = NULL; struct drsuapi_DsGetNT4ChangeLog r; - int32_t out_level = 0; struct GUID null_guid; struct dom_sid null_sid; DATA_BLOB cookie;
svn commit: samba r22397 - in branches/SAMBA_4_0/source/auth/gensec: .
Author: metze Date: 2007-04-20 05:58:31 + (Fri, 20 Apr 2007) New Revision: 22397 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22397 Log: hopefully fix the build on some aix hosts in the build-farm we need to make sure -Iheimdal/lib/gssapi comes before -I/usr/local/include metze Modified: branches/SAMBA_4_0/source/auth/gensec/config.mk Changeset: Modified: branches/SAMBA_4_0/source/auth/gensec/config.mk === --- branches/SAMBA_4_0/source/auth/gensec/config.mk 2007-04-20 05:56:22 UTC (rev 22396) +++ branches/SAMBA_4_0/source/auth/gensec/config.mk 2007-04-20 05:58:31 UTC (rev 22397) @@ -28,7 +28,7 @@ SUBSYSTEM = gensec INIT_FUNCTION = gensec_gssapi_init OBJ_FILES = gensec_gssapi.o -PUBLIC_DEPENDENCIES = CREDENTIALS_KRB5 KERBEROS auth HEIMDAL_GSSAPI +PUBLIC_DEPENDENCIES = HEIMDAL_GSSAPI CREDENTIALS_KRB5 KERBEROS auth # End MODULE gensec_gssapi