svn commit: samba r23180 - in branches/SAMBA_4_0/source/torture/raw: .

2007-05-29 Thread tridge
Author: tridge
Date: 2007-05-29 07:32:28 + (Tue, 29 May 2007)
New Revision: 23180

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

Log:

auto-reconnect on both NT_STATUS_END_OF_FILE and NT_STATUS_LOCAL_DISCONNECT

Modified:
   branches/SAMBA_4_0/source/torture/raw/lockbench.c
   branches/SAMBA_4_0/source/torture/raw/openbench.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/lockbench.c
===
--- branches/SAMBA_4_0/source/torture/raw/lockbench.c   2007-05-29 06:33:55 UTC 
(rev 23179)
+++ branches/SAMBA_4_0/source/torture/raw/lockbench.c   2007-05-29 07:32:28 UTC 
(rev 23180)
@@ -212,7 +212,8 @@
NTSTATUS status = smbcli_request_simple_recv(req);
state->req = NULL;
if (!NT_STATUS_IS_OK(status)) {
-   if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) {
+   if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE) ||
+   NT_STATUS_EQUAL(status, NT_STATUS_LOCAL_DISCONNECT)) {
talloc_free(state->tree);
state->tree = NULL;
num_connected--;
@@ -249,7 +250,8 @@
struct benchlock_state *state = talloc_get_type(req->async.private, 
struct benchlock_state);
NTSTATUS status = smbcli_request_simple_recv(req);
-   if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) {
+   if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE) ||
+   NT_STATUS_EQUAL(status, NT_STATUS_LOCAL_DISCONNECT)) {
talloc_free(state->tree);
state->tree = NULL;
num_connected--;

Modified: branches/SAMBA_4_0/source/torture/raw/openbench.c
===
--- branches/SAMBA_4_0/source/torture/raw/openbench.c   2007-05-29 06:33:55 UTC 
(rev 23179)
+++ branches/SAMBA_4_0/source/torture/raw/openbench.c   2007-05-29 07:32:28 UTC 
(rev 23180)
@@ -283,7 +283,8 @@
struct benchopen_state *state = talloc_get_type(req->async.private, 
struct benchopen_state);
NTSTATUS status = smbcli_request_simple_recv(req);
-   if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) {
+   if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE) ||
+   NT_STATUS_EQUAL(status, NT_STATUS_LOCAL_DISCONNECT)) {
talloc_free(state->tree);
state->tree = NULL;
num_connected--;



svn commit: samba r23181 - in branches/SAMBA_4_0/source/torture/raw: .

2007-05-29 Thread tridge
Author: tridge
Date: 2007-05-29 08:22:45 + (Tue, 29 May 2007)
New Revision: 23181

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

Log:

prevent attempts to reopen the connection twice at the same time

Modified:
   branches/SAMBA_4_0/source/torture/raw/lockbench.c
   branches/SAMBA_4_0/source/torture/raw/openbench.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/lockbench.c
===
--- branches/SAMBA_4_0/source/torture/raw/lockbench.c   2007-05-29 07:32:28 UTC 
(rev 23180)
+++ branches/SAMBA_4_0/source/torture/raw/lockbench.c   2007-05-29 08:22:45 UTC 
(rev 23181)
@@ -54,6 +54,7 @@
int lastcount;
struct smbcli_request *req;
struct smb_composite_connect reconnect;
+   struct timed_event *te;
 
/* these are used for reconnections */
int dest_port;
@@ -148,9 +149,10 @@
 
status = smb_composite_connect_recv(ctx, state->mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
-   event_add_timed(state->ev, state->mem_ctx, 
-   timeval_current_ofs(1,0), 
-   reopen_connection, state);
+   talloc_free(state->te);
+   state->te = event_add_timed(state->ev, state->mem_ctx, 
+   timeval_current_ofs(1,0), 
+   reopen_connection, state);
return;
}
 
@@ -218,9 +220,10 @@
state->tree = NULL;
num_connected--;
DEBUG(0,("reopening connection to %s\n", 
state->dest_host));
-   event_add_timed(state->ev, state->mem_ctx, 
-   timeval_current_ofs(1,0), 
-   reopen_connection, state);
+   talloc_free(state->te);
+   state->te = event_add_timed(state->ev, state->mem_ctx, 
+   timeval_current_ofs(1,0), 
+   reopen_connection, state);
} else {
DEBUG(0,("Lock failed - %s\n", nt_errstr(status)));
lock_failed++;
@@ -256,9 +259,10 @@
state->tree = NULL;
num_connected--;
DEBUG(0,("reopening connection to %s\n", state->dest_host));
-   event_add_timed(state->ev, state->mem_ctx, 
-   timeval_current_ofs(1,0), 
-   reopen_connection, state);
+   talloc_free(state->te);
+   state->te = event_add_timed(state->ev, state->mem_ctx, 
+   timeval_current_ofs(1,0), 
+   reopen_connection, state);
}
 }
 

Modified: branches/SAMBA_4_0/source/torture/raw/openbench.c
===
--- branches/SAMBA_4_0/source/torture/raw/openbench.c   2007-05-29 07:32:28 UTC 
(rev 23180)
+++ branches/SAMBA_4_0/source/torture/raw/openbench.c   2007-05-29 08:22:45 UTC 
(rev 23181)
@@ -57,6 +57,7 @@
struct smbcli_request *req_open;
struct smbcli_request *req_close;
struct smb_composite_connect reconnect;
+   struct timed_event *te;
 
/* these are used for reconnections */
int dest_port;
@@ -81,9 +82,10 @@
 
status = smb_composite_connect_recv(ctx, state->mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
-   event_add_timed(state->ev, state->mem_ctx, 
-   timeval_current_ofs(1,0), 
-   reopen_connection, state);
+   talloc_free(state->te);
+   state->te = event_add_timed(state->ev, state->mem_ctx, 
+   timeval_current_ofs(1,0), 
+   reopen_connection, state);
return;
}
 
@@ -210,9 +212,10 @@
state->cli = NULL;
num_connected--;
DEBUG(0,("reopening connection to %s\n", state->dest_host));
-   event_add_timed(state->ev, state->mem_ctx, 
-   timeval_current_ofs(1,0), 
-   reopen_connection, state);
+   talloc_free(state->te);
+   state->te = event_add_timed(state->ev, state->mem_ctx, 
+   timeval_current_ofs(1,0), 
+   reopen_connection, state);
return;
}
 
@@ -262,9 +265,10 @@
state->cli = NULL;
num_connected--;
DEBUG(0,("reopening connection to %s\n", state->dest_host));
-   event_add_timed(state->ev, state->mem_ctx,

svn commit: samba r23182 - in branches/SAMBA_4_0/source/torture/raw: .

2007-05-29 Thread tridge
Author: tridge
Date: 2007-05-29 08:30:41 + (Tue, 29 May 2007)
New Revision: 23182

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

Log:

fixed valgrind error

Modified:
   branches/SAMBA_4_0/source/torture/raw/lockbench.c
   branches/SAMBA_4_0/source/torture/raw/openbench.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/lockbench.c
===
--- branches/SAMBA_4_0/source/torture/raw/lockbench.c   2007-05-29 08:22:45 UTC 
(rev 23181)
+++ branches/SAMBA_4_0/source/torture/raw/lockbench.c   2007-05-29 08:30:41 UTC 
(rev 23182)
@@ -176,6 +176,8 @@
struct smb_composite_connect *io = &state->reconnect;
char *host, *share;
 
+   state->te = NULL;
+
if (!torture_get_conn_index(state->client_num, state->mem_ctx, &host, 
&share)) {
DEBUG(0,("Can't find host/share for reconnect?!\n"));
exit(1);

Modified: branches/SAMBA_4_0/source/torture/raw/openbench.c
===
--- branches/SAMBA_4_0/source/torture/raw/openbench.c   2007-05-29 08:22:45 UTC 
(rev 23181)
+++ branches/SAMBA_4_0/source/torture/raw/openbench.c   2007-05-29 08:30:41 UTC 
(rev 23182)
@@ -114,6 +114,8 @@
struct smb_composite_connect *io = &state->reconnect;
char *host, *share;
 
+   state->te = NULL;
+
if (!torture_get_conn_index(state->client_num, state->mem_ctx, &host, 
&share)) {
DEBUG(0,("Can't find host/share for reconnect?!\n"));
exit(1);



Rev 389: fixed system() return handling in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 389
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Tue 2007-05-29 17:00:08 +1000
message:
  fixed system() return handling
modified:
  takeover/system.c  system.c-20070525071636-a5n1ihghjtppy08r-3
=== modified file 'takeover/system.c'
--- a/takeover/system.c 2007-05-29 02:55:24 +
+++ b/takeover/system.c 2007-05-29 07:00:08 +
@@ -275,6 +275,9 @@
CTDB_NO_MEMORY(ctdb, cmdstr);
 
ret = system(cmdstr);
+   if (ret != -1) {
+   ret = WEXITSTATUS(ret);
+   }
 
talloc_free(cmdstr);
talloc_free(options);



Rev 390: don't block SIGCHLD, or we lose return values from system() ! in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 390
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Tue 2007-05-29 17:23:29 +1000
message:
  don't block SIGCHLD, or we lose return values from system() !
  nicer log messages from events script
modified:
  common/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  tools/events   events-20070529030121-04fjh63cxfh8v1pj-1
=== modified file 'common/ctdb_daemon.c'
--- a/common/ctdb_daemon.c  2007-05-29 03:58:41 +
+++ b/common/ctdb_daemon.c  2007-05-29 07:23:29 +
@@ -734,7 +734,6 @@
setsid();
}
block_signal(SIGPIPE);
-   block_signal(SIGCHLD);
 
/* try to set us up as realtime */
ctdb_set_realtime();

=== modified file 'tools/events'
--- a/tools/events  2007-05-29 06:28:18 +
+++ b/tools/events  2007-05-29 07:23:29 +
@@ -13,8 +13,11 @@
iface=$1
ip=$2
maskbits=$3
-   exec /sbin/ip addr add $ip/$maskbits dev $iface
-   exit 1
+   /sbin/ip addr add $ip/$maskbits dev $iface || {
+echo "Failed to add $ip/$maskbits on dev $iface"
+exit 1
+   }
+   exit 0
;;
 
  releaseip)
@@ -25,8 +28,11 @@
iface=$1
ip=$2
maskbits=$3
-   exec /sbin/ip addr del $ip dev $iface
-   exit 1
+   /sbin/ip addr del $ip dev $iface || {
+echo "Failed to del $ip on dev $iface"
+exit 1
+   }
+   exit 0
;;
 
  recovered)



Re: svn commit: samba r23175 - in branches/SAMBA_4_0: . source/lib/replace source/script source/selftest

2007-05-29 Thread Stefan (metze) Metzmacher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] schrieb:
> Log:
> Handle PKG_CONFIG_PATH not set yet - fixes warning in selftest.pl

> Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
> ===
> --- branches/SAMBA_4_0/source/lib/replace/replace.h   2007-05-28 14:24:36 UTC 
> (rev 23174)
> +++ branches/SAMBA_4_0/source/lib/replace/replace.h   2007-05-28 21:04:59 UTC 
> (rev 23175)
> @@ -258,6 +258,14 @@
>  #endif
>  #endif
>  
> +#ifndef _DEPRECATED_
> +#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
> +#define _DEPRECATED_ __attribute__ ((deprecated))
> +#else
> +#define _DEPRECATED_
> +#endif
> +#endif
> +
>  #ifndef HAVE_VASPRINTF
>  #define vasprintf rep_vasprintf
>  int rep_vasprintf(char **ptr, const char *format, va_list ap) 
> PRINTF_ATTRIBUTE(2,0);
> 
> Modified: branches/SAMBA_4_0/source/script/mkproto.pl
> ===
> --- branches/SAMBA_4_0/source/script/mkproto.pl   2007-05-28 14:24:36 UTC 
> (rev 23174)
> +++ branches/SAMBA_4_0/source/script/mkproto.pl   2007-05-28 21:04:59 UTC 
> (rev 23175)
> @@ -180,10 +180,10 @@
>   }
>  
>   next unless ( $is_public || $line =~ /
> -   
> ^void|^BOOL|^bool|^int|^struct|^char|^const|^\w+_[tT]\s|^uint|^unsigned|^long|
> -   
> ^NTSTATUS|^ADS_STATUS|^enum\s.*\(|^DATA_BLOB|^WERROR|^XFILE|^FILE|^DIR|
> -   
> ^double|^TDB_CONTEXT|^TDB_DATA|^TALLOC_CTX|^NTTIME|^FN_|^init_module|
> -   ^GtkWidget|^GType|^smb_ucs2_t|^krb5_error_code
> +   (_DEPRECATED_ 
> )?^(void|BOOL|bool|int|struct|char|const|\w+_[tT]\s|uint|unsigned|long|NTSTATUS|
> +   
> ADS_STATUS|enum\s.*\(|DATA_BLOB|WERROR|XFILE|FILE|DIR|
> +   
> double|TDB_CONTEXT|TDB_DATA|TALLOC_CTX|NTTIME|FN_|init_module|
> +   GtkWidget|GType|smb_ucs2_t|krb5_error_code)
> /xo);
>  
>   next if ($line =~ /^int\s*main/);

Hi Jelmer,

I don't think you wanted to commit this...

metze
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGW+xxm70gjA5TCD8RAk8UAJ9tAWbzq0uYImkSWKeRBkrUqu2t9QCfewCR
oD2p26M65i5hKGF89yUJnCU=
=tAX3
-END PGP SIGNATURE-


svn commit: samba r23183 - in branches: SAMBA_3_0/source SAMBA_3_0/source/include SAMBA_3_0/source/lib SAMBA_3_0/source/libsmb SAMBA_3_0/source/locking SAMBA_3_0/source/printing SAMBA_3_0/source/rpc_s

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 09:30:34 + (Tue, 29 May 2007)
New Revision: 23183

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

Log:
Check in a change made by Tridge:

This replaces the internal explicit dev/ino file id representation by a
"struct file_id". This is necessary as cluster file systems and NFS
don't necessarily assign the same device number to the shared file
system. With this structure in place we can now easily add different
schemes to map a file to a unique 64-bit device node.

Jeremy, you might note that I did not change the external interface of
smb_share_modes.c.

Volker

Added:
   branches/SAMBA_3_0/source/lib/file_id.c
Modified:
   branches/SAMBA_3_0/source/Makefile.in
   branches/SAMBA_3_0/source/include/locking.h
   branches/SAMBA_3_0/source/include/smb.h
   branches/SAMBA_3_0/source/libsmb/smb_share_modes.c
   branches/SAMBA_3_0/source/locking/brlock.c
   branches/SAMBA_3_0/source/locking/locking.c
   branches/SAMBA_3_0/source/locking/posix.c
   branches/SAMBA_3_0/source/printing/printfsp.c
   branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_0/source/smbd/close.c
   branches/SAMBA_3_0/source/smbd/filename.c
   branches/SAMBA_3_0/source/smbd/files.c
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0/source/smbd/open.c
   branches/SAMBA_3_0/source/smbd/oplock.c
   branches/SAMBA_3_0/source/smbd/oplock_irix.c
   branches/SAMBA_3_0/source/smbd/oplock_linux.c
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0/source/smbd/trans2.c
   branches/SAMBA_3_0/source/torture/locktest.c
   branches/SAMBA_3_0/source/torture/locktest2.c
   branches/SAMBA_3_0/source/utils/status.c
   branches/SAMBA_3_0_26/source/Makefile.in
   branches/SAMBA_3_0_26/source/include/locking.h
   branches/SAMBA_3_0_26/source/include/smb.h
   branches/SAMBA_3_0_26/source/libsmb/smb_share_modes.c
   branches/SAMBA_3_0_26/source/locking/brlock.c
   branches/SAMBA_3_0_26/source/locking/locking.c
   branches/SAMBA_3_0_26/source/locking/posix.c
   branches/SAMBA_3_0_26/source/printing/printfsp.c
   branches/SAMBA_3_0_26/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_0_26/source/smbd/close.c
   branches/SAMBA_3_0_26/source/smbd/filename.c
   branches/SAMBA_3_0_26/source/smbd/files.c
   branches/SAMBA_3_0_26/source/smbd/nttrans.c
   branches/SAMBA_3_0_26/source/smbd/open.c
   branches/SAMBA_3_0_26/source/smbd/oplock.c
   branches/SAMBA_3_0_26/source/smbd/oplock_irix.c
   branches/SAMBA_3_0_26/source/smbd/oplock_linux.c
   branches/SAMBA_3_0_26/source/smbd/reply.c
   branches/SAMBA_3_0_26/source/smbd/trans2.c
   branches/SAMBA_3_0_26/source/torture/locktest.c
   branches/SAMBA_3_0_26/source/torture/locktest2.c
   branches/SAMBA_3_0_26/source/utils/status.c


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


svn commit: samba r23184 - in branches: SAMBA_3_0/source/lib/tdb/tools SAMBA_3_0_26/source/lib/tdb/tools

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 10:15:01 + (Tue, 29 May 2007)
New Revision: 23184

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

Log:
Checkin for Tridge: Add a speed test to tdbtool

Modified:
   branches/SAMBA_3_0/source/lib/tdb/tools/tdbtool.c
   branches/SAMBA_3_0_26/source/lib/tdb/tools/tdbtool.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/tdb/tools/tdbtool.c
===
--- branches/SAMBA_3_0/source/lib/tdb/tools/tdbtool.c   2007-05-29 09:30:34 UTC 
(rev 23183)
+++ branches/SAMBA_3_0/source/lib/tdb/tools/tdbtool.c   2007-05-29 10:15:01 UTC 
(rev 23184)
@@ -35,6 +35,7 @@
 char *line;
 TDB_DATA iterate_kbuf;
 char cmdline[1024];
+static int disable_mmap;
 
 enum commands {
CMD_CREATE_TDB,
@@ -51,6 +52,8 @@
CMD_LIST_HASH_FREE,
CMD_LIST_FREE,
CMD_INFO,
+   CMD_MMAP,
+   CMD_SPEED,
CMD_FIRST,
CMD_NEXT,
CMD_SYSTEM,
@@ -78,6 +81,8 @@
{"list",CMD_LIST_HASH_FREE},
{"free",CMD_LIST_FREE},
{"info",CMD_INFO},
+   {"speed",   CMD_SPEED},
+   {"mmap",CMD_MMAP},
{"first",   CMD_FIRST},
{"1",   CMD_FIRST},
{"next",CMD_NEXT},
@@ -88,6 +93,20 @@
{NULL,  CMD_HELP}
 };
 
+struct timeval tp1,tp2;
+
+static void _start_timer(void)
+{
+   gettimeofday(&tp1,NULL);
+}
+
+static double _end_timer(void)
+{
+   gettimeofday(&tp2,NULL);
+   return((tp2.tv_sec - tp1.tv_sec) + 
+  (tp2.tv_usec - tp1.tv_usec)*1.0e-6);
+}
+
 /* a tdb tool for manipulating a tdb database */
 
 static TDB_CONTEXT *tdb;
@@ -176,7 +195,7 @@
 static void create_tdb(const char *tdbname)
 {
if (tdb) tdb_close(tdb);
-   tdb = tdb_open(tdbname, 0, TDB_CLEAR_IF_FIRST,
+   tdb = tdb_open(tdbname, 0, TDB_CLEAR_IF_FIRST | 
(disable_mmap?TDB_NOMMAP:0),
   O_RDWR | O_CREAT | O_TRUNC, 0600);
if (!tdb) {
printf("Could not create %s: %s\n", tdbname, strerror(errno));
@@ -186,7 +205,7 @@
 static void open_tdb(const char *tdbname)
 {
if (tdb) tdb_close(tdb);
-   tdb = tdb_open(tdbname, 0, 0, O_RDWR, 0600);
+   tdb = tdb_open(tdbname, 0, disable_mmap?TDB_NOMMAP:0, O_RDWR, 0600);
if (!tdb) {
printf("Could not open %s: %s\n", tdbname, strerror(errno));
}
@@ -366,6 +385,31 @@
printf("%d records totalling %d bytes\n", count, total_bytes);
 }
 
+static void speed_tdb(const char *tlimit)
+{
+   unsigned timelimit = tlimit?atoi(tlimit):0;
+   double t;
+   int ops=0;
+   if (timelimit == 0) timelimit = 10;
+   printf("Testing traverse speed for %u seconds\n", timelimit);
+   _start_timer();
+   while ((t=_end_timer()) < timelimit) {
+   tdb_traverse(tdb, traverse_fn, NULL);
+   printf("%10.3f ops/sec\r", (++ops)/t);
+   }
+   printf("\n");
+}
+
+static void toggle_mmap(void)
+{
+   disable_mmap = !disable_mmap;
+   if (disable_mmap) {
+   printf("mmap is disabled\n");
+   } else {
+   printf("mmap is enabled\n");
+   }
+}
+
 static char *tdb_getline(const char *prompt)
 {
static char thisline[1024];
@@ -494,6 +538,12 @@
case CMD_INFO:
info_tdb();
return 0;
+   case CMD_SPEED:
+   speed_tdb(arg1);
+   return 0;
+   case CMD_MMAP:
+   toggle_mmap();
+   return 0;
case CMD_FIRST:
bIterate = 1;
first_record(tdb, &iterate_kbuf);

Modified: branches/SAMBA_3_0_26/source/lib/tdb/tools/tdbtool.c
===
--- branches/SAMBA_3_0_26/source/lib/tdb/tools/tdbtool.c2007-05-29 
09:30:34 UTC (rev 23183)
+++ branches/SAMBA_3_0_26/source/lib/tdb/tools/tdbtool.c2007-05-29 
10:15:01 UTC (rev 23184)
@@ -35,6 +35,7 @@
 char *line;
 TDB_DATA iterate_kbuf;
 char cmdline[1024];
+static int disable_mmap;
 
 enum commands {
CMD_CREATE_TDB,
@@ -51,6 +52,8 @@
CMD_LIST_HASH_FREE,
CMD_LIST_FREE,
CMD_INFO,
+   CMD_MMAP,
+   CMD_SPEED,
CMD_FIRST,
CMD_NEXT,
CMD_SYSTEM,
@@ -78,6 +81,8 @@
{"list",CMD_LIST_HASH_FREE},
{"free",CMD_LIST_FREE},
{"info",CMD_INFO},
+   {"speed",   CMD_SPEED},
+   {"mmap",CMD_MMAP},
{"first",   CMD_FIRST},
{"1",   CMD_FIRST},
{"next",CMD_NEXT},
@@ -88,6 +93,20 @@
{NULL,  CMD_HELP}
 };
 
+struct timeval tp1,tp2;
+
+static void _start_timer(void)
+{
+   gettimeofday(&tp1,NULL);
+}
+
+static double _end_timer(void)
+{
+   gettimeofday(&tp2,NULL);
+   return((tp2.tv_sec - tp1.tv_sec) + 
+  (tp2.tv_usec - tp1.tv_

Rev 391: flush any local arp entries for the given ip on add/del in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 391
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Tue 2007-05-29 19:34:04 +1000
message:
  flush any local arp entries for the given ip on add/del
modified:
  tools/events   events-20070529030121-04fjh63cxfh8v1pj-1
=== modified file 'tools/events'
--- a/tools/events  2007-05-29 07:23:29 +
+++ b/tools/events  2007-05-29 09:34:04 +
@@ -17,6 +17,8 @@
 echo "Failed to add $ip/$maskbits on dev $iface"
 exit 1
}
+   # if we have a local arp entry for this IP then remove it
+   /sbin/arp -d $ip 2> /dev/null
exit 0
;;
 
@@ -32,6 +34,8 @@
 echo "Failed to del $ip on dev $iface"
 exit 1
}
+   # if we have a local arp entry for this IP then remove it
+   /sbin/arp -d $ip 2> /dev/null
exit 0
;;
 



svn commit: samba r23185 - in branches: SAMBA_3_0/source/lib SAMBA_3_0/source/smbd SAMBA_3_0_26/source/lib SAMBA_3_0_26/source/smbd

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 10:48:42 + (Tue, 29 May 2007)
New Revision: 23185

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

Log:
Try to fix the IRIX build, also add the forgotten file_id.c in .26

Added:
   branches/SAMBA_3_0_26/source/lib/file_id.c
Modified:
   branches/SAMBA_3_0/source/lib/file_id.c
   branches/SAMBA_3_0/source/smbd/oplock_irix.c
   branches/SAMBA_3_0_26/source/smbd/oplock_irix.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/file_id.c
===
--- branches/SAMBA_3_0/source/lib/file_id.c 2007-05-29 10:15:01 UTC (rev 
23184)
+++ branches/SAMBA_3_0/source/lib/file_id.c 2007-05-29 10:48:42 UTC (rev 
23185)
@@ -26,7 +26,7 @@
   return a file_id which gives a unique ID for a file given the device and
   inode numbers
  */
-static struct file_id file_id_create(SMB_DEV_T dev, SMB_INO_T inode)
+struct file_id file_id_create(SMB_DEV_T dev, SMB_INO_T inode)
 {
struct file_id key;
/* the ZERO_STRUCT ensures padding doesn't break using the key as a

Modified: branches/SAMBA_3_0/source/smbd/oplock_irix.c
===
--- branches/SAMBA_3_0/source/smbd/oplock_irix.c2007-05-29 10:15:01 UTC 
(rev 23184)
+++ branches/SAMBA_3_0/source/smbd/oplock_irix.c2007-05-29 10:48:42 UTC 
(rev 23185)
@@ -140,8 +140,9 @@
 * is the first fsp open with this dev,ino pair.
 */
 
-   if ((fsp = file_find_di_first((SMB_DEV_T)os.os_dev,
- (SMB_INO_T)os.os_ino)) == NULL) {
+   if ((fsp = file_find_di_first(
+file_id_create((SMB_DEV_T)os.os_dev,
+   (SMB_INO_T)os.os_ino))) == NULL) {
DEBUG(0,("irix_oplock_receive_message: unable to find open "
 "file with dev = %x, inode = %.0f\n",
 (unsigned int)os.os_dev, (double)os.os_ino ));

Added: branches/SAMBA_3_0_26/source/lib/file_id.c
===
--- branches/SAMBA_3_0_26/source/lib/file_id.c  2007-05-29 10:15:01 UTC (rev 
23184)
+++ branches/SAMBA_3_0_26/source/lib/file_id.c  2007-05-29 10:48:42 UTC (rev 
23185)
@@ -0,0 +1,102 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   file_id structure handling
+
+   Copyright (C) Andrew Tridgell 2007
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+
+/*
+  return a file_id which gives a unique ID for a file given the device and
+  inode numbers
+ */
+struct file_id file_id_create(SMB_DEV_T dev, SMB_INO_T inode)
+{
+   struct file_id key;
+   /* the ZERO_STRUCT ensures padding doesn't break using the key as a
+* blob */
+   ZERO_STRUCT(key);
+   key.devid = dev;
+   key.inode = inode;
+   return key;
+}
+
+/*
+  generate a file_id from a stat structure
+ */
+struct file_id file_id_sbuf(const SMB_STRUCT_STAT *sbuf)
+{
+   return file_id_create(sbuf->st_dev, sbuf->st_ino);
+}
+
+
+/*
+  return True if two file_id structures are equal
+ */
+BOOL file_id_equal(const struct file_id *id1, const struct file_id *id2)
+{
+   return id1->inode == id2->inode && id1->devid == id2->devid;
+}
+
+/*
+  a static string for a file_id structure
+ */
+const char *file_id_static_string(const struct file_id *id)
+{
+   static char buf[32];
+   snprintf(buf, sizeof(buf), "%llx:%llx", 
+(unsigned long long)id->devid, 
+(unsigned long long)id->inode);
+   return buf;
+}
+
+/*
+  a 2nd static string for a file_id structure so we can print 2 at once
+ */
+const char *file_id_static_string2(const struct file_id *id)
+{
+   static char buf[32];
+   snprintf(buf, sizeof(buf), "%llx:%llx", 
+(unsigned long long)id->devid, 
+(unsigned long long)id->inode);
+   return buf;
+}
+
+/*
+  push a 16 byte version of a file id into a buffer
+ */
+void push_file_id_16(char *buf, const struct file_id *id)
+{
+   SIVAL(buf,  0, id->devid&0x);
+   SIVAL(buf,  4, id->devid>>32);
+   SIVAL(buf,  8, id->inode&0x);
+   SIVAL(buf, 12, id->inode>>32);
+}
+
+/*
+  pul a 16 byte version of a file id from a buffer
+ */
+

svn commit: samba r23186 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_26/source/smbd

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 10:50:25 + (Tue, 29 May 2007)
New Revision: 23186

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

Log:
Checkin on behalf of Tridge:

Change notify.tdb to use dbwrap

Modified:
   branches/SAMBA_3_0/source/smbd/notify_internal.c
   branches/SAMBA_3_0_26/source/smbd/notify_internal.c


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


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

2007-05-29 Thread metze
Author: metze
Date: 2007-05-29 11:03:07 + (Tue, 29 May 2007)
New Revision: 23187

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

Log:
revert 23145 and 23135 to fix the build on solaris...

metze

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


Changeset:
Modified: branches/SAMBA_4_0/source/heimdal_build/config.m4
===
--- branches/SAMBA_4_0/source/heimdal_build/config.m4   2007-05-29 10:50:25 UTC 
(rev 23186)
+++ branches/SAMBA_4_0/source/heimdal_build/config.m4   2007-05-29 11:03:07 UTC 
(rev 23187)
@@ -70,7 +70,9 @@
atexit  \
cgetent \
getprogname \
+   inet_ntop   \
inet_aton   \
+   inet_pton   \
gethostname \
getnameinfo \
iruserok\
@@ -239,6 +241,18 @@
SMB_ENABLE(HEIMDAL_ROKEN_INET_ATON, YES)
 fi
 
+if test x"$ac_cv_func_inet_pton" = x"no"; then
+AC_CHECK_LIB_EXT(nsl_s, NSL_LIBS, inet_pton)
+AC_CHECK_LIB_EXT(nsl, NSL_LIBS, inet_pton)
+SMB_ENABLE(NSL,YES)
+if test x"$ac_cv_lib_ext_nsl_s_inet_pton" != x"yes" &&
+   test x"$ac_cv_lib_ext_nsl_inet_pton" != x"yes"; then
+   AC_MSG_ERROR([no inet_pton() function available!])
+fi
+fi
+
+SMB_EXT_LIB(NSL,[${NSL_LIBS}],[],[],[])
+
 # only add closefrom if needed
 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, NO)
 if test t$ac_cv_func_closefrom != tyes; then

Modified: branches/SAMBA_4_0/source/heimdal_build/config.mk
===
--- branches/SAMBA_4_0/source/heimdal_build/config.mk   2007-05-29 10:50:25 UTC 
(rev 23186)
+++ branches/SAMBA_4_0/source/heimdal_build/config.mk   2007-05-29 11:03:07 UTC 
(rev 23187)
@@ -439,9 +439,9 @@
HEIMDAL_ROKEN_GETPROGNAME \
HEIMDAL_ROKEN_CLOSEFROM \
GAI \
+   NSL \
RESOLV \
-   EXT_SOCKET \
-   EXT_NSL
+   EXT_SOCKET
 # End SUBSYSTEM HEIMDAL_ROKEN
 ###
 



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

2007-05-29 Thread metze
Author: metze
Date: 2007-05-29 11:13:07 + (Tue, 29 May 2007)
New Revision: 23188

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

Log:
revert 23123 and 23118.

as a long term solution this was the correct approach,
but it's a bit more complex and we need to provide the
whole socket api and libnsl.so checking in libreplace...

as a short term solution to fix the build on host 'hape'
we'll use the same trick as with inet_aton.c from
heimdal's lib/roken/

metze

Removed:
   branches/SAMBA_4_0/source/lib/replace/inet.m4
   branches/SAMBA_4_0/source/lib/replace/inet_ntop.c
   branches/SAMBA_4_0/source/lib/replace/inet_pton.c
Modified:
   branches/SAMBA_4_0/source/lib/replace/README
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4
   branches/SAMBA_4_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/README
===
--- branches/SAMBA_4_0/source/lib/replace/README2007-05-29 11:03:07 UTC 
(rev 23187)
+++ branches/SAMBA_4_0/source/lib/replace/README2007-05-29 11:13:07 UTC 
(rev 23188)
@@ -54,8 +54,6 @@
 strtoull
 socketpair
 strptime
-inet_pton
-inet_ntop
 
 Types:
 bool

Deleted: branches/SAMBA_4_0/source/lib/replace/inet.m4
===
--- branches/SAMBA_4_0/source/lib/replace/inet.m4   2007-05-29 11:03:07 UTC 
(rev 23187)
+++ branches/SAMBA_4_0/source/lib/replace/inet.m4   2007-05-29 11:13:07 UTC 
(rev 23188)
@@ -1,2 +0,0 @@
-AC_CHECK_FUNCS(inet_pton,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} inet_pton.o"])
-AC_CHECK_FUNCS(inet_ntop,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} inet_ntop.o"])

Deleted: branches/SAMBA_4_0/source/lib/replace/inet_ntop.c
===
--- branches/SAMBA_4_0/source/lib/replace/inet_ntop.c   2007-05-29 11:03:07 UTC 
(rev 23187)
+++ branches/SAMBA_4_0/source/lib/replace/inet_ntop.c   2007-05-29 11:13:07 UTC 
(rev 23188)
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 1996-2001  Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* Adapted for Samba lib/replace by Michael Adam */
-
-#include "replace.h"
-#include "system/network.h"
-
-#define NS_INT16SZ  2
-#define NS_IN6ADDRSZ   16
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static const char *inet_ntop4(const unsigned char *src, char *dst,
- size_t size);
-
-#ifdef AF_INET6
-static const char *inet_ntop6(const unsigned char *src, char *dst,
- size_t size);
-#endif
-
-/* char *
- * isc_net_ntop(af, src, dst, size)
- * convert a network format address to presentation format.
- * return:
- * pointer to presentation format address (`dst'), or NULL (see errno).
- * author:
- * Paul Vixie, 1996.
- */
-const char *
-rep_inet_ntop(int af, const void *src, char *dst, size_t size)
-{
-   switch (af) {
-   case AF_INET:
-   return (inet_ntop4(src, dst, size));
-#ifdef AF_INET6
-   case AF_INET6:
-   return (inet_ntop6(src, dst, size));
-#endif
-   default:
-   errno = EAFNOSUPPORT;
-   return (NULL);
-   }
-   /* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- * format an IPv4 address
- * return:
- * `dst' (as a const)
- * notes:
- * (1) uses no statics
- * (2) takes a unsigned char* not an in_addr as input
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4(const unsigned char *src, char *dst, size_t size)
-{
-   static const char *fmt = "%u.%u.%u.%u";
-   char tmp[sizeof "255.255.255.255"];
-   size_t len;
-
-   len = snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]);
-   if (len >= size) {
-   errno = ENOSPC;
-   return (NULL);
-   }
-   memcpy(dst, tmp, len + 1);
-
-   return (dst);
-}
-
-/* const char *
- * isc_inet_ntop6(src, dst, size)
- * convert IPv6 binary address into presentation (printable) format
- * author:
- * Paul Vixie, 1996.
- */

svn commit: samba r23189 - in branches/SAMBA_4_0/source: script scripting/libjs selftest setup

2007-05-29 Thread abartlet
Author: abartlet
Date: 2007-05-29 12:18:41 + (Tue, 29 May 2007)
New Revision: 23189

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

Log:
Work towards a totally scripted setup of LDAP backends, so others can
easily try this out.

I also intend to use this for the selftest, but I'm chasing issues
with the OpenlDAP (but not Fedora DS) backend.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/script/installmisc.sh
   branches/SAMBA_4_0/source/scripting/libjs/provision.js
   branches/SAMBA_4_0/source/selftest/Samba4.pm
   branches/SAMBA_4_0/source/setup/fedorads-partitions.ldif
   branches/SAMBA_4_0/source/setup/fedorads.inf
   branches/SAMBA_4_0/source/setup/provision
   branches/SAMBA_4_0/source/setup/provision-backend
   branches/SAMBA_4_0/source/setup/slapd.conf


Changeset:
Modified: branches/SAMBA_4_0/source/script/installmisc.sh
===
--- branches/SAMBA_4_0/source/script/installmisc.sh 2007-05-29 11:13:07 UTC 
(rev 23188)
+++ branches/SAMBA_4_0/source/script/installmisc.sh 2007-05-29 12:18:41 UTC 
(rev 23189)
@@ -15,6 +15,7 @@
 echo "Installing setup templates"
 mkdir -p $SETUPDIR || exit 1
 cp setup/schema-map-* $SETUPDIR || exit 1
+cp setup/DB_CONFIG $SETUPDIR || exit 1
 cp setup/*.inf $SETUPDIR || exit 1
 cp setup/*.ldif $SETUPDIR || exit 1
 cp setup/*.zone $SETUPDIR || exit 1

Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js
===
--- branches/SAMBA_4_0/source/scripting/libjs/provision.js  2007-05-29 
11:13:07 UTC (rev 23188)
+++ branches/SAMBA_4_0/source/scripting/libjs/provision.js  2007-05-29 
12:18:41 UTC (rev 23189)
@@ -385,10 +385,10 @@
paths.keytab = "secrets.keytab";
paths.dns = lp.get("private dir") + "/" + subobj.DNSDOMAIN + ".zone";
paths.winsdb = "wins.ldb";
-   paths.ldap_basedn_ldif = lp.get("private dir") + "/" + subobj.DNSDOMAIN 
+ ".ldif";
-   paths.ldap_config_basedn_ldif = lp.get("private dir") + "/" + 
subobj.DNSDOMAIN + "-config.ldif";
-   paths.ldap_schema_basedn_ldif = lp.get("private dir") + "/" + 
subobj.DNSDOMAIN + "-schema.ldif";
paths.ldapdir = lp.get("private dir") + "/ldap";
+   paths.ldap_basedn_ldif = paths.ldapdir + "/" + subobj.DNSDOMAIN + 
".ldif";
+   paths.ldap_config_basedn_ldif = paths.ldapdir + "/" + subobj.DNSDOMAIN 
+ "-config.ldif";
+   paths.ldap_schema_basedn_ldif = paths.ldapdir + "/" + subobj.DNSDOMAIN 
+ "-schema.ldif";
return paths;
 }
 
@@ -793,6 +793,8 @@
 
subobj.RDN_DC = substr(rdns[0], strlen("DC="));
 
+   sys.mkdir(paths.ldapdir, 0700);
+
setup_file("provision_basedn.ldif", 
   message, paths.ldap_basedn_ldif, 
   subobj);
@@ -805,7 +807,6 @@
   message, paths.ldap_schema_basedn_ldif, 
   subobj);
 
-   message("Please install the LDIF located in " + paths.ldap_basedn_ldif 
+ ", " + paths.ldap_config_basedn_ldif + " and " + 
paths.ldap_schema_basedn_ldif + " into your LDAP server, and re-run with 
--ldap-backend=ldap://my.ldap.server\n";);
 }
 
 

Modified: branches/SAMBA_4_0/source/selftest/Samba4.pm
===
--- branches/SAMBA_4_0/source/selftest/Samba4.pm2007-05-29 11:13:07 UTC 
(rev 23188)
+++ branches/SAMBA_4_0/source/selftest/Samba4.pm2007-05-29 12:18:41 UTC 
(rev 23189)
@@ -422,8 +422,8 @@
}
 
system("slaptest -u -f $slapd_conf") == 0 or die("slaptest still fails 
after adding modules");
-   system("slapadd -b cn=Configuration,$basedn -f $slapd_conf -l 
$privatedir/$dnsname-config.ldif >/dev/null") == 0 or die("slapadd failed");
-   system("slapadd -b cn=Schema,cn=Configuration,$basedn -f $slapd_conf -l 
$privatedir/$dnsname-schema.ldif >/dev/null") == 0 or die("slapadd failed");
+   system("slapadd -b cn=Configuration,$basedn -f $slapd_conf -l 
$ldapdir/$dnsname-config.ldif >/dev/null") == 0 or die("slapadd failed");
+   system("slapadd -b cn=Schema,cn=Configuration,$basedn -f $slapd_conf -l 
$ldapdir/$dnsname-schema.ldif >/dev/null") == 0 or die("slapadd failed");
 
 system("slaptest -u -f $slapd_conf >/dev/null") == 0 or 
die ("slaptest after database load failed");
@@ -458,7 +458,7 @@
my $winbindd_socket_dir = "$prefix_abs/winbind_socket";
 
my $configuration = "--configfile=$conffile";
-   my $ldapdir = "$prefix_abs/ldap";
+   my $ldapdir = "$privatedir/ldap";
 
my $tlsdir = "$privatedir/tls";
 

Modified: branches/SAMBA_4_0/source/setup/fedorads-partitions.ldif
===
--- branches/SAMBA_4_0/source/setup/fedorads-partitions.ldif2007-05-29 
11:13:07 UTC (rev 23188)
+++ branches/SAMBA_4_0/source/setup/fedorads-partitions.ldif2007-05-29 
12:18:41 UTC (rev 23189)

svn commit: samba r23190 - in branches/SAMBA_3_0_26/source: auth include lib smbd

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 12:53:42 + (Tue, 29 May 2007)
New Revision: 23190

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

Log:
svn merge ../SAMBA_3_0 -r22019:22026

This is abartlet's talloc changes to the samu struct stored 
in the server info state.


Modified:
   branches/SAMBA_3_0_26/source/auth/auth_sam.c
   branches/SAMBA_3_0_26/source/auth/auth_util.c
   branches/SAMBA_3_0_26/source/include/smb.h
   branches/SAMBA_3_0_26/source/lib/util_pw.c
   branches/SAMBA_3_0_26/source/smbd/password.c
   branches/SAMBA_3_0_26/source/smbd/session.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/auth/auth_sam.c
===
--- branches/SAMBA_3_0_26/source/auth/auth_sam.c2007-05-29 12:18:41 UTC 
(rev 23189)
+++ branches/SAMBA_3_0_26/source/auth/auth_sam.c2007-05-29 12:53:42 UTC 
(rev 23190)
@@ -263,10 +263,10 @@
return NT_STATUS_UNSUCCESSFUL;
}
 
-   /* Can't use the talloc version here, because the returned struct gets
-  kept on the server_info */
+   /* the returned struct gets kept on the server_info, by means
+  of a steal further down */
 
-   if ( !(sampass = samu_new( NULL )) ) {
+   if ( !(sampass = samu_new( mem_ctx )) ) {
return NT_STATUS_NO_MEMORY;
}
 

Modified: branches/SAMBA_3_0_26/source/auth/auth_util.c
===
--- branches/SAMBA_3_0_26/source/auth/auth_util.c   2007-05-29 12:18:41 UTC 
(rev 23189)
+++ branches/SAMBA_3_0_26/source/auth/auth_util.c   2007-05-29 12:53:42 UTC 
(rev 23190)
@@ -561,19 +561,23 @@
DOM_SID unix_group_sid;

 
-   if ( !(pwd = getpwnam_alloc(NULL, pdb_get_username(sampass))) ) {
+   if ( !(result = make_server_info(NULL)) ) {
+   return NT_STATUS_NO_MEMORY;
+   }
+
+   if ( !(pwd = getpwnam_alloc(result, pdb_get_username(sampass))) ) {
DEBUG(1, ("User %s in passdb, but getpwnam() fails!\n",
  pdb_get_username(sampass)));
+   TALLOC_FREE(result);
return NT_STATUS_NO_SUCH_USER;
}
 
-   if ( !(result = make_server_info(NULL)) ) {
-   TALLOC_FREE(pwd);
-   return NT_STATUS_NO_MEMORY;
-   }
-
result->sam_account = sampass;
-   result->unix_name = talloc_strdup(result, pwd->pw_name);
+   /* Ensure thaat the sampass will be freed with the result */
+   talloc_steal(result, sampass);
+   result->unix_name = pwd->pw_name;
+   /* Ensure that we keep pwd->pw_name, because we will free pwd below */
+   talloc_steal(result, pwd->pw_name);
result->gid = pwd->pw_gid;
result->uid = pwd->pw_uid;


Modified: branches/SAMBA_3_0_26/source/include/smb.h
===
--- branches/SAMBA_3_0_26/source/include/smb.h  2007-05-29 12:18:41 UTC (rev 
23189)
+++ branches/SAMBA_3_0_26/source/include/smb.h  2007-05-29 12:53:42 UTC (rev 
23190)
@@ -1757,9 +1757,9 @@
gid_t gid; /* gid of a validated user */
 
userdom_struct user;
-   char *homedir;
-   char *unix_homedir;
-   char *logon_script;
+   const char *homedir;
+   const char *unix_homedir;
+   const char *logon_script;

BOOL guest;
 

Modified: branches/SAMBA_3_0_26/source/lib/util_pw.c
===
--- branches/SAMBA_3_0_26/source/lib/util_pw.c  2007-05-29 12:18:41 UTC (rev 
23189)
+++ branches/SAMBA_3_0_26/source/lib/util_pw.c  2007-05-29 12:53:42 UTC (rev 
23190)
@@ -74,7 +74,7 @@
if ((pwnam_cache[i] != NULL) && 
(strcmp(name, pwnam_cache[i]->pw_name) == 0)) {
DEBUG(10, ("Got %s from pwnam_cache\n", name));
-   return (struct passwd *)talloc_reference(mem_ctx, 
pwnam_cache[i]);
+   return tcopy_passwd(mem_ctx, pwnam_cache[i]);
}
}
 
@@ -98,15 +98,15 @@
i = rand() % PWNAMCACHE_SIZE;
 
if (pwnam_cache[i] != NULL) {
-   TALLOC_FREE(pwnam_cache[i]);
+   /* Remove this old cache entry, from the cache.  We
+* use talloc_unlink here because we want to be very
+* clear which referece we are removing */
+   talloc_unlink(pwnam_cache, pwnam_cache[i]);
}
 
pwnam_cache[i] = tcopy_passwd(pwnam_cache, temp);
-   if (pwnam_cache[i]!= NULL && mem_ctx != NULL) {
-   return (struct passwd *)talloc_reference(mem_ctx, 
pwnam_cache[i]);
-   }
 
-   return tcopy_passwd(NULL, pwnam_cache[i]);
+   return tcopy_passwd(mem_ctx, temp);
 }
 
 struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) 

Modified: branches/SAMBA_3_0_26/source/smbd/password.c

Rev 392: samba3 needs ctdb_private.h installed to build in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 392
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Tue 2007-05-29 22:53:28 +1000
message:
  samba3 needs ctdb_private.h installed to build
modified:
  packaging/RHEL/ctdb.spec   ctdb.spec-20070527204758-biuh7znabuwan3zn-3
=== modified file 'packaging/RHEL/ctdb.spec'
--- a/packaging/RHEL/ctdb.spec  2007-05-29 06:23:47 +
+++ b/packaging/RHEL/ctdb.spec  2007-05-29 12:53:28 +
@@ -67,6 +67,10 @@
 install -m755 setup/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
 install -m755 tools/events $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events
 
+# unfortunately samba3 needs ctdb_private.h too
+install -m644 include/ctdb_private.h %{_includedir}/ctdb_private.h
+
+
 # Remove "*.old" files
 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
 
@@ -103,3 +107,4 @@
 %{_sbindir}/ctdbd
 %{_bindir}/ctdb
 %{_includedir}/ctdb.h
+%{_includedir}/ctdb_private.h



svn commit: samba r23191 - in branches/SAMBA_4_0/source/selftest: .

2007-05-29 Thread abartlet
Author: abartlet
Date: 2007-05-29 13:06:08 + (Tue, 29 May 2007)
New Revision: 23191

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

Log:
Use the new provision-backend script to setup Fedora DS for make test.

OpenLDAP to follow once I get things working...

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/selftest/Samba4.pm
   branches/SAMBA_4_0/source/selftest/selftest.pl


Changeset:
Modified: branches/SAMBA_4_0/source/selftest/Samba4.pm
===
--- branches/SAMBA_4_0/source/selftest/Samba4.pm2007-05-29 12:53:42 UTC 
(rev 23190)
+++ branches/SAMBA_4_0/source/selftest/Samba4.pm2007-05-29 13:06:08 UTC 
(rev 23191)
@@ -39,7 +39,7 @@
 
# running slapd in the background means it stays in the same process 
group, so it can be
# killed by timelimit
-   if ($self->{ldap} eq "fedora") {
+   if ($self->{ldap} eq "fedora-ds") {
system("$ENV{FEDORA_DS_PREFIX}/sbin/ns-slapd -D 
$env_vars->{FEDORA_DS_DIR} -d0 -i $env_vars->{FEDORA_DS_PIDFILE}> 
$env_vars->{LDAPDIR}/logs 2>&1 &");
} elsif ($self->{ldap} eq "openldap") {
openldap_start($env_vars->{SLAPD_CONF}, $uri, 
"$env_vars->{LDAPDIR}/logs");
@@ -58,7 +58,7 @@
 sub slapd_stop($$)
 {
my ($self, $envvars) = @_;
-   if ($self->{ldap} eq "fedora") {
+   if ($self->{ldap} eq "fedora-ds") {
system("$envvars->{LDAPDIR}/slapd-samba4/stop-slapd");
} elsif ($self->{ldap} eq "openldap") {
open(IN, "<$envvars->{OPENLDAP_PIDFILE}") or 
@@ -177,54 +177,18 @@
 ");
 }
 
-sub mk_fedora($$)
+sub mk_fedora_ds($$$)
 {
-   my ($self, $ldapdir, $basedn, $root, $password, $privatedir, 
$configuration) = @_;
+   my ($self, $ldapdir, $configuration) = @_;
 
-   mkdir($ldapdir, 0777);
-
my $fedora_ds_inf = "$ldapdir/fedorads.inf";
-   my $fedora_ds_initial_ldif = "$ldapdir/fedorads-initial.ldif";
+   my $fedora_ds_extra_ldif = "$ldapdir/fedorads-partitions.ldif";
 
#Make the subdirectory be as fedora DS would expect
my $fedora_ds_dir = "$ldapdir/slapd-samba4";
 
my $pidfile = "$fedora_ds_dir/logs/slapd-samba4.pid";
 
-   open(CONF, ">$fedora_ds_inf");
-   print CONF "
-[General]
-SuiteSpotUserID = $root
-FullMachineName=   localhost
-ServerRoot=   $ldapdir
-
-[slapd]
-ldapifilepath=$ldapdir/ldapi
-Suffix= $basedn
-RootDN= cn=Manager,$basedn
-RootDNPwd= $password
-ServerIdentifier= samba4
-#InstallLdifFile=$fedora_ds_initial_ldif
-
-inst_dir= $fedora_ds_dir
-config_dir= $fedora_ds_dir
-schema_dir= $fedora_ds_dir/schema
-lock_dir= $fedora_ds_dir/lock
-log_dir= $fedora_ds_dir/logs
-run_dir= $fedora_ds_dir/logs
-db_dir= $fedora_ds_dir/db
-bak_dir= $fedora_ds_dir/bak
-tmp_dir= $fedora_ds_dir/tmp
-ldif_dir= $fedora_ds_dir/ldif
-cert_dir= $fedora_ds_dir
-
-start_server= 0
-install_full_schema= 0
-";
-   close(CONF);
-
-   open(LDIF, ">$fedora_ds_initial_ldif");
-
 my $dir = getcwd();
 chdir "$ENV{FEDORA_DS_PREFIX}/bin" || die;
if (system("perl $ENV{FEDORA_DS_PREFIX}/bin/ds_newinst.pl 
$fedora_ds_inf >&2") != 0) {
@@ -233,40 +197,10 @@
 }
 chdir $dir || die;
 
-   open(LDIF, ">>$fedora_ds_dir/dse.ldif");
-   print LDIF "dn: cn=\"cn=Configuration,$basedn\",cn=mapping 
tree,cn=config
-objectclass: top
-objectclass: extensibleObject
-objectclass: nsMappingTree
-nsslapd-state: backend
-nsslapd-backend: configData
-cn: cn=Configuration,$basedn
+   system("cat $fedora_ds_extra_ldif >> $fedora_ds_dir/dse.ldif");
 
-dn: cn=configData,cn=ldbm database,cn=plugins,cn=config
-objectclass: extensibleObject
-objectclass: nsBackendInstance
-nsslapd-suffix: cn=Configuration,$basedn
-cn: configData
+   system("$self->{bindir}/ad2oLschema $configuration -H 
$ldapdir/schema-tmp.ldb --option=convert:target=fedora-ds -I 
$self->{setupdir}/schema-map-fedora-ds-1.0 -O $fedora_ds_dir/schema/99_ad.ldif 
>&2") == 0 or die("schema conversion for Fedora DS failed");
 
-dn: cn=\"cn=Schema,cn=Configuration,$basedn\",cn=mapping tree,cn=config
-objectclass: top
-objectclass: extensibleObject
-objectclass: nsMappingTree
-nsslapd-state: backend
-nsslapd-backend: schemaData
-cn: cn=Schema,cn=Configuration,$basedn
-
-dn: cn=schemaData,cn=ldbm database,cn=plugins,cn=config
-objectclass: extensibleObject
-objectclass: nsBackendInstance
-nsslapd-suffix: cn=Schema,cn=Configuration,$basedn
-cn: schemaData
-
-";
-   close(LDIF);
-
-   system("$self->{bindir}/ad2oLschema $configuration -H 
$privatedir/sam.ldb --option=convert:target=fedora-ds -I 
$self->{setupdir}/schema-map-fedora-ds-1.0 -O $fedora_ds_dir/schema/99_ad.ldif 
>&2") == 0 or die("schema conversion for Fedora DS failed");
-
return ($fedora_ds_dir, $pidfile);
 }
 
@@ -425,8 +359,6 @@
system("slapadd -b cn=Configuration,$basedn -f $slapd_conf -l 
$ldapdir/$dnsname-config.ldif >/dev/null") == 0 or die("slapad

svn commit: samba r23192 - in branches/SAMBA_3_0/source/passdb: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 13:18:57 + (Tue, 29 May 2007)
New Revision: 23192

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

Log:
Remove fallback to looking up group mappings by the 
Unix name after discussion with Simo.


Modified:
   branches/SAMBA_3_0/source/passdb/passdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/passdb.c
===
--- branches/SAMBA_3_0/source/passdb/passdb.c   2007-05-29 13:06:08 UTC (rev 
23191)
+++ branches/SAMBA_3_0/source/passdb/passdb.c   2007-05-29 13:18:57 UTC (rev 
23192)
@@ -612,23 +612,7 @@
unbecome_root();
 
if (!ret) {
-   /* try to see if we can lookup a mapped
-* group with the unix group name */
-
-   struct group *grp;
-
-   grp = getgrnam(name);
-   if (!grp) {
-   return False;
-   }
-
-   become_root();
-   ret = pdb_getgrgid(&map, grp->gr_gid);
-   unbecome_root();
-
-   if (!ret) {
-   return False;
-   }
+   return False;
}
 
/* BUILTIN groups are looked up elsewhere */



svn commit: samba r23193 - in branches/SAMBA_3_0_25/source: .

2007-05-29 Thread gd
Author: gd
Date: 2007-05-29 13:19:55 + (Tue, 29 May 2007)
New Revision: 23193

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

Log:
Fix nasty typo.

Guenther

Modified:
   branches/SAMBA_3_0_25/source/Makefile.in


Changeset:
Modified: branches/SAMBA_3_0_25/source/Makefile.in
===
--- branches/SAMBA_3_0_25/source/Makefile.in2007-05-29 13:18:57 UTC (rev 
23192)
+++ branches/SAMBA_3_0_25/source/Makefile.in2007-05-29 13:19:55 UTC (rev 
23193)
@@ -750,7 +750,7 @@
$(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ) 
$(SECRETS_OBJ)
 
 PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
-   pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
+   pam_smbpass/pam_smb_acct.o pam_smbpass/support.o
 PAM_SMBPASS_OBJ = $(PAM_SMBPASS_OBJ_0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) 
$(PASSDB_OBJ) $(GROUPDB_OBJ) \
$(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
$(RPC_PARSE_OBJ1) $(DOSERR_OBJ) $(ERRORMAP_OBJ)



svn commit: samba r23194 - in branches/SAMBA_3_0/source/passdb: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 13:20:40 + (Tue, 29 May 2007)
New Revision: 23194

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

Log:
cherry pick two fixes from SAMBA_3_0_26 

* strptime() failure check
* make legcacy sid/uid/gid calls static


Modified:
   branches/SAMBA_3_0/source/passdb/lookup_sid.c
   branches/SAMBA_3_0/source/passdb/pdb_ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/lookup_sid.c
===
--- branches/SAMBA_3_0/source/passdb/lookup_sid.c   2007-05-29 13:19:55 UTC 
(rev 23193)
+++ branches/SAMBA_3_0/source/passdb/lookup_sid.c   2007-05-29 13:20:40 UTC 
(rev 23194)
@@ -1138,7 +1138,7 @@
  *THE LEGACY* convert uid_t to SID function.
 */  
 
-void legacy_uid_to_sid(DOM_SID *psid, uid_t uid)
+static void legacy_uid_to_sid(DOM_SID *psid, uid_t uid)
 {
uint32 rid;
BOOL ret;
@@ -1172,7 +1172,7 @@
  *THE LEGACY* convert gid_t to SID function.
 */  
 
-void legacy_gid_to_sid(DOM_SID *psid, gid_t gid)
+static void legacy_gid_to_sid(DOM_SID *psid, gid_t gid)
 {
BOOL ret;
 
@@ -1203,7 +1203,7 @@
  *THE LEGACY* convert SID to uid function.
 */  
 
-BOOL legacy_sid_to_uid(const DOM_SID *psid, uid_t *puid)
+static BOOL legacy_sid_to_uid(const DOM_SID *psid, uid_t *puid)
 {
enum lsa_SidType type;
uint32 rid;
@@ -1246,7 +1246,7 @@
  Group mapping is used for gids that maps to Wellknown SIDs
 */  
 
-BOOL legacy_sid_to_gid(const DOM_SID *psid, gid_t *pgid)
+static BOOL legacy_sid_to_gid(const DOM_SID *psid, gid_t *pgid)
 {
uint32 rid;
GROUP_MAP map;

Modified: branches/SAMBA_3_0/source/passdb/pdb_ldap.c
===
--- branches/SAMBA_3_0/source/passdb/pdb_ldap.c 2007-05-29 13:19:55 UTC (rev 
23193)
+++ branches/SAMBA_3_0/source/passdb/pdb_ldap.c 2007-05-29 13:20:40 UTC (rev 
23194)
@@ -1,7 +1,7 @@
 /* 
Unix SMB/CIFS implementation.
LDAP protocol helper functions for SAMBA
-   Copyright (C) Jean Fran�ois Micouleau   1998
+   Copyright (C) Jean François Micouleau   1998
Copyright (C) Gerald Carter 2001-2003
Copyright (C) Shahms King   2001
Copyright (C) Andrew Bartlett   2002-2003
@@ -455,7 +455,11 @@
temp))
return (time_t) 0;
 
-   strptime(temp, "%Y%m%d%H%M%SZ", &tm);
+   if ( !strptime(temp, "%Y%m%d%H%M%SZ", &tm)) {
+   DEBUG(2,("ldapsam_get_entry_timestamp: strptime failed on: 
%s\n",
+   (char*)temp));
+   return (time_t) 0;
+   }
tzset();
return timegm(&tm);
 }



svn commit: samba r23195 - in branches: SAMBA_3_0/source/include SAMBA_3_0/source/locking SAMBA_3_0/source/torture SAMBA_3_0/source/utils SAMBA_3_0_26/source/include SAMBA_3_0_26/source/locking SAMBA_

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 13:26:44 + (Tue, 29 May 2007)
New Revision: 23195

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

Log:
Add void *private_data to brl_forall

Modified:
   branches/SAMBA_3_0/source/include/locking.h
   branches/SAMBA_3_0/source/locking/brlock.c
   branches/SAMBA_3_0/source/torture/locktest.c
   branches/SAMBA_3_0/source/torture/locktest2.c
   branches/SAMBA_3_0/source/utils/status.c
   branches/SAMBA_3_0_26/source/include/locking.h
   branches/SAMBA_3_0_26/source/locking/brlock.c
   branches/SAMBA_3_0_26/source/torture/locktest.c
   branches/SAMBA_3_0_26/source/torture/locktest2.c
   branches/SAMBA_3_0_26/source/utils/status.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/locking.h
===
--- branches/SAMBA_3_0/source/include/locking.h 2007-05-29 13:20:40 UTC (rev 
23194)
+++ branches/SAMBA_3_0/source/include/locking.h 2007-05-29 13:26:44 UTC (rev 
23195)
@@ -62,18 +62,6 @@
struct db_record *record;
 };
 
-#define BRLOCK_FN_CAST() \
-   void (*)(struct file_id id, struct server_id pid, \
-enum brl_type lock_type, \
-enum brl_flavour lock_flav, \
-br_off start, br_off size)
-
-#define BRLOCK_FN(fn) \
-   void (*fn)(struct file_id id, struct server_id pid, \
-enum brl_type lock_type, \
-enum brl_flavour lock_flav, \
-br_off start, br_off size)
-
 /* Internal structure in brlock.tdb. 
The data in brlock records is an unsorted linear array of these
records.  It is unnecessary to store the count as tdb provides the

Modified: branches/SAMBA_3_0/source/locking/brlock.c
===
--- branches/SAMBA_3_0/source/locking/brlock.c  2007-05-29 13:20:40 UTC (rev 
23194)
+++ branches/SAMBA_3_0/source/locking/brlock.c  2007-05-29 13:26:44 UTC (rev 
23195)
@@ -1447,6 +1447,15 @@
return True;
 }
 
+struct brl_forall_cb {
+   void (*fn)(struct file_id id, struct server_id pid,
+  enum brl_type lock_type,
+  enum brl_flavour lock_flav,
+  br_off start, br_off size,
+  void *private_data);
+   void *private_data;
+};
+
 /
  Traverse the whole database with this function, calling traverse_callback
  on each lock.
@@ -1454,14 +1463,13 @@
 
 static int traverse_fn(struct db_record *rec, void *state)
 {
+   struct brl_forall_cb *cb = (struct brl_forall_cb *)state;
struct lock_struct *locks;
struct file_id *key;
unsigned int i;
unsigned int num_locks = 0;
unsigned int orig_num_locks = 0;
 
-   BRLOCK_FN(traverse_callback) = (BRLOCK_FN_CAST())state;
-
/* In a traverse function we must make a copy of
   dbuf before modifying it. */
 
@@ -1493,12 +1501,13 @@
}
 
for ( i=0; ifn(*key,
+  locks[i].context.pid,
+  locks[i].lock_type,
+  locks[i].lock_flav,
+  locks[i].start,
+  locks[i].size,
+  cb->private_data);
}
 
SAFE_FREE(locks);
@@ -1509,12 +1518,21 @@
  Call the specified function on each lock in the database.
 /
 
-int brl_forall(BRLOCK_FN(fn))
+int brl_forall(void (*fn)(struct file_id id, struct server_id pid,
+ enum brl_type lock_type,
+ enum brl_flavour lock_flav,
+ br_off start, br_off size,
+ void *private_data),
+  void *private_data)
 {
+   struct brl_forall_cb cb;
+
if (!brlock_db) {
return 0;
}
-   return brlock_db->traverse(brlock_db, traverse_fn, (void *)fn);
+   cb.fn = fn;
+   cb.private_data = private_data;
+   return brlock_db->traverse(brlock_db, traverse_fn, &cb);
 }
 
 /***

Modified: branches/SAMBA_3_0/source/torture/locktest.c
===
--- branches/SAMBA_3_0/source/torture/locktest.c2007-05-29 13:20:40 UTC 
(rev 23194)
+++ branches/SAMBA_3_0/source/torture/locktest.c2007-05-29 13:26:44 UTC 
(rev 23195)
@@ -121,7 +121,8 @@
enum brl_type lock_type,
enum brl_flavour lock_flav,
br_off start,
-   br_off size)
+   br_off size,
+   void *private_data)
 {
 #if NASTY_POSIX_LOCK_HACK
{
@@ -147,7 +148,7 @@
 
 static void show_locks(void)
 {
-  

svn commit: samba r23196 - in branches/SAMBA_3_0_26: examples/VFS examples/perfcounter source source/auth source/librpc/gen_ndr source/librpc/ndr source/libsmb source/nsswitch source/passdb source/pri

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:05:25 + (Tue, 29 May 2007)
New Revision: 23196

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

Log:
Cherry pick patches from SAMBA_3_0:

* Move aclocal.m4 and replace with m4 directory
* Merge VL's require-membership-of changes to winbindd_pam.c 
  and associated changes to token_util.c
* Fix warnings from tdb_pack/unpack in printing.c
* merge ndr fixes and wkssvc service
* formating merges to decrease the diff between branches


Added:
   branches/SAMBA_3_0_26/source/auth/token_util.c
   branches/SAMBA_3_0_26/source/m4/
Removed:
   branches/SAMBA_3_0_26/source/aclocal.m4
Modified:
   branches/SAMBA_3_0_26/examples/VFS/Makefile.in
   branches/SAMBA_3_0_26/examples/VFS/configure.in
   branches/SAMBA_3_0_26/examples/perfcounter/Makefile
   branches/SAMBA_3_0_26/examples/perfcounter/perf_writer_util.c
   branches/SAMBA_3_0_26/source/Makefile.in
   branches/SAMBA_3_0_26/source/auth/auth_util.c
   branches/SAMBA_3_0_26/source/autogen.sh
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_wkssvc.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_wkssvc.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/notify.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srvsvc.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/svcctl.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/wkssvc.h
   branches/SAMBA_3_0_26/source/librpc/ndr/libndr.h
   branches/SAMBA_3_0_26/source/librpc/ndr/ndr.c
   branches/SAMBA_3_0_26/source/librpc/ndr/ndr_basic.c
   branches/SAMBA_3_0_26/source/libsmb/trustdom_cache.c
   branches/SAMBA_3_0_26/source/nsswitch/idmap_cache.c
   branches/SAMBA_3_0_26/source/nsswitch/pam_winbind.c
   branches/SAMBA_3_0_26/source/nsswitch/winbindd_pam.c
   branches/SAMBA_3_0_26/source/nsswitch/winbindd_sid.c
   branches/SAMBA_3_0_26/source/passdb/lookup_sid.c
   branches/SAMBA_3_0_26/source/passdb/passdb.c
   branches/SAMBA_3_0_26/source/passdb/pdb_interface.c
   branches/SAMBA_3_0_26/source/printing/printing.c


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


svn commit: samba r23197 - in branches/SAMBA_3_0_26/source: include libsmb

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:09:46 + (Tue, 29 May 2007)
New Revision: 23197

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

Log:
merge some libsmbclient changes (name changes and formatting only)
Modified:
   branches/SAMBA_3_0_26/source/include/libsmbclient.h
   branches/SAMBA_3_0_26/source/include/nterr.h
   branches/SAMBA_3_0_26/source/libsmb/clitrans.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/include/libsmbclient.h
===
--- branches/SAMBA_3_0_26/source/include/libsmbclient.h 2007-05-29 14:05:25 UTC 
(rev 23196)
+++ branches/SAMBA_3_0_26/source/include/libsmbclient.h 2007-05-29 14:09:46 UTC 
(rev 23197)
@@ -1242,14 +1242,16 @@
  */
 int smbc_chmod(const char *url, mode_t mode);
 
-/[EMAIL PROTECTED] attribute
+/**
+ * @ingroup attribute
  * Change the last modification time on a file
  *
  * @param url   The smb url of the file or directory to change
  *  the modification time of
- * 
- * @param tbuf  A timeval structure which contains the desired
- *  modification time.  NOTE: Only the tv_sec field is
+ *
+ * @param tbuf  An array of two timeval structures which contains,
+ *  respectively, the desired access and modification times.
+ *  NOTE: Only the tv_sec field off each timeval structure is
  *  used.  The tv_usec (microseconds) portion is ignored.
  *
  * @return  0 on success, < 0 on error with errno set:
@@ -1260,16 +1262,16 @@
 int smbc_utimes(const char *url, struct timeval *tbuf);
 
 #ifdef HAVE_UTIME_H
-/[EMAIL PROTECTED] attribute
+/**
+ * @ingroup attribute
  * Change the last modification time on a file
  *
  * @param url   The smb url of the file or directory to change
  *  the modification time of
- * 
- * @param utbuf A utimebuf structure which contains the desired
- *  modification time.  NOTE: Although the structure contains
- *  an access time as well, the access time value is ignored.
  *
+ * @param utbuf A pointer to a utimebuf structure which contains the
+ *  desired access and modification times.
+ *
  * @return  0 on success, < 0 on error with errno set:
  *  - EINVAL The client library is not properly initialized
  *  - ENOMEM No memory was available for internal needs

Modified: branches/SAMBA_3_0_26/source/include/nterr.h
===
--- branches/SAMBA_3_0_26/source/include/nterr.h2007-05-29 14:05:25 UTC 
(rev 23196)
+++ branches/SAMBA_3_0_26/source/include/nterr.h2007-05-29 14:09:46 UTC 
(rev 23197)
@@ -31,7 +31,7 @@
 #define NT_STATUS_NO_MORE_ENTRIES NT_STATUS(0x801a)
 
 /* Vista Status codes. */
-#define STATUS_INACCESSIBLE_SYSTEM_SHORTCUT NT_STATUS(0x802d)
+#define NT_STATUS_INACCESSIBLE_SYSTEM_SHORTCUT NT_STATUS(0x802d)
 
 #define STATUS_MORE_ENTRIES   NT_STATUS(0x0105)
 #define STATUS_SOME_UNMAPPED  NT_STATUS(0x0107)

Modified: branches/SAMBA_3_0_26/source/libsmb/clitrans.c
===
--- branches/SAMBA_3_0_26/source/libsmb/clitrans.c  2007-05-29 14:05:25 UTC 
(rev 23196)
+++ branches/SAMBA_3_0_26/source/libsmb/clitrans.c  2007-05-29 14:09:46 UTC 
(rev 23197)
@@ -194,13 +194,22 @@
 * to a trans call. This is not an error and should not
 * be treated as such. Note that STATUS_NO_MORE_FILES is
 * returned when a trans2 findfirst/next finishes.
+* When setting up an encrypted transport we can also
+* see NT_STATUS_MORE_PROCESSING_REQUIRED here.
+ *
+ * Vista returns NT_STATUS_INACCESSIBLE_SYSTEM_SHORTCUT if the folder
+ * "/Users/All Users" is enumerated.  This is a special pseudo
+ * folder, and the response does not have parameters (nor a parameter
+ * length).
 */
status = cli_nt_error(cli);

-   if (NT_STATUS_IS_ERR(status) ||
-NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES) ||
-NT_STATUS_EQUAL(status,STATUS_INACCESSIBLE_SYSTEM_SHORTCUT)) {
-   goto out;
+   if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+   if (NT_STATUS_IS_ERR(status) ||
+NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES) ||
+
NT_STATUS_EQUAL(status,NT_STATUS_INACCESSIBLE_SYSTEM_SHORTCUT)) {
+   goto out;
+   }
}
 
/* parse out the lengths */
@@ -305,8 +314,10 @@
 CVAL(cli->inbuf,smb_com)));
goto out;
}
-   if (NT_STATUS_IS_ERR(cli_nt_error(cli))) {
-   goto out;
+   if (!NT_STATUS_EQUAL(status, 
NT_STATUS_

svn commit: samba r23198 - in branches/SAMBA_3_0_26/source: passdb registry utils

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:18:17 + (Tue, 29 May 2007)
New Revision: 23198

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

Log:
cherry pick more patches from SAMBA_3_0
Modified:
   branches/SAMBA_3_0_26/source/passdb/machine_sid.c
   branches/SAMBA_3_0_26/source/registry/reg_objects.c
   branches/SAMBA_3_0_26/source/utils/net_ads.c
   branches/SAMBA_3_0_26/source/utils/pdbedit.c
   branches/SAMBA_3_0_26/source/utils/smbcacls.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/passdb/machine_sid.c
===
--- branches/SAMBA_3_0_26/source/passdb/machine_sid.c   2007-05-29 14:09:46 UTC 
(rev 23197)
+++ branches/SAMBA_3_0_26/source/passdb/machine_sid.c   2007-05-29 14:18:17 UTC 
(rev 23198)
@@ -220,6 +220,5 @@
 
sid_copy(&dom_sid, sid);
sid_split_rid(&dom_sid, &rid);
-   
-   return sid_equal(&dom_sid, get_global_sam_sid());
+   return sid_check_is_domain(&dom_sid);
 }

Modified: branches/SAMBA_3_0_26/source/registry/reg_objects.c
===
--- branches/SAMBA_3_0_26/source/registry/reg_objects.c 2007-05-29 14:09:46 UTC 
(rev 23197)
+++ branches/SAMBA_3_0_26/source/registry/reg_objects.c 2007-05-29 14:18:17 UTC 
(rev 23198)
@@ -73,7 +73,7 @@
 }
  
  /***
- Add a new key to the array
+ Delete a key from the array
  **/
 
 int regsubkey_ctr_delkey( REGSUBKEY_CTR *ctr, const char *keyname )

Modified: branches/SAMBA_3_0_26/source/utils/net_ads.c
===
--- branches/SAMBA_3_0_26/source/utils/net_ads.c2007-05-29 14:09:46 UTC 
(rev 23197)
+++ branches/SAMBA_3_0_26/source/utils/net_ads.c2007-05-29 14:18:17 UTC 
(rev 23198)
@@ -1369,10 +1369,10 @@
status = ads_dns_lookup_ns( ctx, root_domain, &nameservers, 
&ns_count );

if ( !NT_STATUS_IS_OK(status) || (ns_count == 0)) { 

-   DEBUG(3,("net_ads_join: Failed to find name server for the %s "
+   DEBUG(3,("net_ads_join: Failed to find name server for 
the %s "
 "realm\n", ads->config.realm));
-   goto done;
-   }
+   goto done;
+   }
 
dnsdomain = root_domain;


Modified: branches/SAMBA_3_0_26/source/utils/pdbedit.c
===
--- branches/SAMBA_3_0_26/source/utils/pdbedit.c2007-05-29 14:09:46 UTC 
(rev 23197)
+++ branches/SAMBA_3_0_26/source/utils/pdbedit.c2007-05-29 14:18:17 UTC 
(rev 23198)
@@ -761,6 +761,7 @@
static char *pwd_time_format = NULL;
static BOOL pw_from_stdin = False;
struct pdb_methods *bin, *bout, *bdef;
+   char *configfile = NULL;
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -818,6 +819,9 @@
case 'C':
account_policy_value_set = True;
break;
+   case 's':
+   configfile = optarg;
+   break;
}
}
 

Modified: branches/SAMBA_3_0_26/source/utils/smbcacls.c
===
--- branches/SAMBA_3_0_26/source/utils/smbcacls.c   2007-05-29 14:09:46 UTC 
(rev 23197)
+++ branches/SAMBA_3_0_26/source/utils/smbcacls.c   2007-05-29 14:18:17 UTC 
(rev 23198)
@@ -381,7 +381,7 @@
fstring tok;
SEC_DESC *ret = NULL;
size_t sd_size;
-   DOM_SID *group_sid=NULL, *owner_sid=NULL;
+   DOM_SID *grp_sid=NULL, *owner_sid=NULL;
SEC_ACL *dacl=NULL;
int revision=1;
 
@@ -407,13 +407,13 @@
}
 
if (strncmp(tok,"GROUP:", 6) == 0) {
-   if (group_sid) {
+   if (grp_sid) {
printf("Only specify group once\n");
goto done;
}
-   group_sid = SMB_CALLOC_ARRAY(DOM_SID, 1);
-   if (!group_sid ||
-   !StringToSid(group_sid, tok+6)) {
+   grp_sid = SMB_CALLOC_ARRAY(DOM_SID, 1);
+   if (!grp_sid ||
+   !StringToSid(grp_sid, tok+6)) {
printf("Failed to parse group sid\n");
goto done;
}
@@ -436,11 +436,11 @@
goto done;
}
 
-   ret = make_sec_desc(ctx,revision, SEC_DESC_SELF_RELATIVE, owner_sid, 
group_sid, 
+   ret = make_sec_desc(ctx,revision, SEC_DESC_SELF_RELATIVE, owner_sid, 
grp_

svn commit: samba r23199 - in branches/SAMBA_3_0_26/source/libads: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:19:53 + (Tue, 29 May 2007)
New Revision: 23199

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

Log:
merge ldap_rename2_s() fix from SAMBA_3_0
Modified:
   branches/SAMBA_3_0_26/source/libads/ldap.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/libads/ldap.c
===
--- branches/SAMBA_3_0_26/source/libads/ldap.c  2007-05-29 14:18:17 UTC (rev 
23198)
+++ branches/SAMBA_3_0_26/source/libads/ldap.c  2007-05-29 14:19:53 UTC (rev 
23199)
@@ -1754,7 +1754,8 @@
goto done;
}
 
-   ldap_status = ldap_rename2_s(ads->ld, computer_dn, computer_rdn, 
org_unit, 1);
+   ldap_status = ldap_rename_s(ads->ld, computer_dn, computer_rdn, 
+   org_unit, 1, NULL, NULL);
rc = ADS_ERROR(ldap_status);
 
 done:



svn commit: samba r23200 - in branches/SAMBA_3_0_26/source: libads nmbd

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:26:27 + (Tue, 29 May 2007)
New Revision: 23200

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

Log:
More merge's:

* A little const
* Metze's fix for GSS-SPNEGO against Win2k3


Modified:
   branches/SAMBA_3_0_26/source/libads/sasl.c
   branches/SAMBA_3_0_26/source/nmbd/nmbd_lmhosts.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/libads/sasl.c
===
--- branches/SAMBA_3_0_26/source/libads/sasl.c  2007-05-29 14:19:53 UTC (rev 
23199)
+++ branches/SAMBA_3_0_26/source/libads/sasl.c  2007-05-29 14:26:27 UTC (rev 
23200)
@@ -441,7 +441,8 @@
 
gss_release_buffer(&minor_status, &output_token);
 
-   output_token.value = SMB_MALLOC(strlen(ads->config.bind_path) + 8);
+   output_token.length = 4;
+   output_token.value = SMB_MALLOC(output_token.length);
p = (uint8 *)output_token.value;
 
*p++ = 1; /* no sign & seal selection */
@@ -449,11 +450,15 @@
*p++ = max_msg_size>>16;
*p++ = max_msg_size>>8;
*p++ = max_msg_size;
-   snprintf((char *)p, strlen(ads->config.bind_path)+4, "dn:%s", 
ads->config.bind_path);
-   p += strlen((const char *)p);
+   /*
+* we used to add sprintf("dn:%s", ads->config.bind_path) here.
+* but using ads->config.bind_path is the wrong! It should be
+* the DN of the user object!
+*
+* w2k3 gives an error when we send an incorrect DN, but sending nothing
+* is ok and matches the information flow used in GSS-SPNEGO.
+*/
 
-   output_token.length = PTR_DIFF(p, output_token.value);
-
gss_rc = gss_wrap(&minor_status, context_handle,0,GSS_C_QOP_DEFAULT,
  &output_token, (int *)&conf_state,
  &input_token);

Modified: branches/SAMBA_3_0_26/source/nmbd/nmbd_lmhosts.c
===
--- branches/SAMBA_3_0_26/source/nmbd/nmbd_lmhosts.c2007-05-29 14:19:53 UTC 
(rev 23199)
+++ branches/SAMBA_3_0_26/source/nmbd/nmbd_lmhosts.c2007-05-29 14:26:27 UTC 
(rev 23200)
@@ -29,7 +29,7 @@
 Load a lmhosts file.
 /
 
-void load_lmhosts_file(char *fname)
+void load_lmhosts_file(const char *fname)
 {  
pstring name;
int name_type;



svn commit: samba r23201 - in branches/SAMBA_3_0_26/source: python/examples/tdbpack script script/tests

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:38:31 + (Tue, 29 May 2007)
New Revision: 23201

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

Log:
minor patches to make test and pythong examples from SAMBA-3_0
Modified:
   branches/SAMBA_3_0_26/source/python/examples/tdbpack/tdbtimetrial.py
   branches/SAMBA_3_0_26/source/python/examples/tdbpack/test_tdbpack.py
   branches/SAMBA_3_0_26/source/script/mkversion.sh
   branches/SAMBA_3_0_26/source/script/tests/selftest.sh
   branches/SAMBA_3_0_26/source/script/tests/test_posix_s3.sh


Changeset:
Modified: branches/SAMBA_3_0_26/source/python/examples/tdbpack/tdbtimetrial.py
===
--- branches/SAMBA_3_0_26/source/python/examples/tdbpack/tdbtimetrial.py
2007-05-29 14:26:27 UTC (rev 23200)
+++ branches/SAMBA_3_0_26/source/python/examples/tdbpack/tdbtimetrial.py
2007-05-29 14:38:31 UTC (rev 23201)
@@ -1,4 +1,4 @@
-#! /usr/bin/python2.2
+#! /usr/bin/python
 
 def run_trial():
 # import tdbutil

Modified: branches/SAMBA_3_0_26/source/python/examples/tdbpack/test_tdbpack.py
===
--- branches/SAMBA_3_0_26/source/python/examples/tdbpack/test_tdbpack.py
2007-05-29 14:26:27 UTC (rev 23200)
+++ branches/SAMBA_3_0_26/source/python/examples/tdbpack/test_tdbpack.py
2007-05-29 14:38:31 UTC (rev 23201)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2.2
+#! /usr/bin/env python
 
 __doc__ = """test case for samba.tdbpack functions
 

Modified: branches/SAMBA_3_0_26/source/script/mkversion.sh
===
--- branches/SAMBA_3_0_26/source/script/mkversion.sh2007-05-29 14:26:27 UTC 
(rev 23200)
+++ branches/SAMBA_3_0_26/source/script/mkversion.sh2007-05-29 14:38:31 UTC 
(rev 23201)
@@ -82,6 +82,13 @@
else
TMP_SVK_REVISION_STR="[EMAIL PROTECTED]"
fi
+   if test x"${HAVESVK}" = x"no";then
+   HAVEBZR=no
+   bzr revno > /dev/null 2>&1 && HAVEBZR=yes
+   TMP_BZR_REVNO=`bzr revno 2> /dev/null`
+   TMP_BZR_NICK=`bzr nick 2> /dev/null`
+   TMP_BZR_REVISION_STR="${TMP_BZR_NICK}-${TMP_BZR_REVNO}"
+   fi
 fi
 
 if test x"${HAVESVN}" = x"yes";then
@@ -89,6 +96,8 @@
echo "#define SAMBA_VERSION_SVN_REVISION ${TMP_REVISION}" >> 
$OUTPUT_FILE
 elif test x"${HAVESVK}" = x"yes";then

SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVK-build-${TMP_SVK_REVISION_STR}"
+elif test x"${HAVEBZR}" = x"yes";then
+   
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-BZR-build-${TMP_BZR_REVISION_STR}"
 else
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-UNKNOWN"
 fi

Modified: branches/SAMBA_3_0_26/source/script/tests/selftest.sh
===
--- branches/SAMBA_3_0_26/source/script/tests/selftest.sh   2007-05-29 
14:26:27 UTC (rev 23200)
+++ branches/SAMBA_3_0_26/source/script/tests/selftest.sh   2007-05-29 
14:38:31 UTC (rev 23201)
@@ -95,8 +95,6 @@
log file = $LOGDIR/log.%m
log level = 0
 
-   passdb backend = tdbsam
-
name resolve order = bcast
 EOF
 
@@ -108,6 +106,8 @@
interfaces = $TORTURE_INTERFACES
panic action = $SCRIPTDIR/gdb_backtrace %d %\$(MAKE_TEST_BINARY)
include = $COMMONCONFFILE
+
+   passdb backend = tdbsam
 EOF
 
 cat >$SAMBA4CONFFILE<

svn commit: samba r23202 - in branches/SAMBA_3_0_26/source/libsmb: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:44:18 + (Tue, 29 May 2007)
New Revision: 23202

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

Log:
fix compile error from missed merge
Modified:
   branches/SAMBA_3_0_26/source/libsmb/clierror.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/libsmb/clierror.c
===
--- branches/SAMBA_3_0_26/source/libsmb/clierror.c  2007-05-29 14:38:31 UTC 
(rev 23201)
+++ branches/SAMBA_3_0_26/source/libsmb/clierror.c  2007-05-29 14:44:18 UTC 
(rev 23202)
@@ -385,7 +385,7 @@
  * byte isn't 0xc0, it doesn't match cli_is_nt_error() above.
  */
 status = cli_nt_error(cli);
-if (NT_STATUS_V(status) == 
NT_STATUS_V(STATUS_INACCESSIBLE_SYSTEM_SHORTCUT)) {
+if (NT_STATUS_V(status) == 
NT_STATUS_V(NT_STATUS_INACCESSIBLE_SYSTEM_SHORTCUT)) {
 return EACCES;
 }
 



svn commit: samba r23203 - in branches/SAMBA_3_0_26/source/smbd: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:48:37 + (Tue, 29 May 2007)
New Revision: 23203

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

Log:
sync a few comments from SAMBA_3_0
Modified:
   branches/SAMBA_3_0_26/source/smbd/nttrans.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/smbd/nttrans.c
===
--- branches/SAMBA_3_0_26/source/smbd/nttrans.c 2007-05-29 14:44:18 UTC (rev 
23202)
+++ branches/SAMBA_3_0_26/source/smbd/nttrans.c 2007-05-29 14:48:37 UTC (rev 
23203)
@@ -353,7 +353,7 @@
return(ERROR_DOS(ERRSRV,ERRnofids));
}
 
-   /* Add pipe to db */
+   /* TODO: Add pipe to db */

if ( !store_pipe_opendb( p ) ) {
DEBUG(3,("nt_open_pipe: failed to store %s pipe open.\n", 
fname));
@@ -2284,7 +2284,7 @@
unsigned char objid[16];
 
/* This should return the object-id on this file.
-* I think I'll make this be the inode+dev. JRA.
+* I think I'll make this be the inode+dev. JRA.
 */
 
DEBUG(10,("FSCTL_CREATE_OR_GET_OBJECT_ID: called on 
FID[0x%04X]\n",fidnum));
@@ -2293,7 +2293,7 @@
pdata = nttrans_realloc(ppdata, data_count);
if (pdata == NULL) {
return ERROR_NT(NT_STATUS_NO_MEMORY);
-   }   
+   }
push_file_id_16(pdata, &fsp->file_id);
memcpy(pdata+16,create_volume_objectid(conn,objid),16);
push_file_id_16(pdata+32, &fsp->file_id);



svn commit: samba r23204 - in branches: SAMBA_3_0/source/include SAMBA_3_0/source/lib SAMBA_3_0/source/locking SAMBA_3_0/source/smbd SAMBA_3_0/source/utils SAMBA_3_0_26/source/include SAMBA_3_0_26/sou

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 14:49:19 + (Tue, 29 May 2007)
New Revision: 23204

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

Log:
Add MSG_SMB_BRL_VALIDATE. Tridge, this is a bit different from your bzr
branch, please check if it fulfils your needs.

Two changes: The validation is not done inside the brlock.c traverse_fn,
it's done as a separate routine. 

Secondly, this patch does not call the checker routines in smbcontrol
directly but depends on a running smbd.


Modified:
   branches/SAMBA_3_0/source/include/messages.h
   branches/SAMBA_3_0/source/lib/messages.c
   branches/SAMBA_3_0/source/locking/brlock.c
   branches/SAMBA_3_0/source/smbd/server.c
   branches/SAMBA_3_0/source/utils/smbcontrol.c
   branches/SAMBA_3_0_26/source/include/messages.h
   branches/SAMBA_3_0_26/source/lib/messages.c
   branches/SAMBA_3_0_26/source/locking/brlock.c
   branches/SAMBA_3_0_26/source/smbd/server.c
   branches/SAMBA_3_0_26/source/utils/smbcontrol.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/messages.h
===
--- branches/SAMBA_3_0/source/include/messages.h2007-05-29 14:48:37 UTC 
(rev 23203)
+++ branches/SAMBA_3_0/source/include/messages.h2007-05-29 14:49:19 UTC 
(rev 23204)
@@ -83,6 +83,11 @@
  * Samba4 compatibility
  */
 #define MSG_PVFS_NOTIFY0x0310
+/*
+ * cluster reconfigure events
+ */
+#define MSG_SMB_BRL_VALIDATE   0x0311
+#define MSG_SMB_RELEASE_IP 0x0312
 
 /* winbind messages */
 #define MSG_WINBIND_FINISHED   0x0401

Modified: branches/SAMBA_3_0/source/lib/messages.c
===
--- branches/SAMBA_3_0/source/lib/messages.c2007-05-29 14:48:37 UTC (rev 
23203)
+++ branches/SAMBA_3_0/source/lib/messages.c2007-05-29 14:49:19 UTC (rev 
23204)
@@ -199,7 +199,7 @@
status = messaging_tdb_init(ctx, ctx, &ctx->local);
 
if (!NT_STATUS_IS_OK(status)) {
-   DEBUG(0, ("message_init failed: %s\n", nt_errstr(status)));
+   DEBUG(0, ("messaging_tdb_init failed: %s\n", 
nt_errstr(status)));
TALLOC_FREE(ctx);
}
 

Modified: branches/SAMBA_3_0/source/locking/brlock.c
===
--- branches/SAMBA_3_0/source/locking/brlock.c  2007-05-29 14:48:37 UTC (rev 
23203)
+++ branches/SAMBA_3_0/source/locking/brlock.c  2007-05-29 14:49:19 UTC (rev 
23204)
@@ -1686,3 +1686,109 @@
 {
return brl_get_locks_internal(mem_ctx, fsp, True);
 }
+
+struct brl_revalidate_state {
+   ssize_t array_size;
+   uint32 num_pids;
+   struct server_id *pids;
+};
+
+/*
+ * Collect PIDs of all processes with pending entries
+ */
+
+static void brl_revalidate_collect(struct file_id id, struct server_id pid,
+  enum brl_type lock_type,
+  enum brl_flavour lock_flav,
+  br_off start, br_off size,
+  void *private_data)
+{
+   struct brl_revalidate_state *state =
+   (struct brl_revalidate_state *)private_data;
+
+   if (!IS_PENDING_LOCK(lock_type)) {
+   return;
+   }
+
+   add_to_large_array(state, sizeof(pid), (void *)&pid,
+  &state->pids, &state->num_pids,
+  &state->array_size);
+}
+
+/*
+ * qsort callback to sort the processes
+ */
+
+static int compare_procids(const void *p1, const void *p2)
+{
+   const struct server_id *i1 = (struct server_id *)i1;
+   const struct server_id *i2 = (struct server_id *)i2;
+
+   if (i1->pid < i2->pid) return -1;
+   if (i2->pid > i2->pid) return 1;
+   return 0;
+}
+
+/*
+ * Send a MSG_SMB_UNLOCK message to all processes with pending byte range
+ * locks so that they retry. Mainly used in the cluster code after a node has
+ * died.
+ *
+ * Done in two steps to avoid double-sends: First we collect all entries in an
+ * array, then qsort that array and only send to non-dupes.
+ */
+
+static void brl_revalidate(struct messaging_context *msg_ctx,
+  void *private_data,
+  uint32_t msg_type,
+  struct server_id server_id,
+  DATA_BLOB *data)
+{
+   struct brl_revalidate_state *state;
+   uint32 i;
+   struct server_id last_pid;
+
+   if (!(state = TALLOC_ZERO_P(NULL, struct brl_revalidate_state))) {
+   DEBUG(0, ("talloc failed\n"));
+   return;
+   }
+
+   brl_forall(brl_revalidate_collect, state);
+
+   if (state->array_size == -1) {
+   DEBUG(0, ("talloc failed\n"));
+   goto done;
+   }
+
+   if (state->num_pids == 0) {
+   goto done;
+   }
+
+   qsort(state->pids, state->num_pids, sizeof(state->pids[0]

svn commit: samba r23205 - in branches/SAMBA_4_0/source/setup: .

2007-05-29 Thread metze
Author: metze
Date: 2007-05-29 14:51:24 + (Tue, 29 May 2007)
New Revision: 23205

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

Log:
abartlet please commit the correct content ...

this just fixes make install

metze
Added:
   branches/SAMBA_4_0/source/setup/DB_CONFIG


Changeset:
Added: branches/SAMBA_4_0/source/setup/DB_CONFIG
===



svn commit: samba r23207 - in branches/SAMBA_3_0/source/utils: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:53:46 + (Tue, 29 May 2007)
New Revision: 23207

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

Log:
merge net help test fix from SAMBA_3_0_26
Modified:
   branches/SAMBA_3_0/source/utils/net_help.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_help.c
===
--- branches/SAMBA_3_0/source/utils/net_help.c  2007-05-29 14:53:13 UTC (rev 
23206)
+++ branches/SAMBA_3_0/source/utils/net_help.c  2007-05-29 14:53:46 UTC (rev 
23207)
@@ -220,6 +220,7 @@
 static int net_usage(int argc, const char **argv)
 {
d_printf("  net time\t\tto view or set time information\n"\
+"  net lookup\t\tto lookup host name or ip address\n"\
 "  net user\t\tto manage users\n"\
 "  net group\t\tto manage groups\n"\
 "  net sam\t\tto edit the local user database directly\n"\



svn commit: samba r23206 - in branches/SAMBA_3_0/source/smbd: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 14:53:13 + (Tue, 29 May 2007)
New Revision: 23206

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

Log:
remove unreachable code
Modified:
   branches/SAMBA_3_0/source/smbd/nttrans.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===
--- branches/SAMBA_3_0/source/smbd/nttrans.c2007-05-29 14:51:24 UTC (rev 
23205)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c2007-05-29 14:53:13 UTC (rev 
23206)
@@ -2307,7 +2307,6 @@
return -1;
}
 
-
case FSCTL_GET_REPARSE_POINT:
/* pretend this fail - my winXP does it like this
 * --metze
@@ -2315,7 +2314,6 @@
 
DEBUG(10,("FSCTL_GET_REPARSE_POINT: called on FID[0x%04X](but 
not implemented)\n",fidnum));
return ERROR_NT(NT_STATUS_NOT_A_REPARSE_POINT);
-   return -1;
 
case FSCTL_SET_REPARSE_POINT:
/* pretend this fail - I'm assuming this because of the 
FSCTL_GET_REPARSE_POINT case.
@@ -2324,7 +2322,6 @@
 
DEBUG(10,("FSCTL_SET_REPARSE_POINT: called on FID[0x%04X](but 
not implemented)\n",fidnum));
return ERROR_NT(NT_STATUS_NOT_A_REPARSE_POINT);
-   return -1;

case FSCTL_GET_SHADOW_COPY_DATA: /* don't know if this name is 
right...*/
{



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

2007-05-29 Thread metze
Author: metze
Date: 2007-05-29 15:18:20 + (Tue, 29 May 2007)
New Revision: 23208

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

Log:
on some HP-UX boxes dlfcn.h is available and use unsigned int flags
for dlopen but no library contains the function...

metze
Modified:
   branches/SAMBA_4_0/source/lib/replace/dlfcn.c
   branches/SAMBA_4_0/source/lib/replace/dlfcn.m4
   branches/SAMBA_4_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/dlfcn.c
===
--- branches/SAMBA_4_0/source/lib/replace/dlfcn.c   2007-05-29 14:53:46 UTC 
(rev 23207)
+++ branches/SAMBA_4_0/source/lib/replace/dlfcn.c   2007-05-29 15:18:20 UTC 
(rev 23208)
@@ -26,7 +26,11 @@
 #include "replace.h"
 
 #ifndef HAVE_DLOPEN
+#ifdef DLOPEN_TAKES_UNSIGNED_FLAGS
+void *rep_dlopen(const char *name, unsigned int flags)
+#else
 void *rep_dlopen(const char *name, int flags)
+#endif
 {
return NULL;
 }

Modified: branches/SAMBA_4_0/source/lib/replace/dlfcn.m4
===
--- branches/SAMBA_4_0/source/lib/replace/dlfcn.m4  2007-05-29 14:53:46 UTC 
(rev 23207)
+++ branches/SAMBA_4_0/source/lib/replace/dlfcn.m4  2007-05-29 15:18:20 UTC 
(rev 23208)
@@ -5,13 +5,18 @@
 libreplace_cv_dlfcn=no
 AC_SEARCH_LIBS(dlopen, dl)
 
-if test x"${ac_cv_search_dlopen}" = x"no"; then
-   libreplace_cv_dlfcn=yes
-else
-   AC_CHECK_HEADERS(dlfcn.h)
-   AC_CHECK_FUNCS([dlopen dlsym dlerror 
dlclose],[],[libreplace_cv_dlfcn=yes])
-fi
+AC_CHECK_HEADERS(dlfcn.h)
+AC_CHECK_FUNCS([dlopen dlsym dlerror dlclose],[],[libreplace_cv_dlfcn=yes])
 
+AC_VERIFY_C_PROTOTYPE([void *dlopen(const char* filename, unsigned int flags)],
+   [
+   return 0;
+   ],[
+   AC_DEFINE(DLOPEN_TAKES_UNSIGNED_FLAGS, 1, [Whether dlopen takes 
unsinged int flags])
+   ],[],[
+   #include 
+   ])
+
 if test x"${libreplace_cv_dlfcn}" = x"yes";then
LIBREPLACEOBJ="${LIBREPLACEOBJ} dlfcn.o"
 fi

Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===
--- branches/SAMBA_4_0/source/lib/replace/replace.h 2007-05-29 14:53:46 UTC 
(rev 23207)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h 2007-05-29 15:18:20 UTC 
(rev 23208)
@@ -228,8 +228,12 @@
 
 #ifndef HAVE_DLOPEN
 #define dlopen rep_dlopen
+#ifdef DLOPEN_TAKES_UNSIGNED_FLAGS
+void *rep_dlopen(const char *name, unsigned int flags);
+#else
 void *rep_dlopen(const char *name, int flags);
 #endif
+#endif
 
 #ifndef HAVE_DLSYM
 #define dlsym rep_dlsym



svn commit: samba r23209 - in branches/SAMBA_4_0/source: heimdal/lib/roken heimdal_build

2007-05-29 Thread metze
Author: metze
Date: 2007-05-29 15:19:37 + (Tue, 29 May 2007)
New Revision: 23209

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

Log:
import getnameinfo.c, inet_ntop.c and inet_pton.c from
loikeet-heimdal

metze
Added:
   branches/SAMBA_4_0/source/heimdal/lib/roken/getnameinfo.c
   branches/SAMBA_4_0/source/heimdal/lib/roken/inet_ntop.c
   branches/SAMBA_4_0/source/heimdal/lib/roken/inet_pton.c
Modified:
   branches/SAMBA_4_0/source/heimdal_build/config.m4
   branches/SAMBA_4_0/source/heimdal_build/config.mk


Changeset:
Added: branches/SAMBA_4_0/source/heimdal/lib/roken/getnameinfo.c
===
--- branches/SAMBA_4_0/source/heimdal/lib/roken/getnameinfo.c   2007-05-29 
15:18:20 UTC (rev 23208)
+++ branches/SAMBA_4_0/source/heimdal/lib/roken/getnameinfo.c   2007-05-29 
15:19:37 UTC (rev 23209)
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 1999 - 2001 Kungliga Tekniska H�gskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 
+ * 3. Neither the name of the Institute nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include 
+RCSID("$Id: getnameinfo.c,v 1.6 2005/06/16 16:53:09 lha Exp $");
+#endif
+
+#include "roken.h"
+
+static int
+doit (int af,
+  const void *addr,
+  size_t addrlen,
+  int port,
+  char *host, size_t hostlen,
+  char *serv, size_t servlen,
+  int flags)
+{
+if (host != NULL) {
+   if (flags & NI_NUMERICHOST) {
+   if (inet_ntop (af, addr, host, hostlen) == NULL)
+   return EAI_SYSTEM;
+   } else {
+   struct hostent *he = gethostbyaddr (addr,
+   addrlen,
+   af);
+   if (he != NULL) {
+   strlcpy (host, hostent_find_fqdn(he), hostlen);
+   if (flags & NI_NOFQDN) {
+   char *dot = strchr (host, '.');
+   if (dot != NULL)
+   *dot = '\0';
+   }
+   } else if (flags & NI_NAMEREQD) {
+   return EAI_NONAME;
+   } else if (inet_ntop (af, addr, host, hostlen) == NULL)
+   return EAI_SYSTEM;
+   }
+}
+
+if (serv != NULL) {
+   if (flags & NI_NUMERICSERV) {
+   snprintf (serv, servlen, "%u", ntohs(port));
+   } else {
+   const char *proto = "tcp";
+   struct servent *se;
+
+   if (flags & NI_DGRAM)
+   proto = "udp";
+
+   se = getservbyport (port, proto);
+   if (se == NULL) {
+   snprintf (serv, servlen, "%u", ntohs(port));
+   } else {
+   strlcpy (serv, se->s_name, servlen);
+   }
+   }
+}
+return 0;
+}
+
+/*
+ *
+ */
+
+int ROKEN_LIB_FUNCTION
+getnameinfo(const struct sockaddr *sa, socklen_t salen,
+   char *host, size_t hostlen,
+   char *serv, size_t servlen,
+   int flags)
+{
+switch (sa->sa_family) {
+#ifdef HAVE_IPV6
+case AF_INET6 : {
+   const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sa;
+
+   return doit (AF_INET6, &sin6->sin6_addr, sizeof(sin6->sin6_addr),
+sin6->sin6_port,
+host, hostlen,
+serv, servlen,
+flags);
+}
+#endif
+case AF_INET : {
+   const struct sockaddr_in *sin4 = (const struct sockaddr_in *)sa;
+
+   return doit (AF_INET, &sin4->sin_addr

svn commit: samba r23210 - in branches: SAMBA_3_0/source/include SAMBA_3_0/source/nsswitch SAMBA_3_0/source/rpc_client SAMBA_3_0/source/rpc_parse SAMBA_3_0/source/rpcclient SAMBA_3_0_25/source/include

2007-05-29 Thread gd
Author: gd
Date: 2007-05-29 15:27:13 + (Tue, 29 May 2007)
New Revision: 23210

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

Log:
Very funny, we thought to use netr_GetDcName (e.g. in winbind) but were using
netr_GetDcAnyName all the time (which is the correct thing to do). 

Fix the naming and opcode mixup in all branches.

Guenther

Modified:
   branches/SAMBA_3_0/source/include/rpc_netlogon.h
   branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_misc.c
   branches/SAMBA_3_0/source/rpc_client/cli_netlogon.c
   branches/SAMBA_3_0/source/rpc_parse/parse_net.c
   branches/SAMBA_3_0/source/rpcclient/cmd_netlogon.c
   branches/SAMBA_3_0_25/source/include/rpc_netlogon.h
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_misc.c
   branches/SAMBA_3_0_25/source/rpc_client/cli_netlogon.c
   branches/SAMBA_3_0_25/source/rpc_parse/parse_net.c
   branches/SAMBA_3_0_25/source/rpcclient/cmd_netlogon.c
   branches/SAMBA_3_0_26/source/include/rpc_netlogon.h
   branches/SAMBA_3_0_26/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0_26/source/nsswitch/winbindd_misc.c
   branches/SAMBA_3_0_26/source/rpc_client/cli_netlogon.c
   branches/SAMBA_3_0_26/source/rpc_parse/parse_net.c
   branches/SAMBA_3_0_26/source/rpcclient/cmd_netlogon.c


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


Re: svn commit: samba r23189 - in branches/SAMBA_4_0/source: script scripting/libjs selftest setup

2007-05-29 Thread Stefan (metze) Metzmacher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> Log:
> Work towards a totally scripted setup of LDAP backends, so others can
> easily try this out.
> 
> I also intend to use this for the selftest, but I'm chasing issues
> with the OpenlDAP (but not Fedora DS) backend.
> 
> Andrew Bartlett
> 
> Modified:
>branches/SAMBA_4_0/source/script/installmisc.sh
>branches/SAMBA_4_0/source/scripting/libjs/provision.js
>branches/SAMBA_4_0/source/selftest/Samba4.pm
>branches/SAMBA_4_0/source/setup/fedorads-partitions.ldif
>branches/SAMBA_4_0/source/setup/fedorads.inf
>branches/SAMBA_4_0/source/setup/provision
>branches/SAMBA_4_0/source/setup/provision-backend
>branches/SAMBA_4_0/source/setup/slapd.conf

Hi Andrew,

please commit your version of setup/DB_CONFIG :-)

metze
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGXEyxm70gjA5TCD8RAoOnAKCx77KInnxgWZgqI9+r/gn3Np59bgCfSS6v
fUFZ0GkcFxTo9kPGGB7EfPQ=
=qULD
-END PGP SIGNATURE-


svn commit: samba r23211 - in branches/SAMBA_3_0_26/source: include lib libads libmsrpc libsmb printing python registry rpc_client rpc_parse rpc_server rpcclient

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 16:26:38 + (Tue, 29 May 2007)
New Revision: 23211

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

Log:
merge security descriptor data structure changes from SAMBA_3_0
Modified:
   branches/SAMBA_3_0_26/source/include/rpc_secdes.h
   branches/SAMBA_3_0_26/source/include/smb.h
   branches/SAMBA_3_0_26/source/include/vfs.h
   branches/SAMBA_3_0_26/source/lib/secace.c
   branches/SAMBA_3_0_26/source/lib/secdesc.c
   branches/SAMBA_3_0_26/source/libads/disp_sec.c
   branches/SAMBA_3_0_26/source/libmsrpc/cac_winreg.c
   branches/SAMBA_3_0_26/source/libsmb/clisecdesc.c
   branches/SAMBA_3_0_26/source/printing/nt_printing.c
   branches/SAMBA_3_0_26/source/python/py_ntsec.c
   branches/SAMBA_3_0_26/source/python/py_spoolss_printers_conv.c
   branches/SAMBA_3_0_26/source/registry/reg_printing.c
   branches/SAMBA_3_0_26/source/rpc_client/cli_reg.c
   branches/SAMBA_3_0_26/source/rpc_parse/parse_reg.c
   branches/SAMBA_3_0_26/source/rpc_parse/parse_sec.c
   branches/SAMBA_3_0_26/source/rpc_parse/parse_spoolss.c
   branches/SAMBA_3_0_26/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c
   branches/SAMBA_3_0_26/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_0_26/source/rpcclient/cmd_lsarpc.c
   branches/SAMBA_3_0_26/source/rpcclient/cmd_samr.c


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


svn commit: samba r23212 - in branches/SAMBA_3_0_26/source/rpc_server: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 16:46:16 + (Tue, 29 May 2007)
New Revision: 23212

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

Log:
merge from SAMBA_3_0: Use pipe_user rather than global current_user
Modified:
   branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c
===
--- branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c2007-05-29 
16:26:38 UTC (rev 23211)
+++ branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c2007-05-29 
16:46:16 UTC (rev 23212)
@@ -1534,7 +1534,6 @@
 
fstring name;
int snum;
-   struct current_user user;
Printer_entry *Printer=NULL;
 
if ( !q_u->printername )
@@ -1558,8 +1557,6 @@
return WERR_INVALID_PRINTER_NAME;
}
 
-   get_current_user(&user, p);
-
/*
 * First case: the user is opening the print server:
 *
@@ -1624,12 +1621,12 @@
/* if the user is not root, doesn't have 
SE_PRINT_OPERATOR privilege,
   and not a printer admin, then fail */

-   if ((user.ut.uid != 0) &&
-   !user_has_privileges(user.nt_user_token,
+   if ((p->pipe_user.ut.uid != 0) &&
+   !user_has_privileges(p->pipe_user.nt_user_token,
 &se_printop ) &&
!token_contains_name_in_list(
-   uidtoname(user.ut.uid), NULL,
-   user.nt_user_token,
+   uidtoname(p->pipe_user.ut.uid), NULL,
+   p->pipe_user.nt_user_token,
lp_printer_admin(snum))) {
close_printer_handle(p, handle);
return WERR_ACCESS_DENIED;
@@ -1682,9 +1679,9 @@
return WERR_ACCESS_DENIED;
}
 
-   if (!user_ok_token(uidtoname(user.ut.uid), user.nt_user_token,
-  snum) ||
-   !print_access_check(&user, snum,
+   if (!user_ok_token(uidtoname(p->pipe_user.ut.uid),
+  p->pipe_user.nt_user_token, snum) ||
+   !print_access_check(&p->pipe_user, snum,
printer_default->access_required)) {
DEBUG(3, ("access DENIED for printer open\n"));
close_printer_handle(p, handle);
@@ -1978,20 +1975,17 @@
NT_PRINTER_DRIVER_INFO_LEVELinfo;
NT_PRINTER_DRIVER_INFO_LEVELinfo_win2k;
int version;
-   struct current_user user;
WERROR  status;
WERROR  status_win2k = WERR_ACCESS_DENIED;
SE_PRIV se_printop = SE_PRINT_OPERATOR; 

-   get_current_user(&user, p);
-
/* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege,
   and not a printer admin, then fail */

-   if ( (user.ut.uid != 0) 
-   && !user_has_privileges(user.nt_user_token, &se_printop ) 
-   && !token_contains_name_in_list( uidtoname(user.ut.uid), 
-   NULL, user.nt_user_token, lp_printer_admin(-1)) ) 
+   if ( (p->pipe_user.ut.uid != 0) 
+   && !user_has_privileges(p->pipe_user.nt_user_token, &se_printop 
) 
+   && !token_contains_name_in_list( 
uidtoname(p->pipe_user.ut.uid), 
+   NULL, p->pipe_user.nt_user_token, lp_printer_admin(-1)) ) 
{
return WERR_ACCESS_DENIED;
}
@@ -2038,7 +2032,7 @@
/* if we get to here, we now have 2 driver info 
structures to remove */
/* remove the Win2k driver first*/

-   status_win2k = delete_printer_driver(info_win2k.info_3, 
&user, 3, False );
+   status_win2k = delete_printer_driver(info_win2k.info_3, 
&p->pipe_user, 3, False );
free_a_printer_driver( info_win2k, 3 );

/* this should not have failed---if it did, report to 
client */
@@ -2050,7 +2044,7 @@
}
}

-   status = delete_printer_driver(info.info_3, &user, version, False);
+   status = delete_printer_driver(info.info_3, &p->pipe_user, version, 
False);

/* if at least one of the deletes succeeded return OK */

@@ -2076,20 +2070,17 @@
int version;
uint32  flags = q_u->delete_flags;
BOOL 

svn commit: samba r23213 - in branches/SAMBA_3_0_26/source/rpc_server: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 16:54:01 + (Tue, 29 May 2007)
New Revision: 23213

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

Log:
Merge printer_info6 support from SAMBA_3_0
(TODO check svn annotate in SAMBA_3_0 for release notes)


Modified:
   branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c
===
--- branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c2007-05-29 
16:46:16 UTC (rev 23212)
+++ branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c2007-05-29 
16:54:01 UTC (rev 23213)
@@ -4333,6 +4333,32 @@
 }
 
 /
+ * construct_printer_info_6
+ * fill a printer_info_6 struct
+ /
+
+static BOOL construct_printer_info_6(Printer_entry *print_hnd,
+PRINTER_INFO_6 *printer,
+int snum)
+{
+   NT_PRINTER_INFO_LEVEL *ntprinter = NULL;
+   int count;
+   print_status_struct status;
+
+   if (!W_ERROR_IS_OK(get_a_printer(print_hnd, &ntprinter, 2,
+lp_const_servicename(snum
+   return False;
+
+   count = print_queue_length(snum, &status);
+
+   printer->status = nt_printq_status(status.status);
+   
+   free_a_printer(&ntprinter, 2);
+
+   return True;
+}
+
+/
  * construct_printer_info_7
  * fill a printer_info_7 struct
  /
@@ -4960,6 +4986,46 @@
return result;  
 }
 
+static WERROR getprinter_level_6(Printer_entry *print_hnd,
+int snum,
+RPC_BUFFER *buffer, uint32 offered,
+uint32 *needed)
+{
+   PRINTER_INFO_6 *printer;
+   WERROR result = WERR_OK;
+
+   if ((printer = SMB_MALLOC_P(PRINTER_INFO_6)) == NULL) {
+   return WERR_NOMEM;
+   }
+
+   if (!construct_printer_info_6(print_hnd, printer, snum)) {
+   free_printer_info_6(printer);
+   return WERR_NOMEM;
+   }
+
+   /* check the required size. */
+   *needed += spoolss_size_printer_info_6(printer);
+
+   if (*needed > offered) {
+   result = WERR_INSUFFICIENT_BUFFER;
+   goto out;
+   }
+
+   if (!rpcbuf_alloc_size(buffer, *needed)) {
+   result = WERR_NOMEM;
+   goto out;
+   }
+
+   /* fill the buffer with the structures */
+   smb_io_printer_info_6("", buffer, printer, 0);  
+   
+out:
+   /* clear memory */
+   free_printer_info_6(printer);
+   
+   return result;  
+}
+
 static WERROR getprinter_level_7(Printer_entry *print_hnd, int snum, 
RPC_BUFFER *buffer, uint32 offered, uint32 *needed)
 {
PRINTER_INFO_7 *printer=NULL;
@@ -5036,6 +5102,8 @@
return getprinter_level_4(Printer, snum, buffer, offered, 
needed);
case 5: 
return getprinter_level_5(Printer, snum, buffer, offered, 
needed);
+   case 6: 
+   return getprinter_level_6(Printer, snum, buffer, offered, 
needed);
case 7:
return getprinter_level_7(Printer, snum, buffer, offered, 
needed);
}



svn commit: samba r23214 - in branches/SAMBA_3_0_26/source/rpc_server: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 17:10:36 + (Tue, 29 May 2007)
New Revision: 23214

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

Log:
Merge signature change for get_printer_snum() from SAMBA_3_0.
Does not include change from snum to struct share_pararms.
Just decreases the diff.


Modified:
   branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c
===
--- branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c2007-05-29 
16:54:01 UTC (rev 23213)
+++ branches/SAMBA_3_0_26/source/rpc_server/srv_spoolss_nt.c2007-05-29 
17:10:36 UTC (rev 23214)
@@ -375,7 +375,8 @@
  Return the snum of a printer corresponding to an handle.
 /
 
-static BOOL get_printer_snum(pipes_struct *p, POLICY_HND *hnd, int *number)
+static BOOL get_printer_snum(pipes_struct *p, POLICY_HND *hnd, int *number,
+struct share_params **params)
 {
Printer_entry *Printer = find_printer_index_by_hnd(p, hnd);

@@ -1649,7 +1650,7 @@
/* NT doesn't let us connect to a printer if the connecting user
   doesn't have print permission.  */
 
-   if (!get_printer_snum(p, handle, &snum)) {
+   if (!get_printer_snum(p, handle, &snum, NULL)) {
close_printer_handle(p, handle);
return WERR_BADFID;
}
@@ -1876,7 +1877,7 @@
return WERR_BADFID;
}

-   if (!get_printer_snum(p, handle, &snum))
+   if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;
 
Printer->document_started=False;
@@ -2468,7 +2469,7 @@
status = getprinterdata_printer_server( p->mem_ctx, value, 
type, data, needed, *out_size );
else
{
-   if ( !get_printer_snum(p,handle, &snum) ) {
+   if ( !get_printer_snum(p,handle, &snum, NULL) ) {
status = WERR_BADFID;
goto done;
}
@@ -2687,7 +2688,7 @@
if ( Printer->printer_type == SPLHND_SERVER)
snum = -1;
else if ( (Printer->printer_type == SPLHND_PRINTER) &&
-   !get_printer_snum(p, handle, &snum) )
+   !get_printer_snum(p, handle, &snum, NULL) )
return WERR_BADFID;

client_ip.s_addr = inet_addr(p->conn->client_address);
@@ -3827,7 +3828,7 @@
if ( !option )
return WERR_BADFID;
 
-   get_printer_snum(p, hnd, &snum);
+   get_printer_snum(p, hnd, &snum, NULL);
 
for (i=0; icount; i++) {
option_type=&option->ctr.type[i];
@@ -5086,7 +5087,7 @@
 
*needed=0;
 
-   if (!get_printer_snum(p, handle, &snum))
+   if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;
 
switch (level) {
@@ -5702,7 +5703,7 @@
fstrcpy(servername, get_server_name( printer ));
unistr2_to_ascii(architecture, uni_arch, sizeof(architecture)-1);
 
-   if (!get_printer_snum(p, handle, &snum))
+   if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;
 
switch (level) {
@@ -5758,7 +5759,7 @@
return WERR_BADFID;
}

-   if (!get_printer_snum(p, handle, &snum))
+   if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;
 
Printer->page_started=False;
@@ -5807,7 +5808,7 @@
}   

/* get the share number of the printer */
-   if (!get_printer_snum(p, handle, &snum)) {
+   if (!get_printer_snum(p, handle, &snum, NULL)) {
return WERR_BADFID;
}
 
@@ -5859,7 +5860,7 @@
return WERR_BADFID;
}
 
-   if (!get_printer_snum(p, handle, &snum))
+   if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;
 
(*buffer_written) = (uint32)print_job_write(snum, Printer->jobid, 
(const char *)buffer,
@@ -5895,7 +5896,7 @@
return WERR_BADFID;
}
 
-   if (!get_printer_snum(p, handle, &snum))
+   if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;
 
switch (command) {
@@ -5940,7 +5941,7 @@
return WERR_BADFID;
}

-   if (!get_printer_snum(p, handle, &snum))
+   if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;

print_job_delete( &p->pipe_user, snum, Printer->jobid, &errcode );  
@@ -5963,7 +5964,7 @@
 
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
 
-   if (!Printer || !get_printer_snum(p, handle, &snum)) {
+   if (!Printer

svn commit: samba r23215 - in branches/SAMBA_3_0_26/source/modules: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 17:12:08 + (Tue, 29 May 2007)
New Revision: 23215

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

Log:
missed merged for sec_desc changes
Modified:
   branches/SAMBA_3_0_26/source/modules/vfs_cap.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/modules/vfs_cap.c
===
--- branches/SAMBA_3_0_26/source/modules/vfs_cap.c  2007-05-29 17:10:36 UTC 
(rev 23214)
+++ branches/SAMBA_3_0_26/source/modules/vfs_cap.c  2007-05-29 17:12:08 UTC 
(rev 23215)
@@ -184,7 +184,7 @@
return SMB_VFS_NEXT_REALPATH(handle, path, resolved_path);
 }
 
-static BOOL cap_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const 
char *name, uint32 security_info_sent, struct security_descriptor_info *psd)
+static BOOL cap_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const 
char *name, uint32 security_info_sent, struct security_descriptor *psd)
 {
 pstring capname;
capencode(capname, name);



svn commit: samba r23216 - in branches/SAMBA_3_0_26/source/rpc_server: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 17:41:55 + (Tue, 29 May 2007)
New Revision: 23216

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

Log:
sync comment with SAMBA_3_0
Modified:
   branches/SAMBA_3_0_26/source/rpc_server/srv_pipe_hnd.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/rpc_server/srv_pipe_hnd.c
===
--- branches/SAMBA_3_0_26/source/rpc_server/srv_pipe_hnd.c  2007-05-29 
17:12:08 UTC (rev 23215)
+++ branches/SAMBA_3_0_26/source/rpc_server/srv_pipe_hnd.c  2007-05-29 
17:41:55 UTC (rev 23216)
@@ -1170,7 +1170,7 @@
 
DLIST_REMOVE(Pipes, p);

-   /* Remove from pipe open db */
+   /* TODO: Remove from pipe open db */

if ( !delete_pipe_opendb( p ) ) {
DEBUG(3,("close_rpc_pipe_hnd: failed to delete %s "



svn commit: samba r23217 - in branches/SAMBA_3_0_26/source: include librpc/gen_ndr librpc/idl

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 17:51:45 + (Tue, 29 May 2007)
New Revision: 23217

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

Log:
Use the enum lsa_SidType declaration from the autogenerated lsa.h


Added:
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/lsa.h
   branches/SAMBA_3_0_26/source/librpc/idl/lsa.idl
Modified:
   branches/SAMBA_3_0_26/source/include/smb.h


Changeset:
Modified: branches/SAMBA_3_0_26/source/include/smb.h
===
--- branches/SAMBA_3_0_26/source/include/smb.h  2007-05-29 17:41:55 UTC (rev 
23216)
+++ branches/SAMBA_3_0_26/source/include/smb.h  2007-05-29 17:51:45 UTC (rev 
23217)
@@ -243,20 +243,6 @@
 
 #define SID_MAX_SIZE ((size_t)(8+(MAXSUBAUTHS*4)))
 
-/* SID Types */
-enum lsa_SidType {
-   SID_NAME_USE_NONE = 0,
-   SID_NAME_USER= 1, /* user */
-   SID_NAME_DOM_GRP, /* domain group */
-   SID_NAME_DOMAIN,  /* domain sid */
-   SID_NAME_ALIAS,   /* local group */
-   SID_NAME_WKN_GRP, /* well-known group */
-   SID_NAME_DELETED, /* deleted account: needed for c2 rating */
-   SID_NAME_INVALID, /* invalid account */
-   SID_NAME_UNKNOWN, /* unknown sid type */
-   SID_NAME_COMPUTER /* sid for a computer */
-};
-
 #define LOOKUP_NAME_ISOLATED 1 /* Look up unqualified names */
 #define LOOKUP_NAME_REMOTE   2  /* Ask others */
 #define LOOKUP_NAME_ALL (LOOKUP_NAME_ISOLATED|LOOKUP_NAME_REMOTE)
@@ -312,6 +298,7 @@
 #include "librpc/ndr/misc.h"
 #include "librpc/ndr/security.h"
 #include "librpc/ndr/libndr.h"
+#include "librpc/gen_ndr/lsa.h"
 #include "librpc/gen_ndr/wkssvc.h"
 
 struct lsa_dom_info {

Copied: branches/SAMBA_3_0_26/source/librpc/gen_ndr/lsa.h (from rev 23215, 
branches/SAMBA_3_0/source/librpc/gen_ndr/lsa.h)

Copied: branches/SAMBA_3_0_26/source/librpc/idl/lsa.idl (from rev 23216, 
branches/SAMBA_3_0/source/librpc/idl/lsa.idl)



svn commit: samba r23218 - in branches/SAMBA_3_0_26/source/libsmb: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 17:56:57 + (Tue, 29 May 2007)
New Revision: 23218

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

Log:
merge a const warning
Modified:
   branches/SAMBA_3_0_26/source/libsmb/namequery.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/libsmb/namequery.c
===
--- branches/SAMBA_3_0_26/source/libsmb/namequery.c 2007-05-29 17:51:45 UTC 
(rev 23217)
+++ branches/SAMBA_3_0_26/source/libsmb/namequery.c 2007-05-29 17:56:57 UTC 
(rev 23218)
@@ -651,7 +651,7 @@
  Start parsing the lmhosts file.
 */
 
-XFILE *startlmhosts(char *fname)
+XFILE *startlmhosts(const char *fname)
 {
XFILE *fp = x_fopen(fname,O_RDONLY, 0);
if (!fp) {



svn commit: samba r23219 - in branches: SAMBA_3_0/source/rpc_client SAMBA_3_0/source/rpcclient SAMBA_3_0_26/source/rpc_client SAMBA_3_0_26/source/rpcclient

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 17:57:52 + (Tue, 29 May 2007)
New Revision: 23219

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

Log:
Two warnings

Modified:
   branches/SAMBA_3_0/source/rpc_client/cli_netlogon.c
   branches/SAMBA_3_0/source/rpcclient/cmd_netlogon.c
   branches/SAMBA_3_0_26/source/rpc_client/cli_netlogon.c
   branches/SAMBA_3_0_26/source/rpcclient/cmd_netlogon.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_client/cli_netlogon.c
===
--- branches/SAMBA_3_0/source/rpc_client/cli_netlogon.c 2007-05-29 17:56:57 UTC 
(rev 23218)
+++ branches/SAMBA_3_0/source/rpc_client/cli_netlogon.c 2007-05-29 17:57:52 UTC 
(rev 23219)
@@ -501,7 +501,8 @@
 
info->domain_controller_address_type = r->dc_address_type;
 
-   info->domain_guid = talloc_memdup(mem_ctx, &r->domain_guid, 
sizeof(struct GUID));
+   info->domain_guid = (struct GUID *)talloc_memdup(
+   mem_ctx, &r->domain_guid, sizeof(struct GUID));
if (!info->domain_guid) {
return WERR_GENERAL_FAILURE;
}

Modified: branches/SAMBA_3_0/source/rpcclient/cmd_netlogon.c
===
--- branches/SAMBA_3_0/source/rpcclient/cmd_netlogon.c  2007-05-29 17:56:57 UTC 
(rev 23218)
+++ branches/SAMBA_3_0/source/rpcclient/cmd_netlogon.c  2007-05-29 17:57:52 UTC 
(rev 23219)
@@ -254,7 +254,7 @@
WERROR result;
uint32 flags = DS_RETURN_DNS_NAME;
const char *server_name = cli->cli->desthost;
-   const char *domain_name;
+   const char *domain_name = NULL;
const char *client_account = NULL;
uint32 mask = 0;
const char *site_name = NULL;

Modified: branches/SAMBA_3_0_26/source/rpc_client/cli_netlogon.c
===
--- branches/SAMBA_3_0_26/source/rpc_client/cli_netlogon.c  2007-05-29 
17:56:57 UTC (rev 23218)
+++ branches/SAMBA_3_0_26/source/rpc_client/cli_netlogon.c  2007-05-29 
17:57:52 UTC (rev 23219)
@@ -463,7 +463,8 @@
 
info->domain_controller_address_type = r->dc_address_type;
 
-   info->domain_guid = talloc_memdup(mem_ctx, &r->domain_guid, 
sizeof(struct GUID));
+   info->domain_guid = (struct GUID *)talloc_memdup(
+   mem_ctx, &r->domain_guid, sizeof(struct GUID));
if (!info->domain_guid) {
return WERR_GENERAL_FAILURE;
}

Modified: branches/SAMBA_3_0_26/source/rpcclient/cmd_netlogon.c
===
--- branches/SAMBA_3_0_26/source/rpcclient/cmd_netlogon.c   2007-05-29 
17:56:57 UTC (rev 23218)
+++ branches/SAMBA_3_0_26/source/rpcclient/cmd_netlogon.c   2007-05-29 
17:57:52 UTC (rev 23219)
@@ -217,7 +217,7 @@
WERROR result;
uint32 flags = DS_RETURN_DNS_NAME;
const char *server_name = cli->cli->desthost;
-   const char *domain_name;
+   const char *domain_name = NULL;
const char *client_account = NULL;
uint32 mask = 0;
const char *site_name = NULL;



svn commit: samba r23220 - in branches: SAMBA_3_0/source/include SAMBA_3_0/source/lib SAMBA_3_0/source/smbd SAMBA_3_0_26/source/include SAMBA_3_0_26/source/lib SAMBA_3_0_26/source/smbd

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 18:04:38 + (Tue, 29 May 2007)
New Revision: 23220

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

Log:
Add traverse_read to dbwrap

Modified:
   branches/SAMBA_3_0/source/include/dbwrap.h
   branches/SAMBA_3_0/source/lib/dbwrap_file.c
   branches/SAMBA_3_0/source/lib/dbwrap_tdb.c
   branches/SAMBA_3_0/source/smbd/session.c
   branches/SAMBA_3_0_26/source/include/dbwrap.h
   branches/SAMBA_3_0_26/source/lib/dbwrap_file.c
   branches/SAMBA_3_0_26/source/lib/dbwrap_tdb.c
   branches/SAMBA_3_0_26/source/smbd/session.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/dbwrap.h
===
--- branches/SAMBA_3_0/source/include/dbwrap.h  2007-05-29 17:57:52 UTC (rev 
23219)
+++ branches/SAMBA_3_0/source/include/dbwrap.h  2007-05-29 18:04:38 UTC (rev 
23220)
@@ -38,6 +38,10 @@
int (*f)(struct db_record *db,
 void *private_data),
void *private_data);
+   int (*traverse_read)(struct db_context *db,
+int (*f)(struct db_record *db,
+ void *private_data),
+void *private_data);
int (*get_seqnum)(struct db_context *db);
void *private_data;
 };

Modified: branches/SAMBA_3_0/source/lib/dbwrap_file.c
===
--- branches/SAMBA_3_0/source/lib/dbwrap_file.c 2007-05-29 17:57:52 UTC (rev 
23219)
+++ branches/SAMBA_3_0/source/lib/dbwrap_file.c 2007-05-29 18:04:38 UTC (rev 
23220)
@@ -367,6 +367,7 @@
result->private_data = ctx;
result->fetch_locked = db_file_fetch_locked;
result->traverse = db_file_traverse;
+   result->traverse_read = db_file_traverse;
 
ctx->locked_record = NULL;
if (!(ctx->dirname = talloc_strdup(ctx, name))) {

Modified: branches/SAMBA_3_0/source/lib/dbwrap_tdb.c
===
--- branches/SAMBA_3_0/source/lib/dbwrap_tdb.c  2007-05-29 17:57:52 UTC (rev 
23219)
+++ branches/SAMBA_3_0/source/lib/dbwrap_tdb.c  2007-05-29 18:04:38 UTC (rev 
23220)
@@ -174,6 +174,46 @@
return tdb_traverse(db_ctx->tdb, db_tdb_traverse_func, &ctx);
 }
 
+static NTSTATUS db_tdb_store_deny(struct db_record *rec, TDB_DATA data, int 
flag)
+{
+   return NT_STATUS_MEDIA_WRITE_PROTECTED;
+}
+
+static NTSTATUS db_tdb_delete_deny(struct db_record *rec)
+{
+   return NT_STATUS_MEDIA_WRITE_PROTECTED;
+}
+
+static int db_tdb_traverse_read_func(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA 
dbuf,
+   void *private_data)
+{
+   struct db_tdb_traverse_ctx *ctx =
+   (struct db_tdb_traverse_ctx *)private_data;
+   struct db_record rec;
+
+   rec.key = kbuf;
+   rec.value = dbuf;
+   rec.store = db_tdb_store_deny;
+   rec.delete_rec = db_tdb_delete_deny;
+   rec.private_data = ctx->db->private_data;
+
+   return ctx->f(&rec, ctx->private_data);
+}
+
+static int db_tdb_traverse_read(struct db_context *db,
+  int (*f)(struct db_record *rec, void *private_data),
+  void *private_data)
+{
+   struct db_tdb_ctx *db_ctx =
+   talloc_get_type_abort(db->private_data, struct db_tdb_ctx);
+   struct db_tdb_traverse_ctx ctx;
+
+   ctx.db = db;
+   ctx.f = f;
+   ctx.private_data = private_data;
+   return tdb_traverse_read(db_ctx->tdb, db_tdb_traverse_read_func, &ctx);
+}
+
 static int db_tdb_get_seqnum(struct db_context *db)
 
 {
@@ -222,6 +262,7 @@
talloc_set_destructor(db_tdb, db_tdb_ctx_destr);
result->fetch_locked = db_tdb_fetch_locked;
result->traverse = db_tdb_traverse;
+   result->traverse_read = db_tdb_traverse_read;
result->get_seqnum = db_tdb_get_seqnum;
return result;
 

Modified: branches/SAMBA_3_0/source/smbd/session.c
===
--- branches/SAMBA_3_0/source/smbd/session.c2007-05-29 17:57:52 UTC (rev 
23219)
+++ branches/SAMBA_3_0/source/smbd/session.c2007-05-29 18:04:38 UTC (rev 
23220)
@@ -275,7 +275,7 @@
return False;
}
 
-   ctx->traverse(ctx, fn, private_data);
+   ctx->traverse_read(ctx, fn, private_data);
return True;
 }
 

Modified: branches/SAMBA_3_0_26/source/include/dbwrap.h
===
--- branches/SAMBA_3_0_26/source/include/dbwrap.h   2007-05-29 17:57:52 UTC 
(rev 23219)
+++ branches/SAMBA_3_0_26/source/include/dbwrap.h   2007-05-29 18:04:38 UTC 
(rev 23220)
@@ -38,6 +38,10 @@
int (*f)(struct db_record *db,
 void *private_data),
void *private_data);
+   int (*traverse_read)(struct db_context *db,

svn commit: samba r23221 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_26/source/smbd

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 18:14:54 + (Tue, 29 May 2007)
New Revision: 23221

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

Log:
Fix a bad merge, avoid a memory leak and tdb lock problem

Modified:
   branches/SAMBA_3_0/source/smbd/connection.c
   branches/SAMBA_3_0_26/source/smbd/connection.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/connection.c
===
--- branches/SAMBA_3_0/source/smbd/connection.c 2007-05-29 18:04:38 UTC (rev 
23220)
+++ branches/SAMBA_3_0/source/smbd/connection.c 2007-05-29 18:14:54 UTC (rev 
23221)
@@ -43,6 +43,7 @@
nt_errstr(status)));
}
 
+   TALLOC_FREE(rec);
return NT_STATUS_IS_OK(status);
 }
 

Modified: branches/SAMBA_3_0_26/source/smbd/connection.c
===
--- branches/SAMBA_3_0_26/source/smbd/connection.c  2007-05-29 18:04:38 UTC 
(rev 23220)
+++ branches/SAMBA_3_0_26/source/smbd/connection.c  2007-05-29 18:14:54 UTC 
(rev 23221)
@@ -43,6 +43,7 @@
nt_errstr(status)));
}
 
+   TALLOC_FREE(rec);
return NT_STATUS_IS_OK(status);
 }
 



svn commit: samba r23222 - in branches: SAMBA_3_0/source/locking SAMBA_3_0_26/source/locking

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 18:32:49 + (Tue, 29 May 2007)
New Revision: 23222

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

Log:
share_mode_forall() is only for counting and status display stuff, so
traverse_read is enough here

Modified:
   branches/SAMBA_3_0/source/locking/locking.c
   branches/SAMBA_3_0_26/source/locking/locking.c


Changeset:
Modified: branches/SAMBA_3_0/source/locking/locking.c
===
--- branches/SAMBA_3_0/source/locking/locking.c 2007-05-29 18:14:54 UTC (rev 
23221)
+++ branches/SAMBA_3_0/source/locking/locking.c 2007-05-29 18:32:49 UTC (rev 
23222)
@@ -1404,5 +1404,5 @@
state.fn = fn;
state.private_data = private_data;
 
-   return lock_db->traverse(lock_db, traverse_fn, (void *)&state);
+   return lock_db->traverse_read(lock_db, traverse_fn, (void *)&state);
 }

Modified: branches/SAMBA_3_0_26/source/locking/locking.c
===
--- branches/SAMBA_3_0_26/source/locking/locking.c  2007-05-29 18:14:54 UTC 
(rev 23221)
+++ branches/SAMBA_3_0_26/source/locking/locking.c  2007-05-29 18:32:49 UTC 
(rev 23222)
@@ -1404,5 +1404,5 @@
state.fn = fn;
state.private_data = private_data;
 
-   return lock_db->traverse(lock_db, traverse_fn, (void *)&state);
+   return lock_db->traverse_read(lock_db, traverse_fn, (void *)&state);
 }



svn commit: samba r23223 - in branches: SAMBA_3_0/source/utils SAMBA_3_0_26/source/utils

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 18:41:16 + (Tue, 29 May 2007)
New Revision: 23223

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

Log:
Convert a leftover direct tdb access to sessionid.tdb

Modified:
   branches/SAMBA_3_0/source/utils/status.c
   branches/SAMBA_3_0_26/source/utils/status.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/status.c
===
--- branches/SAMBA_3_0/source/utils/status.c2007-05-29 18:32:49 UTC (rev 
23222)
+++ branches/SAMBA_3_0/source/utils/status.c2007-05-29 18:41:16 UTC (rev 
23223)
@@ -219,22 +219,22 @@
}
 
d_printf("%-10s   %s   %-12s  %s",
-  crec->servicename,procid_str_static(&crec->pid),
-  crec->machine,
-  time_to_asc(crec->start));
+crec->servicename,procid_str_static(&crec->pid),
+crec->machine,
+time_to_asc(crec->start));
 
return 0;
 }
 
-static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, 
void *state)
+static int traverse_sessionid(struct db_record *db, void *state)
 {
struct sessionid sessionid;
fstring uid_str, gid_str;
 
-   if (dbuf.dsize != sizeof(sessionid))
+   if (db->value.dsize != sizeof(sessionid))
return 0;
 
-   memcpy(&sessionid, dbuf.dptr, sizeof(sessionid));
+   memcpy(&sessionid, db->value.dptr, sizeof(sessionid));
 
if (!process_exists(sessionid.pid) || !Ucrit_checkUid(sessionid.uid)) {
return 0;
@@ -245,7 +245,7 @@
fstr_sprintf(uid_str, "%d", sessionid.uid);
fstr_sprintf(gid_str, "%d", sessionid.gid);
 
-   d_printf("%s   %-12s  %-12s  %-12s (%s)\n",
+   d_printf("%-7s   %-12s  %-12s  %-12s (%s)\n",
 procid_str_static(&sessionid.pid),
 numeric_only ? uid_str : uidtoname(sessionid.uid),
 numeric_only ? gid_str : gidtoname(sessionid.gid), 
@@ -261,7 +261,6 @@
 {
int c;
int profile_only = 0;
-   TDB_CONTEXT *tdb;
BOOL show_processes, show_locks, show_shares;
poptContext pc;
struct poptOption long_options[] = {
@@ -336,16 +335,18 @@
}
 
if ( show_processes ) {
-   tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, TDB_DEFAULT, 
O_RDONLY, 0);
-   if (!tdb) {
+   struct db_context *db;
+   db = db_open(NULL, lock_path("sessionid.tdb"), 0,
+TDB_DEFAULT, O_RDWR, 0644);
+   if (!db) {
d_printf("sessionid.tdb not initialised\n");
} else {
d_printf("\nSamba version %s\n",SAMBA_VERSION_STRING);
d_printf("PID Username  Group Machine   
 \n");

d_printf("---\n");
 
-   tdb_traverse(tdb, traverse_sessionid, NULL);
-   tdb_close(tdb);
+   db->traverse_read(db, traverse_sessionid, NULL);
+   talloc_free(db);
}
 
if (processes_only) 

Modified: branches/SAMBA_3_0_26/source/utils/status.c
===
--- branches/SAMBA_3_0_26/source/utils/status.c 2007-05-29 18:32:49 UTC (rev 
23222)
+++ branches/SAMBA_3_0_26/source/utils/status.c 2007-05-29 18:41:16 UTC (rev 
23223)
@@ -219,22 +219,22 @@
}
 
d_printf("%-10s   %s   %-12s  %s",
-  crec->servicename,procid_str_static(&crec->pid),
-  crec->machine,
-  time_to_asc(crec->start));
+crec->servicename,procid_str_static(&crec->pid),
+crec->machine,
+time_to_asc(crec->start));
 
return 0;
 }
 
-static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, 
void *state)
+static int traverse_sessionid(struct db_record *db, void *state)
 {
struct sessionid sessionid;
fstring uid_str, gid_str;
 
-   if (dbuf.dsize != sizeof(sessionid))
+   if (db->value.dsize != sizeof(sessionid))
return 0;
 
-   memcpy(&sessionid, dbuf.dptr, sizeof(sessionid));
+   memcpy(&sessionid, db->value.dptr, sizeof(sessionid));
 
if (!process_exists(sessionid.pid) || !Ucrit_checkUid(sessionid.uid)) {
return 0;
@@ -245,7 +245,7 @@
fstr_sprintf(uid_str, "%d", sessionid.uid);
fstr_sprintf(gid_str, "%d", sessionid.gid);
 
-   d_printf("%s   %-12s  %-12s  %-12s (%s)\n",
+   d_printf("%-7s   %-12s  %-12s  %-12s (%s)\n",
 procid_str_static(&sessionid.pid),
 numeric_only ? uid_str : uidtoname(sessionid.uid),
 numeric_only ? gid_str : gidtoname(sessionid.gid), 
@@ -261,7 +261,6 @@
 {
i

svn commit: samba r23224 - in branches: SAMBA_3_0/source SAMBA_3_0/source/lib SAMBA_3_0/source/libsmb SAMBA_3_0_26/source SAMBA_3_0_26/source/lib SAMBA_3_0_26/source/libsmb

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 19:09:38 + (Tue, 29 May 2007)
New Revision: 23224

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

Log:
Move map_nt_error_from_unix to lib/errmap_unix.c. This function is
useful even in binaries that don't link in libsmb

Added:
   branches/SAMBA_3_0/source/lib/errmap_unix.c
   branches/SAMBA_3_0_26/source/lib/errmap_unix.c
Modified:
   branches/SAMBA_3_0/source/Makefile.in
   branches/SAMBA_3_0/source/libsmb/errormap.c
   branches/SAMBA_3_0_26/source/Makefile.in
   branches/SAMBA_3_0_26/source/libsmb/errormap.c


Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===
--- branches/SAMBA_3_0/source/Makefile.in   2007-05-29 18:41:16 UTC (rev 
23223)
+++ branches/SAMBA_3_0/source/Makefile.in   2007-05-29 19:09:38 UTC (rev 
23224)
@@ -276,7 +276,7 @@
  lib/util_unistr.o lib/util_file.o lib/data_blob.o \
  lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
  lib/substitute.o lib/fsusage.o \
- lib/ms_fnmatch.o lib/select.o \
+ lib/ms_fnmatch.o lib/select.o lib/errmap_unix.o \
  lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
  lib/md5.o lib/hmacmd5.o lib/arc4.o lib/iconv.o \
  nsswitch/wb_client.o $(WBCOMMON_OBJ) \

Added: branches/SAMBA_3_0/source/lib/errmap_unix.c
===
--- branches/SAMBA_3_0/source/lib/errmap_unix.c 2007-05-29 18:41:16 UTC (rev 
23223)
+++ branches/SAMBA_3_0/source/lib/errmap_unix.c 2007-05-29 19:09:38 UTC (rev 
23224)
@@ -0,0 +1,92 @@
+/* 
+ *  Unix SMB/CIFS implementation.
+ *  map unix to NT errors, an excerpt of libsmb/errormap.c
+ *  Copyright (C) Andrew Tridgell 2001
+ *  Copyright (C) Andrew Bartlett 2001
+ *  Copyright (C) Tim Potter 2000
+ *  Copyright (C) Jeremy Allison 2007
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "includes.h"
+
+/* Mapping from Unix, to NT error numbers */
+
+const struct unix_error_map unix_dos_nt_errmap[] = {
+   { EPERM, ERRDOS, ERRnoaccess, NT_STATUS_ACCESS_DENIED },
+   { EACCES, ERRDOS, ERRnoaccess, NT_STATUS_ACCESS_DENIED },
+   { ENOENT, ERRDOS, ERRbadfile, NT_STATUS_OBJECT_NAME_NOT_FOUND },
+   { ENOTDIR, ERRDOS, ERRbadpath,  NT_STATUS_NOT_A_DIRECTORY },
+   { EIO, ERRHRD, ERRgeneral, NT_STATUS_IO_DEVICE_ERROR },
+   { EBADF, ERRSRV, ERRsrverror, NT_STATUS_INVALID_HANDLE },
+   { EINVAL, ERRSRV, ERRsrverror, NT_STATUS_INVALID_HANDLE },
+   { EEXIST, ERRDOS, ERRfilexists, NT_STATUS_OBJECT_NAME_COLLISION},
+   { ENFILE, ERRDOS, ERRnofids, NT_STATUS_TOO_MANY_OPENED_FILES },
+   { EMFILE, ERRDOS, ERRnofids, NT_STATUS_TOO_MANY_OPENED_FILES },
+   { ENOSPC, ERRHRD, ERRdiskfull, NT_STATUS_DISK_FULL },
+   { ENOMEM, ERRDOS, ERRnomem, NT_STATUS_NO_MEMORY },
+   { EISDIR, ERRDOS, ERRnoaccess, NT_STATUS_FILE_IS_A_DIRECTORY},
+   { EMLINK, ERRDOS, ERRgeneral, NT_STATUS_TOO_MANY_LINKS },
+   { EINTR,  ERRHRD, ERRgeneral, NT_STATUS_RETRY },
+#ifdef EDQUOT
+   { EDQUOT, ERRHRD, ERRdiskfull, NT_STATUS_DISK_FULL }, /* Windows apps 
need this, not NT_STATUS_QUOTA_EXCEEDED */
+#endif
+#ifdef ENOTEMPTY
+   { ENOTEMPTY, ERRDOS, ERRnoaccess, NT_STATUS_DIRECTORY_NOT_EMPTY },
+#endif
+#ifdef EXDEV
+   { EXDEV, ERRDOS, ERRdiffdevice, NT_STATUS_NOT_SAME_DEVICE },
+#endif
+#ifdef EROFS
+   { EROFS, ERRHRD, ERRnowrite, NT_STATUS_ACCESS_DENIED },
+#endif
+#ifdef ENAMETOOLONG
+   { ENAMETOOLONG, ERRDOS, 206, NT_STATUS_OBJECT_NAME_INVALID },
+#endif
+#ifdef EFBIG
+   { EFBIG, ERRHRD, ERRdiskfull, NT_STATUS_DISK_FULL },
+#endif
+#ifdef ENOBUFS
+   { ENOBUFS, ERRDOS, ERRnomem, NT_STATUS_INSUFFICIENT_RESOURCES },
+#endif
+   { EAGAIN, ERRDOS, 111, NT_STATUS_NETWORK_BUSY },
+#ifdef EWOULDBLOCK
+   { EWOULDBLOCK, ERRDOS, 111, NT_STATUS_NETWORK_BUSY },
+#endif
+   { 0, 0, 0, NT_STATUS_OK }
+};
+
+/*
+ Map an NT error code from a Unix error code.
+*/
+
+NTSTATUS map_nt_error_from_unix(int unix_error)
+{
+   int i = 0;
+
+   if (unix_error == 0)
+   return NT

svn commit: samba r23225 - in branches/SAMBA_3_0/source/nsswitch: .

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 19:31:57 + (Tue, 29 May 2007)
New Revision: 23225

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

Log:
Attached find a patch that makes use of NetSamLogonEx in
winbind. With this and W2k3 DCs around it is possible to use
more than one winbind on the same machine account, because
NetSamLogonEx does not use the credentials chain.

I added the flag domain->can_do_samlogon_ex because this
only works against W2k3 and with schannel. The theory is to
try if we're AD and have schannel, and fall back to
NetSamLogon if this fails. can_do_samlogon_ex is thus a
protection against multiple failures.

Only checking into 3_0, this needs more review before going
into a production release.

Feel free to comment :-)


Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd.h
   branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.h
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd.h   2007-05-29 19:09:38 UTC 
(rev 23224)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd.h   2007-05-29 19:31:57 UTC 
(rev 23225)
@@ -169,6 +169,14 @@
time_t startup_time;   /* When we set "startup" true. */
BOOL startup;  /* are we in the first 30 
seconds after startup_time ? */
 
+   BOOL can_do_samlogon_ex; /* Due to the lack of finer control what type
+ * of DC we have, let us try to do a
+ * credential-chain less samlogon_ex call
+ * with AD and schannel. If this fails with
+ * DCERPC_FAULT_OP_RNG_ERROR, then set this
+ * to False. This variable is around so that
+ * we don't have to try _ex every time. */
+
/* Lookup methods for this domain (LDAP or RPC) */
struct winbindd_methods *methods;
 

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c2007-05-29 19:09:38 UTC 
(rev 23224)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c2007-05-29 19:31:57 UTC 
(rev 23225)
@@ -2201,6 +2201,12 @@
  no_schannel:
if ((lp_client_schannel() == False) ||
((neg_flags & NETLOGON_NEG_SCHANNEL) == 0)) {
+
+   /*
+* NetSamLogonEx only works for schannel
+*/
+   domain->can_do_samlogon_ex = False;
+
/* We're done - just keep the existing connection to NETLOGON
 * open */
conn->netlogon_pipe = netlogon_pipe;
@@ -2232,6 +2238,11 @@
return !NT_STATUS_IS_OK(result) ? result : 
NT_STATUS_PIPE_NOT_AVAILABLE;
}
 
+   /*
+* Try NetSamLogonEx for AD domains
+*/
+   domain->can_do_samlogon_ex = domain->active_directory;
+   
*cli = conn->netlogon_pipe;
return NT_STATUS_OK;
 }

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2007-05-29 19:09:38 UTC 
(rev 23224)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2007-05-29 19:31:57 UTC 
(rev 23225)
@@ -1200,6 +1200,17 @@
/* check authentication loop */
 
do {
+   NTSTATUS (*logon_fn)(struct rpc_pipe_client
+*cli, TALLOC_CTX *mem_ctx,
+uint32 logon_parameters,
+const char *server,
+const char *username,
+const char *domain,
+const char *workstation, 
+const uint8 chal[8], 
+DATA_BLOB lm_response,
+DATA_BLOB nt_response,
+NET_USER_INFO_3 *info3);
 
ZERO_STRUCTP(my_info3);
retry = False;
@@ -1211,7 +1222,11 @@
goto done;
}
 
-   result = rpccli_netlogon_sam_network_logon(netlogon_pipe,
+   logon_fn = contact_domain->can_do_samlogon_ex
+   ? rpccli_netlogon_sam_network_logon_ex
+   : rpccli_netlogon_sam_network_logon;
+
+   result = logon_fn(netlogon_pipe,
   state->mem_ctx,
   0,
   
contact_domain->dcname, /* server name */
@@ -1222,6 +1

svn commit: samba r23226 - in branches: SAMBA_3_0/source/lib SAMBA_3_0_26/source/lib

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 19:36:13 + (Tue, 29 May 2007)
New Revision: 23226

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

Log:
Make the "debug prefix timestamp" output a bit more readable by making
the debug level alway at least 2 digits

Modified:
   branches/SAMBA_3_0/source/lib/debug.c
   branches/SAMBA_3_0_26/source/lib/debug.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/debug.c
===
--- branches/SAMBA_3_0/source/lib/debug.c   2007-05-29 19:31:57 UTC (rev 
23225)
+++ branches/SAMBA_3_0/source/lib/debug.c   2007-05-29 19:36:13 UTC (rev 
23226)
@@ -979,7 +979,7 @@
   
/* Print it all out at once to prevent split syslog output. */
if( lp_debug_prefix_timestamp() ) {
-   (void)Debug1( "[%s, %d%s] ",
+   (void)Debug1( "[%s, %2d%s] ",
current_timestring(lp_debug_hires_timestamp()), level,
header_str);
} else {

Modified: branches/SAMBA_3_0_26/source/lib/debug.c
===
--- branches/SAMBA_3_0_26/source/lib/debug.c2007-05-29 19:31:57 UTC (rev 
23225)
+++ branches/SAMBA_3_0_26/source/lib/debug.c2007-05-29 19:36:13 UTC (rev 
23226)
@@ -979,7 +979,7 @@
   
/* Print it all out at once to prevent split syslog output. */
if( lp_debug_prefix_timestamp() ) {
-   (void)Debug1( "[%s, %d%s] ",
+   (void)Debug1( "[%s, %2d%s] ",
current_timestring(lp_debug_hires_timestamp()), level,
header_str);
} else {



svn commit: samba r23227 - in branches/SAMBA_3_0_26/source/rpc_server: .

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 19:48:34 + (Tue, 29 May 2007)
New Revision: 23227

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

Log:
merge current user to pipe_user changes on the lsa server pipe
Modified:
   branches/SAMBA_3_0_26/source/rpc_server/srv_lsa_nt.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/rpc_server/srv_lsa_nt.c
===
--- branches/SAMBA_3_0_26/source/rpc_server/srv_lsa_nt.c2007-05-29 
19:36:13 UTC (rev 23226)
+++ branches/SAMBA_3_0_26/source/rpc_server/srv_lsa_nt.c2007-05-29 
19:48:34 UTC (rev 23227)
@@ -544,7 +544,7 @@
lsa_get_generic_sd(p->mem_ctx, &psd, &sd_size);
 
if(!se_access_check(psd, p->pipe_user.nt_user_token, des_access, 
&acc_granted, &status)) {
-   if (geteuid() != 0) {
+   if (p->pipe_user.ut.uid != sec_initial_uid()) {
return status;
}
DEBUG(4,("ACCESS should be DENIED (granted: %#010x;  required: 
%#010x)\n",
@@ -554,7 +554,7 @@
 
/* This is needed for lsa_open_account and rpcclient  :-) */
 
-   if (geteuid() == 0)
+   if (p->pipe_user.ut.uid == sec_initial_uid())
acc_granted = POLICY_ALL_ACCESS;
 
/* associate the domain SID with the (unique) handle. */
@@ -875,7 +875,12 @@
 
if (name->type == SID_NAME_UNKNOWN) {
name->dom_idx = -1;
-   /* unknown sids should return the string representation 
of the SID */
+   /* Unknown sids should return the string
+* representation of the SID. Windows 2003 behaves
+* rather erratic here, in many cases it returns the
+* RID as 8 bytes hex, in others it returns the full
+* SID. We (Jerry/VL) could not figure out which the
+* hard cases are, so leave it with the SID.  */
name->name = talloc_asprintf(p->mem_ctx, "%s", 
 
sid_string_static(sids[i]));
if (name->name == NULL) {
@@ -1769,7 +1774,6 @@
struct lsa_info *info = NULL;
SE_PRIV mask;
PRIVILEGE_SET *set = NULL;
-   struct current_user user;
 
/* find the connection policy handle. */
if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
@@ -1778,8 +1782,7 @@
/* check to see if the pipe_user is root or a Domain Admin since 
   account_pol.tdb was already opened as root, this is all we have */
   
-   get_current_user( &user, p );
-   if ( user.ut.uid != sec_initial_uid() 
+   if ( p->pipe_user.ut.uid != sec_initial_uid() 
&& !nt_token_check_domain_rid( p->pipe_user.nt_user_token, 
DOMAIN_GROUP_RID_ADMINS ) )
{
return NT_STATUS_ACCESS_DENIED;
@@ -1810,7 +1813,6 @@
struct lsa_info *info = NULL;
SE_PRIV mask;
PRIVILEGE_SET *set = NULL;
-   struct current_user user;
 
/* find the connection policy handle. */
if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
@@ -1819,8 +1821,7 @@
/* check to see if the pipe_user is root or a Domain Admin since 
   account_pol.tdb was already opened as root, this is all we have */
   
-   get_current_user( &user, p );
-   if ( user.ut.uid != sec_initial_uid()
+   if ( p->pipe_user.ut.uid != sec_initial_uid()
&& !nt_token_check_domain_rid( p->pipe_user.nt_user_token, 
DOMAIN_GROUP_RID_ADMINS ) ) 
{
return NT_STATUS_ACCESS_DENIED;
@@ -1971,7 +1972,6 @@
DOM_SID sid;
fstring privname;
UNISTR4_ARRAY *uni_privnames = q_u->rights;
-   struct current_user user;

 
/* find the connection policy handle. */
@@ -1981,8 +1981,7 @@
/* check to see if the pipe_user is a Domain Admin since 
   account_pol.tdb was already opened as root, this is all we have */
   
-   get_current_user( &user, p );
-   if ( user.ut.uid != sec_initial_uid()
+   if ( p->pipe_user.ut.uid != sec_initial_uid()
&& !nt_token_check_domain_rid( p->pipe_user.nt_user_token, 
DOMAIN_GROUP_RID_ADMINS ) ) 
{
return NT_STATUS_ACCESS_DENIED;
@@ -2029,7 +2028,6 @@
DOM_SID sid;
fstring privname;
UNISTR4_ARRAY *uni_privnames = q_u->rights;
-   struct current_user user;

 
/* find the connection policy handle. */
@@ -2039,8 +2037,7 @@
/* check to see if the pipe_user is a Domain Admin since 
   account_pol.tdb was already opened as root, this is all we have */
   
-   get_current_user( &user, p );
-   if ( user.ut.uid != sec_initial_uid()
+   if ( p->pipe_user.ut.uid != sec_initial_uid()
  

svn commit: samba r23228 - in branches: SAMBA_3_0/source/modules SAMBA_3_0_26/source/modules

2007-05-29 Thread vlendec
Author: vlendec
Date: 2007-05-29 19:54:26 + (Tue, 29 May 2007)
New Revision: 23228

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

Log:
Merge cleanup to the gpfs module from Tridge. Also potentially disable
gpfs share modes in special situations. This might be split up in
several modules later.

Modified:
   branches/SAMBA_3_0/source/modules/gpfs.c
   branches/SAMBA_3_0_26/source/modules/gpfs.c


Changeset:
Modified: branches/SAMBA_3_0/source/modules/gpfs.c
===
--- branches/SAMBA_3_0/source/modules/gpfs.c2007-05-29 19:48:34 UTC (rev 
23227)
+++ branches/SAMBA_3_0/source/modules/gpfs.c2007-05-29 19:54:26 UTC (rev 
23228)
@@ -25,6 +25,7 @@
 #include "gpfs_gpl.h"
 
 static void *libgpfs_handle = NULL;
+static BOOL gpfs_share_modes;
 
 static int (*gpfs_set_share_fn)(int fd, unsigned int allow, unsigned int deny);
 static int (*gpfs_set_lease_fn)(int fd, unsigned int leaseType);
@@ -39,6 +40,10 @@
unsigned int deny = GPFS_DENY_NONE;
int result;
 
+   if (!gpfs_share_modes) {
+   return True;
+   }
+
if (gpfs_set_share_fn == NULL) {
return False;
}
@@ -84,6 +89,10 @@
 {
int gpfs_type = GPFS_LEASE_NONE;
 
+   if (!gpfs_share_modes) {
+   return True;
+   }
+
if (gpfs_set_lease_fn == NULL) {
errno = EINVAL;
return -1;
@@ -138,15 +147,7 @@
if (gpfs_set_share_fn == NULL) {
DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
  "'gpfs_set_share'\n"));
-   sys_dlclose(libgpfs_handle);
-
-   /* leave libgpfs_handle != NULL around, no point
-  in trying twice */
-   gpfs_set_share_fn = NULL;
-   gpfs_set_lease_fn = NULL;
-   gpfs_getacl_fn = NULL;
-   gpfs_putacl_fn = NULL;
-   return;
+   goto failed;
}
 
gpfs_set_lease_fn = sys_dlsym(libgpfs_handle, "gpfs_set_lease");
@@ -155,45 +156,39 @@
  "'gpfs_set_lease'\n"));
sys_dlclose(libgpfs_handle);
 
-   /* leave libgpfs_handle != NULL around, no point
-  in trying twice */
-   gpfs_set_share_fn = NULL;
-   gpfs_set_lease_fn = NULL;
-   gpfs_getacl_fn = NULL;
-   gpfs_putacl_fn = NULL;
-   return;
+   goto failed;
}
 
gpfs_getacl_fn = sys_dlsym(libgpfs_handle, "gpfs_getacl");
if (gpfs_getacl_fn == NULL) {
DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
  "'gpfs_getacl'\n"));
-   sys_dlclose(libgpfs_handle);
-
-   /* leave libgpfs_handle != NULL around, no point
-  in trying twice */
-   gpfs_set_share_fn = NULL;
-   gpfs_set_lease_fn = NULL;
-   gpfs_getacl_fn = NULL;
-   gpfs_putacl_fn = NULL;
-   return;
+   goto failed;
}
 
gpfs_putacl_fn = sys_dlsym(libgpfs_handle, "gpfs_putacl");
if (gpfs_putacl_fn == NULL) {
DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
  "'gpfs_putacl'\n"));
-   sys_dlclose(libgpfs_handle);
+   goto failed;
+   }
 
-   /* leave libgpfs_handle != NULL around, no point
-  in trying twice */
-   gpfs_set_share_fn = NULL;
-   gpfs_set_lease_fn = NULL;
-   gpfs_getacl_fn = NULL;
-   gpfs_putacl_fn = NULL;
-   return;
+   if (lp_parm_bool(-1, "gpfs", "sharemodes", True)) {
+   gpfs_share_modes = True;
+   } else {
+   gpfs_share_modes = False;
}
 
+   return;
+
+failed:
+   sys_dlclose(libgpfs_handle);
+   /* leave libgpfs_handle != NULL around, no point
+  in trying twice */
+   gpfs_set_share_fn = NULL;
+   gpfs_set_lease_fn = NULL;
+   gpfs_getacl_fn = NULL;
+   gpfs_putacl_fn = NULL;
 }
 
 #else

Modified: branches/SAMBA_3_0_26/source/modules/gpfs.c
===
--- branches/SAMBA_3_0_26/source/modules/gpfs.c 2007-05-29 19:48:34 UTC (rev 
23227)
+++ branches/SAMBA_3_0_26/source/modules/gpfs.c 2007-05-29 19:54:26 UTC (rev 
23228)
@@ -25,6 +25,7 @@
 #include "gpfs_gpl.h"
 
 static void *libgpfs_handle = NULL;
+static BOOL gpfs_share_modes;
 
 static int (*gpfs_set_share_fn)(int fd, unsigned int allow, unsigned int deny);
 static int (*gpfs_set_lease_fn)(int fd, unsigned int leaseType);
@@ -39,6 +40,10 @@
unsigned int deny = GPFS_DENY_NONE;
int result;
 
+   if (!gpfs_share_modes) {
+   return True;
+   }
+
if (gpfs_set_share_fn == NULL) {
re

svn commit: samba r23229 - in branches/SAMBA_3_0_26/source/librpc: . gen_ndr idl tools

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 20:09:45 + (Tue, 29 May 2007)
New Revision: 23229

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

Log:
copy all of the librpc directory frmo SAMBA_3_0 (including gen_ndr)
Added:
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_dfs.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_dfs.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_echo.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_echo.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_epmapper.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_epmapper.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_eventlog.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_eventlog.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_initshutdown.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_initshutdown.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_lsa.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_lsa.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_netlogon.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_netlogon.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_srvsvc.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_srvsvc.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_svcctl.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_svcctl.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_unixinfo.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_unixinfo.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_winreg.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/cli_winreg.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/dfs.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/echo.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/epmapper.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/eventlog.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/initshutdown.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_dcerpc.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_dfs.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_dfs.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_echo.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_echo.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_epmapper.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_epmapper.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_eventlog.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_eventlog.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_initshutdown.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_initshutdown.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_lsa.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_lsa.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_misc.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_netlogon.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_netlogon.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_security.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_srvsvc.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_svcctl.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_svcctl.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_unixinfo.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_unixinfo.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_winreg.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/ndr_winreg.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/netlogon.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_dfs.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_dfs.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_echo.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_echo.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_epmapper.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_epmapper.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_eventlog.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_eventlog.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_initshutdown.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_initshutdown.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_lsa.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_lsa.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_netlogon.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_netlogon.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_srvsvc.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_srvsvc.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_svcctl.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_svcctl.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_unixinfo.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_unixinfo.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_winreg.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/srv_winreg.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/tables.c
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/unixinfo.h
   branches/SAMBA_3_0_26/source/librpc/gen_ndr/winreg.h
   branches/SAMBA_3_0_26/source/librpc/idl/dfs.idl
   branches/SAMBA_3_0_26/source/librpc/idl/echo.idl
   branches/SAMBA

svn commit: samba r23230 - in branches/SAMBA_3_0_26/source: . include libmsrpc python rpc_client rpc_parse rpc_server rpcclient utils

2007-05-29 Thread jerry
Author: jerry
Date: 2007-05-29 20:12:48 + (Tue, 29 May 2007)
New Revision: 23230

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

Log:
Adopt Volker's approach to integrating the pidl output
and use the srv_xxx_proxy() method.  

Merge the existing proxied lsa server calls from SAMBA_3_0
Merge the rpccli_lsa_close -> rpccli_lsa_Close change


Modified:
   branches/SAMBA_3_0_26/source/Makefile.in
   branches/SAMBA_3_0_26/source/include/rpc_client.h
   branches/SAMBA_3_0_26/source/libmsrpc/cac_lsarpc.c
   branches/SAMBA_3_0_26/source/python/py_lsa.c
   branches/SAMBA_3_0_26/source/rpc_client/cli_lsarpc.c
   branches/SAMBA_3_0_26/source/rpc_parse/parse_lsa.c
   branches/SAMBA_3_0_26/source/rpc_server/srv_lsa.c
   branches/SAMBA_3_0_26/source/rpc_server/srv_lsa_nt.c
   branches/SAMBA_3_0_26/source/rpc_server/srv_pipe.c
   branches/SAMBA_3_0_26/source/rpcclient/cmd_lsarpc.c
   branches/SAMBA_3_0_26/source/rpcclient/cmd_test.c
   branches/SAMBA_3_0_26/source/rpcclient/rpcclient.c
   branches/SAMBA_3_0_26/source/utils/net_domain.c
   branches/SAMBA_3_0_26/source/utils/net_rpc.c
   branches/SAMBA_3_0_26/source/utils/net_rpc_join.c
   branches/SAMBA_3_0_26/source/utils/net_rpc_rights.c
   branches/SAMBA_3_0_26/source/utils/net_util.c


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


svn commit: samba r23231 - in branches/SAMBA_4_0/source/torture/rpc: .

2007-05-29 Thread jmcd
Author: jmcd
Date: 2007-05-29 21:50:17 + (Tue, 29 May 2007)
New Revision: 23231

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

Log:
Fix make test on build farm for 64-bit hosts.  There's no reason this should
be any different for 64-bit hosts, but we probably are lucking out on other
fields here as well.  The "fields_present" field shouldn't just be copied
from usrmgr traces, because it indicates which fields should be set, and
in this case, we were setting the kickoff time (NOT the expired time) to some
random date.

Modified:
   branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c   2007-05-29 20:12:48 UTC 
(rev 23230)
+++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c   2007-05-29 21:50:17 UTC 
(rev 23231)
@@ -582,6 +582,7 @@
qui.out.info->info21.force_password_change = 0;
qui.out.info->info21.account_name.string = NULL;
qui.out.info->info21.rid = 0;
+   qui.out.info->info21.acct_expiry = 0;
qui.out.info->info21.fields_present = 0x81827fa; /* copy 
usrmgr.exe */
 
u_info.info21 = qui.out.info->info21;



svn commit: samba r23232 - in branches/SAMBA_4_0/source/setup: .

2007-05-29 Thread abartlet
Author: abartlet
Date: 2007-05-29 23:24:42 + (Tue, 29 May 2007)
New Revision: 23232

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

Log:
Add in some extra files required by the new provision-backend.

(sorry for breaking the build)

Andrew Bartlett

Added:
   branches/SAMBA_4_0/source/setup/modules.conf
Modified:
   branches/SAMBA_4_0/source/setup/DB_CONFIG


Changeset:
Modified: branches/SAMBA_4_0/source/setup/DB_CONFIG
===
--- branches/SAMBA_4_0/source/setup/DB_CONFIG   2007-05-29 21:50:17 UTC (rev 
23231)
+++ branches/SAMBA_4_0/source/setup/DB_CONFIG   2007-05-29 23:24:42 UTC (rev 
23232)
@@ -0,0 +1,23 @@
+# Set the database in memory cache size.
+#
+set_cachesize   0   5242880
+
+
+#
+# Set database flags (this is a test environment, we don't need to fsync()).
+#  
+set_flags   DB_TXN_NOSYNC
+
+#
+ Set log values.
+#
+set_lg_regionmax104857
+set_lg_max  1048576
+set_lg_bsize209715
+set_lg_dir  ${LDAPDBDIR}/bdb-logs
+
+
+#
+# Set temporary file creation directory.
+#  
+set_tmp_dir ${LDAPDBDIR}/tmp

Added: branches/SAMBA_4_0/source/setup/modules.conf
===
--- branches/SAMBA_4_0/source/setup/modules.conf2007-05-29 21:50:17 UTC 
(rev 23231)
+++ branches/SAMBA_4_0/source/setup/modules.conf2007-05-29 23:24:42 UTC 
(rev 23232)
@@ -0,0 +1 @@
+#OpenLDAP modules configuration file for ${REALM}



Build status as of Wed May 30 00:00:02 2007

2007-05-29 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-05-29 
00:01:18.0 +
+++ /home/build/master/cache/broken_results.txt 2007-05-30 00:00:20.0 
+
@@ -1,4 +1,4 @@
-Build status as of Tue May 29 00:00:02 2007
+Build status as of Wed May 30 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 
@@ -7,19 +7,19 @@
 ccache   33 6  0 
 ctdb 0  0  0 
 distcc   2  0  0 
-ldb  33 9  0 
-libreplace   32 13 0 
-lorikeet-heimdal 28 17 0 
+ldb  32 9  0 
+libreplace   31 12 0 
+lorikeet-heimdal 27 17 0 
 pidl 16 2  0 
 ppp  12 0  0 
 python   0  0  0 
-rsync34 13 0 
+rsync33 13 0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba-gtk3  2  0 
-samba4   30 20 3 
-samba_3_034 19 0 
-smb-build31 30 0 
-talloc   34 6  0 
-tdb  33 5  0 
+samba-gtk2  2  0 
+samba4   30 21 3 
+samba_3_033 18 0 
+smb-build30 30 0 
+talloc   33 6  0 
+tdb  32 3  0 
 


Rev 393: auto-restart NFS if its running when we release an IP in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 393
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 10:21:16 +1000
message:
  auto-restart NFS if its running when we release an IP
modified:
  tools/events   events-20070529030121-04fjh63cxfh8v1pj-1
=== modified file 'tools/events'
--- a/tools/events  2007-05-29 09:34:04 +
+++ b/tools/events  2007-05-30 00:21:16 +
@@ -36,11 +36,18 @@
}
# if we have a local arp entry for this IP then remove it
/sbin/arp -d $ip 2> /dev/null
+   echo $ip >> /etc/ctdb/released_ips
exit 0
;;
 
  recovered)
 # restart any services as necessary, like NFS
+   # 
+   [ -f /etc/ctdb/released_ips ] && {
+   ( /sbin/service nfs status > /dev/null 2>&1 && 
+  /sbin/service nfs restart > /dev/null 2>&1 ) &
+   } > /dev/null 2>&1
+   /bin/rm -f /etc/ctdb/released_ips
exit 0
;;
 



svn commit: samba r23233 - in branches/SAMBA_4_0/source/selftest: .

2007-05-29 Thread abartlet
Author: abartlet
Date: 2007-05-30 00:36:23 + (Wed, 30 May 2007)
New Revision: 23233

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

Log:
Use the schema and basedn files generated by the provision-backend script.

(Moving towards using only the script's output, one step at a time).

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/selftest/Samba4.pm


Changeset:
Modified: branches/SAMBA_4_0/source/selftest/Samba4.pm
===
--- branches/SAMBA_4_0/source/selftest/Samba4.pm2007-05-29 23:24:42 UTC 
(rev 23232)
+++ branches/SAMBA_4_0/source/selftest/Samba4.pm2007-05-30 00:36:23 UTC 
(rev 23233)
@@ -332,12 +332,9 @@
write_openldap_dbconfig("$ldapdir/db/config");
write_openldap_dbconfig("$ldapdir/db/schema");
 
-   #This uses the provision we just did, to read out the schema
-   system("$self->{bindir}/ad2oLschema $configuration -H 
$privatedir/sam.ldb -I $self->{setupdir}/schema-map-openldap-2.3 -O 
$ldapdir/ad.schema >&2") == 0 or die("schema conversion for OpenLDAP failed");
+   #This uses the provision-backend we just did, to read out the schema
+   system("$self->{bindir}/ad2oLschema $configuration -H 
$ldapdir/schema-tmp.ldb -I $self->{setupdir}/schema-map-openldap-2.3 -O 
$ldapdir/ad.schema >&2") == 0 or die("schema conversion for OpenLDAP failed");
 
-   #Now create an LDAP baseDN
-   system("$self->{bindir}/smbscript $self->{setupdir}/provision 
$provision_options --ldap-base >&2") == 0 or die("creating an OpenLDAP basedn 
failed");
-
my $oldpath = $ENV{PATH};
$ENV{PATH} = "/usr/local/sbin:/usr/sbin:/sbin:$ENV{PATH}";
 



svn commit: samba r23234 - in branches/SAMBA_3_0_25/packaging/Debian/debian-sarge: . patches

2007-05-29 Thread idra
Author: idra
Date: 2007-05-30 00:40:31 + (Wed, 30 May 2007)
New Revision: 23234

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

Log:

Update debian-sarge packaging


Removed:
   
branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/patches/undefined-symbols.patch
Modified:
   branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/changelog
   
branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/patches/documentation.patch
   branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/patches/fhs.patch
   
branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/patches/non-linux-ports.patch
   branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/patches/samba.patch


Changeset:
Modified: branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/changelog
===
--- branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/changelog   
2007-05-30 00:36:23 UTC (rev 23233)
+++ branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/changelog   
2007-05-30 00:40:31 UTC (rev 23234)
@@ -1,3 +1,34 @@
+samba (3.0.25a-1) stable; urgency=high
+
+  * samba 3.0.25a Stabilizing release
+  * Includes Security fixes release with 3.0.24a and 3.0.25
+
+ -- Simo Sorce <[EMAIL PROTECTED]>  Mon, 28 May 2007 20:45:30 -0400
+
+samba (3.0.24-1) stable; urgency=high
+
+  * samba 3.0.24 Security Release
+
+ -- Simo Sorce <[EMAIL PROTECTED]>  Mon, 19 Feb 2007 15:53:30 -0500
+
+samba (3.0.23d-1) stable; urgency=low
+
+  * samba 3.0.23d Samba Team Release
+
+ -- Simo Sorce <[EMAIL PROTECTED]>  Fri, 17 Nov 2006 15:39:30 -0500
+
+samba (3.0.23c-1) stable; urgency=low
+
+  * samba 3.0.23c Samba Team Release
+
+ -- Simo Sorce <[EMAIL PROTECTED]>  Fri, 8  Sep 2006 14:12:30 -0400
+
+samba (3.0.23a-1) stable; urgency=low
+
+  * samba 3.0.23a Samba Team Release
+
+ -- Simo Sorce <[EMAIL PROTECTED]>  Tue, 1  Aug 2006 22:01:30 -0400
+
 samba (3.0.23-1) stable; urgency=low
 
   * samba 3.0.23 Samba Team Release

Modified: 
branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/patches/documentation.patch
===
--- 
branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/patches/documentation.patch 
2007-05-30 00:36:23 UTC (rev 23233)
+++ 
branches/SAMBA_3_0_25/packaging/Debian/debian-sarge/patches/documentation.patch 
2007-05-30 00:40:31 UTC (rev 23234)
@@ -1,66 +1,66 @@
 --- samba-3.0.4/docs/manpages/swat.8.orig  2004-05-05 10:22:50.0 
-0400
 +++ samba-3.0.4/docs/manpages/swat.8   2004-05-10 13:25:53.0 -0400
-@@ -80,6 +80,13 @@
+@@ -80,4 +80,10 @@
  .SH "INSTALLATION"
- 
  .PP
 +\fBDebian-specific Note\fR: all these steps have already been done for
 +you. However, by default, swat is not enabled. This has been done for
 +security reasons. To enable swat you need to edit /etc/inetd.conf,
 +uncomment the swat entry (usually at the end of the file), and then
 +restart inetd.
-+
 +.PP
  Swat is included as binary package with most distributions\&. The package 
manager in this case takes care of the installation and configuration\&. This 
section is only for those who have compiled swat from scratch\&.
- 
  .PP
-@@ -87,13 +94,13 @@
- 
- .TP 3
- \(bu
+@@ -87,12 +94,12 @@
+ .TP 3n
+ •
 -/usr/local/samba/sbin/swat
 +/usr/sbin/swat
- .TP
- \(bu
+ .TP 3n
+ •
 -/usr/local/samba/swat/images/*
 +/usr/share/samba/swat/images/*
- .TP
- \(bu
+ .TP 3n
+ •
 -/usr/local/samba/swat/help/*
 +/usr/share/samba/swat/help/*
- .LP
- 
  .SS "Inetd Installation"
-@@ -102,7 +109,7 @@
- You need to edit your \fI/etc/inetd\&.conf \fR and \fI/etc/services\fR to 
enable SWAT to be launched via \fBinetd\fR\&.
- 
  .PP
--In \fI/etc/services\fR you need to add a line like this:
-+In \fI/etc/services\fR you need to add a line like this (not needed for 
Debian):
- 
+ You need to edit your
+@@ -125,7 +131,7 @@
  .PP
+ In
+ \fI/etc/services\fR
+-you need to add a line like this:
++you need to add a line like this (not needed for Debian):
+ .PP
  \fBswat 901/tcp\fR
-@@ -114,10 +121,10 @@
- the choice of port number isn't really important except that it should be 
less than 1024 and not currently used (using a number above 1024 presents an 
obscure security hole depending on the implementation details of 
your\fBinetd\fR daemon)\&.
- 
  .PP
--In \fI/etc/inetd\&.conf\fR you should add a line like this:
-+In \fI/etc/inetd\&.conf\fR you should add a line like this (not needed for 
Debian since the maintainer scripts do it automatically. You need to uncomment 
the line, though, because it is added commented out for security reasons):
- 
+@@ -140,9 +146,9 @@
  .PP
--\fBswat stream tcp nowait\&.400 root /usr/local/samba/sbin/swat swat\fR
-+\fBswat stream tcp nowait\&.400 root /usr/sbin/swat swat\fR
- 
+ In
+ \fI/etc/inetd.conf\fR
+-you should add a line like this:
++you should add a line like this (not needed for Debian since the maintainer 
scripts do it automatically. You need to uncomment the line, though, because it 
is added comm

svn commit: samba r23235 - in branches/SAMBA_4_0/source: selftest setup

2007-05-29 Thread abartlet
Author: abartlet
Date: 2007-05-30 01:09:18 + (Wed, 30 May 2007)
New Revision: 23235

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

Log:
Don't do a seperate LDAP provision step.  Instead, everything we need
(including the config files) is created by provision-backend.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/selftest/Samba4.pm
   branches/SAMBA_4_0/source/setup/DB_CONFIG


Changeset:
Modified: branches/SAMBA_4_0/source/selftest/Samba4.pm
===
--- branches/SAMBA_4_0/source/selftest/Samba4.pm2007-05-30 00:40:31 UTC 
(rev 23234)
+++ branches/SAMBA_4_0/source/selftest/Samba4.pm2007-05-30 01:09:18 UTC 
(rev 23235)
@@ -204,137 +204,17 @@
return ($fedora_ds_dir, $pidfile);
 }
 
-sub write_openldap_dbconfig($) {
-my ( $ldapdbdir ) = @_;
-   open(CONF, ">$ldapdbdir/DB_CONFIG");
-   print CONF "
-#
-   # Set the database in memory cache size.
-   #
-   set_cachesize   0   5242880
-   
-   
-   #
-   # Set database flags (this is a test environment, we don't need to 
fsync()).
-   #   
-   set_flags   DB_TXN_NOSYNC
-   
-   #
-   # Set log values.
-   #
-   set_lg_regionmax104857
-   set_lg_max  1048576
-   set_lg_bsize209715
-   set_lg_dir  $ldapdbdir/bdb-logs
-   
-   
-   #
-   # Set temporary file creation directory.
-   #   
-   set_tmp_dir $ldapdbdir/tmp
-   ";
-   close(CONF);
-
-
-}
-
-sub mk_openldap()
+sub mk_openldap($)
 {
-   my ($self, $ldapdir, $basedn, $password, $privatedir, $dnsname, 
$configuration, $provision_options) = @_;
+   my ($self, $ldapdir, $configuration, $basedn, $dnsname, $password) = @_;
 
my $slapd_conf = "$ldapdir/slapd.conf";
my $pidfile = "$ldapdir/slapd.pid";
my $modconf = "$ldapdir/modules.conf";
 
-   mkdir($_, 0777) foreach ($ldapdir, "$ldapdir/db", "$ldapdir/db/user", 
"$ldapdir/db/config", "$ldapdir/db/schema", "$ldapdir/db/bdb-logs", 
-   "$ldapdir/db/tmp");
+   #This uses the backend provision we just did, to read out the schema
+   system("$self->{bindir}/ad2oLschema $configuration 
--option=convert:target=openldap -H $ldapdir/schema-tmp.ldb -I 
$self->{setupdir}/schema-map-openldap-2.3 -O $ldapdir/backend-schema.schema 
>&2") == 0 or die("schema conversion for OpenLDAP failed");
 
-   open(CONF, ">$slapd_conf");
-   print CONF "
-loglevel 0
-
-include $ldapdir/ad.schema
-
-pidfile$pidfile
-argsfile   $ldapdir/slapd.args
-sasl-realm $dnsname
-access to * by * write
-
-allow update_anon
-
-authz-regexp
-  uid=([^,]*),cn=$dnsname,cn=digest-md5,cn=auth
-  ldap:///$basedn??sub?(samAccountName=\$1)
-
-authz-regexp
-  uid=([^,]*),cn=([^,]*),cn=digest-md5,cn=auth
-  ldap:///$basedn??sub?(samAccountName=\$1)
-
-include $modconf
-
-defaultsearchbase \"$basedn\"
-
-backendbdb
-databasebdb
-suffix \"cn=Schema,cn=Configuration,$basedn\"
-directory  $ldapdir/db/schema
-index   objectClass eq
-index   samAccountName eq
-index name eq
-index objectCategory eq
-index lDAPDisplayName eq
-index subClassOf eq
-
-databasebdb
-suffix \"cn=Configuration,$basedn\"
-directory  $ldapdir/db/config
-index   objectClass eq
-index   samAccountName eq
-index name eq
-index objectSid eq
-index objectCategory eq
-index nCName eq pres
-index subClassOf eq
-index dnsRoot eq
-index nETBIOSName eq pres
-
-databasebdb
-suffix \"$basedn\"
-rootdn  \"cn=Manager,$basedn\"
-rootpw  $password
-directory  $ldapdir/db/user
-index   objectClass eq
-index   samAccountName eq
-index name eq
-index objectSid eq
-index objectCategory eq
-index member eq
-index uidNumber eq
-index gidNumber eq
-index unixName eq
-index privilege eq
-index nCName eq pres
-index lDAPDisplayName eq
-index subClassOf eq
-index dnsRoot eq
-index nETBIOSName eq pres
-
-#syncprov is stable in OpenLDAP 2.3, and available in 2.2.  
-#We only need this for the contextCSN attribute anyway
-overlay syncprov
-syncprov-checkpoint 100 10
-syncprov-sessionlog 100
-";
-
-   close(CONF);
-   
-   write_openldap_dbconfig("$ldapdir/db/user");
-   write_openldap_dbconfig("$ldapdir/db/config");
-   write_openldap_dbconfig("$ldapdir/db/schema");
-
-   #This uses the provision-backend we just did, to read out the schema
-   system("$self->{bindir}/ad2oLschema $configuration -H 
$ldapdir/schema-tmp.ldb -I $self->{setupdir}/schema-map-openldap-2.3 -O 
$ldapdir/ad.schema >&2") == 0 or die("schema conversion for OpenLDAP failed");
-
my $oldpath = $ENV{PATH};
$ENV{PATH} = "/usr/local/sbin:/usr/sbin:/sbin:

Rev 396: fixed onnode symlink install in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 396
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 11:17:52 +1000
message:
  fixed onnode symlink install
modified:
  packaging/RHEL/ctdb.spec   ctdb.spec-20070527204758-biuh7znabuwan3zn-3
=== modified file 'packaging/RHEL/ctdb.spec'
--- a/packaging/RHEL/ctdb.spec  2007-05-30 01:00:43 +
+++ b/packaging/RHEL/ctdb.spec  2007-05-30 01:17:52 +
@@ -68,10 +68,10 @@
 install -m755 tools/events $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events
 install -m755 tools/onnode.ssh $RPM_BUILD_ROOT%{_bindir}
 install -m755 tools/onnode.rsh $RPM_BUILD_ROOT%{_bindir}
-ln -sf %{_bindir}/onnode.ssh onnode
+ln -sf %{_bindir}/onnode.ssh $RPM_BUILD_ROOT%{_bindir}/onnode
 
 # unfortunately samba3 needs ctdb_private.h too
-install -m644 include/ctdb_private.h %{_includedir}/ctdb_private.h
+install -m644 include/ctdb_private.h 
$RPM_BUILD_ROOT%{_includedir}/ctdb_private.h
 
 
 # Remove "*.old" files
@@ -109,5 +109,9 @@
 %{_sysconfdir}/ctdb/events
 %{_sbindir}/ctdbd
 %{_bindir}/ctdb
+%{_bindir}/onnode.ssh
+%{_bindir}/onnode.rsh
+%{_bindir}/onnode
 %{_includedir}/ctdb.h
 %{_includedir}/ctdb_private.h
+



Rev 394: moved onnode into ctdb from s3 examples/ctdb in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 394
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 11:00:43 +1000
message:
  moved onnode into ctdb from s3 examples/ctdb
added:
  tools/onnode.rsh   onnode.rsh-20070530010004-83j66tszzvsimcn2-1
  tools/onnode.ssh   onnode.ssh-20070530010004-83j66tszzvsimcn2-3
modified:
  packaging/RHEL/ctdb.spec   ctdb.spec-20070527204758-biuh7znabuwan3zn-3
=== added file 'tools/onnode.rsh'
--- a/tools/onnode.rsh  1970-01-01 00:00:00 +
+++ b/tools/onnode.rsh  2007-05-30 01:00:43 +
@@ -0,0 +1,43 @@
+#!/bin/sh
+# onnode script for rsh
+
+if [ $# -lt 2 ]; then
+cat < 
+EOF
+exit 1
+fi
+
+NODE="$1"
+shift
+SCRIPT="$*"
+
+NODES=/etc/ctdb/nodes
+
+NUMNODES=`egrep '^[[:alnum:]]' $NODES | wc -l`
+MAXNODE=`expr $NUMNODES - 1`
+
+if [ $NODE = "all" ]; then
+for a in `egrep '^[[:alnum:]]' $NODES`; do
+   if [ -f "$SCRIPT" ]; then
+   rsh $a at -f $SCRIPT now
+   else
+   rsh $a $SCRIPT
+   fi
+done
+exit 0
+fi
+
+if [ $NODE -gt $MAXNODE ]; then
+echo "Node $NODE doesn't exist"
+exit 1
+fi
+
+NODEPLUSONE=`expr $NODE + 1`
+a=`egrep '^[[:alnum:]]' $NODES | head -$NODEPLUSONE | tail -1`
+
+if [ -f "$SCRIPT" ]; then
+exec rsh $a at -f $SCRIPT now
+else
+exec rsh $a $SCRIPT
+fi

=== added file 'tools/onnode.ssh'
--- a/tools/onnode.ssh  1970-01-01 00:00:00 +
+++ b/tools/onnode.ssh  2007-05-30 01:00:43 +
@@ -0,0 +1,43 @@
+#!/bin/sh
+# onnode script for ssh
+
+if [ $# -lt 2 ]; then
+cat < 
+EOF
+exit 1
+fi
+
+NODE="$1"
+shift
+SCRIPT="$*"
+
+NODES=/etc/ctdb/nodes
+
+NUMNODES=`egrep '^[[:alnum:]]' $NODES | wc -l`
+MAXNODE=`expr $NUMNODES - 1`
+
+if [ $NODE = "all" ]; then
+for a in `egrep '^[[:alnum:]]' $NODES`; do
+   if [ -f "$SCRIPT" ]; then
+   ssh $a at -f $SCRIPT now
+   else
+   ssh $a $SCRIPT
+   fi
+done
+exit 0
+fi
+
+if [ $NODE -gt $MAXNODE ]; then
+echo "Node $NODE doesn't exist"
+exit 1
+fi
+
+NODEPLUSONE=`expr $NODE + 1`
+a=`egrep '^[[:alnum:]]' $NODES | head -$NODEPLUSONE | tail -1`
+
+if [ -f "$SCRIPT" ]; then
+exec ssh $a at -f $SCRIPT now
+else
+exec ssh $a $SCRIPT
+fi

=== modified file 'packaging/RHEL/ctdb.spec'
--- a/packaging/RHEL/ctdb.spec  2007-05-29 12:53:28 +
+++ b/packaging/RHEL/ctdb.spec  2007-05-30 01:00:43 +
@@ -66,6 +66,9 @@
 install -m644 setup/ctdb.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb
 install -m755 setup/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
 install -m755 tools/events $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events
+install -m755 tools/onnode.ssh $RPM_BUILD_ROOT%{_bindir}
+install -m755 tools/onnode.rsh $RPM_BUILD_ROOT%{_bindir}
+ln -sf %{_bindir}/onnode.ssh onnode
 
 # unfortunately samba3 needs ctdb_private.h too
 install -m644 include/ctdb_private.h %{_includedir}/ctdb_private.h



Rev 395: support ctdb status -n all in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 395
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 11:12:50 +1000
message:
  support ctdb status -n all
modified:
  tools/ctdb_control.c   
ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1
=== modified file 'tools/ctdb_control.c'
--- a/tools/ctdb_control.c  2007-05-29 06:02:02 +
+++ b/tools/ctdb_control.c  2007-05-30 01:12:50 +
@@ -265,7 +265,22 @@
uint32_t recmode, recmaster;
uint32_t myvnn;
 
-   myvnn = ctdb_ctrl_getvnn(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE);
+   if (options.vnn == CTDB_BROADCAST_ALL) {
+   uint32_t *nodes;
+   uint32_t num_nodes;
+   ret = 0;
+
+   nodes = ctdb_get_connected_nodes(ctdb, TIMELIMIT(), ctdb, 
&num_nodes);
+   CTDB_NO_MEMORY(ctdb, nodes);
+   
+   for (i=0;i

Rev 397: wait for local tcp services like smbd to come up before allowing ctdb to start talking to other nodes in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 397
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 12:27:58 +1000
message:
  wait for local tcp services like smbd to come up before allowing ctdb to 
start talking to other nodes
modified:
  common/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  tools/events   events-20070529030121-04fjh63cxfh8v1pj-1
=== modified file 'common/ctdb_daemon.c'
--- a/common/ctdb_daemon.c  2007-05-29 07:23:29 +
+++ b/common/ctdb_daemon.c  2007-05-30 02:27:58 +
@@ -50,6 +50,12 @@
return;
}
 
+   ret = ctdb_event_script(ctdb, "startup");
+   if (ret != 0) {
+   DEBUG(0,("Failed startup event script\n"));
+   return;
+   }
+
/* start the transport running */
if (ctdb->methods->start(ctdb) != 0) {
DEBUG(0,("transport failed to start!\n"));

=== modified file 'tools/events'
--- a/tools/events  2007-05-30 00:21:16 +
+++ b/tools/events  2007-05-30 02:27:58 +
@@ -1,10 +1,28 @@
 #!/bin/sh
 # sample event script for ctdb
 
+. /etc/sysconfig/ctdb
+
 cmd="$1"
 shift
 
 case $cmd in 
+ startup)
+   # wait for local services to come up
+   [ -z "$CTDB_WAIT_TCP_PORTS" ] || {
+ all_ok=0
+ while [ $all_ok -eq 0 ]; do
+ all_ok=1
+ for p in $CTDB_WAIT_TCP_PORTS; do
+ /usr/bin/nc -z 127.0.0.1 $p || all_ok=0
+ done
+ [ $all_ok -eq 1 ] || sleep 1
+  done
+ echo "Local services on $CTDB_WAIT_TCP_PORTS are up"
+   }
+   exit 0; 
+   ;;
+   
  takeip)
if [ $# != 3 ]; then
   echo "must supply interface, IP and maskbits"
@@ -13,6 +31,7 @@
iface=$1
ip=$2
maskbits=$3
+
/sbin/ip addr add $ip/$maskbits dev $iface || {
 echo "Failed to add $ip/$maskbits on dev $iface"
 exit 1



Rev 398: - nice messages while waiting for tcp services to come up in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 398
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 12:37:03 +1000
message:
  - nice messages while waiting for tcp services to come up
  - added more comments to sysconfig file
modified:
  packaging/RHEL/setup/ctdb.sysconfig 
ctdb.sysconfig-20070527204758-biuh7znabuwan3zn-7
  tools/events   events-20070529030121-04fjh63cxfh8v1pj-1
=== modified file 'packaging/RHEL/setup/ctdb.sysconfig'
--- a/packaging/RHEL/setup/ctdb.sysconfig   2007-05-29 06:02:02 +
+++ b/packaging/RHEL/setup/ctdb.sysconfig   2007-05-30 02:37:03 +
@@ -1,15 +1,52 @@
-# Options to ctdbd
-
+# Options to ctdbd. This is read by /etc/init.d/ctdb
+
+# the NODES file must be specified or ctdb won't start
+# it should contain a list of IPs that ctdb will use
+# it must be exactly the same on all cluster nodes
+# defaults to /etc/ctdb/nodes
+# NODES=/etc/ctdb/nodes
+
+# the directory to put the local ctdb database files in
+# defaults to /var/ctdb
 # DBDIR=/var/ctdb
-# NODES=/etc/ctdb/nodes
+
+# the script to run when ctdb needs to ask the OS for help,
+# such as when a IP address needs to be taken or released
+# defaults to /etc/ctdb/events
 # EVENT_SCRIPT=/etc/ctdb/events
+
+# the location of the local ctdb socket
+# defaults to /tmp/ctdb.socket
 # CTDB_SOCKET=/tmp/ctdb.socket
+
+# what transport to use. Only tcp is currently supported
+# defaults to tcp
 # TRANSPORT="tcp"
+
+# should ctdb do IP takeover? If it should, then specify a file
+# containing the list of public IP addresses that ctdb will manage
+# Note that these IPs must be different from those in $NODES above
+# there is no default
 # PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
+
+# when doing IP takeover you also must specify what network interface
+# to use for the public addresses
+# there is no default
 # PUBLIC_INTERFACE=eth0
+
+# where to log messages
+# the default is /var/log/log.ctdb
 # LOGFILE=/var/log/log.ctdb
+
+# what debug level to run at. Higher means more verbose
+# the default is 0
 # DEBUGLEVEL=0
 
-# any other options
+# use this to specify any local tcp ports to wait on before starting
+# ctdb. Use 445 and 139 for Samba
+# the default is not to wait for any local services
+# CTDB_WAIT_TCP_PORTS="445 139"
+
+# any other options you might want. Run ctdbd --help for a list
 # CTDB_OPTIONS=
 

=== modified file 'tools/events'
--- a/tools/events  2007-05-30 02:27:58 +
+++ b/tools/events  2007-05-30 02:37:03 +
@@ -11,6 +11,7 @@
# wait for local services to come up
[ -z "$CTDB_WAIT_TCP_PORTS" ] || {
  all_ok=0
+ echo "Waiting for tcp services on $CTDB_WAIT_TCP_PORTS to come up"
  while [ $all_ok -eq 0 ]; do
  all_ok=1
  for p in $CTDB_WAIT_TCP_PORTS; do
@@ -18,7 +19,7 @@
  done
  [ $all_ok -eq 1 ] || sleep 1
   done
- echo "Local services on $CTDB_WAIT_TCP_PORTS are up"
+ echo "Local tcp services on $CTDB_WAIT_TCP_PORTS are up"
}
exit 0; 
;;



Rev 399: don't start the transport connecting to the other nodes until after the startup event script has run in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 399
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 13:26:50 +1000
message:
  don't start the transport connecting to the other nodes until after the 
startup event script has run
modified:
  common/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  common/ctdb_recoverd.c recoverd.c-20070503213540-bvxuyd9jm1f7ig90-1
  ib/ibw_ctdb_init.c 
ibw_ctdb_init.c-20070102171305-cn2z4k7ibx8141d5-1
  include/ctdb_private.h 
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  takeover/system.c  system.c-20070525071636-a5n1ihghjtppy08r-3
  tcp/tcp_init.c tcp_init.c-20061128004937-x70q1cu5xzg5g2tm-2

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


Rev 400: - use a CTDB_BROADCAST_ALL for the attach message so it goes to currently disconnected nodes in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 400
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 14:35:22 +1000
message:
  - use a CTDB_BROADCAST_ALL for the attach message so it goes to currently 
disconnected nodes
  - start node monitoring only after transport starts
  - check if a node is already disconnected in the node dead function
modified:
  common/ctdb.c  ctdb.c-20061127094323-t50f58d65iaao5of-2
  common/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  common/ctdb_ltdb.c ctdb_ltdb.c-20061128065342-to93h6eejj5kon81-2
=== modified file 'common/ctdb.c'
--- a/common/ctdb.c 2007-05-29 06:23:47 +
+++ b/common/ctdb.c 2007-05-30 04:35:22 +
@@ -371,6 +371,12 @@
 */
 void ctdb_node_dead(struct ctdb_node *node)
 {
+   if (!(node->flags & NODE_FLAGS_CONNECTED)) {
+   DEBUG(1,("%s: node %s is already marked disconnected: %u 
connected\n", 
+node->ctdb->name, node->name, 
+node->ctdb->num_connected));
+   return;
+   }
node->ctdb->num_connected--;
node->flags &= ~NODE_FLAGS_CONNECTED;
node->rx_cnt = 0;
@@ -385,6 +391,12 @@
 */
 void ctdb_node_connected(struct ctdb_node *node)
 {
+   if (node->flags & NODE_FLAGS_CONNECTED) {
+   DEBUG(1,("%s: node %s is already marked connected: %u 
connected\n", 
+node->ctdb->name, node->name, 
+node->ctdb->num_connected));
+   return;
+   }
node->ctdb->num_connected++;
node->dead_count = 0;
node->flags |= NODE_FLAGS_CONNECTED;

=== modified file 'common/ctdb_daemon.c'
--- a/common/ctdb_daemon.c  2007-05-30 03:26:50 +
+++ b/common/ctdb_daemon.c  2007-05-30 04:35:22 +
@@ -50,6 +50,9 @@
DEBUG(0,("Failed to start recovery daemon\n"));
exit(11);
}
+
+   /* start monitoring for dead nodes */
+   ctdb_start_monitoring(ctdb);
 }
 
 /* go into main ctdb loop */
@@ -772,9 +775,6 @@
 
ctdb->ev = event_context_init(NULL);
 
-   /* start monitoring for dead nodes */
-   ctdb_start_monitoring(ctdb);
-
/* start frozen, then let the first election sort things out */
if (!ctdb_blocking_freeze(ctdb)) {
DEBUG(0,("Failed to get initial freeze\n"));

=== modified file 'common/ctdb_ltdb.c'
--- a/common/ctdb_ltdb.c2007-05-29 03:48:30 +
+++ b/common/ctdb_ltdb.c2007-05-30 04:35:22 +
@@ -425,7 +425,7 @@
}

/* tell all the other nodes about this database */
-   ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_VNNMAP, 0,
+   ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, 0,
 CTDB_CONTROL_DB_ATTACH, 0, 
CTDB_CTRL_FLAG_NOREPLY,
 indata, NULL, NULL);
 



Rev 401: we need to listen at transport initialise stage to find our own node number in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 401
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 14:46:14 +1000
message:
  we need to listen at transport initialise stage to find our own node number
modified:
  common/ctdb_monitor.c  
ctdb_monitor.c-20070518100625-8jf4ft1mjzmb22ck-1
  ib/ibw_ctdb_init.c 
ibw_ctdb_init.c-20070102171305-cn2z4k7ibx8141d5-1
  tcp/tcp_init.c tcp_init.c-20061128004937-x70q1cu5xzg5g2tm-2
=== modified file 'common/ctdb_monitor.c'
--- a/common/ctdb_monitor.c 2007-05-20 23:24:34 +
+++ b/common/ctdb_monitor.c 2007-05-30 04:46:14 +
@@ -64,13 +64,14 @@
 
if (node->dead_count >= CTDB_MONITORING_DEAD_COUNT) {
ctdb_node_dead(node);
+   ctdb_send_keepalive(ctdb, node->vnn);
/* maybe tell the transport layer to kill the
   sockets as well?
*/
continue;
}

-   if (node->tx_cnt == 0) {
+   if (node->tx_cnt == 0 && (node->flags & NODE_FLAGS_CONNECTED)) {
ctdb_send_keepalive(ctdb, node->vnn);
}
 

=== modified file 'ib/ibw_ctdb_init.c'
--- a/ib/ibw_ctdb_init.c2007-05-30 03:26:50 +
+++ b/ib/ibw_ctdb_init.c2007-05-30 04:46:14 +
@@ -88,6 +88,10 @@
}
}
 
+   /* listen on our own address */
+   if (ctdb_ibw_listen(ctdb, 10)) /* TODO: backlog as param */
+   return -1;
+
return 0;
 }
 
@@ -99,10 +103,6 @@
 {
int i, ret;
 
-   /* listen on our own address */
-   if (ctdb_ibw_listen(ctdb, 10)) /* TODO: backlog as param */
-   return -1;
-
/* everything async here */
for (i=0;inum_nodes;i++) {
struct ctdb_node *node = ctdb->nodes[i];

=== modified file 'tcp/tcp_init.c'
--- a/tcp/tcp_init.c2007-05-30 03:26:50 +
+++ b/tcp/tcp_init.c2007-05-30 04:46:14 +
@@ -52,6 +52,9 @@
 {
int i;
 
+   /* listen on our own address */
+   if (ctdb_tcp_listen(ctdb) != 0) return -1;
+
for (i=0; inum_nodes; i++) {
if (ctdb_tcp_add_node(ctdb->nodes[i]) != 0) {
DEBUG(0, ("methods->add_node failed at %d\n", i));
@@ -69,9 +72,6 @@
 {
int i;
 
-   /* listen on our own address */
-   if (ctdb_tcp_listen(ctdb) != 0) return -1;
-
/* startup connections to the other servers - will happen on
   next event loop */
for (i=0;inum_nodes;i++) {



Rev 402: close sockets when we exec scripts in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 402
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 15:43:25 +1000
message:
  close sockets when we exec scripts
modified:
  common/ctdb_client.c   ctdb_client.c-20070411010216-3kd8v37k61steeya-1
  common/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  common/ctdb_util.c ctdb_util.c-20061128065342-to93h6eejj5kon81-3
  include/ctdb_private.h 
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  tcp/tcp_connect.c  tcp_connect.c-20061128004937-x70q1cu5xzg5g2tm-1
=== modified file 'common/ctdb_client.c'
--- a/common/ctdb_client.c  2007-05-29 03:58:41 +
+++ b/common/ctdb_client.c  2007-05-30 05:43:25 +
@@ -174,6 +174,9 @@
if (ctdb->daemon.sd == -1) {
return -1;
}
+
+   set_nonblocking(ctdb->daemon.sd);
+   set_close_on_exec(ctdb->daemon.sd);

if (connect(ctdb->daemon.sd, (struct sockaddr *)&addr, sizeof(addr)) == 
-1) {
close(ctdb->daemon.sd);

=== modified file 'common/ctdb_daemon.c'
--- a/common/ctdb_daemon.c  2007-05-30 04:35:22 +
+++ b/common/ctdb_daemon.c  2007-05-30 05:43:25 +
@@ -101,13 +101,6 @@
 }
 
 
-static void set_non_blocking(int fd)
-{
-   unsigned v;
-   v = fcntl(fd, F_GETFL, 0);
-fcntl(fd, F_SETFL, v | O_NONBLOCK);
-}
-
 static void block_signal(int signum)
 {
struct sigaction act;
@@ -585,7 +578,9 @@
if (fd == -1) {
return;
}
-   set_non_blocking(fd);
+
+   set_nonblocking(fd);
+   set_close_on_exec(fd);
 
client = talloc_zero(ctdb, struct ctdb_client);
client->ctdb = ctdb;
@@ -634,6 +629,9 @@
return -1;
}
 
+   set_nonblocking(ctdb->daemon.sd);
+   set_close_on_exec(ctdb->daemon.sd);
+
 #if 0
/* AIX doesn't like this :( */
if (fchown(ctdb->daemon.sd, geteuid(), getegid()) != 0 ||
@@ -643,7 +641,7 @@
}
 #endif
 
-   set_non_blocking(ctdb->daemon.sd);
+   set_nonblocking(ctdb->daemon.sd);
 
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;

=== modified file 'common/ctdb_util.c'
--- a/common/ctdb_util.c2007-05-29 05:15:00 +
+++ b/common/ctdb_util.c2007-05-30 05:43:25 +
@@ -217,3 +217,18 @@
}
 #endif
 }
+
+void set_nonblocking(int fd)
+{
+   unsigned v;
+   v = fcntl(fd, F_GETFL, 0);
+fcntl(fd, F_SETFL, v | O_NONBLOCK);
+}
+
+void set_close_on_exec(int fd)
+{
+   unsigned v;
+   v = fcntl(fd, F_GETFD, 0);
+fcntl(fd, F_SETFD, v | FD_CLOEXEC);
+}
+

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h2007-05-30 03:26:50 +
+++ b/include/ctdb_private.h2007-05-30 05:43:25 +
@@ -955,6 +955,8 @@
   const char *fmt, ...) PRINTF_ATTRIBUTE(3,4);
 void ctdb_release_all_ips(struct ctdb_context *ctdb);
 
+void set_nonblocking(int fd);
+void set_close_on_exec(int fd);
 
 
 #endif

=== modified file 'tcp/tcp_connect.c'
--- a/tcp/tcp_connect.c 2007-05-25 12:07:45 +
+++ b/tcp/tcp_connect.c 2007-05-30 05:43:25 +
@@ -26,14 +26,6 @@
 #include "../include/ctdb_private.h"
 #include "ctdb_tcp.h"
 
-static void set_nonblocking(int fd)
-{
-   unsigned v;
-   v = fcntl(fd, F_GETFL, 0);
-fcntl(fd, F_SETFL, v | O_NONBLOCK);
-}
-
-
 /*
   called when a complete packet has come in - should not happen on this socket
  */
@@ -134,6 +126,7 @@
tnode->fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
 
set_nonblocking(tnode->fd);
+   set_close_on_exec(tnode->fd);
 
ZERO_STRUCT(sock_out);
 #ifdef HAVE_SOCK_SIN_LEN
@@ -213,6 +206,7 @@
in->ctdb = ctdb;
 
set_nonblocking(in->fd);
+   set_close_on_exec(in->fd);
 
 setsockopt(in->fd,SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(one));
 
@@ -322,6 +316,8 @@
return -1;
}
 
+   set_close_on_exec(ctcp->listen_fd);
+
 setsockopt(ctcp->listen_fd,SOL_SOCKET,SO_REUSEADDR,(char 
*)&one,sizeof(one));
 
/* we can either auto-bind to the first available address, or we can



Rev 403: use our own netmask when deciding if we should takeover a IP, not the other nodes in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 403
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 16:11:39 +1000
message:
  use our own netmask when deciding if we should takeover a IP, not the other 
nodes
  - check if ctdb dies while waiting for the startup event
modified:
  takeover/ctdb_takeover.c   
ctdb_takeover.c-20070525071636-a5n1ihghjtppy08r-2
  tools/events   events-20070529030121-04fjh63cxfh8v1pj-1
=== modified file 'takeover/ctdb_takeover.c'
--- a/takeover/ctdb_takeover.c  2007-05-29 06:23:47 +
+++ b/takeover/ctdb_takeover.c  2007-05-30 06:11:39 +
@@ -318,8 +318,9 @@
 j != i;
 j=(j+1)%nodemap->num) {
if ((nodemap->nodes[j].flags & 
NODE_FLAGS_CONNECTED) &&
-   
ctdb_same_subnet(ctdb->nodes[j]->public_address, 
ctdb->nodes[i]->public_address, 
-
ctdb->nodes[i]->public_netmask_bits)) {
+   
ctdb_same_subnet(ctdb->nodes[j]->public_address, 
+
ctdb->nodes[i]->public_address, 
+
ctdb->nodes[j]->public_netmask_bits)) {
ctdb->nodes[i]->takeover_vnn = 
nodemap->nodes[j].vnn;
break;
}

=== modified file 'tools/events'
--- a/tools/events  2007-05-30 02:37:03 +
+++ b/tools/events  2007-05-30 06:11:39 +
@@ -18,6 +18,10 @@
  /usr/bin/nc -z 127.0.0.1 $p || all_ok=0
  done
  [ $all_ok -eq 1 ] || sleep 1
+ /usr/bin/ctdb status > /dev/null 2>&1 || {
+   echo "ctdb daemon has died. Exiting event startup"
+   exit 1
+ }
   done
  echo "Local tcp services on $CTDB_WAIT_TCP_PORTS are up"
}



svn commit: lorikeet r717 - in trunk/fedora-ds: .

2007-05-29 Thread abartlet
Author: abartlet
Date: 2007-05-30 06:19:52 + (Wed, 30 May 2007)
New Revision: 717

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

Log:
Commit my locally modified copy of mmr.pl to control setup of multi-master 
replicatoin in a Fedora DS environment.

Andrew Bartlett

Added:
   trunk/fedora-ds/mmr.pl


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


Rev 404: tell newly connected nodes about any tcp tickle records that we have that they don't have in http://samba.org/~tridge/ctdb

2007-05-29 Thread tridge

revno: 404
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 16:37:39 +1000
message:
  tell newly connected nodes about any tcp tickle records that we have that 
they don't have
modified:
  takeover/ctdb_takeover.c   
ctdb_takeover.c-20070525071636-a5n1ihghjtppy08r-2
=== modified file 'takeover/ctdb_takeover.c'
--- a/takeover/ctdb_takeover.c  2007-05-30 06:11:39 +
+++ b/takeover/ctdb_takeover.c  2007-05-30 06:37:39 +
@@ -463,6 +463,13 @@
 
if (NULL == ctdb_tcp_find(ctdb->tcp_list, tcp)) {
DLIST_ADD(ctdb->tcp_list, tcp);
+   DEBUG(2,("Added tickle info for %s:%u from vnn %u\n",
+inet_ntoa(tcp->daddr.sin_addr), 
ntohs(tcp->daddr.sin_port),
+tcp->vnn));
+   } else {
+   DEBUG(4,("Already had tickle info for %s:%u from vnn %u\n",
+inet_ntoa(tcp->daddr.sin_addr), 
ntohs(tcp->daddr.sin_port),
+tcp->vnn));
}
 
return 0;
@@ -484,7 +491,11 @@
 
tcp = ctdb_tcp_find(ctdb->tcp_list, &t);
if (tcp) {
+   DEBUG(2,("Removed tickle info for %s:%u from vnn %u\n",
+inet_ntoa(tcp->daddr.sin_addr), 
ntohs(tcp->daddr.sin_port),
+tcp->vnn));
DLIST_REMOVE(ctdb->tcp_list, tcp);
+   talloc_free(tcp);
}
 
return 0;
@@ -503,6 +514,24 @@
DLIST_REMOVE(ctdb->tcp_list, tcp);
talloc_free(tcp);
}
+
+   /* and tell the new guy about any that he should have
+  from us */
+   if (tcp->vnn == ctdb->vnn) {
+   struct ctdb_control_tcp_vnn t;
+   TDB_DATA data;
+
+   t.vnn  = tcp->vnn;
+   t.src  = tcp->saddr;
+   t.dest = tcp->daddr;
+
+   data.dptr = (uint8_t *)&t;
+   data.dsize = sizeof(t);
+
+   ctdb_daemon_send_control(ctdb, vnn, 0, 
+CTDB_CONTROL_TCP_ADD,
+0, CTDB_CTRL_FLAG_NOREPLY, 
data, NULL, NULL);
+   }
}
return 0;
 }