svn commit: samba r24614 - in branches/SAMBA_4_0/source: . heimdal/kdc heimdal/kuser heimdal/lib/asn1 heimdal/lib/gssapi/mech heimdal/lib/gssapi/spnego heimdal/lib/hcrypto heimdal/lib/hx509 heimdal/li

2007-08-22 Thread abartlet
Author: abartlet
Date: 2007-08-22 06:46:34 + (Wed, 22 Aug 2007)
New Revision: 24614

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24614

Log:
Merge with current lorikeet-heimdal.  This brings us one step closer
to an alpha release.

Andrew Bartlett

Added:
   branches/SAMBA_4_0/source/heimdal/lib/krb5/krb_err.et
Modified:
   branches/SAMBA_4_0/source/heimdal/kdc/default_config.c
   branches/SAMBA_4_0/source/heimdal/kdc/digest.c
   branches/SAMBA_4_0/source/heimdal/kdc/kaserver.c
   branches/SAMBA_4_0/source/heimdal/kdc/kerberos4.c
   branches/SAMBA_4_0/source/heimdal/kdc/kerberos5.c
   branches/SAMBA_4_0/source/heimdal/kdc/kx509.c
   branches/SAMBA_4_0/source/heimdal/kuser/kinit.c
   branches/SAMBA_4_0/source/heimdal/lib/asn1/asn1_err.et
   branches/SAMBA_4_0/source/heimdal/lib/asn1/der_get.c
   branches/SAMBA_4_0/source/heimdal/lib/asn1/gen.c
   branches/SAMBA_4_0/source/heimdal/lib/asn1/gen_decode.c
   branches/SAMBA_4_0/source/heimdal/lib/asn1/gen_encode.c
   branches/SAMBA_4_0/source/heimdal/lib/asn1/gen_length.c
   branches/SAMBA_4_0/source/heimdal/lib/asn1/k5.asn1
   branches/SAMBA_4_0/source/heimdal/lib/asn1/lex.c
   branches/SAMBA_4_0/source/heimdal/lib/asn1/parse.c
   branches/SAMBA_4_0/source/heimdal/lib/asn1/parse.h
   branches/SAMBA_4_0/source/heimdal/lib/asn1/rfc2459.asn1
   branches/SAMBA_4_0/source/heimdal/lib/asn1/test.asn1
   branches/SAMBA_4_0/source/heimdal/lib/asn1/timegm.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_acquire_cred.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_add_cred.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_canonicalize_name.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_compare_name.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_duplicate_name.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_init_sec_context.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_mech_switch.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_names.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/gss_oid_to_str.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/mech/name.h
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/spnego/accept_sec_context.c
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/spnego/spnego.asn1
   branches/SAMBA_4_0/source/heimdal/lib/hcrypto/hmac.c
   branches/SAMBA_4_0/source/heimdal/lib/hx509/ca.c
   branches/SAMBA_4_0/source/heimdal/lib/hx509/cert.c
   branches/SAMBA_4_0/source/heimdal/lib/hx509/hx509-private.h
   branches/SAMBA_4_0/source/heimdal/lib/hx509/ks_p11.c
   branches/SAMBA_4_0/source/heimdal/lib/hx509/peer.c
   branches/SAMBA_4_0/source/heimdal/lib/hx509/print.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/cache.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/changepw.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/get_cred.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/init_creds.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/init_creds_pw.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/krb5-private.h
   branches/SAMBA_4_0/source/heimdal/lib/krb5/krb5-protos.h
   branches/SAMBA_4_0/source/heimdal/lib/krb5/krb5-v4compat.h
   branches/SAMBA_4_0/source/heimdal/lib/krb5/krb5.h
   branches/SAMBA_4_0/source/heimdal/lib/krb5/krb5_locl.h
   branches/SAMBA_4_0/source/heimdal/lib/krb5/krbhst.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/pkinit.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/plugin.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/rd_priv.c
   branches/SAMBA_4_0/source/heimdal/lib/krb5/v4_glue.c
   branches/SAMBA_4_0/source/heimdal/lib/ntlm/ntlm.c
   branches/SAMBA_4_0/source/heimdal_build/config.mk
   branches/SAMBA_4_0/source/static_deps.mk


