svn commit: samba r22245 - in branches/SAMBA_3_0_25/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-16 06:30:20 + (Mon, 16 Apr 2007)
New Revision: 22245

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22245

Log:
merge from samba4:

remove useless printf's

metze
Modified:
   branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c   2007-04-16 
06:30:08 UTC (rev 22244)
+++ branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c   2007-04-16 
06:30:20 UTC (rev 22245)
@@ -423,9 +423,7 @@
 
 static int test_strerror(void)
 {
-   printf("test: strerror\n");
/* FIXME */
-   printf("failure: sterror\n");
return true;
 }
 



svn commit: samba r22244 - in branches/SAMBA_3_0/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-16 06:30:08 + (Mon, 16 Apr 2007)
New Revision: 22244

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22244

Log:
merge from samba4:

remove useless printf's

metze
Modified:
   branches/SAMBA_3_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_3_0/source/lib/replace/test/testsuite.c  2007-04-16 
06:29:45 UTC (rev 22243)
+++ branches/SAMBA_3_0/source/lib/replace/test/testsuite.c  2007-04-16 
06:30:08 UTC (rev 22244)
@@ -423,9 +423,7 @@
 
 static int test_strerror(void)
 {
-   printf("test: strerror\n");
/* FIXME */
-   printf("failure: sterror\n");
return true;
 }
 



svn commit: samba r22243 - in branches/SAMBA_4_0/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-16 06:29:45 + (Mon, 16 Apr 2007)
New Revision: 22243

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22243

Log:
remove useless printf's

metze
Modified:
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2007-04-16 
06:23:42 UTC (rev 22242)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2007-04-16 
06:29:45 UTC (rev 22243)
@@ -423,9 +423,7 @@
 
 static int test_strerror(void)
 {
-   printf("test: strerror\n");
/* FIXME */
-   printf("failure: sterror\n");
return true;
 }
 



svn commit: samba r22242 - in branches/SAMBA_4_0/source/smbd: .

2007-04-15 Thread tridge
Author: tridge
Date: 2007-04-16 06:23:42 + (Mon, 16 Apr 2007)
New Revision: 22242

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22242

Log:

ctdb init now takes a process model

Modified:
   branches/SAMBA_4_0/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_4_0/source/smbd/server.c
===
--- branches/SAMBA_4_0/source/smbd/server.c 2007-04-16 06:11:36 UTC (rev 
22241)
+++ branches/SAMBA_4_0/source/smbd/server.c 2007-04-16 06:23:42 UTC (rev 
22242)
@@ -286,7 +286,7 @@
event_ctx = event_context_init(NULL);
 
/* initialise clustering if needed */
-   cluster_ctdb_init(event_ctx);
+   cluster_ctdb_init(event_ctx, model);
 
