svn commit: samba r10443 - in branches/SAMBA_4_0/source/build/scons: .

2005-09-22 Thread tpot
Author: tpot
Date: 2005-09-23 06:39:34 + (Fri, 23 Sep 2005)
New Revision: 10443

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

Log:
Fix emitter for NdrMarshaller tool.

Modified:
   branches/SAMBA_4_0/source/build/scons/pidl.py


Changeset:
Modified: branches/SAMBA_4_0/source/build/scons/pidl.py
===
--- branches/SAMBA_4_0/source/build/scons/pidl.py   2005-09-23 02:28:30 UTC 
(rev 10442)
+++ branches/SAMBA_4_0/source/build/scons/pidl.py   2005-09-23 06:39:34 UTC 
(rev 10443)
@@ -11,7 +11,7 @@
 idl_scanner = SCons.Scanner.ClassicCPP("PIDLScan", '.idl', 'CPPPATH', 
r'depends\(([^,]+),+\)', SCons.Node.FS.default_fs)
 
 def idl_emitter(target, source, env):
-   base, ext = SCons.Util.splitext(str(source[0]))
+   base, ext = SCons.Util.splitext(str(source[0]).split('/')[-1])
result = ['gen_ndr/ndr_%s.c' % base, 'gen_ndr/ndr_%s.h' % base]
return result, source
 



svn commit: samba r10442 - in branches/SAMBA_4_0/source: build/scons librpc

2005-09-22 Thread tpot
Author: tpot
Date: 2005-09-23 02:28:30 + (Fri, 23 Sep 2005)
New Revision: 10442

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

Log:
Build librpc/libndr_misc.a from librpc/idl/misc.idl.  Doesn't quite work 
yet as scons somehow thinks it needs to put a directory called ndr_idl 
in the command line.

Modified:
   branches/SAMBA_4_0/source/build/scons/pidl.py
   branches/SAMBA_4_0/source/librpc/SConscript


Changeset:
Modified: branches/SAMBA_4_0/source/build/scons/pidl.py
===
--- branches/SAMBA_4_0/source/build/scons/pidl.py   2005-09-23 02:13:27 UTC 
(rev 10441)
+++ branches/SAMBA_4_0/source/build/scons/pidl.py   2005-09-23 02:28:30 UTC 
(rev 10442)
@@ -12,8 +12,8 @@
 
 def idl_emitter(target, source, env):
base, ext = SCons.Util.splitext(str(source[0]))
-   result = ['gen_ndr/%s.c' % base, 'gen_ndr/%s.h' % base]
-   return result
+   result = ['gen_ndr/ndr_%s.c' % base, 'gen_ndr/ndr_%s.h' % base]
+   return result, source
 
 pidl_builder = SCons.Builder.Builder(action='$PIDLCOM',
 emitter = idl_emitter,
@@ -23,7 +23,7 @@
 
 def generate(env):
env['PIDL']  = env.Detect('pidl') or './pidl/pidl'
-   env['PIDLFLAGS'] = []
+   env['PIDLFLAGS'] = ['--outputdir', 'librpc/gen_ndr', 
'--ndr-header', '--ndr-parser']
env['PIDLCOM']   = '$PIDL $PIDLFLAGS -- $SOURCE'
env['BUILDERS']['NdrMarshaller'] = pidl_builder
 

Modified: branches/SAMBA_4_0/source/librpc/SConscript
===
--- branches/SAMBA_4_0/source/librpc/SConscript 2005-09-23 02:13:27 UTC (rev 
10441)
+++ branches/SAMBA_4_0/source/librpc/SConscript 2005-09-23 02:28:30 UTC (rev 
10442)
@@ -11,6 +11,8 @@
'rpc/dcerpc_util.c','rpc/dcerpc_error.c','rpc/dcerpc_smb.c',
'rpc/dcerpc_sock.c'])
 