Changeset:
Sorry, the patch is too large (4353 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24614


Rev 593: merge from volker in http://samba.org/~tridge/ctdb

2007-08-22 Thread tridge

revno: 593
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Wed 2007-08-22 17:18:55 +1000
message:
  merge from volker
modified:
  common/system_linux.c  system.c-20070525071636-a5n1ihghjtppy08r-3
  doc/ctdb.1.xml ctdb.1.xml-20070608070258-bjuf7701h1qc1b05-2
  doc/ctdbd.1.xmlctdbd.1.xml-20070610004256-jh1qq0ws5zidbmbq-1
=== modified file 'common/system_linux.c'
--- a/common/system_linux.c 2007-08-15 02:34:41 +
+++ b/common/system_linux.c 2007-08-22 07:18:55 +
@@ -161,8 +161,10 @@
 {
uint32_t sum = uint16_checksum(data, n);
uint16_t sum2;
-   sum += uint16_checksum((uint16_t *)ip-saddr, sizeof(ip-saddr));
-   sum += uint16_checksum((uint16_t *)ip-daddr, sizeof(ip-daddr));
+   sum += uint16_checksum((uint16_t *)(void *)ip-saddr,
+  sizeof(ip-saddr));
+   sum += uint16_checksum((uint16_t *)(void *)ip-daddr,
+  sizeof(ip-daddr));
sum += ip-protocol + n;
sum = (sum  0x) + (sum  16);
sum = (sum  0x) + (sum  16);

=== modified file 'doc/ctdb.1.xml'
--- a/doc/ctdb.1.xml2007-08-02 21:53:52 +
+++ b/doc/ctdb.1.xml2007-08-22 07:18:55 +
@@ -59,7 +59,7 @@
   varlistentryterm-Y/term
 listitem
   para
-Produce output in machinereadable form for easier parsing by 
scripts. Not all commands support this option.
+Produce output in machine readable form for easier parsing by 
scripts. Not all commands support this option.
   /para
 /listitem
   /varlistentry
@@ -132,7 +132,7 @@
   OK - This node is fully functional.
 /para
 para
-  DISCONNECTED - This node could not be connected through the network 
and is currently not parcipitating in the cluster. If there is a public IP 
address associated with this node it should have been taken over by a different 
node. No services are running on this node.
+  DISCONNECTED - This node could not be connected through the network 
and is currently not participating in the cluster. If there is a public IP 
address associated with this node it should have been taken over by a different 
node. No services are running on this node.
 /para
 para
   DISABLED - This node has been administratively disabled. This node 
is still functional and participates in the CTDB cluster but its IP addresses 
have been taken over by a different node and no services are currently being 
hosted.
@@ -156,7 +156,7 @@
   refsect3titleVNNMAP/title
 para
   The list of Virtual Node Numbers. This is a list of all nodes that 
actively participates in the cluster and that share the workload of hosting the 
Clustered TDB database records.
-  Only nodes that are parcipitating in the vnnmap can become lmaster 
or dmaster for a database record.
+  Only nodes that are participating in the vnnmap can become lmaster 
or dmaster for a database record.
 /para
   /refsect3
 

=== modified file 'doc/ctdbd.1.xml'
--- a/doc/ctdbd.1.xml   2007-07-10 05:46:05 +
+++ b/doc/ctdbd.1.xml   2007-08-22 07:18:55 +
@@ -319,7 +319,7 @@
 
 para
   DISCONNECTED - This node could not be connected through the network 
-  and is currently not parcipitating in the cluster. If there is a 
+  and is currently not particpating in the cluster. If there is a 
   public IP address associated with this node it should have been taken 
   over by a different node. No services are running on this node.
 /para



Rev 592: merge from volker in http://samba.org/~tridge/ctdb

2007-08-22 Thread tridge

revno: 592
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Wed 2007-08-22 17:16:01 +1000
message:
  merge from volker
modified:
  Makefile.inmakefile.in-20061117234101-o3qt14umlg9en8z0-1
  tests/rb_test.crb_test.c-20070808012115-zxl6646v2t2axezt-1
  utils/smnotify/smnotify.c  smnotify.c-20070803001844-k0ekeu031hzlt8bg-3
=== modified file 'Makefile.in'
--- a/Makefile.in   2007-08-15 05:01:31 +
+++ b/Makefile.in   2007-08-22 07:16:01 +
@@ -135,6 +135,7 @@
 
 clean:
rm -f *.o */*.o */*/*.o */*~
+   rm -f utils/smnotify/gen_xdr.c
rm -f $(BINS) $(SBINS) $(TEST_BINS)
 
 distclean: clean

=== modified file 'tests/rb_test.c'
--- a/tests/rb_test.c   2007-08-15 00:57:21 +
+++ b/tests/rb_test.c   2007-08-22 07:16:01 +
@@ -134,7 +134,7 @@
 
printf(testing trbt_insert32_callback for %d records\n, num_records);
memctx   = talloc_new(NULL);
-   u32array = talloc_array(memctx, uint32_t, num_records);
+   u32array = talloc_array(memctx, uint32_t *, num_records);
tree = trbt_create(memctx, 0);
for (i=0; inum_records; i++) {
u32array[i]  = talloc(u32array, uint32_t);
@@ -175,7 +175,7 @@
printf(testing trbt_insertarray32_callback\n);
memctx   = talloc_new(NULL);
tree = trbt_create(memctx, 0);
-   u32array = talloc_array(memctx, uint32_t, 4);
+   u32array = talloc_array(memctx, uint32_t *, 4);
for (i=0;i4;i++) {
u32array[i]  = talloc(u32array, uint32_t);
*u32array[i] = 0;

=== modified file 'utils/smnotify/smnotify.c'
--- a/utils/smnotify/smnotify.c 2007-08-03 00:47:37 +
+++ b/utils/smnotify/smnotify.c 2007-08-22 07:16:01 +
@@ -28,7 +28,7 @@
 
 static char *client   = NULL;
 static const char *ip = NULL;
-static const char *server = NULL;
+static char *server = NULL;
 static int stateval   = 0;
 static int clientport = 0;
 static int sendport   = 0;



svn commit: samba r24615 - in branches: SAMBA_3_2/source/nsswitch SAMBA_3_2_0/source/nsswitch

2007-08-22 Thread gd
Author: gd
Date: 2007-08-22 09:32:37 + (Wed, 22 Aug 2007)
New Revision: 24615

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24615

Log:
Say for which domain the getdcname request failed.

Guenther

Modified:
   branches/SAMBA_3_2/source/nsswitch/winbindd_misc.c
   branches/SAMBA_3_2_0/source/nsswitch/winbindd_misc.c


Changeset:
Modified: branches/SAMBA_3_2/source/nsswitch/winbindd_misc.c
===
--- branches/SAMBA_3_2/source/nsswitch/winbindd_misc.c  2007-08-22 06:46:34 UTC 
(rev 24614)
+++ branches/SAMBA_3_2/source/nsswitch/winbindd_misc.c  2007-08-22 09:32:37 UTC 
(rev 24615)
@@ -253,7 +253,8 @@
cli_set_timeout(netlogon_pipe-cli, orig_timeout);
 
if (!W_ERROR_IS_OK(werr)) {
-   DEBUG(5, (Error requesting DCname: %s\n, dos_errstr(werr)));
+   DEBUG(5, (Error requesting DCname for domain %s: %s\n,
+   state-request.domain_name, dos_errstr(werr)));
return WINBINDD_ERROR;
}
 

Modified: branches/SAMBA_3_2_0/source/nsswitch/winbindd_misc.c
===
--- branches/SAMBA_3_2_0/source/nsswitch/winbindd_misc.c2007-08-22 
06:46:34 UTC (rev 24614)
+++ branches/SAMBA_3_2_0/source/nsswitch/winbindd_misc.c2007-08-22 
09:32:37 UTC (rev 24615)
@@ -253,7 +253,8 @@
cli_set_timeout(netlogon_pipe-cli, orig_timeout);
 
if (!W_ERROR_IS_OK(werr)) {
-   DEBUG(5, (Error requesting DCname: %s\n, dos_errstr(werr)));
+   DEBUG(5, (Error requesting DCname for domain %s: %s\n,
+   state-request.domain_name, dos_errstr(werr)));
return WINBINDD_ERROR;
}
 



svn commit: samba r24616 - in branches: SAMBA_3_2/source/param SAMBA_3_2_0/source/param

2007-08-22 Thread obnox
Author: obnox
Date: 2007-08-22 10:47:32 + (Wed, 22 Aug 2007)
New Revision: 24616

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24616

Log:
In set_boolean(), only pass the result back to the caller 
if parsing of the boolean string was successful.
Also, initialize the local result variable
(although not strictly necessary anymore, now.)


Modified:
   branches/SAMBA_3_2/source/param/loadparm.c
   branches/SAMBA_3_2_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_2/source/param/loadparm.c
===
--- branches/SAMBA_3_2/source/param/loadparm.c  2007-08-22 09:32:37 UTC (rev 
24615)
+++ branches/SAMBA_3_2/source/param/loadparm.c  2007-08-22 10:47:32 UTC (rev 
24616)
@@ -3090,6 +3090,7 @@
BOOL value;
 
bRetval = True;
+   value = False;
if (strwicmp(pszParmValue, yes) == 0 ||
strwicmp(pszParmValue, true) == 0 ||
strwicmp(pszParmValue, 1) == 0)
@@ -3105,7 +3106,7 @@
bRetval = False;
}
 
-   if (pb != NULL) {
+   if ((pb != NULL)  (bRetval != False)) {
*pb = value;
}
 

Modified: branches/SAMBA_3_2_0/source/param/loadparm.c
===
--- branches/SAMBA_3_2_0/source/param/loadparm.c2007-08-22 09:32:37 UTC 
(rev 24615)
+++ branches/SAMBA_3_2_0/source/param/loadparm.c2007-08-22 10:47:32 UTC 
(rev 24616)
@@ -3095,6 +3095,7 @@
BOOL value;
 
bRetval = True;
+   value = False;
if (strwicmp(pszParmValue, yes) == 0 ||
strwicmp(pszParmValue, true) == 0 ||
strwicmp(pszParmValue, 1) == 0)
@@ -3110,7 +3111,7 @@
bRetval = False;
}
 
-   if (pb != NULL) {
+   if ((pb != NULL)  (bRetval != False)) {
*pb = value;
}
 



svn commit: samba r24617 - in branches/SAMBA_3_0_25/source/modules: .

2007-08-22 Thread vlendec
Author: vlendec
Date: 2007-08-22 11:23:24 + (Wed, 22 Aug 2007)
New Revision: 24617

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24617

Log:
Revert -r24035. No idea what this was. Sorry for breaking the build of
the aixacl2 module.

Modified:
   branches/SAMBA_3_0_25/source/modules/nfs4_acls.h


Changeset:
Modified: branches/SAMBA_3_0_25/source/modules/nfs4_acls.h
===
--- branches/SAMBA_3_0_25/source/modules/nfs4_acls.h2007-08-22 10:47:32 UTC 
(rev 24616)
+++ branches/SAMBA_3_0_25/source/modules/nfs4_acls.h2007-08-22 11:23:24 UTC 
(rev 24617)
@@ -138,7 +138,7 @@
  * when applicable */
 typedef BOOL (*set_nfs4acl_native_fn_t)(files_struct *, SMB4ACL_T *);
 
-NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp,
+BOOL smb_set_nt_acl_nfs4(files_struct *fsp,
uint32 security_info_sent,
SEC_DESC *psd,
set_nfs4acl_native_fn_t set_nfs4_native);



svn commit: samba r24618 - in branches/SAMBA_3_2/source/lib: .

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 11:55:48 + (Wed, 22 Aug 2007)
New Revision: 24618

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24618

Log:
move printing out the version string and exit()
into the popt _POST processing.

Now 'smbd -V --bla' complains about an unknown option

metze
Modified:
   branches/SAMBA_3_2/source/lib/popt_common.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/popt_common.c
===
--- branches/SAMBA_3_2/source/lib/popt_common.c 2007-08-22 11:23:24 UTC (rev 
24617)
+++ branches/SAMBA_3_2/source/lib/popt_common.c 2007-08-22 11:55:48 UTC (rev 
24618)
@@ -57,6 +57,8 @@
lp_set_logfile(logfile);
 }
 
+static BOOL PrintSambaVersionString;
+
 static void popt_common_callback(poptContext con,
   enum poptCallbackReason reason,
   const struct poptOption *opt,
@@ -68,6 +70,14 @@
return;
}
 
+   if (reason == POPT_CALLBACK_REASON_POST) {
+   if (!PrintSambaVersionString) return;
+
+   printf( Version %s\n, SAMBA_VERSION_STRING);
+   exit(0);
+   return;
+   }
+
switch(opt-val) {
case 'd':
if (arg) {
@@ -77,8 +87,7 @@
break;
 
case 'V':
-   printf( Version %s\n, SAMBA_VERSION_STRING);
-   exit(0);
+   PrintSambaVersionString = True;
break;
 
case 'O':
@@ -133,7 +142,7 @@
 };
 
 struct poptOption popt_common_samba[] = {
-   { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, (void 
*)popt_common_callback },
+   { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void 
*)popt_common_callback },
{ debuglevel, 'd', POPT_ARG_STRING, NULL, 'd', Set debug level, 
DEBUGLEVEL },
{ configfile, 's', POPT_ARG_STRING, NULL, 's', Use alternate 
configuration file, CONFIGFILE },
{ log-basename, 'l', POPT_ARG_STRING, NULL, 'l', Base name for log 
files, LOGFILEBASE },



svn commit: samba r24619 - in branches/SAMBA_3_2_0/source/lib: .

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:03:13 + (Wed, 22 Aug 2007)
New Revision: 24619

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24619

Log:
move printing out the version string and exit()
into the popt _POST processing.

Now 'smbd -V --bla' complains about an unknown option

metze
Modified:
   branches/SAMBA_3_2_0/source/lib/popt_common.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/lib/popt_common.c
===
--- branches/SAMBA_3_2_0/source/lib/popt_common.c   2007-08-22 11:55:48 UTC 
(rev 24618)
+++ branches/SAMBA_3_2_0/source/lib/popt_common.c   2007-08-22 12:03:13 UTC 
(rev 24619)
@@ -57,6 +57,8 @@
lp_set_logfile(logfile);
 }
 
+static BOOL PrintSambaVersionString;
+
 static void popt_common_callback(poptContext con,
   enum poptCallbackReason reason,
   const struct poptOption *opt,
@@ -68,6 +70,14 @@
return;
}
 
+   if (reason == POPT_CALLBACK_REASON_POST) {
+   if (!PrintSambaVersionString) return;
+
+   printf( Version %s\n, SAMBA_VERSION_STRING);
+   exit(0);
+   return;
+   }
+
switch(opt-val) {
case 'd':
if (arg) {
@@ -77,8 +87,7 @@
break;
 
case 'V':
-   printf( Version %s\n, SAMBA_VERSION_STRING);
-   exit(0);
+   PrintSambaVersionString = True;
break;
 
case 'O':
@@ -133,7 +142,7 @@
 };
 
 struct poptOption popt_common_samba[] = {
-   { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, (void 
*)popt_common_callback },
+   { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void 
*)popt_common_callback },
{ debuglevel, 'd', POPT_ARG_STRING, NULL, 'd', Set debug level, 
DEBUGLEVEL },
{ configfile, 's', POPT_ARG_STRING, NULL, 's', Use alternate 
configuration file, CONFIGFILE },
{ log-basename, 'l', POPT_ARG_STRING, NULL, 'l', Base name for log 
files, LOGFILEBASE },



svn commit: samba r24620 - in branches/SAMBA_4_0/source/lib/cmdline: .

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:04:42 + (Wed, 22 Aug 2007)
New Revision: 24620

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24620

Log:
move printing out the version string and exit()
into the popt _POST processing.

Now 'smbd -V --bla' complains about an unknown option

metze
Modified:
   branches/SAMBA_4_0/source/lib/cmdline/popt_common.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/cmdline/popt_common.c
===
--- branches/SAMBA_4_0/source/lib/cmdline/popt_common.c 2007-08-22 12:03:13 UTC 
(rev 24619)
+++ branches/SAMBA_4_0/source/lib/cmdline/popt_common.c 2007-08-22 12:04:42 UTC 
(rev 24620)
@@ -39,6 +39,8 @@
 
 struct cli_credentials *cmdline_credentials = NULL;
 
+static bool PrintSambaVersionString;
+
 static void popt_common_callback(poptContext con, 
   enum poptCallbackReason reason,
   const struct poptOption *opt,
@@ -47,6 +49,11 @@
const char *pname;
 
if (reason == POPT_CALLBACK_REASON_POST) {
+   if (PrintSambaVersionString) {
+   printf( Version %s\n, SAMBA_VERSION_STRING );
+   exit(0);
+   }
+
lp_load();
/* Hook any 'every Samba program must do this, after
 * the smb.conf is setup' functions here */
@@ -85,8 +92,7 @@
break;
 
case 'V':
-   printf( Version %s\n, SAMBA_VERSION_STRING );
-   exit(0);
+   PrintSambaVersionString = true;
break;
 
case 'O':
@@ -176,7 +182,7 @@
 };
 
 struct poptOption popt_common_version[] = {
-   { NULL, 0, POPT_ARG_CALLBACK, (void *)popt_common_callback },
+   { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_POST, (void 
*)popt_common_callback },
{ version, 'V', POPT_ARG_NONE, NULL, 'V', Print version },
{ NULL }
 };



svn commit: samba r24621 - in branches/SAMBA_3_2/source: nmbd nsswitch smbd

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:06:27 + (Wed, 22 Aug 2007)
New Revision: 24621

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24621

Log:
- deferr calling build_options();exit(0);
- use poptPrintUsage() to give the user more info

metze
Modified:
   branches/SAMBA_3_2/source/nmbd/nmbd.c
   branches/SAMBA_3_2/source/nsswitch/winbindd.c
   branches/SAMBA_3_2/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_3_2/source/nmbd/nmbd.c
===
--- branches/SAMBA_3_2/source/nmbd/nmbd.c   2007-08-22 12:04:42 UTC (rev 
24620)
+++ branches/SAMBA_3_2/source/nmbd/nmbd.c   2007-08-22 12:06:27 UTC (rev 
24621)
@@ -678,8 +678,9 @@
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
default:
-   d_fprintf(stderr, \nInvalid option %s: %s\n,
+   d_fprintf(stderr, \nInvalid option %s: %s\n\n,
  poptBadOption(pc, 0), poptStrerror(opt));
+   poptPrintUsage(pc, stderr, 0);
exit(1);
}
};

Modified: branches/SAMBA_3_2/source/nsswitch/winbindd.c
===
--- branches/SAMBA_3_2/source/nsswitch/winbindd.c   2007-08-22 12:04:42 UTC 
(rev 24620)
+++ branches/SAMBA_3_2/source/nsswitch/winbindd.c   2007-08-22 12:06:27 UTC 
(rev 24621)
@@ -1017,8 +1017,9 @@
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
default:
-   d_fprintf(stderr, \nInvalid option %s: %s\n,
+   d_fprintf(stderr, \nInvalid option %s: %s\n\n,
  poptBadOption(pc, 0), poptStrerror(opt));
+   poptPrintUsage(pc, stderr, 0);
exit(1);
}
}
@@ -1036,6 +1037,8 @@
exit(1);
}
 
+   poptFreeContext(pc);
+
if (!override_logfile) {
pstr_sprintf(logfile, %s/log.winbindd, dyn_LOGFILEBASE);
lp_set_logfile(logfile);
@@ -1167,8 +1170,6 @@
messaging_register(winbind_messaging_context(), NULL,
   MSG_DUMP_EVENT_LIST, winbind_msg_dump_event_list);
 
-   poptFreeContext(pc);
-
netsamlogon_cache_init(); /* Non-critical */

/* clear the cached list of trusted domains */

Modified: branches/SAMBA_3_2/source/smbd/server.c
===
--- branches/SAMBA_3_2/source/smbd/server.c 2007-08-22 12:04:42 UTC (rev 
24620)
+++ branches/SAMBA_3_2/source/smbd/server.c 2007-08-22 12:06:27 UTC (rev 
24621)
@@ -818,6 +818,7 @@
const char *profile_level = NULL;
int opt;
poptContext pc;
+   BOOL print_build_options = False;
 
enum smb_server_mode server_mode = SERVER_MODE_DAEMON;
 
@@ -849,21 +850,25 @@
 #endif
 
pc = poptGetContext(smbd, argc, argv, long_options, 0);
-   
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt)  {
case 'b':
-   build_options(True); /* Display output to screen as 
well as debug */ 
-   exit(0);
+   print_build_options = True;
+   break;
default:
-   d_fprintf(stderr, \nInvalid option %s: %s\n,
+   d_fprintf(stderr, \nInvalid option %s: %s\n\n,
  poptBadOption(pc, 0), poptStrerror(opt));
+   poptPrintUsage(pc, stderr, 0);
exit(1);
}
}
-
poptFreeContext(pc);
 
+   if (print_build_options) {
+   build_options(True); /* Display output to screen as well as 
debug */
+   exit(0);
+   }
+
 #ifdef HAVE_SETLUID
/* needed for SecureWare on SCO */
setluid(0);



svn commit: samba r24622 - in branches/SAMBA_3_2_0/source: nmbd nsswitch smbd

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:06:54 + (Wed, 22 Aug 2007)
New Revision: 24622

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24622

Log:
- deferr calling build_options();exit(0);
- use poptPrintUsage() to give the user more info

metze
Modified:
   branches/SAMBA_3_2_0/source/nmbd/nmbd.c
   branches/SAMBA_3_2_0/source/nsswitch/winbindd.c
   branches/SAMBA_3_2_0/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/nmbd/nmbd.c
===
--- branches/SAMBA_3_2_0/source/nmbd/nmbd.c 2007-08-22 12:06:27 UTC (rev 
24621)
+++ branches/SAMBA_3_2_0/source/nmbd/nmbd.c 2007-08-22 12:06:54 UTC (rev 
24622)
@@ -681,8 +681,9 @@
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
default:
-   d_fprintf(stderr, \nInvalid option %s: %s\n,
+   d_fprintf(stderr, \nInvalid option %s: %s\n\n,
  poptBadOption(pc, 0), poptStrerror(opt));
+   poptPrintUsage(pc, stderr, 0);
exit(1);
}
};

Modified: branches/SAMBA_3_2_0/source/nsswitch/winbindd.c
===
--- branches/SAMBA_3_2_0/source/nsswitch/winbindd.c 2007-08-22 12:06:27 UTC 
(rev 24621)
+++ branches/SAMBA_3_2_0/source/nsswitch/winbindd.c 2007-08-22 12:06:54 UTC 
(rev 24622)
@@ -986,8 +986,9 @@
Fork = False;
break;
default:
-   d_fprintf(stderr, \nInvalid option %s: %s\n,
+   d_fprintf(stderr, \nInvalid option %s: %s\n\n,
  poptBadOption(pc, 0), poptStrerror(opt));
+   poptPrintUsage(pc, stderr, 0);
exit(1);
}
}
@@ -998,6 +999,8 @@
exit(1);
}
 