if (interactive) {
/* catch EOF on stdin */



svn commit: samba r22241 - in branches/SAMBA_3_0_25/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-16 06:11:36 + (Mon, 16 Apr 2007)
New Revision: 22241

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22241

Log:
merge from samba4:

use strlcpy instead of strcpy to make the IBM checker happy

metze
Modified:
   branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c   2007-04-16 
06:08:43 UTC (rev 22240)
+++ branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c   2007-04-16 
06:11:36 UTC (rev 22241)
@@ -117,7 +117,7 @@
 {
char tmp[10];
printf("test: strlcat\n");
-   strcpy(tmp, "");
+   strlcpy(tmp, "", sizeof(tmp));
if (strlcat(tmp, "bla", 3) != 3) {
printf("failure: strlcat [\ninvalid return code\n]\n");
return false;
@@ -128,7 +128,7 @@
return false;
}
 
-   strcpy(tmp, "da");
+   strlcpy(tmp, "da", sizeof(tmp));
if (strlcat(tmp, "me", 4) != 4) {
printf("failure: strlcat [\nexpected \"dam\", got \"%s\"\n]\n",
   tmp);



svn commit: samba r22240 - in branches/SAMBA_3_0/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-16 06:08:43 + (Mon, 16 Apr 2007)
New Revision: 22240

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22240

Log:
merge from samba4:

use strlcpy instead of strcpy to make the IBM checker happy

metze
Modified:
   branches/SAMBA_3_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_3_0/source/lib/replace/test/testsuite.c  2007-04-16 
06:08:06 UTC (rev 22239)
+++ branches/SAMBA_3_0/source/lib/replace/test/testsuite.c  2007-04-16 
06:08:43 UTC (rev 22240)
@@ -117,7 +117,7 @@
 {
char tmp[10];
printf("test: strlcat\n");
-   strcpy(tmp, "");
+   strlcpy(tmp, "", sizeof(tmp));
if (strlcat(tmp, "bla", 3) != 3) {
printf("failure: strlcat [\ninvalid return code\n]\n");
return false;
@@ -128,7 +128,7 @@
return false;
}
 
-   strcpy(tmp, "da");
+   strlcpy(tmp, "da", sizeof(tmp));
if (strlcat(tmp, "me", 4) != 4) {
printf("failure: strlcat [\nexpected \"dam\", got \"%s\"\n]\n",
   tmp);



svn commit: samba r22239 - in branches/SAMBA_4_0/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-16 06:08:06 + (Mon, 16 Apr 2007)
New Revision: 22239

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22239

Log:
use strlcpy instead of strcpy to make the IBM checker happy

metze
Modified:
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2007-04-16 
05:48:11 UTC (rev 22238)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2007-04-16 
06:08:06 UTC (rev 22239)
@@ -117,7 +117,7 @@
 {
char tmp[10];
printf("test: strlcat\n");
-   strcpy(tmp, "");
+   strlcpy(tmp, "", sizeof(tmp));
if (strlcat(tmp, "bla", 3) != 3) {
printf("failure: strlcat [\ninvalid return code\n]\n");
return false;
@@ -128,7 +128,7 @@
return false;
}
 
-   strcpy(tmp, "da");
+   strlcpy(tmp, "da", sizeof(tmp));
if (strlcat(tmp, "me", 4) != 4) {
printf("failure: strlcat [\nexpected \"dam\", got \"%s\"\n]\n",
   tmp);



Rev 111: this is a demonstration of an idea for handling locks in ctdb. in http://samba.org/~tridge/ctdb

2007-04-15 Thread tridge

revno: 111
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Mon 2007-04-16 16:01:37 +1000
message:
  this is a demonstration of an idea for handling locks in ctdb.
  
  The problem we have is this:
  
- we want the client smbd processes to be able to 'shortcut' access
  to the ltdb, by directly accessing the ltdb, and if the header of
  the record shows we are the dmaster then process immediately, with
  no overhead of talking across the unix domain socket
  
- a client doing a shortcut will use tdb_chainlock() to lock the
  record while processing
  
- we want the main ctdb daemon to be able to set locks on the
  record, and when those locks collide with a 'shortcut' fcntl lock,
  we want the ctdb daemon to keep processing other operations
  
- we don't want to have to send a message from a smbd client to the
  ctdbd each time it releases a lock
  
  The solution is shown in this example. Note that the expensive fork()
  and blocking lock is only paid in case of contention, so in the median
  case I think this is zero cost.
added:
  tests/lockwait.c   lockwait.c-20070416055753-3ztnb4cxqgamfudx-1
modified:
  Makefile.inmakefile.in-20061117234101-o3qt14umlg9en8z0-1
  common/util.c  util.c-20061117234101-o3qt14umlg9en8z0-20
  config.mk  config.mk-20070416041303-xql6zaaq90w8kovl-1
  include/includes.h includes.h-20061117234101-o3qt14umlg9en8z0-17

Diff too large for email (315, the limit is 200).


svn commit: samba r22238 - in branches/SAMBA_4_0/source/heimdal_build: .

2007-04-15 Thread abartlet
Author: abartlet
Date: 2007-04-16 05:48:11 + (Mon, 16 Apr 2007)
New Revision: 22238

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22238

Log:
Because these utilities compile in socket_wrapper.ho, they may need
-lsocket on some systems.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/heimdal_build/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/heimdal_build/config.mk
===
--- branches/SAMBA_4_0/source/heimdal_build/config.mk   2007-04-16 05:18:13 UTC 
(rev 22237)
+++ branches/SAMBA_4_0/source/heimdal_build/config.mk   2007-04-16 05:48:11 UTC 
(rev 22238)
@@ -494,7 +494,8 @@
../heimdal/lib/vers/print_version.ho \
../lib/socket_wrapper/socket_wrapper.ho \
replace.ho
-PRIVATE_DEPENDENCIES = HEIMDAL_ASN1_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H
+PRIVATE_DEPENDENCIES = HEIMDAL_ASN1_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H 
EXT_SOCKET EXT_NSL
+
 # End BINARY asn1_compile
 ###
 
@@ -520,7 +521,7 @@
../heimdal/lib/roken/setprogname.ho \
../lib/socket_wrapper/socket_wrapper.ho \
replace.ho
-PRIVATE_DEPENDENCIES = HEIMDAL_COM_ERR_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H
+PRIVATE_DEPENDENCIES = HEIMDAL_COM_ERR_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H 
EXT_SOCKET EXT_NSL
 # End BINARY compile_et
 ###
 



svn commit: samba r22237 - in branches/SAMBA_4_0/source/cluster/ctdb: .

2007-04-15 Thread tridge
Author: tridge
Date: 2007-04-16 05:18:13 + (Mon, 16 Apr 2007)
New Revision: 22237

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22237

Log:

this init fn doesn't exist yet

Modified:
   branches/SAMBA_4_0/source/cluster/ctdb/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/cluster/ctdb/config.mk
===
--- branches/SAMBA_4_0/source/cluster/ctdb/config.mk2007-04-16 04:59:47 UTC 
(rev 22236)
+++ branches/SAMBA_4_0/source/cluster/ctdb/config.mk2007-04-16 05:18:13 UTC 
(rev 22237)
@@ -15,7 +15,6 @@
 
 ##
 [SUBSYSTEM::ctdb]
-INIT_FUNCTION = server_service_ctdbd_init
 OBJ_FILES = \
ctdb_cluster.o \
common/ctdb.o \



svn commit: samba r22236 - in branches/SAMBA_4_0/source: heimdal_build lib/socket_wrapper

2007-04-15 Thread abartlet
Author: abartlet
Date: 2007-04-16 04:59:47 + (Mon, 16 Apr 2007)
New Revision: 22236

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22236

Log:
Update to Heimdal's socket_wrapper, which supports IPv6.

To make this pass, I needed to add support for 6 and 17 as valid
protocol values to socket().

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/heimdal_build/config.mk
   branches/SAMBA_4_0/source/heimdal_build/roken.h
   branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c


Changeset:
Sorry, the patch is too large (841 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22236


svn commit: samba r22235 - in branches/SAMBA_4_0: source/script/tests testprogs/blackbox

2007-04-15 Thread abartlet
Author: abartlet
Date: 2007-04-16 04:55:52 + (Mon, 16 Apr 2007)
New Revision: 22235

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22235

Log:
Test kinit, and PKINIT functionality by means of a new blackbox test.

Andrew Bartlett

Added:
   branches/SAMBA_4_0/testprogs/blackbox/test_kinit.sh
Modified:
   branches/SAMBA_4_0/source/script/tests/tests_all.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/tests_all.sh
===
--- branches/SAMBA_4_0/source/script/tests/tests_all.sh 2007-04-16 04:47:11 UTC 
(rev 22234)
+++ branches/SAMBA_4_0/source/script/tests/tests_all.sh 2007-04-16 04:55:52 UTC 
(rev 22235)
@@ -11,6 +11,6 @@
  $SRCDIR/script/tests/test_cifs.sh
  $SRCDIR/script/tests/test_local.sh
  $SRCDIR/script/tests/test_pidl.sh
- $SRCDIR/script/tests/test_blackbox.sh $PREFIX/blackbox
+ $SRCDIR/script/tests/test_blackbox.sh $PREFIX
  $SRCDIR/script/tests/test_simple.sh
  $SRCDIR/script/tests/test_s3upgrade.sh $PREFIX/upgrade

Added: branches/SAMBA_4_0/testprogs/blackbox/test_kinit.sh
===
--- branches/SAMBA_4_0/testprogs/blackbox/test_kinit.sh 2007-04-16 04:47:11 UTC 
(rev 22234)
+++ branches/SAMBA_4_0/testprogs/blackbox/test_kinit.sh 2007-04-16 04:55:52 UTC 
(rev 22235)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+if [ $# -lt 5 ]; then
+cat < ./tmppassfile
+testit "kinit with password" samba4kinit --password-file=./tmppassfile 
--request-pac [EMAIL PROTECTED]   || failed=`expr $failed + 1`
+testit "kinit with pkinit" samba4kinit --request-pac 
--pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem
 [EMAIL PROTECTED] || failed=`expr $failed + 1`
+
+echo ls | testit "Test login with kerberos ccache" $VALGRIND bin/smbclient 
$CONFIGURATION //$SERVER/tmp -k yes || failed=`expr $failed + 1`
+
+testit "domain join with kerberos ccache" $VALGRIND bin/net join $DOMAIN 
$CONFIGURATION  -W "$DOMAIN" -k yes $@
+
+rm -f tmpccfile tmppassfile
+exit $failed



svn commit: samba r22234 - in branches/SAMBA_4_0/source/cluster/ctdb: . tests

2007-04-15 Thread tridge
Author: tridge
Date: 2007-04-16 04:47:11 + (Mon, 16 Apr 2007)
New Revision: 22234

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22234

Log:

merge test suite changes from bzr tree

Added:
   branches/SAMBA_4_0/source/cluster/ctdb/tests/cmdline.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/cmdline.h
Modified:
   branches/SAMBA_4_0/source/cluster/ctdb/Makefile.in
   branches/SAMBA_4_0/source/cluster/ctdb/config.mk
   branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
   branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.h
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_bench.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_fetch.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_fetch1.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_messaging.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_test.c


Changeset:
Sorry, the patch is too large (738 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22234


Rev 110: merged from samba4 in http://samba.org/~tridge/ctdb

2007-04-15 Thread tridge

revno: 110
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Mon 2007-04-16 14:13:10 +1000
message:
  merged from samba4
added:
  config.mk  config.mk-20070416041303-xql6zaaq90w8kovl-1
=== added file 'config.mk'
--- a/config.mk 1970-01-01 00:00:00 +
+++ b/config.mk 2007-04-16 04:13:10 +
@@ -0,0 +1,29 @@
+##
+[SUBSYSTEM::brlock_ctdb]
+OBJ_FILES = brlock_ctdb.o
+
+##
+[SUBSYSTEM::opendb_ctdb]
+OBJ_FILES = opendb_ctdb.o
+
+##
+[SUBSYSTEM::ctdb_tcp]
+OBJ_FILES = \
+   tcp/tcp_init.o \
+   tcp/tcp_io.o \
+   tcp/tcp_connect.o
+
+##
+[SUBSYSTEM::ctdb]
+OBJ_FILES = \
+   ctdb_cluster.o \
+   common/ctdb.o \
+   common/ctdb_call.o \
+   common/ctdb_message.o \
+   common/ctdb_ltdb.o \
+   common/ctdb_util.o \
+   common/ctdb_io.o \
+   common/ctdb_client.o \
+   common/ctdb_daemon.o
+PUBLIC_DEPENDENCIES = LIBTDB LIBTALLOC
+PRIVATE_DEPENDENCIES = ctdb_tcp



Rev 109: pull out common command line code for tests into tests/cmdline.c in http://samba.org/~tridge/ctdb

2007-04-15 Thread tridge

revno: 109
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Mon 2007-04-16 14:12:50 +1000
message:
  pull out common command line code for tests into tests/cmdline.c
added:
  tests/cmdline.ccmdline.c-20070416041216-w1zvz91bkdsgjckw-1
  tests/cmdline.hcmdline.h-20070416041216-w1zvz91bkdsgjckw-2
modified:
  Makefile.inmakefile.in-20061117234101-o3qt14umlg9en8z0-1
  tests/ctdb_bench.c ctdb_bench.c-20061219052637-2liagoglohxb6p7s-1
  tests/ctdb_fetch.c ctdb_fetch.c-20070405031748-f7gslozfj3rwh5ie-1
  tests/ctdb_fetch1.cctdb_fetch1.c-20070412111848-xawz6wqk9r0v8jdk-1
  tests/ctdb_messaging.c 
ctdb_messaging.c-20070411034205-6d6vne56pbih2x1p-1
  tests/ctdb_test.c  ctdb_test.c-20061117234101-o3qt14umlg9en8z0-16

Diff too large for email (596, the limit is 200).


svn commit: samba r22233 - in branches/SAMBA_4_0/source/script/tests: .

2007-04-15 Thread abartlet
Author: abartlet
Date: 2007-04-16 03:16:23 + (Mon, 16 Apr 2007)
New Revision: 22233

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22233

Log:
Allow 'REALM' as a global environment variable in the tests.

Set the default socket_wrapper interface inside the test env setup, so
it actually stays (fixes LOCAL-SOCKET failures).

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.pl
   branches/SAMBA_4_0/source/script/tests/test_blackbox.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl
===
--- branches/SAMBA_4_0/source/script/tests/selftest.pl  2007-04-16 00:29:13 UTC 
(rev 22232)
+++ branches/SAMBA_4_0/source/script/tests/selftest.pl  2007-04-16 03:16:23 UTC 
(rev 22233)
@@ -556,7 +556,7 @@
}
write_clientconf($conffile, $testenv_vars);
foreach ("PASSWORD", "DOMAIN", "SERVER", "USERNAME", "NETBIOSNAME", 
-"KRB5_CONFIG") {
+"KRB5_CONFIG", "REALM") {
if (defined($testenv_vars->{$_})) {
$ENV{$_} = $testenv_vars->{$_};
} else {
@@ -564,6 +564,8 @@
}
}
 
+   SocketWrapper::set_default_iface(6);
+
$running_envs{$envname} = $testenv_vars;
return $testenv_vars;
 }
@@ -574,8 +576,8 @@
$target->teardown_env($running_envs{$envname});
delete $running_envs{$envname};
 }
-SocketWrapper::set_default_iface(6);
 
+
 if ($opt_testenv) {
my $testenv_vars = setup_env("dc");
$ENV{PIDDIR} = $testenv_vars->{PIDDIR};

Modified: branches/SAMBA_4_0/source/script/tests/test_blackbox.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_blackbox.sh 2007-04-16 
00:29:13 UTC (rev 22232)
+++ branches/SAMBA_4_0/source/script/tests/test_blackbox.sh 2007-04-16 
03:16:23 UTC (rev 22233)
@@ -17,4 +17,6 @@
 . $incdir/test_functions.sh
 
 plantest "blackbox.smbclient" dc 
$incdir/../../../testprogs/blackbox/test_smbclient.sh "\$NETBIOSNAME" 
"\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" "$ADDARGS"
+plantest "blackbox.kinit" dc $incdir/../../../testprogs/blackbox/test_kinit.sh 
"\$NETBIOSNAME" "\$USERNAME" "\$PASSWORD" "\$REALM" "$PREFIX" "$ADDARGS"
+
 plantest "blackbox.cifsdd" dc 
$incdir/../../../testprogs/blackbox/test_cifsdd.sh "\$NETBIOSNAME" "\$USERNAME" 
"\$PASSWORD" "\$DOMAIN" "$ADDARGS"



Rev 108: merge CTDB_SRVID_ALL patch from Samba4 in http://samba.org/~tridge/ctdb

2007-04-15 Thread tridge

revno: 108
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Mon 2007-04-16 10:31:39 +1000
message:
  merge CTDB_SRVID_ALL patch from Samba4
modified:
  common/ctdb_message.c  
ctdb_message.c-20070208224107-9dnio7x7z33prrmt-1
  common/ctdb_util.c ctdb_util.c-20061128065342-to93h6eejj5kon81-3
  include/ctdb.h ctdb.h-20061117234101-o3qt14umlg9en8z0-11
=== modified file 'common/ctdb_message.c'
--- a/common/ctdb_message.c 2007-04-16 00:21:44 +
+++ b/common/ctdb_message.c 2007-04-16 00:31:39 +
@@ -39,7 +39,7 @@
/* XXX we need a must faster way of finding the matching srvid
   - maybe a tree? */
for (ml=ctdb->message_list;ml;ml=ml->next) {
-   if (ml->srvid == srvid) break;
+   if (ml->srvid == srvid || ml->srvid == CTDB_SRVID_ALL) break;
}
if (ml == NULL) {
printf("daemon vnn:%d  no msg handler for srvid=%u\n", 
ctdb_get_vnn(ctdb), srvid);

=== modified file 'common/ctdb_util.c'
--- a/common/ctdb_util.c2007-04-16 00:21:44 +
+++ b/common/ctdb_util.c2007-04-16 00:31:39 +
@@ -43,15 +43,16 @@
talloc_free(ctdb->err_msg);
va_start(ap, fmt);
ctdb->err_msg = talloc_vasprintf(ctdb, fmt, ap);
+   DEBUG(0,("ctdb error: %s\n", ctdb->err_msg));
va_end(ap);
 }
 
-
 /*
   a fatal internal error occurred - no hope for recovery
 */
 void ctdb_fatal(struct ctdb_context *ctdb, const char *msg)
 {
+   DEBUG(0,("ctdb fatal error: %s\n", msg));
fprintf(stderr, "ctdb fatal error: '%s'\n", msg);
abort();
 }

=== modified file 'include/ctdb.h'
--- a/include/ctdb.h2007-04-12 05:46:50 +
+++ b/include/ctdb.h2007-04-16 00:31:39 +
@@ -56,6 +56,11 @@
 #define CTDB_FLAG_CONNECT_WAIT (1<<2)
 
 
+/* 
+   a message handler ID meaning "give me all messages"
+ */
+#define CTDB_SRVID_ALL 0x
+
 struct event_context;
 
 /*



svn commit: samba r22232 - in branches/SAMBA_4_0/source/cluster/ctdb: . common include

2007-04-15 Thread tridge
Author: tridge
Date: 2007-04-16 00:29:13 + (Mon, 16 Apr 2007)
New Revision: 22232

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22232

Log:

add a special message handler ID meaning "all messages please"

This better fits the way Samba4 does message dispatch

Modified:
   branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c
   branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
   branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h


Changeset:
Modified: branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c
===
--- branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c
2007-04-16 00:18:54 UTC (rev 22231)
+++ branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c
2007-04-16 00:29:13 UTC (rev 22232)
@@ -39,7 +39,7 @@
/* XXX we need a must faster way of finding the matching srvid
   - maybe a tree? */
for (ml=ctdb->message_list;ml;ml=ml->next) {
-   if (ml->srvid == srvid) break;
+   if (ml->srvid == srvid || ml->srvid == CTDB_SRVID_ALL) break;
}
if (ml == NULL) {
printf("daemon vnn:%d  no msg handler for srvid=%u\n", 
ctdb_get_vnn(ctdb), srvid);

Modified: branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
===
--- branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c   2007-04-16 
00:18:54 UTC (rev 22231)
+++ branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c   2007-04-16 
00:29:13 UTC (rev 22232)
@@ -144,8 +144,8 @@
int ret;
 
/* setup messaging handler */
-   ret = ctdb_set_message_handler(state->ctdb, ctdb_message_handler, 
-  server.id, state);
+   ret = ctdb_set_message_handler(state->ctdb, CTDB_SRVID_ALL, 
+  ctdb_message_handler, state);
 if (ret == -1) {
 DEBUG(0,("ctdb_set_message_handler failed - %s\n", 
 ctdb_errstr(state->ctdb)));

Modified: branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h
===
--- branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h   2007-04-16 
00:18:54 UTC (rev 22231)
+++ branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h   2007-04-16 
00:29:13 UTC (rev 22232)
@@ -56,6 +56,11 @@
 #define CTDB_FLAG_CONNECT_WAIT (1<<2)
 
 
+/* 
+   a message handler ID meaning "give me all messages"
+ */
+#define CTDB_SRVID_ALL 0x
+
 struct event_context;
 
 /*



Rev 107: - fix includes to work in both samba4 and ctdb standalone in http://samba.org/~tridge/ctdb

2007-04-15 Thread tridge

revno: 107
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Mon 2007-04-16 10:21:44 +1000
message:
  - fix includes to work in both samba4 and ctdb standalone
  - when we do a store_unlock the lock record becomes unlocked, so we
must destroy it (or we leak memory)
modified:
  common/ctdb_call.c ctdb_call.c-20061128065342-to93h6eejj5kon81-1
  common/ctdb_client.c   ctdb_client.c-20070411010216-3kd8v37k61steeya-1
  common/ctdb_io.c   ctdb_io.c-20070409200335-dzfc7f3rra5rcf60-1
  common/ctdb_message.c  
ctdb_message.c-20070208224107-9dnio7x7z33prrmt-1
  common/ctdb_util.c ctdb_util.c-20061128065342-to93h6eejj5kon81-3
=== modified file 'common/ctdb_call.c'
--- a/common/ctdb_call.c2007-04-13 10:38:24 +
+++ b/common/ctdb_call.c2007-04-16 00:21:44 +
@@ -796,10 +796,13 @@
ret = ctdb_ltdb_fetch(rec->ctdb_db, rec->key, &header, NULL, NULL);
if (ret) {
ctdb_set_error(rec->ctdb_db->ctdb, "Fetch of locally held 
record failed");
+   talloc_free(rec);
return ret;
}
 
ret = ctdb_ltdb_store(rec->ctdb_db, rec->key, &header, data);

+   talloc_free(rec);
+
return ret;
 }

=== modified file 'common/ctdb_client.c'
--- a/common/ctdb_client.c  2007-04-14 21:41:35 +
+++ b/common/ctdb_client.c  2007-04-16 00:21:44 +
@@ -656,6 +656,7 @@
state = ctdb_client_store_unlock_send(rec, rec, data);
res = ctdb_client_store_unlock_recv(state, rec);
 
+   talloc_free(rec);
+
return res;
-
 }

=== modified file 'common/ctdb_io.c'
--- a/common/ctdb_io.c  2007-04-13 10:38:24 +
+++ b/common/ctdb_io.c  2007-04-16 00:21:44 +
@@ -28,7 +28,7 @@
 #include "system/network.h"
 #include "system/filesys.h"
 #include "../include/ctdb_private.h"
-#include "ctdb.h"
+#include "../include/ctdb.h"
 
 /* structures for packet queueing - see common/ctdb_io.c */
 struct ctdb_partial {

=== modified file 'common/ctdb_message.c'
--- a/common/ctdb_message.c 2007-04-13 10:38:24 +
+++ b/common/ctdb_message.c 2007-04-16 00:21:44 +
@@ -27,7 +27,7 @@
 #include "system/network.h"
 #include "system/filesys.h"
 #include "../include/ctdb_private.h"
-
+#include "lib/util/dlinklist.h"
 
 /*
   this dispatches the messages to the registered ctdb message handler

=== modified file 'common/ctdb_util.c'
--- a/common/ctdb_util.c2006-12-18 05:01:11 +
+++ b/common/ctdb_util.c2007-04-16 00:21:44 +
@@ -20,9 +20,10 @@
 
 #include "includes.h"
 #include "lib/events/events.h"
+#include "lib/tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
-#include "ctdb_private.h"
+#include "../include/ctdb_private.h"
 
 /*
   return error string for last error



svn commit: samba r22231 - in branches/SAMBA_4_0/source/cluster/ctdb: . common direct ib include tcp tests

2007-04-15 Thread tridge
Author: tridge
Date: 2007-04-16 00:18:54 + (Mon, 16 Apr 2007)
New Revision: 22231

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22231

Log:
merge from bzr ctdb tree
Added:
   branches/SAMBA_4_0/source/cluster/ctdb/Makefile.in
   branches/SAMBA_4_0/source/cluster/ctdb/README
   branches/SAMBA_4_0/source/cluster/ctdb/autogen.sh
   branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_client.c
   branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_daemon.c
   branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_io.c
   branches/SAMBA_4_0/source/cluster/ctdb/config.guess
   branches/SAMBA_4_0/source/cluster/ctdb/configure.ac
   branches/SAMBA_4_0/source/cluster/ctdb/direct/
   branches/SAMBA_4_0/source/cluster/ctdb/direct/README
   branches/SAMBA_4_0/source/cluster/ctdb/direct/ctdbd.c
   branches/SAMBA_4_0/source/cluster/ctdb/direct/ctdbd.sh
   branches/SAMBA_4_0/source/cluster/ctdb/direct/ctdbd_test.c
   branches/SAMBA_4_0/source/cluster/ctdb/direct/nodes.txt
   branches/SAMBA_4_0/source/cluster/ctdb/ib/
   branches/SAMBA_4_0/source/cluster/ctdb/ib/README.txt
   branches/SAMBA_4_0/source/cluster/ctdb/ib/config.m4
   branches/SAMBA_4_0/source/cluster/ctdb/ib/ibw_ctdb.c
   branches/SAMBA_4_0/source/cluster/ctdb/ib/ibw_ctdb.h
   branches/SAMBA_4_0/source/cluster/ctdb/ib/ibw_ctdb_init.c
   branches/SAMBA_4_0/source/cluster/ctdb/ib/ibwrapper.c
   branches/SAMBA_4_0/source/cluster/ctdb/ib/ibwrapper.h
   branches/SAMBA_4_0/source/cluster/ctdb/ib/ibwrapper_internal.h
   branches/SAMBA_4_0/source/cluster/ctdb/ib/ibwrapper_test.c
   branches/SAMBA_4_0/source/cluster/ctdb/include/idtree.h
   branches/SAMBA_4_0/source/cluster/ctdb/include/includes.h
   branches/SAMBA_4_0/source/cluster/ctdb/install-sh
   branches/SAMBA_4_0/source/cluster/ctdb/tests/1node.txt
   branches/SAMBA_4_0/source/cluster/ctdb/tests/4nodes.txt
   branches/SAMBA_4_0/source/cluster/ctdb/tests/bench-ssh.sh
   branches/SAMBA_4_0/source/cluster/ctdb/tests/bench.sh
   branches/SAMBA_4_0/source/cluster/ctdb/tests/bench1.sh
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_fetch1.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_messaging.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/fetch.sh
   branches/SAMBA_4_0/source/cluster/ctdb/tests/fetch1.sh
   branches/SAMBA_4_0/source/cluster/ctdb/tests/messaging.sh
   branches/SAMBA_4_0/source/cluster/ctdb/tests/nodes.txt
   branches/SAMBA_4_0/source/cluster/ctdb/tests/test.sh
   branches/SAMBA_4_0/source/cluster/ctdb/tests/test1.sh
Modified:
   branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb.c
   branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_call.c
   branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_ltdb.c
   branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c
   branches/SAMBA_4_0/source/cluster/ctdb/config.mk
   branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
   branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h
   branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb_private.h
   branches/SAMBA_4_0/source/cluster/ctdb/opendb_ctdb.c
   branches/SAMBA_4_0/source/cluster/ctdb/tcp/ctdb_tcp.h
   branches/SAMBA_4_0/source/cluster/ctdb/tcp/tcp_connect.c
   branches/SAMBA_4_0/source/cluster/ctdb/tcp/tcp_init.c
   branches/SAMBA_4_0/source/cluster/ctdb/tcp/tcp_io.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_bench.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_fetch.c
   branches/SAMBA_4_0/source/cluster/ctdb/tests/ctdb_test.c


Changeset:
Sorry, the patch is too large (9412 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22231


Build status as of Mon Apr 16 00:00:02 2007

2007-04-15 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-04-15 
00:01:40.0 +
+++ /home/build/master/cache/broken_results.txt 2007-04-16 00:00:48.0 
+
@@ -1,24 +1,24 @@
-Build status as of Sun Apr 15 00:00:02 2007
+Build status as of Mon Apr 16 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
 build_farm   0  0  0 
-ccache   37 6  0 
+ccache   36 6  0 
 ctdb 0  0  0 
 distcc   3  0  0 
-ldb  34 5  0 
-libreplace   33 16 0 
-lorikeet-heimdal 31 15 0 
+ldb  34 7  0 
+libreplace   32 7  0 
+lorikeet-heimdal 30 14 0 
 pidl 21 2  0 
 ppp  15 0  0 
-rsync37 13 0 
+rsync36 12 0 
 samba0  0  0 
 samba-docs   0  0  0 
 samba-gtk3  3  0 
-samba4   39 35 2 
-samba_3_041 19 1 
-smb-build33 32 0 
-talloc   37 1  0 
-tdb  35 2  0 
+samba4   38 35 2 
+samba_3_041 21 1 
+smb-build32 31 0 
+talloc   36 1  0 
+tdb  34 3  0 
 


svn commit: samba r22230 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/nsswitch

2007-04-15 Thread idra
Author: idra
Date: 2007-04-15 23:58:39 + (Sun, 15 Apr 2007)
New Revision: 22230

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22230

Log:

Let's just cast here, the 2 calls have different allocation mechanisms.
We just let domname and name hang on the mem ctx until the call returns,
and the context will be destroyed.

Simo.


Modified:
   branches/SAMBA_3_0/source/nsswitch/idmap.c
   branches/SAMBA_3_0_25/source/nsswitch/idmap.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/idmap.c
===
--- branches/SAMBA_3_0/source/nsswitch/idmap.c  2007-04-15 21:14:37 UTC (rev 
9)
+++ branches/SAMBA_3_0/source/nsswitch/idmap.c  2007-04-15 23:58:39 UTC (rev 
22230)
@@ -811,7 +811,7 @@
 {
NTSTATUS ret;
struct idmap_domain *dom;
-   const char *domname, *name;
+   char *domname, *name;
enum lsa_SidType sid_type;
BOOL wbret;
 
@@ -825,14 +825,16 @@
/* by default calls to winbindd are disabled
   the following call will not recurse so this is safe */
winbind_on();
-   wbret = winbind_lookup_sid(ctx, map->sid, &domname, &name, 
&sid_type);
+   wbret = winbind_lookup_sid(ctx, map->sid,
+   (const char **)&domname,
+   (const char **)&name,
+   &sid_type);
winbind_off();
} else {
-   char *tmp_dom, *tmp_name;
-   wbret = winbindd_lookup_name_by_sid(ctx, map->sid, &tmp_dom,
-   &tmp_name, &sid_type);
-   domname = tmp_dom;
-   name = tmp_name;
+   wbret = winbindd_lookup_name_by_sid(ctx, map->sid,
+   &domname,
+   &name,
+   &sid_type);
}
 
/* check if this is a valid SID and then map it */

Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap.c
===
--- branches/SAMBA_3_0_25/source/nsswitch/idmap.c   2007-04-15 21:14:37 UTC 
(rev 9)
+++ branches/SAMBA_3_0_25/source/nsswitch/idmap.c   2007-04-15 23:58:39 UTC 
(rev 22230)
@@ -811,7 +811,7 @@
 {
NTSTATUS ret;
struct idmap_domain *dom;
-   const char *domname, *name;
+   char *domname, *name;
enum lsa_SidType sid_type;
BOOL wbret;
 
@@ -825,10 +825,16 @@
/* by default calls to winbindd are disabled
   the following call will not recurse so this is safe */
winbind_on();
-   wbret = winbind_lookup_sid(ctx, map->sid, &domname, &name, 
&sid_type);
+   wbret = winbind_lookup_sid(ctx, map->sid,
+   (const char **)&domname,
+   (const char **)&name,
+   &sid_type);
winbind_off();
} else {
-   wbret = winbindd_lookup_name_by_sid(ctx, map->sid, &domname, 
&name, &sid_type);
+   wbret = winbindd_lookup_name_by_sid(ctx, map->sid,
+   &domname,
+   &name,
+   &sid_type);
}
 
/* check if this is a valid SID and then map it */



Rev 106: added --dblist option to ctdbd, to allow list of databases to be specified on the command line in http://samba.org/~tridge/ctdb

2007-04-15 Thread tridge

revno: 106
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Mon 2007-04-16 09:29:10 +1000
message:
  added --dblist option to ctdbd, to allow list of databases to be specified on 
the command line
modified:
  direct/ctdbd.c ctdbd.c-20070411085044-dqmhr6mfeexnyt4m-1
=== modified file 'direct/ctdbd.c'
--- a/direct/ctdbd.c2007-04-15 04:39:23 +
+++ b/direct/ctdbd.c2007-04-15 23:29:10 +
@@ -43,12 +43,13 @@
 int main(int argc, const char *argv[])
 {
struct ctdb_context *ctdb;
-   struct ctdb_db_context *ctdb_db;
const char *nlist = NULL;
const char *transport = "tcp";
const char *myaddress = NULL;
int self_connect=0;
int daemon_mode=0;
+   const char *db_list = "test.tdb";
+   char *s, *tok;
 
struct poptOption popt_options[] = {
POPT_AUTOHELP
@@ -57,6 +58,7 @@
{ "transport", 0, POPT_ARG_STRING, &transport, 0, "protocol 
transport", NULL },
{ "self-connect", 0, POPT_ARG_NONE, &self_connect, 0, "enable 
self connect", "boolean" },
{ "daemon", 0, POPT_ARG_NONE, &daemon_mode, 0, "spawn a ctdb 
daemon", "boolean" },
+   { "dblist", 0, POPT_ARG_STRING, &db_list, 0, "list of 
databases", NULL },
POPT_TABLEEND
};
int opt;
@@ -127,11 +129,18 @@
exit(1);
}
 
-   /* attach to a specific database */
-   ctdb_db = ctdb_attach(ctdb, "test.tdb", TDB_DEFAULT, 
O_RDWR|O_CREAT|O_TRUNC, 0666);
-   if (!ctdb_db) {
-   printf("ctdb_attach failed - %s\n", ctdb_errstr(ctdb));
-   exit(1);
+   /* attach to the list of databases */
+   s = talloc_strdup(ctdb, db_list);
+   for (tok=strtok(s, ", "); tok; tok=strtok(NULL, ", ")) {
+   struct ctdb_db_context *ctdb_db;
+   ctdb_db = ctdb_attach(ctdb, tok, TDB_DEFAULT, 
+ O_RDWR|O_CREAT|O_TRUNC, 0666);
+   if (!ctdb_db) {
+   printf("ctdb_attach to '%s'failed - %s\n", tok, 
+  ctdb_errstr(ctdb));
+   exit(1);
+   }
+   printf("Attached to database '%s'\n", tok);
}
 
/* start the protocol running */



Rev 105: merge from ronnie in http://samba.org/~tridge/ctdb

2007-04-15 Thread tridge

revno: 105
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Mon 2007-04-16 08:58:57 +1000
message:
  merge from ronnie
modified:
  direct/ctdbd.c ctdbd.c-20070411085044-dqmhr6mfeexnyt4m-1
  direct/ctdbd_test.cctdbd_test.c-20070411085057-17kgjzfktsh28g99-1
  tests/ctdb_fetch1.cctdb_fetch1.c-20070412111848-xawz6wqk9r0v8jdk-1

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie sahlberg <[EMAIL PROTECTED]>
branch nick: ctdb
timestamp: Mon 2007-04-16 08:37:27 +1000
message:
  add code to fetch1 test to tell the two child processes one at a time to 
fetch_lock the same record
  
  they both successfully fetch and lock the same record at this stage  but 
when the actual locking works properly  the second child will block.
  
  this test allows us to verify the blocking once we have implemented it

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie sahlberg <[EMAIL PROTECTED]>
branch nick: ctdb
timestamp: Sun 2007-04-15 14:39:23 +1000
message:
  add examples for volker on how to do fetchlock/storeunlock
  
  
  note that the actual locking/unl;ocking does not still work

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie sahlberg <[EMAIL PROTECTED]>
branch nick: ctdb
timestamp: Sun 2007-04-15 14:02:39 +1000
message:
  update to fetch1.sh test
  
  there is still a bug in the ctdb code in that the children no longer 
receive messages from the parent for unknown reasons

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie sahlberg <[EMAIL PROTECTED]>
branch nick: ctdb
timestamp: Sun 2007-04-15 07:41:35 +1000
message:
  merge from tridge

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie sahlberg <[EMAIL PROTECTED]>
branch nick: ctdb
timestamp: Fri 2007-04-13 21:10:20 +1000
message:
  merge from tridge

Diff too large for email (410, the limit is 200).


Rev 5363: merge from upstream in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

2007-04-15 Thread Michael Adam
At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/


revno: 5363
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Michael Adam <[EMAIL PROTECTED]>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Mon 2007-04-16 00:50:54 +0200
message:
  merge from upstream
modified:
  REVISION   REVISION-20060530022625-68239662668b41c3
  source/lib/debug.c debug.c-20060530022627-f23cb2ef8f91a8a6
  source/libsmb/clientgen.c  clientgen.c-20060530022627-3aad65ce54001b6b
  source/nsswitch/idmap.cidmap.c-20061212152801-ke1ub3n5v1jjf8gy-1
  source/nsswitch/winbindd.c winbindd.c-20060530022627-8bb76c46bd1253ec
  source/nsswitch/winbindd_cache.c 
winbindd_cache.c-20060530022627-45b83e217d38566d
  source/smbd/process.c  process.c-20060530022627-8fe40017fe0e41ff

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: [EMAIL PROTECTED]
branch nick: SAMBA_3_0.bzr
timestamp: Sat 2007-04-14 06:04:15 -0500
message:
  [EMAIL PROTECTED] (r22214)  2007-04-14 01:44:30 -0500 (Sat, 14 Apr 2007)
  
  Fix incompatible pointer type warnings. Simo, please check and merge 
to 3_0_25
  if appropriate.
  
  Volker
  

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: [EMAIL PROTECTED]
branch nick: SAMBA_3_0.bzr
timestamp: Sat 2007-04-14 06:01:56 -0500
message:
  [EMAIL PROTECTED] (r22213)  2007-04-14 01:40:47 -0500 (Sat, 14 Apr 2007)
  
  We can't use become_root() here, as it does DEBUG()
  itself. become_root_uid_only did not :-)
  
  Revert 21868, we need to find a better way.
  
  Volker
  

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: [EMAIL PROTECTED]
branch nick: SAMBA_3_0.bzr
timestamp: Sat 2007-04-14 00:01:43 -0500
message:
  [EMAIL PROTECTED] (r22212)  2007-04-13 19:53:38 -0500 (Fri, 13 Apr 2007)
  
  Cope with signature errors on sessionsetupX logins
  where the server just reflects our signature back
  to us. Allow the upper layer to see the real error.
  Jeremy.
  

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: [EMAIL PROTECTED]
branch nick: SAMBA_3_0.bzr
timestamp: Fri 2007-04-13 18:10:18 -0500
message:
  [EMAIL PROTECTED] (r22211)  2007-04-13 17:56:27 -0500 (Fri, 13 Apr 2007)
  
  Don't return a value from void functions !
  Jeremy.
  

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: [EMAIL PROTECTED]
branch nick: SAMBA_3_0.bzr
timestamp: Fri 2007-04-13 18:07:50 -0500
message:
  [EMAIL PROTECTED] (r22210)  2007-04-13 17:42:21 -0500 (Fri, 13 Apr 2007)
  
  Fix typo in testing for non-centry entries.
  Jeremy.
  

merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: [EMAIL PROTECTED]
branch nick: SAMBA_3_0.bzr
timestamp: Fri 2007-04-13 18:02:59 -0500
message:
  [EMAIL PROTECTED] (r22209)  2007-04-13 17:29:50 -0500 (Fri, 13 Apr 2007)
  
  Fix the storage of time_t -> make it 64 bits (use the
  same load/store function as NTTIME). Add a version number
  string to the winbindd cache so we can tell if it needs
  upgrading. THIS WILL DELETE ANY EXISTING winbindd_cache.tdb
  on first startup regardless of offline auth status. Once
  this is done we're in good shape though.
  Jeremy.
  
=== modified file 'REVISION'
--- a/REVISION  2007-04-13 05:05:03 +
+++ b/REVISION  2007-04-14 11:04:15 +
@@ -2,9 +2,9 @@
 URL: svn+ssh://svn.samba.org/home/svn/samba/branches/SAMBA_3_0
 Repository Root: svn+ssh://svn.samba.org/home/svn/samba
 Repository UUID: 0c0555d6-39d7-0310-84fc-f1cc0bd64818
-Revision: 22207
+Revision: 22214
 Node Kind: directory
-Last Changed Author: jra
-Last Changed Rev: 22207
-Last Changed Date: 2007-04-12 20:46:47 -0500 (Thu, 12 Apr 2007)
+Last Changed Author: vlendec
+Last Changed Rev: 22214
+Last Changed Date: 2007-04-14 01:44:30 -0500 (Sat, 14 Apr 2007)
 

=== modified file 'source/lib/debug.c'
--- a/source/lib/debug.c2007-04-06 05:01:25 +
+++ b/source/lib/debug.c2007-04-14 11:01:56 +
@@ -688,15 +688,20 @@
int maxlog;
SMB_STRUCT_STAT st;
 
+   /*
+*  We need to be root to check/change log-file,

Rev 5362: update todos in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

2007-04-15 Thread Michael Adam
At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/


revno: 5362
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Michael Adam <[EMAIL PROTECTED]>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Mon 2007-04-16 00:46:10 +0200
message:
  update todos
modified:
  source/TODO.registry.ma
todo.registry.ma-20070404061017-mw7eb61m4bxpc71a-1
=== modified file 'source/TODO.registry.ma'
--- a/source/TODO.registry.ma   2007-04-10 21:17:54 +
+++ b/source/TODO.registry.ma   2007-04-15 22:46:10 +
@@ -16,13 +16,25 @@
 * add a means to write out the default values of the global 
   section (like testparm -v)
 
-* integrate global registry options into loadparm mechanism
+* put conversion between registry value data types and
+  string or/and loadparm data types into separate functions
+  to be called in multiple places (net_conf, loadparm, service.c
+  (load_registry_sevice).
+
+* clarify which registry data types are really allowed
+  and desirable for KEY_SMBCONF. load_registry_service only
+  interprets REG_DWORD and REG_SZ.
+
+DONE:
+
+[r5334] check existence of given share for setparm and create
+  if it does not exist
+
+[r5361] integrate global registry options into loadparm mechanism
   via a global parameter "include registry globals" (say) of 
   type P_BOOL. works like an include, but only for global
   options. side effect: activate "registry shares".
 
-DONE:
-
-[r5334] check existence of given share for setparm and create
-  if it does not exist
+  DONE via special semantics of "include = registry" in global
+  section.
 



Rev 5361: Make "include = registry" effective (only in global section): in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

2007-04-15 Thread Michael Adam
At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/


revno: 5361
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Michael Adam <[EMAIL PROTECTED]>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Mon 2007-04-16 00:30:33 +0200
message:
  Make "include = registry" effective (only in global section):
  Parameters are processed by do_parameter.
  
  Currently (as with smbd/service.c:load_registry_service(),
  parameters read from registry are either type sz or type dword
  and are converted to string (in case of reg type dword).
  This conversion, which is also present in utils/net_conf.c
  should really go into one helper function...
modified:
  source/param/loadparm.cloadparm.c-20060530022627-1efa1edb3eb0e897
=== modified file 'source/param/loadparm.c'
--- a/source/param/loadparm.c   2007-04-13 16:00:33 +
+++ b/source/param/loadparm.c   2007-04-15 22:30:33 +
@@ -3182,8 +3182,9 @@
char *regpath = NULL;
WERROR werr = WERR_OK;
struct registry_key *key = NULL;
-   struct registry_value *valvalue = NULL;
+   struct registry_value *value = NULL;
char *valname = NULL;
+   char *valstr = NULL;
uint32 idx = 0;
NT_USER_TOKEN *token;
 
@@ -3216,10 +3217,25 @@
 
for (idx = 0;
 W_ERROR_IS_OK(werr = reg_enumvalue(ctx, key, idx, &valname,
-   &valvalue));
+   &value));
 idx++)
{
-   DEBUG(1, ("got global registry parameter '%s'\n", valname));
+   DEBUG(5, ("got global registry parameter '%s'\n", valname));
+   switch(value->type) {
+   case REG_DWORD:
+   valstr = talloc_asprintf(ctx, "%d", value->v.dword);
+   pfunc(valname, valstr);
+   TALLOC_FREE(valstr);
+   break;
+   case REG_SZ:
+   pfunc(valname, value->v.sz.str);
+   break;
+   default:
+   /* ignore */
+   break;
+   }
+   TALLOC_FREE(value);
+   TALLOC_FREE(valstr);
}
 
ret = pfunc("registry shares", "yes");
@@ -3239,7 +3255,14 @@
pstrcpy(fname, pszParmValue);
 
if (strequal(fname, INCLUDE_REGISTRY_NAME)) {
-   return process_registry_globals(do_parameter);
+   if (bInGlobalSection) {
+   return process_registry_globals(do_parameter);
+   }
+   else {
+   DEBUG(1, ("\"include = registry\" only effective "
+ "in %s section\n", GLOBAL_NAME));
+   return False;
+   }
}
 
standard_sub_basic(get_current_username(), current_user_info.domain,



Rev 5360: correct one indentation in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

2007-04-15 Thread Michael Adam
At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/


revno: 5360
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Michael Adam <[EMAIL PROTECTED]>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Mon 2007-04-16 00:23:54 +0200
message:
  correct one indentation
modified:
  source/utils/net_conf.cnet_conf.c-20070409110216-64p0zt0mes4j6yoe-1
=== modified file 'source/utils/net_conf.c'
--- a/source/utils/net_conf.c   2007-04-15 21:33:09 +
+++ b/source/utils/net_conf.c   2007-04-15 22:23:54 +
@@ -136,7 +136,7 @@
 }
 break;
 }
-case REG_BINARY:
+   case REG_BINARY:
 result = talloc_asprintf(mem_ctx, "binary (%d bytes)",
 (int)value->v.binary.length);
 break;



Rev 5359: remove unneeded declaration of global variable (code using it moved to in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

2007-04-15 Thread Michael Adam
At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/


revno: 5359
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Michael Adam <[EMAIL PROTECTED]>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Sun 2007-04-15 23:33:09 +0200
message:
  remove unneeded declaration of global variable (code using it moved to
  lib/util_reg.c:registry_init_regdb()
modified:
  source/utils/net_conf.cnet_conf.c-20070409110216-64p0zt0mes4j6yoe-1
=== modified file 'source/utils/net_conf.c'
--- a/source/utils/net_conf.c   2007-04-13 15:57:35 +
+++ b/source/utils/net_conf.c   2007-04-15 21:33:09 +
@@ -38,8 +38,6 @@
 #include "includes.h"
 #include "utils/net.h"
 
-extern REGISTRY_OPS smbconf_reg_ops;
-
 /* 
  * usage functions
  */



Rev 5358: fix segfault due to missing "static" - thanks Volker! in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

2007-04-15 Thread Michael Adam
At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/


revno: 5358
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Michael Adam <[EMAIL PROTECTED]>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Sun 2007-04-15 23:31:18 +0200
message:
  fix segfault due to missing "static" - thanks Volker!
modified:
  source/lib/util_reg.c  util_reg.c-20060711181331-c2d45d0e1f4a8648
=== modified file 'source/lib/util_reg.c'
--- a/source/lib/util_reg.c 2007-04-15 21:28:50 +
+++ b/source/lib/util_reg.c 2007-04-15 21:31:18 +
@@ -2,6 +2,7 @@
  * Unix SMB/CIFS implementation.
  * Registry helper routines
  * Copyright (C) Volker Lendecke 2006
+ * Copyright (C) Michael Adam 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
@@ -261,7 +262,7 @@
 {
BOOL ret = False;
int saved_errno = 0;
-   REGISTRY_HOOK smbconf_reg_hook = {KEY_SMBCONF, &smbconf_reg_ops};
+   static REGISTRY_HOOK smbconf_reg_hook = {KEY_SMBCONF, &smbconf_reg_ops};
 
DEBUG(10, ("registry_init_regdb called\n"));
 



Rev 5357: add some comments in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

2007-04-15 Thread Michael Adam
At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/


revno: 5357
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Michael Adam <[EMAIL PROTECTED]>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Sun 2007-04-15 23:28:50 +0200
message:
  add some comments
modified:
  source/lib/util_reg.c  util_reg.c-20060711181331-c2d45d0e1f4a8648
=== modified file 'source/lib/util_reg.c'
--- a/source/lib/util_reg.c 2007-04-13 15:57:35 +
+++ b/source/lib/util_reg.c 2007-04-15 21:28:50 +
@@ -226,6 +226,10 @@
return WERR_OK;
 }
 
+/*
+ * create a fake token just with enough rights to
+ * locally access the registry.
+ */
 NT_USER_TOKEN *registry_create_admin_token(TALLOC_CTX *mem_ctx)
 {
NT_USER_TOKEN *token = NULL;
@@ -248,12 +252,19 @@
return token;
 }
 
+/*
+ * init the smbconf portion of the registry.
+ * for use in places where not the whole registry is needed,
+ * e.g. utils/net_conf.c and loadparm.c
+ */
 BOOL registry_init_regdb(void)
 {
BOOL ret = False;
int saved_errno = 0;
REGISTRY_HOOK smbconf_reg_hook = {KEY_SMBCONF, &smbconf_reg_ops};
 
+   DEBUG(10, ("registry_init_regdb called\n"));
+
if (!regdb_init()) {
saved_errno = errno;
DEBUG(1, ("Can't open the registry"));



svn commit: samba r22229 - in branches/SAMBA_3_0/source/lib/ldb/include: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 21:14:37 + (Sun, 15 Apr 2007)
New Revision: 9

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9

Log:
discard_const_p is in lib/replace now

metze
Modified:
   branches/SAMBA_3_0/source/lib/ldb/include/includes.h


Changeset:
Modified: branches/SAMBA_3_0/source/lib/ldb/include/includes.h
===
--- branches/SAMBA_3_0/source/lib/ldb/include/includes.h2007-04-15 
21:14:03 UTC (rev 8)
+++ branches/SAMBA_3_0/source/lib/ldb/include/includes.h2007-04-15 
21:14:37 UTC (rev 9)
@@ -16,10 +16,6 @@
 #define dyn_MODULESDIR dyn_LIBDIR
 #endif
 
-
-
-#define discard_const_p(type, ptr) ((type *)((intptr_t)(ptr)))
-
 #include "replace.h"
 #include "system/filesys.h"
 #include "system/network.h"



svn commit: samba r22228 - in branches/SAMBA_3_0_25/source/lib/replace: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 21:14:03 + (Sun, 15 Apr 2007)
New Revision: 8

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8

Log:
merge from samba4:

move discard_const macros to librelace

metze
Modified:
   branches/SAMBA_3_0_25/source/lib/replace/replace.h
   branches/SAMBA_3_0_25/source/lib/replace/strptime.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/lib/replace/replace.h
===
--- branches/SAMBA_3_0_25/source/lib/replace/replace.h  2007-04-15 21:13:48 UTC 
(rev 7)
+++ branches/SAMBA_3_0_25/source/lib/replace/replace.h  2007-04-15 21:14:03 UTC 
(rev 8)
@@ -79,6 +79,29 @@
 #include 
 #endif
 
+/**
+  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.
+*/
+#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
+
+/** Type-safe version of discard_const */
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]

Modified: branches/SAMBA_3_0_25/source/lib/replace/strptime.c
===
--- branches/SAMBA_3_0_25/source/lib/replace/strptime.c 2007-04-15 21:13:48 UTC 
(rev 7)
+++ branches/SAMBA_3_0_25/source/lib/replace/strptime.c 2007-04-15 21:14:03 UTC 
(rev 8)
@@ -974,7 +974,7 @@
   if (want_xday && !have_yday)
 day_of_the_year (tm);
 
-  return (char *) rp;
+  return discard_const_p(char, rp);
 }
 
 



svn commit: samba r22227 - in branches/SAMBA_3_0/source/lib/replace: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 21:13:48 + (Sun, 15 Apr 2007)
New Revision: 7

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7

Log:
merge from samba4:

move discard_const macros to librelace

metze
Modified:
   branches/SAMBA_3_0/source/lib/replace/replace.h
   branches/SAMBA_3_0/source/lib/replace/strptime.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/replace/replace.h
===
--- branches/SAMBA_3_0/source/lib/replace/replace.h 2007-04-15 21:13:13 UTC 
(rev 6)
+++ branches/SAMBA_3_0/source/lib/replace/replace.h 2007-04-15 21:13:48 UTC 
(rev 7)
@@ -79,6 +79,29 @@
 #include 
 #endif
 
+/**
+  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.
+*/
+#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
+
+/** Type-safe version of discard_const */
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]

Modified: branches/SAMBA_3_0/source/lib/replace/strptime.c
===
--- branches/SAMBA_3_0/source/lib/replace/strptime.c2007-04-15 21:13:13 UTC 
(rev 6)
+++ branches/SAMBA_3_0/source/lib/replace/strptime.c2007-04-15 21:13:48 UTC 
(rev 7)
@@ -974,7 +974,7 @@
   if (want_xday && !have_yday)
 day_of_the_year (tm);
 
-  return (char *) rp;
+  return discard_const_p(char, rp);
 }
 
 



svn commit: samba r22226 - in branches/SAMBA_4_0/source/lib: ldb/include replace util

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 21:13:13 + (Sun, 15 Apr 2007)
New Revision: 6

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6

Log:
move discard_const macros to librelace

metze
Modified:
   branches/SAMBA_4_0/source/lib/ldb/include/includes.h
   branches/SAMBA_4_0/source/lib/replace/replace.h
   branches/SAMBA_4_0/source/lib/replace/strptime.c
   branches/SAMBA_4_0/source/lib/util/util.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/include/includes.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/includes.h2007-04-15 
20:58:00 UTC (rev 5)
+++ branches/SAMBA_4_0/source/lib/ldb/include/includes.h2007-04-15 
21:13:13 UTC (rev 6)
@@ -16,11 +16,6 @@
 #define dyn_MODULESDIR dyn_LIBDIR
 #endif
 
-
-
-#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
-#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-
 #include "replace.h"
 #include "system/filesys.h"
 #include "system/network.h"

Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===
--- branches/SAMBA_4_0/source/lib/replace/replace.h 2007-04-15 20:58:00 UTC 
(rev 5)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h 2007-04-15 21:13:13 UTC 
(rev 6)
@@ -79,6 +79,29 @@
 #include 
 #endif
 
+/**
+  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.
+*/
+#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
+
+/** Type-safe version of discard_const */
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]

Modified: branches/SAMBA_4_0/source/lib/replace/strptime.c
===
--- branches/SAMBA_4_0/source/lib/replace/strptime.c2007-04-15 20:58:00 UTC 
(rev 5)
+++ branches/SAMBA_4_0/source/lib/replace/strptime.c2007-04-15 21:13:13 UTC 
(rev 6)
@@ -974,7 +974,7 @@
   if (want_xday && !have_yday)
 day_of_the_year (tm);
 
-  return (char *) rp;
+  return discard_const_p(char, rp);
 }
 
 

Modified: branches/SAMBA_4_0/source/lib/util/util.h
===
--- branches/SAMBA_4_0/source/lib/util/util.h   2007-04-15 20:58:00 UTC (rev 
5)
+++ branches/SAMBA_4_0/source/lib/util/util.h   2007-04-15 21:13:13 UTC (rev 
6)
@@ -107,27 +107,4 @@
 #define strlen(x) valgrind_strlen(x)
 #endif
 
-/**
-  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.
-*/
-#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
-
-/** Type-safe version of discard_const */
-#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-
 #endif /* _SAMBA_UTIL_H_ */



svn commit: samba r22225 - in branches/SAMBA_3_0_25/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 20:58:00 + (Sun, 15 Apr 2007)
New Revision: 5

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5

Log:
merge from samba4:

make comparing of struct tm more verbose and portable

metze
Modified:
   branches/SAMBA_3_0_25/source/lib/replace/test/strptime.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/lib/replace/test/strptime.c
===
--- branches/SAMBA_3_0_25/source/lib/replace/test/strptime.c2007-04-15 
20:57:48 UTC (rev 4)
+++ branches/SAMBA_3_0_25/source/lib/replace/test/strptime.c2007-04-15 
20:58:00 UTC (rev 5)
@@ -8,6 +8,10 @@
 #define true 1
 #define false 0
 
+#ifndef __STRING
+#define __STRING(x)#x
+#endif
+
 /* make printf a no-op */
 #define printf if(0) printf
 
@@ -24,6 +28,9 @@
char *ret;
struct tm t, t2;
 
+   memset(&t, 0, sizeof(t));
+   memset(&t2, 0, sizeof(t2));
+
printf("test: strptime\n");
 
ret = strptime(s, "%Y%m%d%H%M%S", &t);
@@ -56,13 +63,26 @@
return false;
}
 
-   if (memcmp(&t, &t2, sizeof(t)) == 0) {
-   printf("failure: strptime [\n"
-  "result differs if the format string has a 'Z' at the 
end\n"
-  "]\n");
-   return false;
+#define CMP_TM_ELEMENT(t1,t2,elem) \
+   if (t1.elem != t2.elem) { \
+   printf("failure: strptime [\n" \
+  "result differs if the format string has a 'Z' at the 
end\n" \
+  "element: %s %d != %d\n" \
+  "]\n", \
+  __STRING(elen), t1.elem, t2.elem); \
+   return false; \
}
 
+   CMP_TM_ELEMENT(t,t2,tm_sec);
+   CMP_TM_ELEMENT(t,t2,tm_min);
+   CMP_TM_ELEMENT(t,t2,tm_hour);
+   CMP_TM_ELEMENT(t,t2,tm_mday);
+   CMP_TM_ELEMENT(t,t2,tm_mon);
+   CMP_TM_ELEMENT(t,t2,tm_year);
+   CMP_TM_ELEMENT(t,t2,tm_wday);
+   CMP_TM_ELEMENT(t,t2,tm_yday);
+   CMP_TM_ELEMENT(t,t2,tm_isdst);
+
if (t.tm_sec != 46) {
printf("failure: strptime [\n"
   "tm_sec: expected: 46, got: %d\n"



svn commit: samba r22224 - in branches/SAMBA_3_0/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 20:57:48 + (Sun, 15 Apr 2007)
New Revision: 4

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4

Log:
merge from samba4:

make comparing of struct tm more verbose and portable

metze
Modified:
   branches/SAMBA_3_0/source/lib/replace/test/strptime.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/replace/test/strptime.c
===
--- branches/SAMBA_3_0/source/lib/replace/test/strptime.c   2007-04-15 
20:55:52 UTC (rev 3)
+++ branches/SAMBA_3_0/source/lib/replace/test/strptime.c   2007-04-15 
20:57:48 UTC (rev 4)
@@ -8,6 +8,10 @@
 #define true 1
 #define false 0
 
+#ifndef __STRING
+#define __STRING(x)#x
+#endif
+
 /* make printf a no-op */
 #define printf if(0) printf
 
@@ -24,6 +28,9 @@
char *ret;
struct tm t, t2;
 
+   memset(&t, 0, sizeof(t));
+   memset(&t2, 0, sizeof(t2));
+
printf("test: strptime\n");
 
ret = strptime(s, "%Y%m%d%H%M%S", &t);
@@ -56,13 +63,26 @@
return false;
}
 
-   if (memcmp(&t, &t2, sizeof(t)) == 0) {
-   printf("failure: strptime [\n"
-  "result differs if the format string has a 'Z' at the 
end\n"
-  "]\n");
-   return false;
+#define CMP_TM_ELEMENT(t1,t2,elem) \
+   if (t1.elem != t2.elem) { \
+   printf("failure: strptime [\n" \
+  "result differs if the format string has a 'Z' at the 
end\n" \
+  "element: %s %d != %d\n" \
+  "]\n", \
+  __STRING(elen), t1.elem, t2.elem); \
+   return false; \
}
 
+   CMP_TM_ELEMENT(t,t2,tm_sec);
+   CMP_TM_ELEMENT(t,t2,tm_min);
+   CMP_TM_ELEMENT(t,t2,tm_hour);
+   CMP_TM_ELEMENT(t,t2,tm_mday);
+   CMP_TM_ELEMENT(t,t2,tm_mon);
+   CMP_TM_ELEMENT(t,t2,tm_year);
+   CMP_TM_ELEMENT(t,t2,tm_wday);
+   CMP_TM_ELEMENT(t,t2,tm_yday);
+   CMP_TM_ELEMENT(t,t2,tm_isdst);
+
if (t.tm_sec != 46) {
printf("failure: strptime [\n"
   "tm_sec: expected: 46, got: %d\n"



svn commit: samba r22223 - in branches/SAMBA_4_0/source/lib/replace/test: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 20:55:52 + (Sun, 15 Apr 2007)
New Revision: 3

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3

Log:
make comparing of struct tm more verbose and more portable

metze
Modified:
   branches/SAMBA_4_0/source/lib/replace/test/strptime.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/test/strptime.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/strptime.c   2007-04-15 
20:19:47 UTC (rev 2)
+++ branches/SAMBA_4_0/source/lib/replace/test/strptime.c   2007-04-15 
20:55:52 UTC (rev 3)
@@ -8,6 +8,10 @@
 #define true 1
 #define false 0
 
+#ifndef __STRING
+#define __STRING(x)#x
+#endif
+
 /* make printf a no-op */
 #define printf if(0) printf
 
@@ -24,6 +28,9 @@
char *ret;
struct tm t, t2;
 
+   memset(&t, 0, sizeof(t));
+   memset(&t2, 0, sizeof(t2));
+
printf("test: strptime\n");
 
ret = strptime(s, "%Y%m%d%H%M%S", &t);
@@ -56,13 +63,26 @@
return false;
}
 
-   if (memcmp(&t, &t2, sizeof(t)) == 0) {
-   printf("failure: strptime [\n"
-  "result differs if the format string has a 'Z' at the 
end\n"
-  "]\n");
-   return false;
+#define CMP_TM_ELEMENT(t1,t2,elem) \
+   if (t1.elem != t2.elem) { \
+   printf("failure: strptime [\n" \
+  "result differs if the format string has a 'Z' at the 
end\n" \
+  "element: %s %d != %d\n" \
+  "]\n", \
+  __STRING(elen), t1.elem, t2.elem); \
+   return false; \
}
 
+   CMP_TM_ELEMENT(t,t2,tm_sec);
+   CMP_TM_ELEMENT(t,t2,tm_min);
+   CMP_TM_ELEMENT(t,t2,tm_hour);
+   CMP_TM_ELEMENT(t,t2,tm_mday);
+   CMP_TM_ELEMENT(t,t2,tm_mon);
+   CMP_TM_ELEMENT(t,t2,tm_year);
+   CMP_TM_ELEMENT(t,t2,tm_wday);
+   CMP_TM_ELEMENT(t,t2,tm_yday);
+   CMP_TM_ELEMENT(t,t2,tm_isdst);
+
if (t.tm_sec != 46) {
printf("failure: strptime [\n"
   "tm_sec: expected: 46, got: %d\n"



svn commit: samba r22222 - in branches/SAMBA_4_0: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 20:19:47 + (Sun, 15 Apr 2007)
New Revision: 2

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=2

Log:
a dummy commit:-)

metze
Modified:
   branches/SAMBA_4_0/TODO


Changeset:
Modified: branches/SAMBA_4_0/TODO
===
--- branches/SAMBA_4_0/TODO 2007-04-15 20:12:09 UTC (rev 1)
+++ branches/SAMBA_4_0/TODO 2007-04-15 20:19:47 UTC (rev 2)
@@ -15,6 +15,8 @@
 
 - testsuite for the 'net' tool
 
+- and a lot of other stuff
+
 Configuration options
 =
 
@@ -279,3 +281,4 @@
 - winbind nested groups
 - winbind max idle children
 - winbind nss info
+



svn commit: samba r22221 - in branches/SAMBA_3_0/source: . lib/replace lib/replace/system lib/replace/test

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 20:12:09 + (Sun, 15 Apr 2007)
New Revision: 1

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=1

Log:
merge from samba4:

- libreplace unsetenv() and strptime() replacements

metze
Added:
   branches/SAMBA_3_0/source/lib/replace/strptime.c
   branches/SAMBA_3_0/source/lib/replace/strptime.m4
   branches/SAMBA_3_0/source/lib/replace/test/strptime.c
Modified:
   branches/SAMBA_3_0/source/Makefile.in
   branches/SAMBA_3_0/source/lib/replace/Makefile.in
   branches/SAMBA_3_0/source/lib/replace/README
   branches/SAMBA_3_0/source/lib/replace/libreplace.m4
   branches/SAMBA_3_0/source/lib/replace/replace.c
   branches/SAMBA_3_0/source/lib/replace/replace.h
   branches/SAMBA_3_0/source/lib/replace/samba.m4
   branches/SAMBA_3_0/source/lib/replace/system/wait.h
   branches/SAMBA_3_0/source/lib/replace/test/testsuite.c


Changeset:
Sorry, the patch is too large (1685 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=1


svn commit: samba r22220 - in branches/SAMBA_3_0_25/source: . lib/replace lib/replace/system lib/replace/test

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 20:10:32 + (Sun, 15 Apr 2007)
New Revision: 0

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=0

Log:
merge from samba4:

- libreplace unsetenv() and strptime() replacements

metze
Added:
   branches/SAMBA_3_0_25/source/lib/replace/strptime.c
   branches/SAMBA_3_0_25/source/lib/replace/strptime.m4
   branches/SAMBA_3_0_25/source/lib/replace/test/strptime.c
Modified:
   branches/SAMBA_3_0_25/source/Makefile.in
   branches/SAMBA_3_0_25/source/lib/replace/Makefile.in
   branches/SAMBA_3_0_25/source/lib/replace/README
   branches/SAMBA_3_0_25/source/lib/replace/libreplace.m4
   branches/SAMBA_3_0_25/source/lib/replace/replace.c
   branches/SAMBA_3_0_25/source/lib/replace/replace.h
   branches/SAMBA_3_0_25/source/lib/replace/samba.m4
   branches/SAMBA_3_0_25/source/lib/replace/system/wait.h
   branches/SAMBA_3_0_25/source/lib/replace/test/testsuite.c


Changeset:
Sorry, the patch is too large (1685 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=0


svn commit: samba r22219 - in branches/SAMBA_3_0_25/source/lib/replace: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 19:23:04 + (Sun, 15 Apr 2007)
New Revision: 22219

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22219

Log:
merge from samba3/4:

merge stdint.h stdbool.h replacement fix to 3.0.25 branch

metze
Modified:
   branches/SAMBA_3_0_25/source/lib/replace/README
   branches/SAMBA_3_0_25/source/lib/replace/libreplace.m4
   branches/SAMBA_3_0_25/source/lib/replace/libreplace_macros.m4


Changeset:
Modified: branches/SAMBA_3_0_25/source/lib/replace/README
===
--- branches/SAMBA_3_0_25/source/lib/replace/README 2007-04-15 19:09:34 UTC 
(rev 22218)
+++ branches/SAMBA_3_0_25/source/lib/replace/README 2007-04-15 19:23:04 UTC 
(rev 22219)
@@ -80,6 +80,10 @@
 MAX
 QSORT_CAST
 
+Headers:
+stdint.h
+stdbool.h
+
 Prerequisites:
 memset (for bzero)
 syslog (for vsyslog)

Modified: branches/SAMBA_3_0_25/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_3_0_25/source/lib/replace/libreplace.m4  2007-04-15 
19:09:34 UTC (rev 22218)
+++ branches/SAMBA_3_0_25/source/lib/replace/libreplace.m4  2007-04-15 
19:23:04 UTC (rev 22219)
@@ -61,9 +61,12 @@
 
 AC_CHECK_FUNCS(pipe strftime srandom random srand rand usleep setbuffer lstat 
getpgrp)
 
-AC_CHECK_HEADERS(stdbool.h sys/select.h)
+AC_CHECK_HEADERS(stdbool.h stdint.h sys/select.h)
 AC_CHECK_HEADERS(setjmp.h)
 
+LIBREPLACE_PROVIDE_HEADER([stdint.h])
+LIBREPLACE_PROVIDE_HEADER([stdbool.h])
+
 AC_CHECK_TYPE(bool, 
 [AC_DEFINE(HAVE_BOOL, 1, [Whether the bool type is available])],,
 [

Modified: branches/SAMBA_3_0_25/source/lib/replace/libreplace_macros.m4
===
--- branches/SAMBA_3_0_25/source/lib/replace/libreplace_macros.m4   
2007-04-15 19:09:34 UTC (rev 22218)
+++ branches/SAMBA_3_0_25/source/lib/replace/libreplace_macros.m4   
2007-04-15 19:23:04 UTC (rev 22219)
@@ -306,3 +306,12 @@
 )
 AS_IF([test $AS_TR_SH([ac_cv_c_prototype_$1]) = yes],[$3],[$4])
 ])
+
+AC_DEFUN(LIBREPLACE_PROVIDE_HEADER, 
+[AC_CHECK_HEADER([$1], 
+   [ AC_CONFIG_COMMANDS(rm-$1, [rm -f $libreplacedir/$1], 
[libreplacedir=$libreplacedir]) ],
+   [ AC_CONFIG_COMMANDS(mk-$1, [echo "#include \"replace.h\"" > 
$libreplacedir/$1], [libreplacedir=$libreplacedir]) ]
+   )
+])
+
+



svn commit: samba r22218 - in branches/SAMBA_4_0/source/lib/replace: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 19:09:34 + (Sun, 15 Apr 2007)
New Revision: 22218

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22218

Log:
fix libreplace standalone build

metze
Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2007-04-15 16:30:01 UTC 
(rev 22217)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2007-04-15 19:09:34 UTC 
(rev 22218)
@@ -37,7 +37,7 @@
 
 installcheck: install test
 
-TEST_OBJS = test/testsuite.o test/os2_delete.o
+TEST_OBJS = test/testsuite.o test/os2_delete.o test/strptime.o
 
 testsuite: libreplace.a $(TEST_OBJS)
$(CC) -o testsuite $(TEST_OBJS) -L. -lreplace



svn commit: samba r22217 - in branches/SAMBA_4_0/source/lib/replace/system: .

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 16:30:01 + (Sun, 15 Apr 2007)
New Revision: 22217

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22217

Log:
merge from samba3 21944:

move acl header checks to the correct place only

metze
Modified:
   branches/SAMBA_4_0/source/lib/replace/system/config.m4
   branches/SAMBA_4_0/source/lib/replace/system/filesys.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/system/config.m4
===
--- branches/SAMBA_4_0/source/lib/replace/system/config.m4  2007-04-15 
16:13:06 UTC (rev 22216)
+++ branches/SAMBA_4_0/source/lib/replace/system/config.m4  2007-04-15 
16:30:01 UTC (rev 22217)
@@ -1,6 +1,7 @@
 # filesys
 AC_HEADER_DIRENT 
-AC_CHECK_HEADERS(fcntl.h sys/fcntl.h sys/acl.h sys/resource.h sys/ioctl.h 
sys/mode.h sys/filio.h sys/fs/s5param.h sys/filsys.h )
+AC_CHECK_HEADERS(fcntl.h sys/fcntl.h sys/resource.h sys/ioctl.h sys/mode.h 
sys/filio.h sys/fs/s5param.h sys/filsys.h)
+AC_CHECK_HEADERS(sys/acl.h acl/libacl.h)
 
 # select
 AC_CHECK_HEADERS(sys/select.h)

Modified: branches/SAMBA_4_0/source/lib/replace/system/filesys.h
===
--- branches/SAMBA_4_0/source/lib/replace/system/filesys.h  2007-04-15 
16:13:06 UTC (rev 22216)
+++ branches/SAMBA_4_0/source/lib/replace/system/filesys.h  2007-04-15 
16:30:01 UTC (rev 22217)
@@ -41,6 +41,10 @@
 #include 
 #endif
 
+#ifdef HAVE_ACL_LIBACL_H
+#include 
+#endif
+
 #ifdef HAVE_SYS_FS_S5PARAM_H 
 #include 
 #endif



svn commit: samba r22216 - in branches/SAMBA_4_0/source: lib/replace lib/replace/test torture/local

2007-04-15 Thread metze
Author: metze
Date: 2007-04-15 16:13:06 + (Sun, 15 Apr 2007)
New Revision: 22216

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22216

Log:
move strptime testsuite into it's own file
so we can include it for the configure test

as it seems that strptime() is really broken on some hosts
in the build farm, re should use the replacement code
when we detect this in the configure test

metze
Added:
   branches/SAMBA_4_0/source/lib/replace/test/strptime.c
Modified:
   branches/SAMBA_4_0/source/lib/replace/strptime.m4
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
   branches/SAMBA_4_0/source/torture/local/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/strptime.m4
===
--- branches/SAMBA_4_0/source/lib/replace/strptime.m4   2007-04-14 09:14:40 UTC 
(rev 22215)
+++ branches/SAMBA_4_0/source/lib/replace/strptime.m4   2007-04-15 16:13:06 UTC 
(rev 22216)
@@ -1,16 +1,8 @@
 AC_CACHE_CHECK([whether strptime is available and 
works],libreplace_cv_STRPTIME_OK,[
AC_TRY_RUN([
-   #include 
-   #include 
-   #include 
-   int main (void) {
-   const char *s = "20061004023546Z";
-   char *ret;
-   struct tm t;
-   ret = strptime(s, "%Y%m%d%H%M%S", &t);
-   if ( ret == NULL ) return 1;
-   return 0;
-   }],
+   #define LIBREPLACE_CONFIGURE_TEST_STRPTIME
+   #include "$libreplacedir/test/strptime.c"
+   ],
[libreplace_cv_STRPTIME_OK=yes],
[libreplace_cv_STRPTIME_OK=no],
[libreplace_cv_STRPTIME_OK="assuming not"])

Added: branches/SAMBA_4_0/source/lib/replace/test/strptime.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/strptime.c   2007-04-14 
09:14:40 UTC (rev 22215)
+++ branches/SAMBA_4_0/source/lib/replace/test/strptime.c   2007-04-15 
16:13:06 UTC (rev 22216)
@@ -0,0 +1,152 @@
+
+#ifdef LIBREPLACE_CONFIGURE_TEST_STRPTIME
+
+#include 
+#include 
+#include 
+
+#define true 1
+#define false 0
+
+/* make printf a no-op */
+#define printf if(0) printf
+
+#else /* LIBREPLACE_CONFIGURE_TEST_STRPTIME */
+
+#include "replace.h"
+#include "system/time.h"
+
+#endif /* LIBREPLACE_CONFIGURE_TEST_STRPTIME */
+
+int libreplace_test_strptime(void)
+{
+   const char *s = "20070414101546Z";
+   char *ret;
+   struct tm t, t2;
+
+   printf("test: strptime\n");
+
+   ret = strptime(s, "%Y%m%d%H%M%S", &t);
+   if ( ret == NULL ) {
+   printf("failure: strptime [\n"
+  "returned NULL\n"
+  "]\n");
+   return false;
+   }
+
+   if ( *ret != 'Z' ) {
+   printf("failure: strptime [\n"
+  "ret doesn't point to 'Z'\n"
+  "]\n");
+   return false;
+   }
+
+   ret = strptime(s, "%Y%m%d%H%M%SZ", &t2);
+   if ( ret == NULL ) {
+   printf("failure: strptime [\n"
+  "returned NULL with Z\n"
+  "]\n");
+   return false;
+   }
+
+   if ( *ret != '\0' ) {
+   printf("failure: strptime [\n"
+  "ret doesn't point to '\\0'\n"
+  "]\n");
+   return false;
+   }
+
+   if (memcmp(&t, &t2, sizeof(t)) == 0) {
+   printf("failure: strptime [\n"
+  "result differs if the format string has a 'Z' at the 
end\n"
+  "]\n");
+   return false;
+   }
+
+   if (t.tm_sec != 46) {
+   printf("failure: strptime [\n"
+  "tm_sec: expected: 46, got: %d\n"
+  "]\n",
+  t.tm_sec);
+   return false;
+   }
+
+   if (t.tm_min != 15) {
+   printf("failure: strptime [\n"
+  "tm_min: expected: 15, got: %d\n"
+  "]\n",
+  t.tm_min);
+   return false;
+   }
+
+   if (t.tm_hour != 10) {
+   printf("failure: strptime [\n"
+  "tm_hour: expected: 10, got: %d\n"
+  "]\n",
+  t.tm_hour);
+   return false;
+   }
+
+   if (t.tm_mday != 14) {
+   printf("failure: strptime [\n"
+  "tm_mday: expected: 14, got: %d\n"
+  "]\n",
+  t.tm_mday);
+   return false;
+   }
+
+   if (t.tm_mon != 3) {
+   printf("failure: strptime [\n"
+  "tm_mon: expected: 3, got: %d\n"
+  "]\n",
+  t.tm_mon);
+   return false;
+   }
+
+   if (t.tm_year != 107) {
+