+ndr_misc = hostenv.NdrMarshaller('idl/misc.idl')
+hostenv.StaticLibrary('ndr_misc', ndr_misc)
 
 '''
 [SUBSYSTEM::NDR_AUDIOSRV]



svn commit: samba r10441 - in trunk/source: libads libsmb

2005-09-22 Thread gd
Author: gd
Date: 2005-09-23 02:13:27 + (Fri, 23 Sep 2005)
New Revision: 10441

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

Log:
fix the build (until we find a better solution)

Guenther

Modified:
   trunk/source/libads/authdata.c
   trunk/source/libsmb/clikrb5.c


Changeset:
Modified: trunk/source/libads/authdata.c
===
--- trunk/source/libads/authdata.c  2005-09-23 02:05:26 UTC (rev 10440)
+++ trunk/source/libads/authdata.c  2005-09-23 02:13:27 UTC (rev 10441)
@@ -27,43 +27,6 @@
 
 #ifdef HAVE_KRB5
 
-BOOL unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB 
*unwrapped_pac_data)
-{
-   DATA_BLOB pac_contents;
-   ASN1_DATA data;
-   int data_type;
-
-   if (!auth_data->length) {
-   return False;
-   }
-
-   asn1_load(&data, *auth_data);
-   asn1_start_tag(&data, ASN1_SEQUENCE(0));
-   asn1_start_tag(&data, ASN1_SEQUENCE(0));
-   asn1_start_tag(&data, ASN1_CONTEXT(0));
-   asn1_read_Integer(&data, &data_type);
-   
-   if (data_type != KRB5_AUTHDATA_WIN2K_PAC ) {
-   DEBUG(10,("authorization data is not a Windows PAC (type: 
%d)\n", data_type));
-   asn1_free(&data);
-   return False;
-   }
-   
-   asn1_end_tag(&data);
-   asn1_start_tag(&data, ASN1_CONTEXT(1));
-   asn1_read_OctetString(&data, &pac_contents);
-   asn1_end_tag(&data);
-   asn1_end_tag(&data);
-   asn1_end_tag(&data);
-   asn1_free(&data);
-
-   *unwrapped_pac_data = data_blob_talloc(mem_ctx, pac_contents.data, 
pac_contents.length);
-
-   data_blob_free(&pac_contents);
-
-   return True;
-}
-
 static BOOL pac_io_logon_name(const char *desc, PAC_LOGON_NAME *logon_name,
  prs_struct *ps, int depth)
 {

Modified: trunk/source/libsmb/clikrb5.c
===
--- trunk/source/libsmb/clikrb5.c   2005-09-23 02:05:26 UTC (rev 10440)
+++ trunk/source/libsmb/clikrb5.c   2005-09-23 02:13:27 UTC (rev 10441)
@@ -188,6 +188,43 @@
 }
 #endif
 
+BOOL unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB 
*unwrapped_pac_data)
+{
+   DATA_BLOB pac_contents;
+   ASN1_DATA data;
+   int data_type;
+
+   if (!auth_data->length) {
+   return False;
+   }
+
+   asn1_load(&data, *auth_data);
+   asn1_start_tag(&data, ASN1_SEQUENCE(0));
+   asn1_start_tag(&data, ASN1_SEQUENCE(0));
+   asn1_start_tag(&data, ASN1_CONTEXT(0));
+   asn1_read_Integer(&data, &data_type);
+   
+   if (data_type != KRB5_AUTHDATA_WIN2K_PAC ) {
+   DEBUG(10,("authorization data is not a Windows PAC (type: 
%d)\n", data_type));
+   asn1_free(&data);
+   return False;
+   }
+   
+   asn1_end_tag(&data);
+   asn1_start_tag(&data, ASN1_CONTEXT(1));
+   asn1_read_OctetString(&data, &pac_contents);
+   asn1_end_tag(&data);
+   asn1_end_tag(&data);
+   asn1_end_tag(&data);
+   asn1_free(&data);
+
+   *unwrapped_pac_data = data_blob_talloc(mem_ctx, pac_contents.data, 
pac_contents.length);
+
+   data_blob_free(&pac_contents);
+
+   return True;
+}
+
  BOOL get_auth_data_from_tkt(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, 
krb5_ticket *tkt)
 {
DATA_BLOB auth_data_wrapped;



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

2005-09-22 Thread abartlet
Author: abartlet
Date: 2005-09-23 02:05:26 + (Fri, 23 Sep 2005)
New Revision: 10440

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

Log:
Start passing against Win2k3 SP1 again, with the NTLMv2 changes
described on the list.  I probably need to write more specific NTLMv2
sucess and failure mode tests.

Andrew Bartlett

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/samlogon.c
===
--- branches/SAMBA_4_0/source/torture/rpc/samlogon.c2005-09-23 01:05:08 UTC 
(rev 10439)
+++ branches/SAMBA_4_0/source/torture/rpc/samlogon.c2005-09-23 02:05:26 UTC 
(rev 10440)
@@ -572,7 +572,7 @@
DATA_BLOB lmv2_response = data_blob(NULL, 0);
DATA_BLOB lmv2_session_key = data_blob(NULL, 0);
DATA_BLOB ntlmv2_session_key = data_blob(NULL, 0);
-   DATA_BLOB names_blob = 
NTLMv2_generate_names_blob(samlogon_state->mem_ctx, lp_netbios_name(), 
lp_workgroup());
+   DATA_BLOB names_blob = 
NTLMv2_generate_names_blob(samlogon_state->mem_ctx, TEST_MACHINE_NAME, 
lp_workgroup());
 
uint8_t lm_session_key[8];
uint8_t user_session_key[16];



svn commit: samba r10439 - in trunk/source/libsmb: .

2005-09-22 Thread jra
Author: jra
Date: 2005-09-23 01:05:08 + (Fri, 23 Sep 2005)
New Revision: 10439

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

Log:
Fix typo in debug from new pac code.
Jeremy.

Modified:
   trunk/source/libsmb/clikrb5.c


Changeset:
Modified: trunk/source/libsmb/clikrb5.c
===
--- trunk/source/libsmb/clikrb5.c   2005-09-23 00:38:22 UTC (rev 10438)
+++ trunk/source/libsmb/clikrb5.c   2005-09-23 01:05:08 UTC (rev 10439)
@@ -204,7 +204,7 @@
if (tkt->enc_part2->authorization_data[i]->ad_type != 
KRB5_AUTHDATA_IF_RELEVANT) {
DEBUG(10,("get_auth_data_from_tkt: ad_type is 
%d\n", 
-   
kt->enc_part2->authorization_data[i]->ad_type));
+   
tkt->enc_part2->authorization_data[i]->ad_type));
continue;
}
 



svn commit: samba r10438 - in branches/SAMBA_4_0/source: . build/m4 client heimdal_build include lib lib/com lib/replace libcli/resolve librpc/ndr torture winbind

2005-09-22 Thread jelmer
Author: jelmer
Date: 2005-09-23 00:38:22 + (Fri, 23 Sep 2005)
New Revision: 10438

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

Log:
Move portability functions to lib/replace/; replace now simply ensures 
that a given set of (working) POSIX functions are available (without 
prefixes to their names, etc). See lib/replace/README for a list. 

Functions that behave different from their POSIX specification  
(such as sys_select, sys_read, etc) have kept the sys_ prefix.

Added:
   branches/SAMBA_4_0/source/lib/replace/README
   branches/SAMBA_4_0/source/lib/replace/dlfcn.c
Modified:
   branches/SAMBA_4_0/source/SConstruct
   branches/SAMBA_4_0/source/build/m4/rewrite.m4
   branches/SAMBA_4_0/source/client/client.c
   branches/SAMBA_4_0/source/dynconfig.c
   branches/SAMBA_4_0/source/heimdal_build/glue.c
   branches/SAMBA_4_0/source/include/includes.h
   branches/SAMBA_4_0/source/lib/com/tables.c
   branches/SAMBA_4_0/source/lib/replace/SConscript
   branches/SAMBA_4_0/source/lib/replace/config.m4
   branches/SAMBA_4_0/source/lib/replace/config.mk
   branches/SAMBA_4_0/source/lib/replace/replace.c
   branches/SAMBA_4_0/source/lib/replace/replace.h
   branches/SAMBA_4_0/source/lib/signal.c
   branches/SAMBA_4_0/source/lib/system.c
   branches/SAMBA_4_0/source/lib/time.c
   branches/SAMBA_4_0/source/lib/util.c
   branches/SAMBA_4_0/source/libcli/resolve/host.c
   branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c
   branches/SAMBA_4_0/source/torture/torture.c
   branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c


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


Build status as of Fri Sep 23 00:00:02 2005

2005-09-22 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2005-09-22 
00:00:37.0 +
+++ /home/build/master/cache/broken_results.txt 2005-09-23 00:00:09.0 
+
@@ -1,17 +1,17 @@
-Build status as of Thu Sep 22 00:00:02 2005
+Build status as of Fri Sep 23 00:00:02 2005
 
 Build counts:
 Tree Total  Broken Panic 
-ccache   7  2  0 
-distcc   11 2  0 
-lorikeet-heimdal 30 13 0 
+ccache   8  2  0 
+distcc   12 2  0 
+lorikeet-heimdal 32 14 0 
 ppp  20 0  0 
-rsync34 2  0 
+rsync35 2  0 
 samba2  1  0 
 samba-docs   0  0  0 
-samba4   36 17 2 
-samba_3_035 13 0 
-smb-build26 3  0 
-talloc   32 8  0 
-tdb  2  1  0 
+samba4   37 33 0 
+samba_3_036 13 0 
+smb-build28 4  0 
+talloc   33 9  0 
+tdb  33 18 0 
 


svn commit: samba r10437 - in trunk/source: . auth include lib libads libsmb nsswitch rpc_parse smbd utils

2005-09-22 Thread gd
Author: gd
Date: 2005-09-22 23:42:38 + (Thu, 22 Sep 2005)
New Revision: 10437

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

Log:
Use the Kerberos PAC when building the user token in a SPNEGO-Kerberos
Session Setup. 

In a lot of areas this is a direct port from Samba4 (especially the
validation/verification of PAC signatures). The main difficulty was not
make it work not only with Samba4's heimdal.

The first, most obvious benefit from this: it makes it possible for
Samba3 running in "security = ads" to use share security descriptors,
privileges or any other authorization mechanisms that are based on the
user's sid.

Thanks a lot to Andrew Bartlett and metze.

I tried my best to get original copyrights correct, please shout if I
did that wrong somewhere.

Guenther

Modified:
   trunk/source/Makefile.in
   trunk/source/auth/auth_util.c
   trunk/source/auth/auth_winbind.c
   trunk/source/configure.in
   trunk/source/include/ads.h
   trunk/source/include/authdata.h
   trunk/source/include/includes.h
   trunk/source/include/rpc_netlogon.h
   trunk/source/lib/time.c
   trunk/source/libads/authdata.c
   trunk/source/libads/kerberos_verify.c
   trunk/source/libsmb/clikrb5.c
   trunk/source/nsswitch/winbindd_pam.c
   trunk/source/rpc_parse/parse_net.c
   trunk/source/smbd/sesssetup.c
   trunk/source/utils/ntlm_auth.c


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


svn commit: samba r10436 - in branches/SAMBA_4_0/source/build/scons: .

2005-09-22 Thread tpot
Author: tpot
Date: 2005-09-22 23:30:08 + (Thu, 22 Sep 2005)
New Revision: 10436

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

Log:
Some thoughts on getting pidl working in scons.

Modified:
   branches/SAMBA_4_0/source/build/scons/pidl.py


Changeset:
Modified: branches/SAMBA_4_0/source/build/scons/pidl.py
===
--- branches/SAMBA_4_0/source/build/scons/pidl.py   2005-09-22 19:44:08 UTC 
(rev 10435)
+++ branches/SAMBA_4_0/source/build/scons/pidl.py   2005-09-22 23:30:08 UTC 
(rev 10436)
@@ -10,7 +10,13 @@
 
 idl_scanner = SCons.Scanner.ClassicCPP("PIDLScan", '.idl', 'CPPPATH', 
r'depends\(([^,]+),+\)', SCons.Node.FS.default_fs)
 
+def idl_emitter(target, source, env):
+   base, ext = SCons.Util.splitext(str(source[0]))
+   result = ['gen_ndr/%s.c' % base, 'gen_ndr/%s.h' % base]
+   return result
+
 pidl_builder = SCons.Builder.Builder(action='$PIDLCOM',
+emitter = idl_emitter,
  src_suffix = '.idl',
  suffix='.c',
  scanner = idl_scanner)
@@ -18,7 +24,7 @@
 def generate(env):
env['PIDL']  = env.Detect('pidl') or './pidl/pidl'
env['PIDLFLAGS'] = []
-   env['PIDLCOM']   = 'CPP=$CPP $PIDL $PIDLFLAGS -- $SOURCE'
+   env['PIDLCOM']   = '$PIDL $PIDLFLAGS -- $SOURCE'
env['BUILDERS']['NdrMarshaller'] = pidl_builder
 
 def exists(env):



svn commit: samba r10435 - in branches/SAMBA_4_0/source/winbind: .

2005-09-22 Thread metze
Author: metze
Date: 2005-09-22 19:44:08 + (Thu, 22 Sep 2005)
New Revision: 10435

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

Log:
fill in the reference to the generic wbsrv_call in the wbsrv_samba3_call,
so that async function can use it.

metze
Modified:
   branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c


Changeset:
Modified: branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c
===
--- branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c  2005-09-22 
19:36:43 UTC (rev 10434)
+++ branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c  2005-09-22 
19:44:08 UTC (rev 10435)
@@ -50,6 +50,7 @@
 
s3_call = talloc_zero(call, struct wbsrv_samba3_call);
NT_STATUS_HAVE_NO_MEMORY(s3_call);
+   s3call->call = call;
 
/* the packet layout is the same as the in memory layout of the 
request, so just copy it */
memcpy(&s3_call->request, blob.data, sizeof(s3_call->request));



svn commit: samba r10434 - in branches/SAMBA_4_0/source/winbind: .

2005-09-22 Thread metze
Author: metze
Date: 2005-09-22 19:36:43 + (Thu, 22 Sep 2005)
New Revision: 10434

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

Log:
add a short path to the event context that should be used for async replies

metze
Modified:
   branches/SAMBA_4_0/source/winbind/wb_server.c
   branches/SAMBA_4_0/source/winbind/wb_server.h


Changeset:
Modified: branches/SAMBA_4_0/source/winbind/wb_server.c
===
--- branches/SAMBA_4_0/source/winbind/wb_server.c   2005-09-22 19:28:20 UTC 
(rev 10433)
+++ branches/SAMBA_4_0/source/winbind/wb_server.c   2005-09-22 19:36:43 UTC 
(rev 10434)
@@ -123,7 +123,8 @@
/* we have a full request - parse it */
status = ops->pull_request(wbconn->partial, wbconn, &call);
if (!NT_STATUS_IS_OK(status)) goto failed;
-   call->wbconn = wbconn;
+   call->wbconn= wbconn;
+   call->event_ctx = conn->event.ctx;
 
/*
 * we have parsed the request, so we can reset the wbconn->partial_read,

Modified: branches/SAMBA_4_0/source/winbind/wb_server.h
===
--- branches/SAMBA_4_0/source/winbind/wb_server.h   2005-09-22 19:28:20 UTC 
(rev 10433)
+++ branches/SAMBA_4_0/source/winbind/wb_server.h   2005-09-22 19:36:43 UTC 
(rev 10434)
@@ -107,6 +107,9 @@
 #define WBSRV_CALL_FLAGS_REPLY_ASYNC 0x0001
uint32_t flags;
 
+   /* the backend should use this event context */
+   struct event_context *event_ctx;
+
/* the connection the call belongs to */
struct wbsrv_connection *wbconn;
 



svn commit: samba r10433 - in trunk/source/rpc_parse: .

2005-09-22 Thread jra
Author: jra
Date: 2005-09-22 19:28:20 + (Thu, 22 Sep 2005)
New Revision: 10433

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

Log:
Janitor for Jerry so we don't regress on XP shutdown code :-).
Jeremy.

Modified:
   trunk/source/rpc_parse/parse_reg.c
   trunk/source/rpc_parse/parse_shutdown.c


Changeset:
Modified: trunk/source/rpc_parse/parse_reg.c
===
--- trunk/source/rpc_parse/parse_reg.c  2005-09-22 19:21:27 UTC (rev 10432)
+++ trunk/source/rpc_parse/parse_reg.c  2005-09-22 19:28:20 UTC (rev 10433)
@@ -1484,8 +1484,9 @@
q_u->server = TALLOC_P( get_talloc_ctx(), uint16 );
*q_u->server = 0x1;
 
+   q_u->message = TALLOC_ZERO_P( get_talloc_ctx(), UNISTR4 );
+
if ( msg && *msg ) { 
-   q_u->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
init_unistr4( q_u->message, msg, UNI_FLAGS_NONE );
 
/* Win2000 is apparently very sensitive to these lengths */

Modified: trunk/source/rpc_parse/parse_shutdown.c
===
--- trunk/source/rpc_parse/parse_shutdown.c 2005-09-22 19:21:27 UTC (rev 
10432)
+++ trunk/source/rpc_parse/parse_shutdown.c 2005-09-22 19:28:20 UTC (rev 
10433)
@@ -34,8 +34,9 @@
q_s->server = TALLOC_P( get_talloc_ctx(), uint16 );
*q_s->server = 0x1;
 
+   q_s->message = TALLOC_ZERO_P( get_talloc_ctx(), UNISTR4 );
+
if ( msg && *msg ) {
-   q_s->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
init_unistr4( q_s->message, msg, UNI_FLAGS_NONE );
 
/* Win2000 is apparently very sensitive to these lengths */



svn commit: samba r10432 - in branches: SAMBA_3_0/source/rpc_parse SAMBA_3_0_RELEASE/source/rpc_parse

2005-09-22 Thread jerry
Author: jerry
Date: 2005-09-22 19:21:27 + (Thu, 22 Sep 2005)
New Revision: 10432

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

Log:
BUG 3080: fix 'net rpc shutdown' for XP clients
Modified:
   branches/SAMBA_3_0/source/rpc_parse/parse_reg.c
   branches/SAMBA_3_0/source/rpc_parse/parse_shutdown.c
   branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_reg.c
   branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_shutdown.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_parse/parse_reg.c
===
--- branches/SAMBA_3_0/source/rpc_parse/parse_reg.c 2005-09-22 18:49:23 UTC 
(rev 10431)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_reg.c 2005-09-22 19:21:27 UTC 
(rev 10432)
@@ -1484,8 +1484,9 @@
q_u->server = TALLOC_P( get_talloc_ctx(), uint16 );
*q_u->server = 0x1;
 
+   q_u->message = TALLOC_ZERO_P( get_talloc_ctx(), UNISTR4 );
+
if ( msg && *msg ) { 
-   q_u->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
init_unistr4( q_u->message, msg, UNI_FLAGS_NONE );
 
/* Win2000 is apparently very sensitive to these lengths */

Modified: branches/SAMBA_3_0/source/rpc_parse/parse_shutdown.c
===
--- branches/SAMBA_3_0/source/rpc_parse/parse_shutdown.c2005-09-22 
18:49:23 UTC (rev 10431)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_shutdown.c2005-09-22 
19:21:27 UTC (rev 10432)
@@ -34,8 +34,9 @@
q_s->server = TALLOC_P( get_talloc_ctx(), uint16 );
*q_s->server = 0x1;
 
+   q_s->message = TALLOC_ZERO_P( get_talloc_ctx(), UNISTR4 );
+
if ( msg && *msg ) {
-   q_s->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
init_unistr4( q_s->message, msg, UNI_FLAGS_NONE );
 
/* Win2000 is apparently very sensitive to these lengths */

Modified: branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_reg.c
===
--- branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_reg.c 2005-09-22 
18:49:23 UTC (rev 10431)
+++ branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_reg.c 2005-09-22 
19:21:27 UTC (rev 10432)
@@ -1484,8 +1484,9 @@
q_u->server = TALLOC_P( get_talloc_ctx(), uint16 );
*q_u->server = 0x1;
 
+   q_u->message = TALLOC_ZERO_P( get_talloc_ctx(), UNISTR4 );
+
if ( msg && *msg ) { 
-   q_u->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
init_unistr4( q_u->message, msg, UNI_FLAGS_NONE );
 
/* Win2000 is apparently very sensitive to these lengths */

Modified: branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_shutdown.c
===
--- branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_shutdown.c
2005-09-22 18:49:23 UTC (rev 10431)
+++ branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_shutdown.c
2005-09-22 19:21:27 UTC (rev 10432)
@@ -34,8 +34,9 @@
q_s->server = TALLOC_P( get_talloc_ctx(), uint16 );
*q_s->server = 0x1;
 
+   q_s->message = TALLOC_ZERO_P( get_talloc_ctx(), UNISTR4 );
+
if ( msg && *msg ) {
-   q_s->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
init_unistr4( q_s->message, msg, UNI_FLAGS_NONE );
 
/* Win2000 is apparently very sensitive to these lengths */



svn commit: samba r10431 - in branches: SAMBA_3_0/source/utils SAMBA_3_0_RELEASE/source/utils

2005-09-22 Thread jerry
Author: jerry
Date: 2005-09-22 18:49:23 + (Thu, 22 Sep 2005)
New Revision: 10431

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

Log:
fix segfault when the pip open fails in 'net rpc' commands
Modified:
   branches/SAMBA_3_0/source/utils/net_rpc.c
   branches/SAMBA_3_0_RELEASE/source/utils/net_rpc.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_rpc.c
===
--- branches/SAMBA_3_0/source/utils/net_rpc.c   2005-09-22 18:48:52 UTC (rev 
10430)
+++ branches/SAMBA_3_0/source/utils/net_rpc.c   2005-09-22 18:49:23 UTC (rev 
10431)
@@ -131,6 +131,8 @@
if (!(conn_flags & NET_FLAGS_NO_PIPE)) {
if (!cli_nt_session_open(cli, pipe_idx)) {
DEBUG(0, ("Could not initialise pipe\n"));
+   cli_shutdown(cli);
+   return -1;
}
}


Modified: branches/SAMBA_3_0_RELEASE/source/utils/net_rpc.c
===
--- branches/SAMBA_3_0_RELEASE/source/utils/net_rpc.c   2005-09-22 18:48:52 UTC 
(rev 10430)
+++ branches/SAMBA_3_0_RELEASE/source/utils/net_rpc.c   2005-09-22 18:49:23 UTC 
(rev 10431)
@@ -131,6 +131,8 @@
if (!(conn_flags & NET_FLAGS_NO_PIPE)) {
if (!cli_nt_session_open(cli, pipe_idx)) {
DEBUG(0, ("Could not initialise pipe\n"));
+   cli_shutdown(cli);
+   return -1;
}
}




svn commit: samba r10430 - in branches/SAMBA_3_0_RELEASE/source: include libsmb

2005-09-22 Thread jerry
Author: jerry
Date: 2005-09-22 18:48:52 + (Thu, 22 Sep 2005)
New Revision: 10430

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

Log:
adding missing files
Added:
   branches/SAMBA_3_0_RELEASE/source/include/smb_share_modes.h
   branches/SAMBA_3_0_RELEASE/source/libsmb/smb_share_modes.c


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


svn commit: samba r10429 - in trunk/source/nsswitch: .

2005-09-22 Thread jra
Author: jra
Date: 2005-09-22 18:46:55 + (Thu, 22 Sep 2005)
New Revision: 10429

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

Log:
Added Volker's fix for LSA pipes. winbindd should now work
with just a machine a/c password to do secure RPC.
Jeremy.

Modified:
   trunk/source/nsswitch/winbindd_cm.c


Changeset:
Modified: trunk/source/nsswitch/winbindd_cm.c
===
--- trunk/source/nsswitch/winbindd_cm.c 2005-09-22 18:41:17 UTC (rev 10428)
+++ trunk/source/nsswitch/winbindd_cm.c 2005-09-22 18:46:55 UTC (rev 10429)
@@ -1162,22 +1162,72 @@
conn = &domain->conn;
 
if (conn->lsa_pipe == NULL) {
+   fstring conn_pwd;
+   pwd_get_cleartext(&conn->cli->pwd, conn_pwd);
+   if (conn->cli->user_name[0] && conn->cli->domain[0] &&
+   conn_pwd[0]) {
+   /* We have an authenticated connection. Use
+  a NTLMSSP SPNEGO authenticated LSA pipe with
+  sign & seal. */
+   conn->lsa_pipe = 
+   cli_rpc_pipe_open_spnego_ntlmssp(conn->cli,
+PI_LSARPC,
+
PIPE_AUTH_LEVEL_PRIVACY,
+
conn->cli->domain,
+
conn->cli->user_name,
+conn_pwd,
+&result);
+   if (conn->lsa_pipe == NULL) {
+   DEBUG(10,("cm_connect_lsa: failed to connect "
+ "to LSA pipe for domain %s using "
+ "NTLMSSP authenticated pipe: user "
+ "%s\\%s. Error was %s\n",
+ domain->name, conn->cli->domain,
+ conn->cli->user_name,
+ nt_errstr(result)));
+   } else {
+   DEBUG(10,("cm_connect_lsa: connected to LSA "
+ "pipe for domain %s using NTLMSSP "
+ "authenticated pipe: user %s\\%s\n",
+ domain->name, conn->cli->domain,
+ conn->cli->user_name ));
+   }
+   }
+   
 #ifndef DISABLE_SCHANNEL_WIN2K3_SP1
-   struct dcinfo *p_dcinfo;
+   /* Fall back to schannel if it's a W2K pre-SP1 box. */
+   if (conn->lsa_pipe == NULL) {
+   struct dcinfo *p_dcinfo;
 
-   if (cm_get_schannel_dcinfo(domain, &p_dcinfo)) {
-   conn->lsa_pipe =
-   cli_rpc_pipe_open_schannel_with_key(conn->cli,
-   PI_LSARPC,
-   
PIPE_AUTH_LEVEL_PRIVACY,
-   
domain->name,
-   p_dcinfo,
-   &result);
-   } else
+   if (cm_get_schannel_dcinfo(domain, &p_dcinfo)) {
+   conn->lsa_pipe =
+   
cli_rpc_pipe_open_schannel_with_key(conn->cli,
+   
PI_LSARPC,
+   
PIPE_AUTH_LEVEL_PRIVACY,
+   
domain->name,
+   
p_dcinfo,
+   
&result);
+   }
+   if (conn->lsa_pipe == NULL) {
+   DEBUG(10,("cm_connect_lsa: failed to connect "
+ "to LSA pipe for domain %s using "
+ "schannel authenticated. Error "
+ "was %s\n", domain->name,
+ nt_errstr(result) ));
+   } else {
+   DEBUG(10,("cm_connect_lsa: connected to LSA "
+ "pipe for domain %s using 
schannel.\n",
+ domain->name ));
+   }
+ 

svn commit: samba r10428 - in trunk/source/rpc_client: .

2005-09-22 Thread jra
Author: jra
Date: 2005-09-22 18:41:17 + (Thu, 22 Sep 2005)
New Revision: 10428

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

Log:
It doesn't help in encrypted RPC streams if you forget to remove
the auth_footer from the stream... :-). Thanks to Volker for catching
this "Doh!" Homer Simpson bug :-).
Jeremy.

Modified:
   trunk/source/rpc_client/cli_pipe.c


Changeset:
Modified: trunk/source/rpc_client/cli_pipe.c
===
--- trunk/source/rpc_client/cli_pipe.c  2005-09-22 18:37:03 UTC (rev 10427)
+++ trunk/source/rpc_client/cli_pipe.c  2005-09-22 18:41:17 UTC (rev 10428)
@@ -440,6 +440,19 @@
 {
NTSTATUS ret = NT_STATUS_OK;
 
+   /* Paranioa checks for auth_len. */
+   if (prhdr->auth_len) {
+   if (prhdr->auth_len > prhdr->frag_len) {
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+
+   if (prhdr->auth_len + RPC_HDR_AUTH_LEN < prhdr->auth_len ||
+   prhdr->auth_len + RPC_HDR_AUTH_LEN < 
RPC_HDR_AUTH_LEN) {
+   /* Integer wrap attempt. */
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+   }
+
/*
 * Now we have a complete RPC request PDU fragment, try and verify any 
auth data.
 */
@@ -543,11 +556,26 @@
 
/* Point the return values at the NDR data. Remember to 
remove any ss padding. */
*ppdata = prs_data_p(current_pdu) + RPC_HEADER_LEN + 
RPC_HDR_RESP_LEN;
+
if (current_pdu_len < RPC_HEADER_LEN + RPC_HDR_RESP_LEN 
+ ss_padding_len) {
return NT_STATUS_BUFFER_TOO_SMALL;
}
+
*pdata_len = current_pdu_len - RPC_HEADER_LEN - 
RPC_HDR_RESP_LEN - ss_padding_len;
 
+   /* Remember to remove the auth footer. */
+   if (prhdr->auth_len) {
+   /* We've already done integer wrap tests on 
auth_len in
+   cli_pipe_validate_rpc_response(). */
+   if (*pdata_len < RPC_HDR_AUTH_LEN + 
prhdr->auth_len) {
+   return NT_STATUS_BUFFER_TOO_SMALL;
+   }
+   *pdata_len -= (RPC_HDR_AUTH_LEN + 
prhdr->auth_len);
+   }
+
+   DEBUG(10,("cli_pipe_validate_current_pdu: got pdu len 
%u, data_len %u, ss_len %u\n",
+   current_pdu_len, *pdata_len, ss_padding_len ));
+
/*
 * If this is the first reply, and the allocation hint 
is reasonably, try and
 * set up the return_data parse_struct to the correct 
size.
@@ -809,6 +837,9 @@
ret = cli_pipe_validate_current_pdu(cli, &rhdr, ¤t_pdu, 
expected_pkt_type,
&ret_data, &ret_data_len, rbuf);
 
+   DEBUG(10,("rpc_api_pipe: got PDU len of %u at offset %u\n",
+   prs_data_size(¤t_pdu), current_rbuf_offset ));
+
if (!NT_STATUS_IS_OK(ret)) {
goto err;
}



svn commit: samba r10427 - in branches/tmp/samba4-winsrepl: . source source/include source/lib/ldb/include source/lib/ldb/ldb_tdb source/lib/ldb/tests source/lib/tdb source/lib/tdb/common source/lib/t

2005-09-22 Thread metze
Author: metze
Date: 2005-09-22 18:37:03 + (Thu, 22 Sep 2005)
New Revision: 10427

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

Log:
 [EMAIL PROTECTED] (orig r10418):  tpot | 2005-09-22 10:47:32 +0200
 Fix comparison_fn_t test I busted.  Add $HOME to the environment as some
 tools get confused if it isn't there.
 
 [EMAIL PROTECTED] (orig r10419):  idra | 2005-09-22 11:06:37 +0200
 
 Remove unused prototypes of locking functions (thanks Jelmer)
 omment about transactions
 
 
 [EMAIL PROTECTED] (orig r10420):  jelmer | 2005-09-22 14:23:44 +0200
 Two minor scons fixes
 
 [EMAIL PROTECTED] (orig r10421):  tridge | 2005-09-22 15:12:46 +0200
 
 following on discussions with simo, I have worked out a way of
 allowing searches to proceed while another process is in a
 transaction, then only upgrading the transaction lock to a write lock
 on commit. 
 
 The solution is:
 
  - split tdb_traverse() into two calls, called tdb_traverse() and
tdb_traverse_read(). The _read() version only gets read locks, and
will fail any write operations made in the callback from the
traverse.
 
  - the normal tdb_traverse() call allows for read or write operations
in the callback, but gets the transaction lock, preventing
transastions from starting inside the traverse
 
 In addition we enforce the following rule that you may not start a
 transaction within a traverse callback, although you can start a
 traverse within a transaction
 
 With these rules in place I believe all the deadlock possibilities are
 removed, and we can now allow for searches to happen in parallel with
 transactions
 
 
 [EMAIL PROTECTED] (orig r10422):  tridge | 2005-09-22 15:14:12 +0200
 
 ldb_search() can now use tdb_traverse_read() to ensure it can run in
 parallel with any transaction
 
 [EMAIL PROTECTED] (orig r10423):  tridge | 2005-09-22 15:16:23 +0200
 
 minor changes to the ldb test suite to allow it to work correctly with
 a real ldap backend (such as openldap)
 
 [EMAIL PROTECTED] (orig r10424):  tridge | 2005-09-22 15:20:28 +0200
 
 for caller convenience, automatically turn a tdb_traverse() into a
 tdb_traverse_read() for read only databases
 
 [EMAIL PROTECTED] (orig r10426):  metze | 2005-09-22 20:35:08 +0200
 - restructure the winbind server code a bit
 - remove the echo test stuff
 - abstract out the used protocol
 - we have a seperate handler for the samba3 protocol now
 - the backend can easy do async replies
   by setting WBSRV_CALL_FLAGS_REPLY_ASYNC in wbsrv_call
   and then call wbsrv_queue_reply() later
 
 metze
 

Added:
   branches/tmp/samba4-winsrepl/source/winbind/wb_samba3_cmd.c
   branches/tmp/samba4-winsrepl/source/winbind/wb_samba3_protocol.c
   branches/tmp/samba4-winsrepl/source/winbind/wb_samba3_protocol.h
   branches/tmp/samba4-winsrepl/source/winbind/wb_server.h
Modified:
   branches/tmp/samba4-winsrepl/
   branches/tmp/samba4-winsrepl/source/SConstruct
   branches/tmp/samba4-winsrepl/source/include/structs.h
   branches/tmp/samba4-winsrepl/source/lib/ldb/include/ldb.h
   branches/tmp/samba4-winsrepl/source/lib/ldb/ldb_tdb/ldb_search.c
   branches/tmp/samba4-winsrepl/source/lib/ldb/tests/init.ldif
   branches/tmp/samba4-winsrepl/source/lib/ldb/tests/test.ldif
   branches/tmp/samba4-winsrepl/source/lib/tdb/SConscript
   branches/tmp/samba4-winsrepl/source/lib/tdb/common/error.c
   branches/tmp/samba4-winsrepl/source/lib/tdb/common/io.c
   branches/tmp/samba4-winsrepl/source/lib/tdb/common/lock.c
   branches/tmp/samba4-winsrepl/source/lib/tdb/common/tdb.c
   branches/tmp/samba4-winsrepl/source/lib/tdb/common/tdb_private.h
   branches/tmp/samba4-winsrepl/source/lib/tdb/common/transaction.c
   branches/tmp/samba4-winsrepl/source/lib/tdb/common/traverse.c
   branches/tmp/samba4-winsrepl/source/lib/tdb/docs/README
   branches/tmp/samba4-winsrepl/source/lib/tdb/include/tdb.h
   branches/tmp/samba4-winsrepl/source/lib/tdb/tools/tdbtorture.c
   branches/tmp/samba4-winsrepl/source/winbind/SConscript
   branches/tmp/samba4-winsrepl/source/winbind/config.mk
   branches/tmp/samba4-winsrepl/source/winbind/wb_server.c


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


svn commit: samba r10426 - in branches/SAMBA_4_0/source: include winbind

2005-09-22 Thread metze
Author: metze
Date: 2005-09-22 18:35:08 + (Thu, 22 Sep 2005)
New Revision: 10426

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

Log:
- restructure the winbind server code a bit
- remove the echo test stuff
- abstract out the used protocol
- we have a seperate handler for the samba3 protocol now
- the backend can easy do async replies
  by setting WBSRV_CALL_FLAGS_REPLY_ASYNC in wbsrv_call
  and then call wbsrv_queue_reply() later

metze

Added:
   branches/SAMBA_4_0/source/winbind/wb_samba3_cmd.c
   branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c
   branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.h
   branches/SAMBA_4_0/source/winbind/wb_server.h
Modified:
   branches/SAMBA_4_0/source/include/structs.h
   branches/SAMBA_4_0/source/winbind/SConscript
   branches/SAMBA_4_0/source/winbind/config.mk
   branches/SAMBA_4_0/source/winbind/wb_server.c


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


svn commit: samba r10425 - in branches/tmp/vl-cluster/source: . include libads libsmb nsswitch param printing rpc_client rpc_parse smbd tdb torture utils

2005-09-22 Thread vlendec
Author: vlendec
Date: 2005-09-22 13:49:54 + (Thu, 22 Sep 2005)
New Revision: 10425

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

Log:
Merge trunk up to r10424
Added:
   branches/tmp/vl-cluster/source/printing/print_iprint.c
Removed:
   branches/tmp/vl-cluster/source/include/rpc_creds.h
Modified:
   branches/tmp/vl-cluster/source/Makefile.in
   branches/tmp/vl-cluster/source/configure.in
   branches/tmp/vl-cluster/source/include/client.h
   branches/tmp/vl-cluster/source/include/includes.h
   branches/tmp/vl-cluster/source/include/ntdomain.h
   branches/tmp/vl-cluster/source/include/printing.h
   branches/tmp/vl-cluster/source/include/rpc_misc.h
   branches/tmp/vl-cluster/source/include/smb.h
   branches/tmp/vl-cluster/source/libads/sasl.c
   branches/tmp/vl-cluster/source/libsmb/cliconnect.c
   branches/tmp/vl-cluster/source/libsmb/clientgen.c
   branches/tmp/vl-cluster/source/libsmb/clikrb5.c
   branches/tmp/vl-cluster/source/libsmb/clispnego.c
   branches/tmp/vl-cluster/source/libsmb/passchange.c
   branches/tmp/vl-cluster/source/nsswitch/pam_winbind.c
   branches/tmp/vl-cluster/source/nsswitch/wb_common.c
   branches/tmp/vl-cluster/source/nsswitch/winbind_client.h
   branches/tmp/vl-cluster/source/nsswitch/winbindd.h
   branches/tmp/vl-cluster/source/nsswitch/winbindd_cm.c
   branches/tmp/vl-cluster/source/nsswitch/winbindd_nss.h
   branches/tmp/vl-cluster/source/param/loadparm.c
   branches/tmp/vl-cluster/source/printing/pcap.c
   branches/tmp/vl-cluster/source/printing/printing.c
   branches/tmp/vl-cluster/source/rpc_client/cli_pipe.c
   branches/tmp/vl-cluster/source/rpc_parse/parse_prs.c
   branches/tmp/vl-cluster/source/smbd/dosmode.c
   branches/tmp/vl-cluster/source/tdb/tdb.c
   branches/tmp/vl-cluster/source/torture/locktest.c
   branches/tmp/vl-cluster/source/utils/ntlm_auth.c


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


svn commit: samba r10424 - in branches/SAMBA_4_0/source/lib/tdb/common: .

2005-09-22 Thread tridge
Author: tridge
Date: 2005-09-22 13:20:28 + (Thu, 22 Sep 2005)
New Revision: 10424

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

Log:

for caller convenience, automatically turn a tdb_traverse() into a
tdb_traverse_read() for read only databases

Modified:
   branches/SAMBA_4_0/source/lib/tdb/common/traverse.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/common/traverse.c
===
--- branches/SAMBA_4_0/source/lib/tdb/common/traverse.c 2005-09-22 13:16:23 UTC 
(rev 10423)
+++ branches/SAMBA_4_0/source/lib/tdb/common/traverse.c 2005-09-22 13:20:28 UTC 
(rev 10424)
@@ -220,6 +220,10 @@
 {
struct tdb_traverse_lock tl = { NULL, 0, 0, F_WRLCK };
int ret;
+
+   if (tdb->read_only) {
+   return tdb_traverse_read(tdb, fn, private);
+   }

if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_WRLCK, F_SETLKW, 
0) == -1) {
TDB_LOG((tdb, 0, "tdb_traverse: failed to get transaction 
lock\n"));



svn commit: samba r10423 - in branches/SAMBA_4_0/source/lib/ldb/tests: .

2005-09-22 Thread tridge
Author: tridge
Date: 2005-09-22 13:16:23 + (Thu, 22 Sep 2005)
New Revision: 10423

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

Log:

minor changes to the ldb test suite to allow it to work correctly with
a real ldap backend (such as openldap)

Modified:
   branches/SAMBA_4_0/source/lib/ldb/tests/init.ldif
   branches/SAMBA_4_0/source/lib/ldb/tests/test.ldif


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/tests/init.ldif
===
--- branches/SAMBA_4_0/source/lib/ldb/tests/init.ldif   2005-09-22 13:14:12 UTC 
(rev 10422)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/init.ldif   2005-09-22 13:16:23 UTC 
(rev 10423)
@@ -14,3 +14,18 @@
  09 $ US
 telephonenumber: +1 313 764-1817
 associateddomain: example.com
+
+dn: ou=People,o=University of Michigan,c=TEST
+objectclass: organizationalUnit
+objectclass: extensibleObject
+ou: People
+uidNumber: 0
+gidNumber: 0
+
+dn: ou=Ldb Test,ou=People,o=University of Michigan,c=TEST
+objectclass: organizationalUnit
+objectclass: extensibleObject
+ou: People
+ou: Ldb Test
+uidNumber: 0
+gidNumber: 0

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/test.ldif
===
--- branches/SAMBA_4_0/source/lib/ldb/tests/test.ldif   2005-09-22 13:14:12 UTC 
(rev 10422)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/test.ldif   2005-09-22 13:16:23 UTC 
(rev 10423)
@@ -1,10 +1,3 @@
-dn: ou=People,o=University of Michigan,c=TEST
-objectclass: organizationalUnit
-objectclass: extensibleObject
-ou: People
-uidNumber: 0
-gidNumber: 0
-
 dn: ou=Groups,o=University of Michigan,c=TEST
 objectclass: organizationalUnit
 ou: Groups



svn commit: samba r10422 - in branches/SAMBA_4_0/source/lib/ldb/ldb_tdb: .

2005-09-22 Thread tridge
Author: tridge
Date: 2005-09-22 13:14:12 + (Thu, 22 Sep 2005)
New Revision: 10422

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

Log:

ldb_search() can now use tdb_traverse_read() to ensure it can run in
parallel with any transaction

Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c  2005-09-22 
13:12:46 UTC (rev 10421)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c  2005-09-22 
13:14:12 UTC (rev 10422)
@@ -472,7 +472,7 @@
sinfo->count = 0;
sinfo->failures = 0;
 
-   ret = tdb_traverse(ltdb->tdb, search_func, sinfo);
+   ret = tdb_traverse_read(ltdb->tdb, search_func, sinfo);
 
if (ret == -1) {
talloc_free(sinfo);



svn commit: samba r10421 - in branches/SAMBA_4_0/source/lib/tdb: common docs include tools

2005-09-22 Thread tridge
Author: tridge
Date: 2005-09-22 13:12:46 + (Thu, 22 Sep 2005)
New Revision: 10421

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

Log:

following on discussions with simo, I have worked out a way of
allowing searches to proceed while another process is in a
transaction, then only upgrading the transaction lock to a write lock
on commit. 

The solution is:

 - split tdb_traverse() into two calls, called tdb_traverse() and
   tdb_traverse_read(). The _read() version only gets read locks, and
   will fail any write operations made in the callback from the
   traverse.

 - the normal tdb_traverse() call allows for read or write operations
   in the callback, but gets the transaction lock, preventing
   transastions from starting inside the traverse

In addition we enforce the following rule that you may not start a
transaction within a traverse callback, although you can start a
traverse within a transaction

With these rules in place I believe all the deadlock possibilities are
removed, and we can now allow for searches to happen in parallel with
transactions


Modified:
   branches/SAMBA_4_0/source/lib/tdb/common/error.c
   branches/SAMBA_4_0/source/lib/tdb/common/io.c
   branches/SAMBA_4_0/source/lib/tdb/common/lock.c
   branches/SAMBA_4_0/source/lib/tdb/common/tdb.c
   branches/SAMBA_4_0/source/lib/tdb/common/tdb_private.h
   branches/SAMBA_4_0/source/lib/tdb/common/transaction.c
   branches/SAMBA_4_0/source/lib/tdb/common/traverse.c
   branches/SAMBA_4_0/source/lib/tdb/docs/README
   branches/SAMBA_4_0/source/lib/tdb/include/tdb.h
   branches/SAMBA_4_0/source/lib/tdb/tools/tdbtorture.c


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


svn commit: samba r10420 - in branches/SAMBA_4_0/source: . lib/tdb

2005-09-22 Thread jelmer
Author: jelmer
Date: 2005-09-22 12:23:44 + (Thu, 22 Sep 2005)
New Revision: 10420

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

Log:
Two minor scons fixes

Modified:
   branches/SAMBA_4_0/source/SConstruct
   branches/SAMBA_4_0/source/lib/tdb/SConscript


Changeset:
Modified: branches/SAMBA_4_0/source/SConstruct
===
--- branches/SAMBA_4_0/source/SConstruct2005-09-22 09:06:37 UTC (rev 
10419)
+++ branches/SAMBA_4_0/source/SConstruct2005-09-22 12:23:44 UTC (rev 
10420)
@@ -42,9 +42,6 @@
hostenv.Append(CCFLAGS='-Wno-format-y2k')
hostenv.Append(CCFLAGS='-Wno-declaration-after-statement')
 
-# Pull in GNU extensions
-hostenv.Append(CPPDEFINES = {'_GNU_SOURCE': 1})
-
 # Some tools get confused if $HOME isn't defined
 hostenv.Append(ENV={'HOME': os.environ['HOME']})
 
@@ -138,6 +135,9 @@
if conf.CheckFunc(f):
defines['HAVE_' + f.upper()] = 1
 
+   # Pull in GNU extensions
+   defines['_GNU_SOURCE'] = 1
+
needed_types = { 
'uint_t': 'unsigned int',
'int8_t': 'signed char',

Modified: branches/SAMBA_4_0/source/lib/tdb/SConscript
===
--- branches/SAMBA_4_0/source/lib/tdb/SConscript2005-09-22 09:06:37 UTC 
(rev 10419)
+++ branches/SAMBA_4_0/source/lib/tdb/SConscript2005-09-22 12:23:44 UTC 
(rev 10420)
@@ -12,4 +12,4 @@
 tdbtool = tdbenv.Program('bin/tdbtool', ['tools/tdbtool.c',tdb])
 tdbtorture = tdbenv.Program('bin/tdbtorture', ['tools/tdbtorture.c',tdb])
 tdbdump = tdbenv.Program('bin/tdbdump', ['tools/tdbdump.c',tdb])
-tdbbackup = tdbenv.Program('bin/tdbbackup', ['tools/tdbbackup.c',tdb])
+#tdbbackup = tdbenv.Program('bin/tdbbackup', ['tools/tdbbackup.c',tdb])



svn commit: samba r10419 - in branches/SAMBA_4_0/source/lib/ldb/include: .

2005-09-22 Thread idra
Author: idra
Date: 2005-09-22 09:06:37 + (Thu, 22 Sep 2005)
New Revision: 10419

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

Log:

Remove unused prototypes of locking functions (thanks Jelmer)
omment about transactions


Modified:
   branches/SAMBA_4_0/source/lib/ldb/include/ldb.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2005-09-22 08:47:32 UTC 
(rev 10418)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2005-09-22 09:06:37 UTC 
(rev 10419)
@@ -49,6 +49,7 @@
   major restrictions as compared to tdb:
 
  - no explicit locking calls
+ UPDATE: we have transactions now, better than locking --SSS.
 
 */
 
@@ -303,16 +304,6 @@
 int ldb_rename(struct ldb_context *ldb, const struct ldb_dn *olddn, const 
struct ldb_dn *newdn);
 
 /*
-  create a named lock
-*/
-int ldb_lock(struct ldb_context *ldb, const char *lockname);
-
-/*
-  release a named lock
-*/
-int ldb_unlock(struct ldb_context *ldb, const char *lockname);
-
-/*
   delete a record from the database
 */
 int ldb_delete(struct ldb_context *ldb, const struct ldb_dn *dn);



svn commit: samba r10418 - in branches/SAMBA_4_0/source: .

2005-09-22 Thread tpot
Author: tpot
Date: 2005-09-22 08:47:32 + (Thu, 22 Sep 2005)
New Revision: 10418

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

Log:
Fix comparison_fn_t test I busted.  Add $HOME to the environment as some
tools get confused if it isn't there.

Modified:
   branches/SAMBA_4_0/source/SConstruct


Changeset:
Modified: branches/SAMBA_4_0/source/SConstruct
===
--- branches/SAMBA_4_0/source/SConstruct2005-09-22 08:23:45 UTC (rev 
10417)
+++ branches/SAMBA_4_0/source/SConstruct2005-09-22 08:47:32 UTC (rev 
10418)
@@ -7,7 +7,7 @@
 # Copyright (C) 2005 Jelmer Vernooij <[EMAIL PROTECTED]>
 # Published under the GNU GPL
 
-import cPickle, string
+import cPickle, string, os
 
 # We don't care about NFS builds...
 
@@ -45,6 +45,9 @@
 # Pull in GNU extensions
 hostenv.Append(CPPDEFINES = {'_GNU_SOURCE': 1})
 
+# Some tools get confused if $HOME isn't defined
+hostenv.Append(ENV={'HOME': os.environ['HOME']})
+
 # Store configuration data in a dictionary.
 
 def saveconfig(data):
@@ -159,7 +162,7 @@
if conf.CheckType(t, type_headers):
defines['HAVE_%s' % string.upper(t)] = 1
 
-   if conf.CheckType('comparison_fn_t', type_headers):
+   if conf.CheckType('comparison_fn_t', '#include '):
defines['HAVE_COMPARISON_FN_T'] = 1
 
if conf.CheckType('sig_atomic_t', '#include '):



svn commit: samba r10417 - in branches/tmp/samba4-winsrepl: . source source/auth source/auth/gensec source/auth/kerberos source/auth/ntlmssp source/build/m4 source/build/scons source/build/smb_build s

2005-09-22 Thread metze
Author: metze
Date: 2005-09-22 08:23:45 + (Thu, 22 Sep 2005)
New Revision: 10417

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

Log:
 [EMAIL PROTECTED] (orig r10353):  vlendec | 2005-09-20 17:43:58 +0200
 Fix typo
 [EMAIL PROTECTED] (orig r10356):  jelmer | 2005-09-20 19:49:19 +0200
 Make the proto generator work with scons
 
 [EMAIL PROTECTED] (orig r10363):  vlendec | 2005-09-20 22:54:25 +0200
 Nobody loudly screamed "noo", so commit the samba3 winbind interface to
 samba4. Ok, maybe the silence is due to timezones, but what can you do... ;-)
 
 Volker
 
 [EMAIL PROTECTED] (orig r10364):  abartlet | 2005-09-20 23:29:29 +0200
 Turn gensec:gssapi on by default, except for a login of the form
 -Udomain\\user.
 
 This will probably break in a few configurations, so please let me
 know.  I'll also work to have a way to inhibit kerberos/ntlmssp, as
 this removes -k.
 
 Andrew Bartlett
 
 [EMAIL PROTECTED] (orig r10365):  vlendec | 2005-09-20 23:37:10 +0200
 Use nsswitch/winbindd_nss.h in winbind/, update that file to the current 3_0
 interface.
 
 Volker
 
 [EMAIL PROTECTED] (orig r10366):  jelmer | 2005-09-21 00:10:40 +0200
 More scons fixes. Building et, asn1, lex and yacc files sort-of works now
 
 [EMAIL PROTECTED] (orig r10368):  tridge | 2005-09-21 00:52:54 +0200
 
 when building the epm tower, don't put host names in the ip address
 field, instead put a zero address. Note that zero is correct (ie. we
 shouldn't do the lookup) as in the client we want to send a zero for
 the server to fill in. When we make this call from the server we fill
 in a real IP.
 
 [EMAIL PROTECTED] (orig r10369):  tpot | 2005-09-21 01:00:45 +0200
 You don't need to put leading or trailing spaces on variables.  It's
 a make-ism.
 
 Use consistent (single) quoting.
 
 [EMAIL PROTECTED] (orig r10370):  tridge | 2005-09-21 01:23:03 +0200
 
 only validate the re-generated binding string for hostnames with IPs
 
 Jelmer, can you see a better approach to this? As far as I am aware
 protocol towers don't use hostnames, they always use IP addresses
 
 [EMAIL PROTECTED] (orig r10372):  abartlet | 2005-09-21 02:15:56 +0200
 Having gone to all the effort to uppercase the realm, actually set the
 upper-case realm.
 
 Andrew Bartlett
 
 [EMAIL PROTECTED] (orig r10373):  abartlet | 2005-09-21 02:27:10 +0200
 Fix segfault in LookupSids.
 
 Andrew Bartlett
 
 [EMAIL PROTECTED] (orig r10374):  jelmer | 2005-09-21 02:38:23 +0200
 Add HAVE_* defines (on command-line or in config.h file) for scons + 
 some other minor updates
 
 [EMAIL PROTECTED] (orig r10376):  tpot | 2005-09-21 06:59:02 +0200
 Argh - not quoting dictionary/hash keys is a bit of a perlism.
 
 [EMAIL PROTECTED] (orig r10377):  tpot | 2005-09-21 07:39:18 +0200
 Save configuration stuff to sconf.cache so it isn't annoyingly run
 at every single build.  Run 'scons configure=1' or delete sconf.cache
 to force checks to be re-run.
 
 Jelmer, I think this stuff is cached in the .sconf_cache directory but
 the message is still displayed and it looks like it caches the compiled
 test object file not the actual result of the test.
 
 [EMAIL PROTECTED] (orig r10378):  tpot | 2005-09-21 09:12:23 +0200
 Build config.h file from dictionary of defines and always use it.
 
 [EMAIL PROTECTED] (orig r10379):  tpot | 2005-09-21 09:20:58 +0200
 Add files for ldb and tdb to proto_files.  The tool for building proto.h
 is busted though.
 
 [EMAIL PROTECTED] (orig r10380):  jelmer | 2005-09-21 11:16:55 +0200
 Use pod-style documentation rather then XML-doc, in good perl style.
 
 [EMAIL PROTECTED] (orig r10381):  jelmer | 2005-09-21 11:27:17 +0200
 Be a bit stricter on pod syntax
 
 [EMAIL PROTECTED] (orig r10382):  abartlet | 2005-09-21 12:17:56 +0200
 In the absence of client support for the full KDC-side
 canonicalisation code, I've hacked Heimdal to use the default realm if
 no other realm can be determined for a given host.
 
 Andrew Bartlett
 
 [EMAIL PROTECTED] (orig r10383):  abartlet | 2005-09-21 12:18:40 +0200
 This patch is on the road to implementing servers (such as kpasswd) that
 use raw krb5, not GSSAPI.  I still keep the 'fake GSSAPI' code, but
 under the module name 'fake_gssapi_krb5'.
 
 Andrew Bartlett
 
 [EMAIL PROTECTED] (orig r10384):  tridge | 2005-09-21 12:45:47 +0200
 add _GNU_SOURCE in tdb configure 
 
 [EMAIL PROTECTED] (orig r10385):  tridge | 2005-09-21 12:46:02 +0200
 removed obsolete comment
 
 
 [EMAIL PROTECTED] (orig r10386):  abartlet | 2005-09-21 14:24:41 +0200
 Merge current lorikeet-heimdal into Samba4.
 
 Andrew Bartlett
 
 [EMAIL PROTECTED] (orig r10387):  abartlet | 2005-09-21 14:38:25 +0200
 By exporting KRB5_CONFIG pointing at a file of our choosing, we can
 avoid DNS delays in our testsuite.  The next step will be to use
 kerberos in the tests (awaits application of socketwrapper or hooks
 into our socket layer).
 
 Andrew Bartlett
 
 [EMAIL PROTECTED] (orig r10388):  jelmer | 2005-09-21 14:57:18 +0200
 Add version num

svn commit: samba r10416 - in branches/SAMBA_4_0/source: .

2005-09-22 Thread tpot
Author: tpot
Date: 2005-09-22 07:17:24 + (Thu, 22 Sep 2005)
New Revision: 10416

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

Log:
Detect some more types to get rid of spurious warnings in the 
lib/replace/replace.h header.

Running 'scons lib/tdb' now (mostly) builds tdb.

Modified:
   branches/SAMBA_4_0/source/SConstruct


Changeset:
Modified: branches/SAMBA_4_0/source/SConstruct
===
--- branches/SAMBA_4_0/source/SConstruct2005-09-22 06:38:26 UTC (rev 
10415)
+++ branches/SAMBA_4_0/source/SConstruct2005-09-22 07:17:24 UTC (rev 
10416)
@@ -7,7 +7,7 @@
 # Copyright (C) 2005 Jelmer Vernooij <[EMAIL PROTECTED]>
 # Published under the GNU GPL
 
-import cPickle
+import cPickle, string
 
 # We don't care about NFS builds...
 
@@ -149,11 +149,22 @@
 
type_headers = """
 #include 
+#include 
 """
for t in needed_types:
if not conf.CheckType(t,type_headers):
defines[t] = needed_types[t]
 
+   for t in ['u_int32_t', 'u_int16_t', 'u_int8_t']:
+   if conf.CheckType(t, type_headers):
+   defines['HAVE_%s' % string.upper(t)] = 1
+
+   if conf.CheckType('comparison_fn_t', type_headers):
+   defines['HAVE_COMPARISON_FN_T'] = 1
+
+   if conf.CheckType('sig_atomic_t', '#include '):
+   defines['HAVE_SIG_ATOMIC_T_TYPE'] = 1
+
if conf.TryCompile("""
 #include