+   poptFreeContext(pc);
+
if (!override_logfile) {
pstr_sprintf(logfile, %s/log.winbindd, dyn_LOGFILEBASE);
lp_set_logfile(logfile);
@@ -1124,8 +1127,6 @@
messaging_register(winbind_messaging_context(), NULL,
   MSG_DUMP_EVENT_LIST, winbind_msg_dump_event_list);
 
-   poptFreeContext(pc);
-
netsamlogon_cache_init(); /* Non-critical */

/* clear the cached list of trusted domains */

Modified: branches/SAMBA_3_2_0/source/smbd/server.c
===
--- branches/SAMBA_3_2_0/source/smbd/server.c   2007-08-22 12:06:27 UTC (rev 
24621)
+++ branches/SAMBA_3_2_0/source/smbd/server.c   2007-08-22 12:06:54 UTC (rev 
24622)
@@ -861,6 +861,7 @@
static char *profile_level = NULL;
int opt;
poptContext pc;
+   BOOL print_build_options = False;
 
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -886,21 +887,25 @@
 #endif
 
pc = poptGetContext(smbd, argc, argv, long_options, 0);
-   
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt)  {
case 'b':
-   build_options(True); /* Display output to screen as 
well as debug */ 
-   exit(0);
+   print_build_options = True;
+   break;
default:
-   d_fprintf(stderr, \nInvalid option %s: %s\n,
+   d_fprintf(stderr, \nInvalid option %s: %s\n\n,
  poptBadOption(pc, 0), poptStrerror(opt));
+   poptPrintUsage(pc, stderr, 0);
exit(1);
}
}
-
poptFreeContext(pc);
 
+   if (print_build_options) {
+   build_options(True); /* Display output to screen as well as 
debug */
+   exit(0);
+   }
+
 #ifdef HAVE_SETLUID
/* needed for SecureWare on SCO */
setluid(0);



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

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:21:40 + (Wed, 22 Aug 2007)
New Revision: 24623

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24623

Log:
add back '-D' option to smbd

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


Changeset:
Modified: branches/SAMBA_4_0/source/smbd/server.c
===
--- branches/SAMBA_4_0/source/smbd/server.c 2007-08-22 12:06:54 UTC (rev 
24622)
+++ branches/SAMBA_4_0/source/smbd/server.c 2007-08-22 12:21:40 UTC (rev 
24623)
@@ -181,7 +181,8 @@
 */
 static int binary_smbd_main(const char *binary_name, int argc, const char 
*argv[])
 {
-   BOOL interactive = False;
+   bool opt_daemon = false;
+   bool opt_interactive = false;
int opt;
poptContext pc;
init_module_fn static_init[] = STATIC_service_MODULES;
@@ -191,11 +192,14 @@
const char *model = standard;
int max_runtime = 0;
enum {
-   OPT_INTERACTIVE = 1000,
+   OPT_DAEMON = 1000,
+   OPT_INTERACTIVE,
OPT_PROCESS_MODEL
};
struct poptOption long_options[] = {
POPT_AUTOHELP
+   {daemon, 'D', POPT_ARG_NONE, NULL, OPT_DAEMON,
+Become a daemon (default), NULL },
{interactive, 'i', POPT_ARG_NONE, NULL, OPT_INTERACTIVE,
 Run interactive (not a daemon), NULL},
{model, 'M', POPT_ARG_STRING, NULL, OPT_PROCESS_MODEL, 
@@ -208,20 +212,38 @@
};
 
pc = poptGetContext(binary_name, argc, argv, long_options, 0);
-   
while((opt = poptGetNextOpt(pc)) != -1) {
switch(opt) {
+   case OPT_DAEMON:
+   opt_daemon = true;
+   break;
case OPT_INTERACTIVE:
-   interactive = True;
+   opt_interactive = true;
break;
case OPT_PROCESS_MODEL:
model = poptGetOptArg(pc);
break;
+   default:
+   d_fprintf(stderr, \nInvalid option %s: %s\n\n,
+ poptBadOption(pc, 0), poptStrerror(opt));
+   poptPrintUsage(pc, stderr, 0);
+   exit(1);
}
}
+
+   if (opt_daemon  opt_interactive) {
+   d_fprintf(stderr,\nERROR: 
+ Option -i|--interactive is not allowed together with 
-D|--daemon\n\n);
+   poptPrintUsage(pc, stderr, 0);
+   exit(1);
+   } else if (!opt_interactive) {
+   /* default is --daemon */
+   opt_daemon = true;
+   }
+
poptFreeContext(pc);
 
-   setup_logging(binary_name, interactive?DEBUG_STDOUT:DEBUG_FILE);
+   setup_logging(binary_name, opt_interactive?DEBUG_STDOUT:DEBUG_FILE);
setup_signals();
 
/* we want total control over the permissions on created files,
@@ -238,7 +260,7 @@
exit(1);
}
 
-   if (!interactive) {
+   if (opt_daemon) {
DEBUG(3,(Becoming a daemon.\n));
become_daemon(True);
}
@@ -289,7 +311,7 @@
/* initialise clustering if needed */
cluster_ctdb_init(event_ctx, model);
 
-   if (interactive) {
+   if (opt_interactive) {
/* catch EOF on stdin */
 #ifdef SIGTTIN
signal(SIGTTIN, SIG_IGN);



svn commit: samba r24624 - in branches/SAMBA_3_2_0/source/nsswitch: .

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:23:18 + (Wed, 22 Aug 2007)
New Revision: 24624

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24624

Log:
add '-D' option to winbindd as we no longer ignore
unknown options.

forbit: '-D -i' together

metze
Modified:
   branches/SAMBA_3_2_0/source/nsswitch/winbindd.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/nsswitch/winbindd.c
===
--- branches/SAMBA_3_2_0/source/nsswitch/winbindd.c 2007-08-22 12:21:40 UTC 
(rev 24623)
+++ branches/SAMBA_3_2_0/source/nsswitch/winbindd.c 2007-08-22 12:23:18 UTC 
(rev 24624)
@@ -932,6 +932,7 @@
 int main(int argc, char **argv, char **envp)
 {
pstring logfile;
+   static BOOL is_daemon = False;
static BOOL Fork = True;
static BOOL log_stdout = False;
static BOOL no_process_group = False;
@@ -940,6 +941,7 @@
{ stdout, 'S', POPT_ARG_VAL, log_stdout, True, Log to 
stdout },
{ foreground, 'F', POPT_ARG_VAL, Fork, False, Daemon in 
foreground mode },
{ no-process-group, 0, POPT_ARG_VAL, no_process_group, True, 
Don't create a new process group },
+   { daemon, 'D', POPT_ARG_NONE, NULL, 'D', Become a daemon 
(default) },
{ interactive, 'i', POPT_ARG_NONE, NULL, 'i', Interactive 
mode },
{ no-caching, 'n', POPT_ARG_VAL, opt_nocache, True, Disable 
caching },
POPT_COMMON_SAMBA
@@ -980,6 +982,9 @@
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
/* Don't become a daemon */
+   case 'D':
+   is_daemon = True;
+   break;
case 'i':
interactive = True;
log_stdout = True;
@@ -993,8 +998,16 @@
}
}
 
+   if (is_daemon  interactive) {
+   d_fprintf(stderr,\nERROR: 
+ Option -i|--interactive is not allowed together with 
-D|--daemon\n\n);
+   poptPrintUsage(pc, stderr, 0);
+   exit(1);
+   }
+
if (log_stdout  Fork) {
-   printf(Can't log to stdout (-S) unless daemon is in foreground 
+(-F) or interactive (-i)\n);
+   d_fprintf(stderr, \nERROR: 
+ Can't log to stdout (-S) unless daemon is in 
foreground +(-F) or interactive (-i)\n\n);
poptPrintUsage(pc, stderr, 0);
exit(1);
}



svn commit: samba r24625 - in branches/SAMBA_3_2/source/nsswitch: .

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:28:58 + (Wed, 22 Aug 2007)
New Revision: 24625

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24625

Log:
add '-D' option to winbindd

TODO: don't allow '-i -D' and '-D -i' on all
  server binaries in the SAMBA_3_2 branch!
  The server_mode patch makes this difficult to check...

metze
Modified:
   branches/SAMBA_3_2/source/nsswitch/winbindd.c


Changeset:
Modified: branches/SAMBA_3_2/source/nsswitch/winbindd.c
===
--- branches/SAMBA_3_2/source/nsswitch/winbindd.c   2007-08-22 12:23:18 UTC 
(rev 24624)
+++ branches/SAMBA_3_2/source/nsswitch/winbindd.c   2007-08-22 12:28:58 UTC 
(rev 24625)
@@ -977,6 +977,7 @@
{ stdout, 'S', POPT_ARG_VAL, log_stdout, True, Log to 
stdout },
{ foreground, 'F', POPT_ARG_VAL, server_mode, 
SERVER_MODE_FOREGROUND, Daemon in foreground mode },
{ no-process-group, 0, POPT_ARG_VAL, no_process_group, True, 
Don't create a new process group },
+   { daemon, 'D', POPT_ARG_VAL, server_mode, 
SERVER_MODE_DAEMON, Become a daemon (default) },
{ interactive, 'i', POPT_ARG_VAL, server_mode, 
SERVER_MODE_INTERACTIVE, Interactive mode },
{ no-caching, 'n', POPT_ARG_VAL, opt_nocache, True, Disable 
caching },
POPT_COMMON_SAMBA



svn commit: samba r24626 - in branches/SAMBA_4_0/source/lib/talloc: .

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:44:22 + (Wed, 22 Aug 2007)
New Revision: 24626

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24626

Log:
as TALLOC_ABORT() is defined to abort() by default
wrap it into a function so that the function name
in the backtrace shows what happens.

metze
Modified:
   branches/SAMBA_4_0/source/lib/talloc/talloc.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c   2007-08-22 12:28:58 UTC 
(rev 24625)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c   2007-08-22 12:44:22 UTC 
(rev 24626)
@@ -115,6 +115,16 @@
 #define TC_HDR_SIZE ((sizeof(struct talloc_chunk)+15)~15)
 #define TC_PTR_FROM_CHUNK(tc) ((void *)(TC_HDR_SIZE + (char*)tc))
 
+static void talloc_abort_double_free(void)
+{
+   TALLOC_ABORT(Bad talloc magic value - double free); 
+}
+
+static void talloc_abort_unknown_value(void)
+{
+   TALLOC_ABORT(Bad talloc magic value - unknown value); 
+}
+
 /* panic if we get a bad magic value */
 static inline struct talloc_chunk *talloc_chunk_from_ptr(const void *ptr)
 {
@@ -122,9 +132,9 @@
struct talloc_chunk *tc = discard_const_p(struct talloc_chunk, pp - 
TC_HDR_SIZE);
if (unlikely((tc-flags  (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) 
{ 
if (tc-flags  TALLOC_FLAG_FREE) {
-   TALLOC_ABORT(Bad talloc magic value - double free); 
+   talloc_abort_double_free();
} else {
-   TALLOC_ABORT(Bad talloc magic value - unknown value); 
+   talloc_abort_unknown_value();
}
}
return tc;



svn commit: samba r24627 - in branches/SAMBA_3_2/source/lib/talloc: .

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:44:41 + (Wed, 22 Aug 2007)
New Revision: 24627

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24627

Log:
merge from SAMBA_4_0:
as TALLOC_ABORT() is defined to abort() by default
wrap it into a function so that the function name
in the backtrace shows what happens.

metze
Modified:
   branches/SAMBA_3_2/source/lib/talloc/talloc.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/talloc/talloc.c
===
--- branches/SAMBA_3_2/source/lib/talloc/talloc.c   2007-08-22 12:44:22 UTC 
(rev 24626)
+++ branches/SAMBA_3_2/source/lib/talloc/talloc.c   2007-08-22 12:44:41 UTC 
(rev 24627)
@@ -115,6 +115,16 @@
 #define TC_HDR_SIZE ((sizeof(struct talloc_chunk)+15)~15)
 #define TC_PTR_FROM_CHUNK(tc) ((void *)(TC_HDR_SIZE + (char*)tc))
 
+static void talloc_abort_double_free(void)
+{
+   TALLOC_ABORT(Bad talloc magic value - double free); 
+}
+
+static void talloc_abort_unknown_value(void)
+{
+   TALLOC_ABORT(Bad talloc magic value - unknown value); 
+}
+
 /* panic if we get a bad magic value */
 static inline struct talloc_chunk *talloc_chunk_from_ptr(const void *ptr)
 {
@@ -122,9 +132,9 @@
struct talloc_chunk *tc = discard_const_p(struct talloc_chunk, pp - 
TC_HDR_SIZE);
if (unlikely((tc-flags  (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) 
{ 
if (tc-flags  TALLOC_FLAG_FREE) {
-   TALLOC_ABORT(Bad talloc magic value - double free); 
+   talloc_abort_double_free();
} else {
-   TALLOC_ABORT(Bad talloc magic value - unknown value); 
+   talloc_abort_unknown_value();
}
}
return tc;



svn commit: samba r24628 - in branches/SAMBA_3_2_0/source/lib/talloc: .

2007-08-22 Thread metze
Author: metze
Date: 2007-08-22 12:45:07 + (Wed, 22 Aug 2007)
New Revision: 24628

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24628

Log:
merge from SAMBA_4_0:
as TALLOC_ABORT() is defined to abort() by default
wrap it into a function so that the function name
in the backtrace shows what happens.

metze
Modified:
   branches/SAMBA_3_2_0/source/lib/talloc/talloc.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/lib/talloc/talloc.c
===
--- branches/SAMBA_3_2_0/source/lib/talloc/talloc.c 2007-08-22 12:44:41 UTC 
(rev 24627)
+++ branches/SAMBA_3_2_0/source/lib/talloc/talloc.c 2007-08-22 12:45:07 UTC 
(rev 24628)
@@ -115,6 +115,16 @@
 #define TC_HDR_SIZE ((sizeof(struct talloc_chunk)+15)~15)
 #define TC_PTR_FROM_CHUNK(tc) ((void *)(TC_HDR_SIZE + (char*)tc))
 
+static void talloc_abort_double_free(void)
+{
+   TALLOC_ABORT(Bad talloc magic value - double free); 
+}
+
+static void talloc_abort_unknown_value(void)
+{
+   TALLOC_ABORT(Bad talloc magic value - unknown value); 
+}
+
 /* panic if we get a bad magic value */
 static inline struct talloc_chunk *talloc_chunk_from_ptr(const void *ptr)
 {
@@ -122,9 +132,9 @@
struct talloc_chunk *tc = discard_const_p(struct talloc_chunk, pp - 
TC_HDR_SIZE);
if (unlikely((tc-flags  (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) 
{ 
if (tc-flags  TALLOC_FLAG_FREE) {
-   TALLOC_ABORT(Bad talloc magic value - double free); 
+   talloc_abort_double_free();
} else {
-   TALLOC_ABORT(Bad talloc magic value - unknown value); 
+   talloc_abort_unknown_value();
}
}
return tc;



svn commit: samba-docs r1164 - in trunk/manpages-3: .

2007-08-22 Thread kseeger
Author: kseeger
Date: 2007-08-22 13:25:00 + (Wed, 22 Aug 2007)
New Revision: 1164

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=1164

Log:
Add documentation for new winbindd -D switch added by metze with r24624 and 
r24625
Modified:
   trunk/manpages-3/winbindd.8.xml


Changeset:
Modified: trunk/manpages-3/winbindd.8.xml
===
--- trunk/manpages-3/winbindd.8.xml 2007-08-20 22:47:12 UTC (rev 1163)
+++ trunk/manpages-3/winbindd.8.xml 2007-08-22 13:25:00 UTC (rev 1164)
@@ -17,6 +17,7 @@
 refsynopsisdiv
cmdsynopsis
commandwinbindd/command
+   arg choice=opt-D/arg
arg choice=opt-F/arg
arg choice=opt-S/arg
arg choice=opt-i/arg
@@ -76,6 +77,16 @@
 
variablelist
varlistentry
+   term-D/term
+   listitemparaIf specified, this parameter causes
+   the server to operate as a daemon. That is, it detaches
+   itself and runs in the background on the appropriate port. 
+   This switch is assumed if commandwinbindd/command is 
+   executed on the command line of a shell.
+   /para/listitem
+   /varlistentry
+
+   varlistentry
termhosts/term
listitemparaThis feature is only available on IRIX.
User information traditionally stored in



svn commit: samba r24629 - in branches: SAMBA_3_0_25/source/nsswitch SAMBA_3_2/source/nsswitch SAMBA_3_2_0/source/nsswitch SAMBA_4_0/source/nsswitch

2007-08-22 Thread obnox
Author: obnox
Date: 2007-08-22 13:51:44 + (Wed, 22 Aug 2007)
New Revision: 24629

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24629

Log:
Make read_sock return the total number of bytes read instead
of the number of bytes read in the last of possibly several
read calls.

This was noted by Metze.

Michael


Modified:
   branches/SAMBA_3_0_25/source/nsswitch/wb_common.c
   branches/SAMBA_3_2/source/nsswitch/wb_common.c
   branches/SAMBA_3_2_0/source/nsswitch/wb_common.c
   branches/SAMBA_4_0/source/nsswitch/wb_common.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/nsswitch/wb_common.c
===
--- branches/SAMBA_3_0_25/source/nsswitch/wb_common.c   2007-08-22 12:45:07 UTC 
(rev 24628)
+++ branches/SAMBA_3_0_25/source/nsswitch/wb_common.c   2007-08-22 13:51:44 UTC 
(rev 24629)
@@ -422,7 +422,7 @@
 
 static int read_sock(void *buffer, int count)
 {
-   int result = 0, nread = 0;
+   int nread = 0;
int total_time = 0, selret;
 
if (winbindd_fd == -1) {
@@ -463,7 +463,7 @@

/* Do the Read */

-   result = read(winbindd_fd, (char *)buffer + nread, 
+   int result = read(winbindd_fd, (char *)buffer + nread, 
  count - nread);

if ((result == -1) || (result == 0)) {
@@ -481,7 +481,7 @@
}
}

-   return result;
+   return nread;
 }
 
 /* Read reply */

Modified: branches/SAMBA_3_2/source/nsswitch/wb_common.c
===
--- branches/SAMBA_3_2/source/nsswitch/wb_common.c  2007-08-22 12:45:07 UTC 
(rev 24628)
+++ branches/SAMBA_3_2/source/nsswitch/wb_common.c  2007-08-22 13:51:44 UTC 
(rev 24629)
@@ -420,7 +420,7 @@
 
 static int read_sock(void *buffer, int count)
 {
-   int result = 0, nread = 0;
+   int nread = 0;
int total_time = 0, selret;
 
if (winbindd_fd == -1) {
@@ -461,7 +461,7 @@

/* Do the Read */

-   result = read(winbindd_fd, (char *)buffer + nread, 
+   int result = read(winbindd_fd, (char *)buffer + nread, 
  count - nread);

if ((result == -1) || (result == 0)) {
@@ -479,7 +479,7 @@
}
}

-   return result;
+   return nread;
 }
 
 /* Read reply */

Modified: branches/SAMBA_3_2_0/source/nsswitch/wb_common.c
===
--- branches/SAMBA_3_2_0/source/nsswitch/wb_common.c2007-08-22 12:45:07 UTC 
(rev 24628)
+++ branches/SAMBA_3_2_0/source/nsswitch/wb_common.c2007-08-22 13:51:44 UTC 
(rev 24629)
@@ -420,7 +420,7 @@
 
 static int read_sock(void *buffer, int count)
 {
-   int result = 0, nread = 0;
+   int nread = 0;
int total_time = 0, selret;
 
if (winbindd_fd == -1) {
@@ -461,7 +461,7 @@

/* Do the Read */

-   result = read(winbindd_fd, (char *)buffer + nread, 
+   int result = read(winbindd_fd, (char *)buffer + nread, 
  count - nread);

if ((result == -1) || (result == 0)) {
@@ -479,7 +479,7 @@
}
}

-   return result;
+   return nread;
 }
 
 /* Read reply */

Modified: branches/SAMBA_4_0/source/nsswitch/wb_common.c
===
--- branches/SAMBA_4_0/source/nsswitch/wb_common.c  2007-08-22 12:45:07 UTC 
(rev 24628)
+++ branches/SAMBA_4_0/source/nsswitch/wb_common.c  2007-08-22 13:51:44 UTC 
(rev 24629)
@@ -421,7 +421,7 @@
 
 static int read_sock(void *buffer, int count)
 {
-   int result = 0, nread = 0;
+   int nread = 0;
int total_time = 0, selret;
 
/* Read data from socket */
@@ -458,7 +458,7 @@

/* Do the Read */

-   result = read(winbindd_fd, (char *)buffer + nread, 
+   int result = read(winbindd_fd, (char *)buffer + nread, 
  count - nread);

if ((result == -1) || (result == 0)) {
@@ -476,7 +476,7 @@
}
}

-   return result;
+   return nread;
 }
 
 /* Read reply */



svn commit: samba r24630 - in branches: SAMBA_3_2/source/registry SAMBA_3_2_0/source/registry

2007-08-22 Thread obnox
Author: obnox
Date: 2007-08-22 16:03:17 + (Wed, 22 Aug 2007)
New Revision: 24630

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24630

Log:
Store Samba configuratin options only under the default name, not as aliases.
This prevents creation of problematic configurations from registry editors
like regedit or net rpc registry.

I will refactor the code to be somewhat more concise,
but I wanted to have this in the tree, now I got it working... :-)

Michael


Modified:
   branches/SAMBA_3_2/source/registry/reg_smbconf.c
   branches/SAMBA_3_2_0/source/registry/reg_smbconf.c


Changeset:
Modified: branches/SAMBA_3_2/source/registry/reg_smbconf.c
===
--- branches/SAMBA_3_2/source/registry/reg_smbconf.c2007-08-22 13:51:44 UTC 
(rev 24629)
+++ branches/SAMBA_3_2/source/registry/reg_smbconf.c2007-08-22 16:03:17 UTC 
(rev 24630)
@@ -43,18 +43,167 @@
 {
int i;
int num_values = regval_ctr_numvals(val);
+   REGVAL_CTR *new_val_ctr;
 
+   /*
+* we build a second regval container and copy over the values,
+* possibly changing names to the canonical name, because when
+* canonicalizing parameter names and replacing the original parameter
+* (with reval_ctr_deletevalue and regval_ctr_addvalue) in the original
+* container, the order would change and that is not so good in the
+* for loop...  :-o
+*/
+   new_val_ctr = TALLOC_ZERO_P(val, REGVAL_CTR);
+   if (new_val_ctr == NULL) {
+   DEBUG(1, (out of memory\n));
+   return False;
+   }
+
for (i=0; i  num_values; i++) {
REGISTRY_VALUE *theval = regval_ctr_specific_value(val, i);
const char *valname = regval_name(theval);
+   int res;
 
-   if (registry_smbconf_valname_forbidden(valname)) {
-   DEBUG(0, (smbconf_store_values: value '%s' forbidden 
+   DEBUG(10, (inspecting value '%s'\n, valname));
+
+   /* unfortunately, we can not reject names that are not
+* valid parameter names here, since e.g. regedit first
+* creates values as New Value #1 and so on and then
+* drops into rename. */
+
+   if (regval_type(theval) != REG_SZ) {
+   DEBUG(1, (smbconf_store_values: only registry value 
+ type REG_SZ currently allowed under key 
+ smbconf\n));
+   return False;
+   }
+
+   if (registry_smbconf_valname_forbidden(regval_name(theval))) {
+   DEBUG(1, (smbconf_store_values: value '%s' forbidden 
  in registry.\n, valname));
return False;
}
+
+   if (lp_parameter_is_valid(valname) 
+   !lp_parameter_is_canonical(valname))
+   {
+   char *valstr;
+   size_t len;
+   const char *canon_valname;
+   const char *canon_valstr;
+   BOOL inverse;
+   struct registry_value *value;
+   WERROR err;
+   DATA_BLOB value_data;
+   TALLOC_CTX *mem_ctx;
+
+   DEBUG(5, (valid parameter '%s' given but it is a 
+ synonym. going to canonicalize it.\n,
+ valname));
+
+   mem_ctx = talloc_new(val);
+   if (mem_ctx == NULL) {
+   DEBUG(1, (out of memory...\n));
+   return False;
+   }
+
+   err = registry_pull_value(mem_ctx, value,
+ theval-type,
+ theval-data_p,
+ theval-size,
+ theval-size);
+   if (!W_ERROR_IS_OK(err)) {
+   TALLOC_FREE(mem_ctx);
+   return False;
+   }
+
+   valstr = (value-v.sz.str);
+   len = value-v.sz.len;
+   DEBUG(10, (theval-size: %d, value-v.sz.len: %d, 
+  value-v.sz.str: '%s'\n,
+  theval-size, value-v.sz.len,
+  value-v.sz.str));
+   if (valstr[len - 1] != '\0') {
+   DEBUG(10, (string is not '\\0'-terminated. 
+ adding '\\0'...\n));
+   valstr = TALLOC_REALLOC_ARRAY(mem_ctx, valstr,
+  

Build status as of Thu Aug 23 00:00:02 2007

2007-08-22 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-08-22 
00:01:36.0 +
+++ /home/build/master/cache/broken_results.txt 2007-08-23 00:00:25.0 
+
@@ -1,24 +1,24 @@
-Build status as of Wed Aug 22 00:00:02 2007
+Build status as of Thu Aug 23 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
 build_farm   0  0  0 
-ccache   30 9  0 
+ccache   29 9  0 
 ctdb 0  0  0 
 distcc   2  0  0 
-ldb  29 5  0 
+ldb  29 4  0 
 libreplace   28 8  0 
-lorikeet-heimdal 24 13 0 
+lorikeet-heimdal 25 13 0 
 pidl 17 3  0 
 ppp  12 9  0 
 python   0  0  0 
-rsync30 11 0 
+rsync30 10 0 
 samba-docs   0  0  0 
 samba-gtk3  3  0 
-samba4   27 25 0 
-samba_3_231 19 0 
+samba4   27 24 0 
+samba_3_230 18 0 
 smb-build27 27 0 
-talloc   30 1  0 
-tdb  28 4  0 
+talloc   29 1  0 
+tdb  29 4  0 
 


svn commit: samba r24631 - in branches/SAMBA_4_0/source: dsdb/schema lib lib/util/tests librpc/tools smbd torture/ldap torture/unix

2007-08-22 Thread abartlet
Author: abartlet
Date: 2007-08-23 02:10:17 + (Thu, 23 Aug 2007)
New Revision: 24631

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24631

Log:
Fix up format warnings, found on my Fedora 7 x86_64 workstation.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/dsdb/schema/schema_init.c
   branches/SAMBA_4_0/source/dsdb/schema/schema_syntax.c
   branches/SAMBA_4_0/source/lib/gendb.c
   branches/SAMBA_4_0/source/lib/util/tests/idtree.c
   branches/SAMBA_4_0/source/librpc/tools/ndrdump.c
   branches/SAMBA_4_0/source/smbd/server.c
   branches/SAMBA_4_0/source/torture/ldap/uptodatevector.c
   branches/SAMBA_4_0/source/torture/unix/whoami.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/schema/schema_init.c
===
--- branches/SAMBA_4_0/source/dsdb/schema/schema_init.c 2007-08-22 16:03:17 UTC 
(rev 24630)
+++ branches/SAMBA_4_0/source/dsdb/schema/schema_init.c 2007-08-23 02:10:17 UTC 
(rev 24631)
@@ -674,7 +674,7 @@
} \
if (strict  _a-value_ctr.num_values != 1) { \
d_printf(%s: %s num_values == %u\n, __location__, attr, \
-   _a-value_ctr.num_values); \
+(unsigned int)_a-value_ctr.num_values);   \
return WERR_INVALID_PARAM; \
} \
if (strict  !_a-value_ctr.values[0].blob) { \
@@ -683,7 +683,7 @@
} \
if (strict  _a-value_ctr.values[0].blob-length != 4) { \
d_printf(%s: %s length == %u\n, __location__, attr, \
-   _a-value_ctr.values[0].blob-length); \
+(unsigned int)_a-value_ctr.values[0].blob-length); \
return WERR_INVALID_PARAM; \
} \
if (_a  _a-value_ctr.num_values = 1 \

Modified: branches/SAMBA_4_0/source/dsdb/schema/schema_syntax.c
===
--- branches/SAMBA_4_0/source/dsdb/schema/schema_syntax.c   2007-08-22 
16:03:17 UTC (rev 24630)
+++ branches/SAMBA_4_0/source/dsdb/schema/schema_syntax.c   2007-08-23 
02:10:17 UTC (rev 24631)
@@ -261,7 +261,7 @@
 
v = BVALS(in-value_ctr.values[i].blob-data, 0);
 
-   str = talloc_asprintf(out-values, %lld, v);
+   str = talloc_asprintf(out-values, %lld, (long long int)v);
W_ERROR_HAVE_NO_MEMORY(str);
 
out-values[i] = data_blob_string_const(str);
@@ -948,7 +948,7 @@
W_ERROR_HAVE_NO_MEMORY(binary);
 
str = talloc_asprintf(out-values, B:%u:%s:%s,
- id3b.binary.length * 2, /* because of 2 
hex chars per byte */
+ (unsigned int)(id3b.binary.length * 2), 
/* because of 2 hex chars per byte */
  binary,
  id3b.dn);
W_ERROR_HAVE_NO_MEMORY(str);

Modified: branches/SAMBA_4_0/source/lib/gendb.c
===
--- branches/SAMBA_4_0/source/lib/gendb.c   2007-08-22 16:03:17 UTC (rev 
24630)
+++ branches/SAMBA_4_0/source/lib/gendb.c   2007-08-23 02:10:17 UTC (rev 
24631)
@@ -23,6 +23,7 @@
 #include includes.h
 #include lib/ldb/include/ldb.h
 #include lib/ldb/include/ldb_errors.h
+#include lib/db_wrap.h
 
 /*
   search the sam for the specified attributes - va_list variant

Modified: branches/SAMBA_4_0/source/lib/util/tests/idtree.c
===
--- branches/SAMBA_4_0/source/lib/util/tests/idtree.c   2007-08-22 16:03:17 UTC 
(rev 24630)
+++ branches/SAMBA_4_0/source/lib/util/tests/idtree.c   2007-08-23 02:10:17 UTC 
(rev 24631)
@@ -61,10 +61,11 @@
}
} else {
if (p != NULL) {
-   torture_fail(tctx, talloc_asprintf(tctx,
-   non-present at %d gave %p (would be 
%d), 
-  ii, p, 
-  (int)(((char *)p) - (char *)(ids[0])) / 
sizeof(int)));
+   torture_fail(tctx, 
+talloc_asprintf(tctx,
+non-present at %d 
gave %p (would be %d), 
+ii, p, 
+(int)char *)p) 
- (char *)(ids[0])) / sizeof(int;
}
if (random() % 5) {
ids[ii] = idr_get_new(idr, ids[ii], n);

Modified: branches/SAMBA_4_0/source/librpc/tools/ndrdump.c
===
--- branches/SAMBA_4_0/source/librpc/tools/ndrdump.c2007-08-22 16:03:17 UTC 
(rev 24630)
+++ 

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

2007-08-22 Thread tridge

revno: 594
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Wed 2007-08-22 17:31:29 +1000
message:
  merge from ronnie
modified:
  include/ctdb_private.h 
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  server/ctdb_control.c  
ctdb_control.c-20070426122724-j6gkpiofhbwdin63-1
  server/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  server/ctdb_ltdb_server.c  
ctdb_ltdb_server.c-20070607120348-7r182h0nlqxysyss-1
  server/ctdb_monitor.c  
ctdb_monitor.c-20070518100625-8jf4ft1mjzmb22ck-1
  server/ctdb_recoverd.c recoverd.c-20070503213540-bvxuyd9jm1f7ig90-1
  server/ctdb_server.c   ctdb.c-20061127094323-t50f58d65iaao5of-2
  server/ctdb_takeover.c 
ctdb_takeover.c-20070525071636-a5n1ihghjtppy08r-2
  server/ctdbd.c ctdbd.c-20070411085044-dqmhr6mfeexnyt4m-1
  server/eventscript.c   eventscript.c-20070704074533-95f10rsay8um8wrr-1
  tools/ctdb.c   
ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1

revno: 432.1.220
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Wed 2007-08-22 12:53:24 +1000
message:
  when we receive a packet from the network, check explicitely that the 
  node is not banned it the call is for a database record. i.e a REQ/REPLY 
  CALL/DMASTER
  
  if we get such a call while banned, ignore the packet and write an entry 
  in the logfile

revno: 432.1.219
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Wed 2007-08-22 12:38:31 +1000
message:
  create a define to represent the 'invalid' generation id we used in two 
  places.
  
  create a new helper function to generate new generation id values that 
  know about the invalid id and avoids generating it.
  
  update the ctdb status tool to know about the invalid generation id and 
  print the string INVALID instead

revno: 432.1.218
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Wed 2007-08-22 11:34:48 +1000
message:
  if the node is inactive  i.e. banned or disconnected  then that node is 
  not participating in the cluster
  
  if a client tries to attach to a database while the node is inactive,  
  return an error back to the client and fail the attach

revno: 432.1.217
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Wed 2007-08-22 10:38:35 +1000
message:
  when a node becomes bannedits databases are no longer part of ctdb 
  and it should thus no longer serve any database access calls until it 
  has been reintroduced into the cluster.
  
  when becoming banned,   reset the local generation id to 1   to prevent 
  any further database access calls from other nodes from being processed.

revno: 432.1.216
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Wed 2007-08-22 09:46:48 +1000
message:
  if lockwait takes an excessive time to complete. log the time it took to 
  complete and also the name of the database

revno: 432.1.215
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Tue 2007-08-21 17:25:15 +1000
message:
  change the structure used for node flag change messages so that we can 
  see both the old flags as well as the new flags (so we can tell which 
  flags changed)
  
  send the CTDB_SRVID_RECONFIGURE messages to connected nodes only, not to 
  every node, connected or not, in the cluster.
  
  
  in the handler inside the recovery daemon which is invoked for node flag 
  change messages, only do a takeover_run() and redistribute the ip 
addresses IF it was the 
  disabled or the unhealthy flags that changed. Also send out the cluster 
  reconfigured message in this case.
  If any of the other flags changed we dont need to do the takeover_run(0 
  here since that will be done during