svn commit: lorikeet r38 - in trunk/ethereal: .

2004-09-02 Thread tpot
Author: tpot
Date: 2004-09-02 06:43:42 + (Thu, 02 Sep 2004)
New Revision: 38

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=lorikeetpath=/trunk/etherealrev=38nolog=1

Log:
Add some notes.

Modified:
   trunk/ethereal/README


Changeset:
Modified: trunk/ethereal/README
===
--- trunk/ethereal/README   2004-09-02 04:06:57 UTC (rev 37)
+++ trunk/ethereal/README   2004-09-02 06:43:42 UTC (rev 38)
@@ -1,7 +1,7 @@
 Build instructions for ethereal pidl parsers
 
 
-To build the parser:
+To build the parsers:
 
   1) Apply the ethereal-pidl.patch to introduce the new plugin into
  the ethereal build system.
@@ -20,6 +20,7 @@
 ethereal program.  This speeds up development muchly as the linking
 for ethereal and tethereal does not need to be performed.
 
+
 Installation:
 
   1) Copy the pidl.so file from the .libs directory (ha ha - libtool)
@@ -29,4 +30,12 @@
   2) When you restart ethereal the plugin should be loaded.  Any
  dynamic linking errors will be displayed on standard error.
 
+
+Other notes:
+
+  - The plugin protocol names are currently 'pidl_foo', where foo is
+the name of the idl file, e.g 'pidl_samr'.  Ethereal can't handle
+duplicate protocol names.
+
+
 Enjoy!



svn commit: samba r2180 - in branches/SAMBA_4_0/source/librpc: ndr rpc

2004-09-02 Thread tridge
Author: tridge
Date: 2004-09-02 10:45:58 + (Thu, 02 Sep 2004)
New Revision: 2180

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/source/librpcrev=2180nolog=1

Log:
added RPC flags padcheck which enables checking of all received pad
bytes to make sure they are zero. Non-zero values usually indicate one
of two things:

 - the server is leaking data through sending uninitialised memory
 - we have mistaken a real field in the IDL for padding

to differentiate between the two you really need to run with
print,padcheck and look carefully at whether the non-zero pad bytes
are random or appear to be deliberate.






Modified:
   branches/SAMBA_4_0/source/librpc/ndr/libndr.h
   branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.h
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c


Changeset:
Sorry, the patch is too large (255 lines) to include; please use WebSVN to see it!
WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/source/librpcrev=2180nolog=1


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

2004-09-02 Thread tridge
Author: tridge
Date: 2004-09-02 11:06:23 + (Thu, 02 Sep 2004)
New Revision: 2181

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/source/torture/rpcrev=2181nolog=1

Log:
an rpc async test on the netlogon pipe






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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/netlogon.c
===
--- branches/SAMBA_4_0/source/torture/rpc/netlogon.c2004-09-02 10:45:58 UTC (rev 
2180)
+++ branches/SAMBA_4_0/source/torture/rpc/netlogon.c2004-09-02 11:06:23 UTC (rev 
2181)
@@ -1625,6 +1625,73 @@
 }
 
 
+static BOOL test_GetDomainInfo_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+   NTSTATUS status;
+   struct netr_LogonGetDomainInfo r;
+   struct netr_DomainQuery1 q1;
+   struct netr_Authenticator a;
+#define ASYNC_COUNT 100
+   struct creds_CredentialState creds;
+   struct creds_CredentialState creds_async[ASYNC_COUNT];
+   struct rpc_request *req[ASYNC_COUNT];
+   int i;
+
+   if (!test_SetupCredentials3(p, mem_ctx, NETLOGON_NEG_AUTH2_ADS_FLAGS, creds)) 
{
+   return False;
+   }
+
+   ZERO_STRUCT(r);
+   r.in.server_name = talloc_asprintf(mem_ctx, %s, dcerpc_server_name(p));
+   r.in.computer_name = TEST_MACHINE_NAME;
+   r.in.unknown1 = 512;
+   r.in.level = 1;
+   r.in.credential = a;
+   r.out.credential = a;
+
+   r.in.i1[0] = 0;
+   r.in.i1[1] = 0;
+
+   r.in.query.query1 = q1;
+   ZERO_STRUCT(q1);
+   
+   /* this should really be the fully qualified name */
+   q1.workstation_domain = TEST_MACHINE_NAME;
+   q1.workstation_site = Default-First-Site-Name;
+   q1.blob2.length = 0;
+   q1.blob2.size = 0;
+   q1.blob2.data = NULL;
+   q1.product.string = product string;
+
+   printf(Testing netr_LogonGetDomainInfo - async count %d\n, ASYNC_COUNT);
+
+   for (i=0;iASYNC_COUNT;i++) {
+   creds_client_authenticator(creds, a);
+
+   creds_async[i] = creds;
+   req[i] = dcerpc_netr_LogonGetDomainInfo_send(p, mem_ctx, r);
+   }
+
+   for (i=0;iASYNC_COUNT;i++) {
+   status = dcerpc_ndr_request_recv(req[i]);
+   if (!NT_STATUS_IS_OK(status) || !NT_STATUS_IS_OK(r.out.result)) {
+   printf(netr_LogonGetDomainInfo_async(%d) - %s/%s\n, 
+  i, nt_errstr(status), nt_errstr(r.out.result));
+   return False;
+   }
+
+   if (!creds_client_check(creds_async[i], a.cred)) {
+   printf(Credential chaining failed at async %d\n, i);
+   return False;
+   }
+   }
+
+   printf(Testing netr_LogonGetDomainInfo - async count %d OK\n, ASYNC_COUNT);
+
+   return True;
+}
+
+
 BOOL torture_rpc_netlogon(int dummy)
 {
 NTSTATUS status;
@@ -1714,6 +1781,10 @@
ret = False;
}
 
+   if (!test_GetDomainInfo_async(p, mem_ctx)) {
+   ret = False;
+   }
+
talloc_destroy(mem_ctx);
 
torture_rpc_close(p);



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

2004-09-02 Thread tridge
Author: tridge
Date: 2004-09-02 11:26:58 + (Thu, 02 Sep 2004)
New Revision: 2182

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/source/torturerev=2182nolog=1

Log:
force the torture test domain join to happen on SMB to prevent the
LSAKEY problem holding up other tests

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/testjoin.c
===
--- branches/SAMBA_4_0/source/torture/rpc/testjoin.c2004-09-02 11:06:23 UTC (rev 
2181)
+++ branches/SAMBA_4_0/source/torture/rpc/testjoin.c2004-09-02 11:26:58 UTC (rev 
2182)
@@ -123,12 +123,12 @@
 
join-mem_ctx = mem_ctx;
 
-   printf(Connecting to SAMR\n);
+   printf(Connecting to SAMR (forced ncacn_np)\n);
 
-   status = torture_rpc_connection(join-p, 
-   DCERPC_SAMR_NAME,
-   DCERPC_SAMR_UUID,
-   DCERPC_SAMR_VERSION);
+   status = torture_rpc_connection_smb(join-p, 
+   DCERPC_SAMR_NAME,
+   DCERPC_SAMR_UUID,
+   DCERPC_SAMR_VERSION);
if (!NT_STATUS_IS_OK(status)) {
goto failed;
}

Modified: branches/SAMBA_4_0/source/torture/torture.c
===
--- branches/SAMBA_4_0/source/torture/torture.c 2004-09-02 11:06:23 UTC (rev 2181)
+++ branches/SAMBA_4_0/source/torture/torture.c 2004-09-02 11:26:58 UTC (rev 2182)
@@ -136,7 +136,7 @@
 }
 
 
-/* open a rpc connection to a named pipe */
+/* open a rpc connection to the chosen binding string */
 NTSTATUS torture_rpc_connection(struct dcerpc_pipe **p, 
const char *pipe_name,
const char *pipe_uuid, 
@@ -158,6 +158,39 @@
 return status;
 }
 
+/* open a rpc connection to a named pipe */
+NTSTATUS torture_rpc_connection_smb(struct dcerpc_pipe **p, 
+   const char *pipe_name,
+   const char *pipe_uuid, 
+   uint32_t pipe_version)
+{
+NTSTATUS status;
+   const char *binding = lp_parm_string(-1, torture, binding);
+   struct dcerpc_binding b;
+   TALLOC_CTX *mem_ctx = talloc_init(torture_rpc_connection_smb);
+
+   if (!binding) {
+   printf(You must specify a ncacn binding string\n);
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+
+   status = dcerpc_parse_binding(mem_ctx, binding, b);
+   if (!NT_STATUS_IS_OK(status)) {
+   DEBUG(0,(Failed to parse dcerpc binding '%s'\n, binding));
+   talloc_destroy(mem_ctx);
+   return status;
+   }
+
+   b.transport = NCACN_NP;
+
+   status = dcerpc_pipe_connect_b(p, b, pipe_uuid, pipe_version,
+  lp_parm_string(-1, torture, userdomain), 
+  lp_parm_string(-1, torture, username),
+  lp_parm_string(-1, torture, password));
+ 
+return status;
+}
+
 /* close a rpc connection to a named pipe */
 NTSTATUS torture_rpc_close(struct dcerpc_pipe *p)
 {



svn commit: lorikeet r39 - in trunk/ethereal/plugins/pidl: .

2004-09-02 Thread tpot
Author: tpot
Date: 2004-09-02 11:42:20 + (Thu, 02 Sep 2004)
New Revision: 39

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=lorikeetpath=/trunk/ethereal/plugins/pidlrev=39nolog=1

Log:
Remove some debugging stuff.

Modified:
   trunk/ethereal/plugins/pidl/eparser.c


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2004-09-02 06:43:42 UTC (rev 38)
+++ trunk/ethereal/plugins/pidl/eparser.c   2004-09-02 11:42:20 UTC (rev 39)
@@ -149,10 +149,6 @@
ndr_pull_uint32(ndr, tree, hf_string4_offset, ofs);
ndr_pull_uint32(ndr, tree, hf_string4_len2, len2);
 
-   g_warning(%d: len = %d, ndr-pinfo-fd-num, len1);
-   g_warning(%d: offset = %d, ndr-pinfo-fd-num, ofs);
-   g_warning(%d: len2 = %d, ndr-pinfo-fd-num, len2);
-
ndr-offset += len2;
break;
 
@@ -228,13 +224,7 @@
  ndr-pinfo-fd-num, 
  ndr-flags  LIBNDR_STRING_FLAGS);
 
-#if 0
-
-   return ndr_pull_error(ndr, NDR_ERR_STRING, Bad string flags 0x%x\n,
- ndr-flags  LIBNDR_STRING_FLAGS);
-
-#endif
-
+   break;
}   
 }
 



svn commit: samba r2183 - in branches/SAMBA_4_0/source/build/pidl: .

2004-09-02 Thread tpot
Author: tpot
Date: 2004-09-02 11:54:13 + (Thu, 02 Sep 2004)
New Revision: 2183

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/source/build/pidlrev=2183nolog=1

Log:
Tidy up naming of ethereal fields.  The field names are taken from the
structure elements with underscores replaced with spaces and words
capitalised.

Fix small buglet where we confuse the name of the interface with the name
of the idl file.

Just discovered security descriptors don't display property anymore.  )-:

Modified:
   branches/SAMBA_4_0/source/build/pidl/eparser.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/eparser.pm
===
--- branches/SAMBA_4_0/source/build/pidl/eparser.pm 2004-09-02 11:26:58 UTC (rev 
2182)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2004-09-02 11:54:13 UTC (rev 
2183)
@@ -292,9 +292,9 @@
}
 
if (util::is_scalar_type($e-{TYPE})) {
-   pidl \t\tndr_pull_array_$e-{TYPE}(ndr, $ndr_flags, tree, 
\$e-{NAME}\, hf_$e-{NAME}_$e-{TYPE}, $var_prefix$e-{NAME}, $size);\n;
+   pidl \t\tndr_pull_array_$e-{TYPE}(ndr, $ndr_flags, tree, \ . 
field2name($e-{NAME}) . \, hf_$e-{NAME}_$e-{TYPE}, $var_prefix$e-{NAME}, 
$size);\n;
} else {
-   pidl \t\tndr_pull_array(ndr, $ndr_flags, tree, \$e-{NAME}\, (void 
**)$var_prefix$e-{NAME}, sizeof($var_prefix$e-{NAME}\[0]), $size, 
(ndr_pull_flags_fn_t)ndr_pull_$e-{TYPE});\n;
+   pidl \t\tndr_pull_array(ndr, $ndr_flags, tree, \ . 
field2name($e-{NAME}) . \, (void **)$var_prefix$e-{NAME}, 
sizeof($var_prefix$e-{NAME}\[0]), $size, 
(ndr_pull_flags_fn_t)ndr_pull_$e-{TYPE});\n;
}
 
pidl \t}\n;
@@ -379,7 +379,7 @@
} elsif (util::is_builtin_type($e-{TYPE})) {
pidl \tndr_pull_$e-{TYPE}(ndr, tree, hf_$e-{NAME}_$e-{TYPE}, 
$cprefix$var_prefix$e-{NAME});\n;
} else {
-   pidl \tndr_pull_$e-{TYPE}(ndr, $ndr_flags, get_subtree(tree, 
\$e-{NAME}\, ndr, ett_$e-{TYPE}), $cprefix$var_prefix$e-{NAME});\n;
+   pidl \tndr_pull_$e-{TYPE}(ndr, $ndr_flags, get_subtree(tree, \ . 
field2name($e-{NAME}) . \, ndr, ett_$e-{TYPE}), $cprefix$var_prefix$e-{NAME});\n;
}
 
end_flags($e);
@@ -430,9 +430,9 @@
} elsif (util::is_builtin_type($e-{TYPE})) {
pidl \t\tndr_pull_$e-{TYPE}(ndr, tree, hf_$e-{NAME}_$e-{TYPE}, 
$cprefix$var_prefix$e-{NAME});\n;
} elsif ($e-{POINTERS}) {
-   pidl \t\tndr_pull_$e-{TYPE}(ndr, NDR_SCALARS|NDR_BUFFERS, 
get_subtree(tree, \$e-{NAME}\, ndr, ett_$e-{TYPE}), 
$cprefix$var_prefix$e-{NAME});\n;
+   pidl \t\tndr_pull_$e-{TYPE}(ndr, NDR_SCALARS|NDR_BUFFERS, 
get_subtree(tree, \ . field2name($e-{NAME}) . \, ndr, ett_$e-{TYPE}), 
$cprefix$var_prefix$e-{NAME});\n;
} else {
-   pidl \t\tndr_pull_$e-{TYPE}(ndr, $ndr_flags, get_subtree(tree, 
\$e-{NAME}\, ndr, ett_$e-{TYPE}), $cprefix$var_prefix$e-{NAME});\n;
+   pidl \t\tndr_pull_$e-{TYPE}(ndr, $ndr_flags, get_subtree(tree, \ . 
field2name($e-{NAME}) . \, ndr, ett_$e-{TYPE}), $cprefix$var_prefix$e-{NAME});\n;
}
 
if (util::need_wire_pointer($e)) {
@@ -831,6 +831,19 @@
 return BASE_NONE;
 }
 
+# Convert a IDL structure field name (e.g access_mask) to a prettier
+# string like 'Access Mask'.
+
+sub field2name($)
+{
+my($field) = shift;
+
+$field =~ s/_/ /g; # Replace underscores with spaces
+$field =~ s/(\w+)/\u\L$1/g;# Capitalise each word
+
+return $field;
+}
+
 sub NeededFunction($)
 {
my $fn = shift;
@@ -841,7 +854,7 @@
 
if (util::is_scalar_type($e-{TYPE})) {
$needed{hf_$e-{NAME}_$e-{TYPE}} = {
-   'name' = $e-{NAME},
+   'name' = field2name($e-{NAME}),
'type' = $e-{TYPE},
'ft'   = type2ft($e-{TYPE}),
'base' = type2base($e-{TYPE})
@@ -871,7 +884,7 @@
if (util::is_scalar_type($e-{TYPE})) {

$needed{hf_$e-{NAME}_$e-{TYPE}} = {
-   'name' = $e-{NAME},
+   'name' = field2name($e-{NAME}),
'type' = $e-{TYPE},
'ft'   = type2ft($e-{TYPE}),
'base' = type2base($e-{TYPE})
@@ -944,8 +957,6 @@
 
pidl /* parser auto-generated by pidl */\n\n;
 
-   pidl #include \ndr_$module.h\\n\n;
-
foreach my $x (@{$idl}) {
if ($x-{TYPE} eq INTERFACE) { 
foreach my $d (@{$x-{DATA}}) {



svn commit: samba r2184 - in branches/SAMBA_4_0/source: libcli/raw librpc/rpc

2004-09-02 Thread tridge
Author: tridge
Date: 2004-09-02 12:02:28 + (Thu, 02 Sep 2004)
New Revision: 2184

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/sourcerev=2184nolog=1

Log:
use the smb.conf socket options for client code too

Modified:
   branches/SAMBA_4_0/source/libcli/raw/clisocket.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_tcp.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clisocket.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clisocket.c2004-09-02 11:54:13 UTC (rev 
2183)
+++ branches/SAMBA_4_0/source/libcli/raw/clisocket.c2004-09-02 12:02:28 UTC (rev 
2184)
@@ -79,6 +79,7 @@
}
 
set_blocking(sock-fd, False);
+   set_socket_options(sock-fd, lp_socket_options());
 
return True;
 }

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_tcp.c
===
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_tcp.c   2004-09-02 11:54:13 UTC (rev 
2183)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_tcp.c   2004-09-02 12:02:28 UTC (rev 
2184)
@@ -298,6 +298,8 @@
return NT_STATUS_PORT_CONNECTION_REFUSED;
}
 
+   set_socket_options(fd, lp_socket_options());
+
set_blocking(fd, False);
 
 if (!(*p = dcerpc_pipe_init())) {



svn commit: samba r2185 - in branches/SAMBA_4_0/source: librpc/rpc torture/rpc

2004-09-02 Thread tridge
Author: tridge
Date: 2004-09-02 12:03:16 + (Thu, 02 Sep 2004)
New Revision: 2185

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/sourcerev=2185nolog=1

Log:
add a callback function to the dcerpc async API

also add a demonstration of its use in the netlogon async example


Modified:
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.h
   branches/SAMBA_4_0/source/torture/rpc/netlogon.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
===
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c   2004-09-02 12:02:28 UTC (rev 
2184)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c   2004-09-02 12:03:16 UTC (rev 
2185)
@@ -631,6 +631,9 @@
req-state = RPC_REQUEST_DONE;
req-status = status;
DLIST_REMOVE(p-pending, req);
+   if (req-async.callback) {
+   req-async.callback(req);
+   }
}
return;
}
@@ -655,6 +658,9 @@
req-status = status;
req-state = RPC_REQUEST_DONE;
DLIST_REMOVE(p-pending, req);
+   if (req-async.callback) {
+   req-async.callback(req);
+   }
return;
}
 
@@ -664,6 +670,9 @@
req-status = NT_STATUS_NET_WRITE_FAULT;
req-state = RPC_REQUEST_DONE;
DLIST_REMOVE(p-pending, req);
+   if (req-async.callback) {
+   req-async.callback(req);
+   }
return;
}
 
@@ -674,6 +683,9 @@
req-status = NT_STATUS_NET_WRITE_FAULT;
req-state = RPC_REQUEST_DONE;
DLIST_REMOVE(p-pending, req);
+   if (req-async.callback) {
+   req-async.callback(req);
+   }
return;
}
 
@@ -686,6 +698,9 @@
req-status = NT_STATUS_NO_MEMORY;
req-state = RPC_REQUEST_DONE;
DLIST_REMOVE(p-pending, req);
+   if (req-async.callback) {
+   req-async.callback(req);
+   }
return;
}
memcpy(req-payload.data+req-payload.length, 
@@ -707,6 +722,10 @@
} else {
req-flags = ~DCERPC_PULL_BIGENDIAN;
}
+
+   if (req-async.callback) {
+   req-async.callback(req);
+   }
 }
 
 
@@ -737,6 +756,7 @@
req-payload = data_blob(NULL, 0);
req-flags = 0;
req-fault_code = 0;
+   req-async.callback = NULL;
 
init_dcerpc_hdr(p, pkt);
 

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc.h
===
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc.h   2004-09-02 12:02:28 UTC (rev 
2184)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc.h   2004-09-02 12:03:16 UTC (rev 
2185)
@@ -166,4 +166,9 @@
size_t struct_size;
TALLOC_CTX *mem_ctx;
} ndr;
+
+   struct {
+   void (*callback)(struct rpc_request *);
+   void *private;
+   } async;
 };

Modified: branches/SAMBA_4_0/source/torture/rpc/netlogon.c
===
--- branches/SAMBA_4_0/source/torture/rpc/netlogon.c2004-09-02 12:02:28 UTC (rev 
2184)
+++ branches/SAMBA_4_0/source/torture/rpc/netlogon.c2004-09-02 12:03:16 UTC (rev 
2185)
@@ -1625,6 +1625,14 @@
 }
 
 
+static void async_callback(struct rpc_request *req)
+{
+   int *counter = req-async.private;
+   if (NT_STATUS_IS_OK(req-status)) {
+   (*counter)++;
+   }
+}
+
 static BOOL test_GetDomainInfo_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
 {
NTSTATUS status;
@@ -1636,6 +1644,7 @@
struct creds_CredentialState creds_async[ASYNC_COUNT];
struct rpc_request *req[ASYNC_COUNT];
int i;
+   int async_counter = 0;
 
if (!test_SetupCredentials3(p, mem_ctx, NETLOGON_NEG_AUTH2_ADS_FLAGS, creds)) 
{
return False;
@@ -1670,6 +1679,13 @@
 
creds_async[i] = creds;
req[i] = dcerpc_netr_LogonGetDomainInfo_send(p, mem_ctx, r);
+
+   req[i]-async.callback = async_callback;
+   req[i]-async.private = async_counter;
+
+   /* even with this flush per request a w2k3 server seems to 
+  clag with multiple outstanding requests. bleergh. */
+   event_loop_once(dcerpc_event_context(p));
}
 
for (i=0;iASYNC_COUNT;i++) {
@@ -1677,18 +1693,18 @@
if (!NT_STATUS_IS_OK(status) || !NT_STATUS_IS_OK(r.out.result)) {
   

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

2004-09-02 Thread tridge
Author: tridge
Date: 2004-09-02 12:54:48 + (Thu, 02 Sep 2004)
New Revision: 2186

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/source/torture/rpcrev=2186nolog=1

Log:
setting [ref] output pointers in dcerpc calls is pointless. Removed it
for test_LookupPrivDisplayName

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/lsa.c
===
--- branches/SAMBA_4_0/source/torture/rpc/lsa.c 2004-09-02 12:03:16 UTC (rev 2185)
+++ branches/SAMBA_4_0/source/torture/rpc/lsa.c 2004-09-02 12:54:48 UTC (rev 2186)
@@ -641,18 +641,14 @@
struct lsa_Name *priv_name)
 {
struct lsa_LookupPrivDisplayName r;
-   struct lsa_Name disp_name;
NTSTATUS status;
 
-   ZERO_STRUCT(disp_name);
-   
printf(testing LookupPrivDisplayName(%s)\n, priv_name-name);

r.in.handle = handle;
r.in.name = priv_name;
r.in.unknown = 0;
r.in.unknown2 = 0;
-   r.out.disp_name = disp_name;
 
status = dcerpc_lsa_LookupPrivDisplayName(p, mem_ctx, r);
if (!NT_STATUS_IS_OK(status)) {



svn commit: samba r2187 - in branches/SAMBA_3_0_RELEASE/source/smbd: .

2004-09-02 Thread jerry
Author: jerry
Date: 2004-09-02 14:16:50 + (Thu, 02 Sep 2004)
New Revision: 2187

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_3_0_RELEASE/source/smbdrev=2187nolog=1

Log:
revert merge of r2150 from 3.0
Modified:
   branches/SAMBA_3_0_RELEASE/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0_RELEASE/source/smbd/reply.c
===
--- branches/SAMBA_3_0_RELEASE/source/smbd/reply.c  2004-09-02 12:54:48 UTC (rev 
2186)
+++ branches/SAMBA_3_0_RELEASE/source/smbd/reply.c  2004-09-02 14:16:50 UTC (rev 
2187)
@@ -97,25 +97,26 @@
d--;
}
s += 3;
-   } else if ((s[0] == '.')  (s[1] == '\0')) {
-   if (s == srcname) {
-   ret = NT_STATUS_OBJECT_NAME_INVALID;
-   break;
-   }
-   *d++ = *s++;
-   } else if ((s[0] == '.')  IS_DIRECTORY_SEP(s[1])) {
+   } else if ((s[0] == '.')  (IS_DIRECTORY_SEP(s[1]) || (s[1] == 
'\0'))) {
+
/*
 * No mb char starts with '.' so we're safe checking the 
directory separator here.
 */
 
-   /* ./ or .\\ fails with a different error depending on 
what is after it... */
+   /* ./ or .\\ fails with a different error depending on 
where it is... */
 
-   if (s[2] == '\0') {
+   if (s == srcname) {
ret = NT_STATUS_OBJECT_NAME_INVALID;
+   break;
} else {
+   if (s[1] != '\0'  s[2] == '\0') {
+   ret = NT_STATUS_INVALID_PARAMETER;
+   break;
+   }
ret = NT_STATUS_OBJECT_PATH_NOT_FOUND;
+   break;
}
-   break;
+   s++;
} else {
if (!(*s  0x80)) {
if (allow_wcard_names) {
@@ -520,6 +521,7 @@
 int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int 
dum_buffsize)
 {
int outsize = 0;
+   int mode;
pstring name;
BOOL ok = False;
BOOL bad_path = False;
@@ -542,6 +544,8 @@
return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
}
 
+   mode = SVAL(inbuf,smb_vwv0);
+
if (check_name(name,conn)) {
if (VALID_STAT(sbuf) || SMB_VFS_STAT(conn,name,sbuf) == 0)
if (!(ok = S_ISDIR(sbuf.st_mode))) {
@@ -574,8 +578,9 @@
}
 
outsize = set_message(outbuf,0,0,True);
-   DEBUG(3,(chkpth %s mode=%d\n, name, (int)SVAL(inbuf,smb_vwv0)));
 
+   DEBUG(3,(chkpth %s mode=%d\n, name, mode));
+
END_PROFILE(SMBchkpth);
return(outsize);
 }



svn commit: samba r2188 - in branches/SAMBA_3_0/source: .

2004-09-02 Thread jerry
Author: jerry
Date: 2004-09-02 14:18:17 + (Thu, 02 Sep 2004)
New Revision: 2188

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_3_0/sourcerev=2188nolog=1

Log:
adding some initial checks for DragonFly (same as FreeBSD 4.1)
Modified:
   branches/SAMBA_3_0/source/configure.in


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2004-09-02 14:16:50 UTC (rev 2187)
+++ branches/SAMBA_3_0/source/configure.in  2004-09-02 14:18:17 UTC (rev 2188)
@@ -480,7 +480,7 @@
*irix*)
AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility])
;;
-   *freebsd*)
+   *freebsd*|*DragonFly*)
AC_DEFINE(FREEBSD, 1, [Whether the host os is FreeBSD])
;;
 #
@@ -1163,7 +1163,8 @@
AC_DEFINE(STAT_ST_BLOCKSIZE,512)
AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
;;
-   *netbsd* | *freebsd*)  BLDSHARED=true
+   *netbsd* | *freebsd* | *DragonFly* )  
+   BLDSHARED=true
LDSHFLAGS=-shared
DYNEXP=-Wl,--export-dynamic
SONAMEFLAG=-Wl,-soname,
@@ -4006,7 +4007,7 @@
fi
 
;;
-   *freebsd*)
+   *freebsd* | *DragonFly* )
AC_CACHE_CHECK([for freebsd sendfile support],samba_cv_HAVE_SENDFILE,[
AC_TRY_LINK([\
 #include sys/types.h



svn commit: samba r2189 - in branches/SAMBA_3_0/examples/LDAP: .

2004-09-02 Thread jerry
Author: jerry
Date: 2004-09-02 15:26:36 + (Thu, 02 Sep 2004)
New Revision: 2189

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_3_0/examples/LDAPrev=2189nolog=1

Log:
adding some comments to the schema file
Modified:
   branches/SAMBA_3_0/examples/LDAP/samba.schema


Changeset:
Modified: branches/SAMBA_3_0/examples/LDAP/samba.schema
===
--- branches/SAMBA_3_0/examples/LDAP/samba.schema   2004-09-02 14:18:17 UTC (rev 
2188)
+++ branches/SAMBA_3_0/examples/LDAP/samba.schema   2004-09-02 15:26:36 UTC (rev 
2189)
@@ -10,6 +10,10 @@
 ## 1.3.6.1.4.1.7165.2.1.x - attributetypes
 ## 1.3.6.1.4.1.7165.2.2.x - objectclasses
 ##
+## Printer support
+## 1.3.6.1.4.1.7165.2.3.1.x - attributetypes
+## 1.3.6.1.4.1.7165.2.3.2.x - objectclasses
+##
 ## - READ THIS WHEN ADDING A NEW ATTRIBUTE OR OBJECT CLASS --
 ##
 ## Run the 'get_next_oid' bash script in this directory to find the 
@@ -30,6 +34,11 @@
 ##
 ## --
 
+# objectIdentifier SambaRoot 1.3.6.1.4.1.7165
+# objectIdentifier Samba3 SambaRoot:2
+# objectIdentifier Samba3Attrib Samba3:1
+# objectIdentifier Samba3ObjectClass Samba3:2
+
 
 ##HISTORICAL  ##
 



svn commit: samba r2190 - in branches/SAMBA_3_0/source/param: .

2004-09-02 Thread jerry
Author: jerry
Date: 2004-09-02 20:51:12 + (Thu, 02 Sep 2004)
New Revision: 2190

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_3_0/source/paramrev=2190nolog=1

Log:
disable 'winbind enable local accounts' by default (had to be done doctor)
Modified:
   branches/SAMBA_3_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===
--- branches/SAMBA_3_0/source/param/loadparm.c  2004-09-02 15:26:36 UTC (rev 2189)
+++ branches/SAMBA_3_0/source/param/loadparm.c  2004-09-02 20:51:12 UTC (rev 2190)
@@ -1510,7 +1510,7 @@
string_set(Globals.szCupsServer, );
 
Globals.winbind_cache_time = 300;   /* 5 minutes */
-   Globals.bWinbindEnableLocalAccounts = True;
+   Globals.bWinbindEnableLocalAccounts = False;
Globals.bWinbindEnumUsers = True;
Globals.bWinbindEnumGroups = True;
Globals.bWinbindUseDefaultDomain = False;



svn commit: samba r2191 - in branches/SAMBA_3_0/source/printing: .

2004-09-02 Thread jerry
Author: jerry
Date: 2004-09-02 21:52:35 + (Thu, 02 Sep 2004)
New Revision: 2191

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_3_0/source/printingrev=2191nolog=1

Log:
ensure that we assign our pid to print jobs (and not our parent's pid); ensures that 
spooling jobs from dead smbds are removed from the tdb
Modified:
   branches/SAMBA_3_0/source/printing/printing.c


Changeset:
Modified: branches/SAMBA_3_0/source/printing/printing.c
===
--- branches/SAMBA_3_0/source/printing/printing.c   2004-09-02 20:51:12 UTC (rev 
2190)
+++ branches/SAMBA_3_0/source/printing/printing.c   2004-09-02 21:52:35 UTC (rev 
2191)
@@ -159,8 +159,6 @@
tdb_delete(rap_tdb, data);
 }
 
-static pid_t local_pid;
-
 static int get_queue_status(int, print_status_struct *);
 
 /
@@ -174,15 +172,10 @@
int services = lp_numservices();
int snum;
 
-   if (local_pid == sys_getpid())
-   return True;
-
unlink(lock_path(printing.tdb));
pstrcpy(printing_path,lock_path(printing));
mkdir(printing_path,0755);
 
-   local_pid = sys_getpid();
-
/* handle a Samba upgrade */
 
for (snum = 0; snum  services; snum++) {
@@ -599,6 +592,7 @@
/* Remove from printing.tdb */
 
tdb_delete(pdb-tdb, print_key(jobid));
+   remove_from_jobs_changed(snum, jobid);
release_print_db(pdb);
rap_jobid_delete(snum, jobid);
 }
@@ -1448,7 +1442,7 @@
if (!pjob)
return -1;
/* don't allow another process to get this info - it is meaningless */
-   if (pjob-pid != local_pid)
+   if (pjob-pid != sys_getpid())
return -1;
return pjob-fd;
 }
@@ -1462,7 +1456,7 @@
 char *print_job_fname(int snum, uint32 jobid)
 {
struct printjob *pjob = print_job_find(snum, jobid);
-   if (!pjob || pjob-spooled || pjob-pid != local_pid)
+   if (!pjob || pjob-spooled || pjob-pid != sys_getpid())
return NULL;
return pjob-filename;
 }
@@ -1501,7 +1495,7 @@
 BOOL print_job_set_name(int snum, uint32 jobid, char *name)
 {
struct printjob *pjob = print_job_find(snum, jobid);
-   if (!pjob || pjob-pid != local_pid)
+   if (!pjob || pjob-pid != sys_getpid())
return False;
 
fstrcpy(pjob-jobname, name);
@@ -1598,8 +1592,6 @@
 
if (pjob-spooled  pjob-sysjob != -1)
result = (*(current_printif-job_delete))(snum, pjob);
-   else
-   remove_from_jobs_changed(snum, jobid);
 
/* Delete the tdb entry if the delete succeeded or the job hasn't
   been spooled. */
@@ -1814,7 +1806,7 @@
if (!pjob)
return -1;
/* don't allow another process to get this info - it is meaningless */
-   if (pjob-pid != local_pid)
+   if (pjob-pid != sys_getpid())
return -1;
 
return_code = write(pjob-fd, buf, size);
@@ -2079,7 +2071,7 @@

ZERO_STRUCT(pjob);

-   pjob.pid = local_pid;
+   pjob.pid = sys_getpid();
pjob.sysjob = -1;
pjob.fd = -1;
pjob.starttime = time(NULL);
@@ -2149,7 +2141,7 @@
if (!pjob)
return;
/* don't allow another process to get this info - it is meaningless */
-   if (pjob-pid != local_pid)
+   if (pjob-pid != sys_getpid())
return;
 
pjob-page_count++;
@@ -2172,7 +2164,7 @@
if (!pjob)
return False;
 
-   if (pjob-spooled || pjob-pid != local_pid)
+   if (pjob-spooled || pjob-pid != sys_getpid())
return False;
 
if (normal_close  (sys_fstat(pjob-fd, sbuf) == 0)) {
@@ -2228,7 +2220,6 @@
/* Still need to add proper error return propagation! 010122:JRR */
unlink(pjob-filename);
pjob_delete(snum, jobid);
-   remove_from_jobs_changed(snum, jobid);
return False;
 }
 



svn commit: samba r2193 - in trunk/source: param printing

2004-09-02 Thread jerry
Author: jerry
Date: 2004-09-02 22:13:11 + (Thu, 02 Sep 2004)
New Revision: 2193

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/trunk/sourcerev=2193nolog=1

Log:
merge winbind enable local accounts and printing fixes from 3.0
Modified:
   trunk/source/param/loadparm.c
   trunk/source/printing/printing.c


Changeset:
Modified: trunk/source/param/loadparm.c
===
--- trunk/source/param/loadparm.c   2004-09-02 21:55:24 UTC (rev 2192)
+++ trunk/source/param/loadparm.c   2004-09-02 22:13:11 UTC (rev 2193)
@@ -1535,7 +1535,7 @@
string_set(Globals.szCupsServer, );
 
Globals.winbind_cache_time = 300;   /* 5 minutes */
-   Globals.bWinbindEnableLocalAccounts = True;
+   Globals.bWinbindEnableLocalAccounts = False;
Globals.bWinbindEnumUsers = True;
Globals.bWinbindEnumGroups = True;
Globals.bWinbindUseDefaultDomain = False;

Modified: trunk/source/printing/printing.c
===
--- trunk/source/printing/printing.c2004-09-02 21:55:24 UTC (rev 2192)
+++ trunk/source/printing/printing.c2004-09-02 22:13:11 UTC (rev 2193)
@@ -159,8 +159,6 @@
tdb_delete(rap_tdb, data);
 }
 
-static pid_t local_pid;
-
 static int get_queue_status(const char *printer_name, print_status_struct *);
 
 /
@@ -174,15 +172,10 @@
int services = lp_numservices();
int snum;
 
-   if (local_pid == sys_getpid())
-   return True;
-
unlink(lock_path(printing.tdb));
pstrcpy(printing_path,lock_path(printing));
mkdir(printing_path,0755);
 
-   local_pid = sys_getpid();
-
/* handle a Samba upgrade */
 
for (snum = 0; snum  services; snum++) {
@@ -609,6 +602,7 @@
/* Remove from printing.tdb */
 
tdb_delete(pdb-tdb, print_key(jobid));
+   remove_from_jobs_changed(snum, jobid);
release_print_db(pdb);
rap_jobid_delete(snum, jobid);
 }
@@ -1482,7 +1476,7 @@
if (!pjob)
return -1;
/* don't allow another process to get this info - it is meaningless */
-   if (pjob-pid != local_pid)
+   if (pjob-pid != sys_getpid())
return -1;
return pjob-fd;
 }
@@ -1497,7 +1491,7 @@
 {
struct printjob *pjob = print_job_find(lp_const_servicename(snum),
   jobid);
-   if (!pjob || pjob-spooled || pjob-pid != local_pid)
+   if (!pjob || pjob-spooled || pjob-pid != sys_getpid())
return NULL;
return pjob-filename;
 }
@@ -1538,7 +1532,7 @@
 {
struct printjob *pjob = print_job_find(lp_const_servicename(snum),
   jobid);
-   if (!pjob || pjob-pid != local_pid)
+   if (!pjob || pjob-pid != sys_getpid())
return False;
 
fstrcpy(pjob-jobname, name);
@@ -1635,8 +1629,6 @@
 
if (pjob-spooled  pjob-sysjob != -1)
result = (*(current_printif-job_delete))(snum, pjob);
-   else
-   remove_from_jobs_changed(lp_const_servicename(snum), jobid);
 
/* Delete the tdb entry if the delete succeeded or the job hasn't
   been spooled. */
@@ -1855,7 +1847,7 @@
if (!pjob)
return -1;
/* don't allow another process to get this info - it is meaningless */
-   if (pjob-pid != local_pid)
+   if (pjob-pid != sys_getpid())
return -1;
 
return_code = write(pjob-fd, buf, size);
@@ -2120,7 +2112,7 @@

ZERO_STRUCT(pjob);

-   pjob.pid = local_pid;
+   pjob.pid = sys_getpid();
pjob.sysjob = -1;
pjob.fd = -1;
pjob.starttime = time(NULL);
@@ -2191,7 +2183,7 @@
if (!pjob)
return;
/* don't allow another process to get this info - it is meaningless */
-   if (pjob-pid != local_pid)
+   if (pjob-pid != sys_getpid())
return;
 
pjob-page_count++;
@@ -2215,7 +2207,7 @@
if (!pjob)
return False;
 
-   if (pjob-spooled || pjob-pid != local_pid)
+   if (pjob-spooled || pjob-pid != sys_getpid())
return False;
 
if (normal_close  (sys_fstat(pjob-fd, sbuf) == 0)) {
@@ -2271,7 +2263,6 @@
/* Still need to add proper error return propagation! 010122:JRR */
unlink(pjob-filename);
pjob_delete(snum, lp_const_servicename(snum), jobid);
-   remove_from_jobs_changed(lp_const_servicename(snum), jobid);
return False;
 }
 



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

2004-09-02 Thread jra
Author: jra
Date: 2004-09-02 22:35:36 + (Thu, 02 Sep 2004)
New Revision: 2194

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_3_0/source/smbdrev=2194nolog=1

Log:
Here is the efforts of much pain reproducing W2K3 pathname
parsing. :-(. One more check for CreateFile() needed.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2004-09-02 22:13:11 UTC (rev 2193)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2004-09-02 22:35:36 UTC (rev 2194)
@@ -48,6 +48,7 @@
char *d = destname;
const char *s = srcname;
NTSTATUS ret = NT_STATUS_OK;
+   BOOL start_of_name_component = True;
 
while (*s) {
if (IS_DIRECTORY_SEP(*s)) {
@@ -58,100 +59,109 @@
while (IS_DIRECTORY_SEP(*s)) {
s++;
}
-   if ((s[0] == '.')  (s[1] == '\0')) {
-   ret = NT_STATUS_OBJECT_NAME_INVALID;
-   break;
-   }
if ((d != destname)  (*s != '\0')) {
/* We only care about non-leading or trailing '/' or 
'\\' */
*d++ = '/';
}
-   } else if ((s[0] == '.')  (s[1] == '.')  (IS_DIRECTORY_SEP(s[2]) 
|| s[2] == '\0')) {
-   /* Uh oh - ../ or ..\\  or ..\0 ! */
 
-   /*
-* No mb char starts with '.' so we're safe checking the 
directory separator here.
-*/
+   start_of_name_component = True;
+   continue;
+   }
 
-   /* If we just added a '/', delete it. */
+   if (start_of_name_component) {
+   if ((s[0] == '.')  (s[1] == '.')  (IS_DIRECTORY_SEP(s[2]) 
|| s[2] == '\0')) {
+   /* Uh oh - /../ or \\..\\  or /..\0 or \\..\0 
! */
 
-   if ((d  destname)  (*(d-1) == '/')) {
-   *(d-1) = '\0';
-   if (d == (destname + 1)) {
+   /*
+* No mb char starts with '.' so we're safe checking 
the directory separator here.
+*/
+
+   /* If  we just added a '/' - delete it */
+   if ((d  destname)  (*(d-1) == '/')) {
+   *(d-1) = '\0';
d--;
-   } else {
-   d -= 2;
}
-   }
-   /* Are we at the start ? Can't go back further if so. */
-   if (d == destname) {
-   ret = NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
-   break;
-   }
-   /* Go back one level... */
-   /* We know this is safe as '/' cannot be part of a mb 
sequence. */
-   /* NOTE - if this assumption is invalid we are not in good 
shape... */
-   while (d  destname) {
-   if (*d == '/')
+
+   /* Are we at the start ? Can't go back further if so. 
*/
+   if (d = destname) {
+   ret = NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
break;
-   d--;
-   }
-   s += 3;
-   } else if ((s[0] == '.')  (s[1] == '\0')) {
-   if (s == srcname) {
-   ret = NT_STATUS_OBJECT_NAME_INVALID;
+   }
+   /* Go back one level... */
+   /* We know this is safe as '/' cannot be part of a mb 
sequence. */
+   /* NOTE - if this assumption is invalid we are not in 
good shape... */
+   /* Decrement d first as d points to the *next* char to 
write into. */
+   for (d--; d  destname; d--) {
+   if (*d == '/')
+   break;
+   }
+   s += 2; /* Else go past the .. */
+   /* We're still at the start of a name component, just 
the previous one. */
+   continue;
+
+   } else if ((s[0] == 

svn commit: samba r2195 - in trunk/source/smbd: .

2004-09-02 Thread jra
Author: jra
Date: 2004-09-02 22:35:45 + (Thu, 02 Sep 2004)
New Revision: 2195

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/trunk/source/smbdrev=2195nolog=1

Log:
Here is the efforts of much pain reproducing W2K3 pathname
parsing. :-(. One more check for CreateFile() needed.
Jeremy.

Modified:
   trunk/source/smbd/reply.c
   trunk/source/smbd/trans2.c


Changeset:
Modified: trunk/source/smbd/reply.c
===
--- trunk/source/smbd/reply.c   2004-09-02 22:35:36 UTC (rev 2194)
+++ trunk/source/smbd/reply.c   2004-09-02 22:35:45 UTC (rev 2195)
@@ -48,6 +48,7 @@
char *d = destname;
const char *s = srcname;
NTSTATUS ret = NT_STATUS_OK;
+   BOOL start_of_name_component = True;
 
while (*s) {
if (IS_DIRECTORY_SEP(*s)) {
@@ -58,100 +59,109 @@
while (IS_DIRECTORY_SEP(*s)) {
s++;
}
-   if ((s[0] == '.')  (s[1] == '\0')) {
-   ret = NT_STATUS_OBJECT_NAME_INVALID;
-   break;
-   }
if ((d != destname)  (*s != '\0')) {
/* We only care about non-leading or trailing '/' or 
'\\' */
*d++ = '/';
}
-   } else if ((s[0] == '.')  (s[1] == '.')  (IS_DIRECTORY_SEP(s[2]) 
|| s[2] == '\0')) {
-   /* Uh oh - ../ or ..\\  or ..\0 ! */
 
-   /*
-* No mb char starts with '.' so we're safe checking the 
directory separator here.
-*/
+   start_of_name_component = True;
+   continue;
+   }
 
-   /* If we just added a '/', delete it. */
+   if (start_of_name_component) {
+   if ((s[0] == '.')  (s[1] == '.')  (IS_DIRECTORY_SEP(s[2]) 
|| s[2] == '\0')) {
+   /* Uh oh - /../ or \\..\\  or /..\0 or \\..\0 
! */
 
-   if ((d  destname)  (*(d-1) == '/')) {
-   *(d-1) = '\0';
-   if (d == (destname + 1)) {
+   /*
+* No mb char starts with '.' so we're safe checking 
the directory separator here.
+*/
+
+   /* If  we just added a '/' - delete it */
+   if ((d  destname)  (*(d-1) == '/')) {
+   *(d-1) = '\0';
d--;
-   } else {
-   d -= 2;
}
-   }
-   /* Are we at the start ? Can't go back further if so. */
-   if (d == destname) {
-   ret = NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
-   break;
-   }
-   /* Go back one level... */
-   /* We know this is safe as '/' cannot be part of a mb 
sequence. */
-   /* NOTE - if this assumption is invalid we are not in good 
shape... */
-   while (d  destname) {
-   if (*d == '/')
+
+   /* Are we at the start ? Can't go back further if so. 
*/
+   if (d = destname) {
+   ret = NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
break;
-   d--;
-   }
-   s += 3;
-   } else if ((s[0] == '.')  (s[1] == '\0')) {
-   if (s == srcname) {
-   ret = NT_STATUS_OBJECT_NAME_INVALID;
+   }
+   /* Go back one level... */
+   /* We know this is safe as '/' cannot be part of a mb 
sequence. */
+   /* NOTE - if this assumption is invalid we are not in 
good shape... */
+   /* Decrement d first as d points to the *next* char to 
write into. */
+   for (d--; d  destname; d--) {
+   if (*d == '/')
+   break;
+   }
+   s += 2; /* Else go past the .. */
+   /* We're still at the start of a name component, just 
the previous one. */
+   continue;
+
+   } else if ((s[0] == '.')  (s[1] == '\0')) {
+   /* Component of pathname can't 

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

2004-09-02 Thread jra
Author: jra
Date: 2004-09-02 22:48:35 + (Thu, 02 Sep 2004)
New Revision: 2196

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_3_0/source/smbdrev=2196nolog=1

Log:
This error code change is incorrect. Still working on it...
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/trans2.c
===
--- branches/SAMBA_3_0/source/smbd/trans2.c 2004-09-02 22:35:45 UTC (rev 2195)
+++ branches/SAMBA_3_0/source/smbd/trans2.c 2004-09-02 22:48:35 UTC (rev 2196)
@@ -1381,11 +1381,6 @@
 
srvstr_get_path(inbuf, directory, params+12, sizeof(directory), -1, 
STR_TERMINATE, ntstatus, True);
if (!NT_STATUS_IS_OK(ntstatus)) {
-   /* W2k3 never seems to return OBJECT_PATH_NOT_FOUND on a
-  bad pathname parse in a findfirst, but always OBJECT_NAME_INVALID. 
JRA */
-   /* It remains to be seen what it does on CreateFile(). JRA. (ie. I 
need to check) */
-   if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_PATH_NOT_FOUND,ntstatus))
-   return ERROR_NT(NT_STATUS_OBJECT_NAME_INVALID);
return ERROR_NT(ntstatus);
}
 



svn commit: samba r2198 - branches/SAMBA_3_0/source trunk/source

2004-09-02 Thread tpot
Author: tpot
Date: 2004-09-02 22:51:12 + (Thu, 02 Sep 2004)
New Revision: 2198

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/rev=2198nolog=1

Log:
Correct fix for #1360.  Need to use -Wl when passing flags to the linker.

Modified:
   branches/SAMBA_3_0/source/configure.in
   trunk/source/configure.in


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2004-09-02 22:49:10 UTC (rev 2197)
+++ branches/SAMBA_3_0/source/configure.in  2004-09-02 22:51:12 UTC (rev 2198)
@@ -1130,7 +1130,7 @@
   case $host_os in
*linux*)   AC_DEFINE(LINUX,1,[Whether the host os is linux])
BLDSHARED=true
-   LDSHFLAGS=-shared -Bsymbolic 
+   LDSHFLAGS=-shared -Wl,-Bsymbolic 
DYNEXP=-Wl,--export-dynamic
PICFLAGS=-fPIC
SONAMEFLAG=-Wl,-soname=

Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2004-09-02 22:49:10 UTC (rev 2197)
+++ trunk/source/configure.in   2004-09-02 22:51:12 UTC (rev 2198)
@@ -1131,7 +1131,7 @@
   case $host_os in
*linux*)   AC_DEFINE(LINUX,1,[Whether the host os is linux])
BLDSHARED=true
-   LDSHFLAGS=-shared -Bsymbolic 
+   LDSHFLAGS=-shared -Wl,-Bsymbolic 
DYNEXP=-Wl,--export-dynamic
PICFLAGS=-fPIC
SONAMEFLAG=-Wl,-soname=



svn commit: samba r2199 - in branches/SAMBA_4_0/source: librpc/idl torture/rpc

2004-09-02 Thread tridge
Author: tridge
Date: 2004-09-03 05:16:25 + (Fri, 03 Sep 2004)
New Revision: 2199

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/sourcerev=2199nolog=1

Log:
the unknown 16 bit number in lsa_LookupPrivDisplayName() is a language
ID, so the client can choose what language they get the privilege
description in.

this is the first time I've seen a language ID on the wire in CIFS.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/lsa.idl
   branches/SAMBA_4_0/source/torture/rpc/lsa.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/lsa.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/lsa.idl2004-09-02 22:51:12 UTC (rev 
2198)
+++ branches/SAMBA_4_0/source/librpc/idl/lsa.idl2004-09-03 05:16:25 UTC (rev 
2199)
@@ -458,10 +458,11 @@
NTSTATUS lsa_LookupPrivDisplayName (
[in,ref] policy_handle *handle,
[in,ref] lsa_Name *name,
-   [in] uint16 unknown, /* 0x0409 */
-   [in] uint16 unknown2,/* 0x0409 */
[out]lsa_Name *disp_name,
-   [out]uint16 unknown3 /* 0x0409 */
+   /* see http://www.microsoft.com/globaldev/nlsweb/ for
+  language definitions */
+   [in,out,ref] uint16 *language_id,
+   [in] uint16 unknown
);
 
/* Function:0x22 */

Modified: branches/SAMBA_4_0/source/torture/rpc/lsa.c
===
--- branches/SAMBA_4_0/source/torture/rpc/lsa.c 2004-09-02 22:51:12 UTC (rev 2198)
+++ branches/SAMBA_4_0/source/torture/rpc/lsa.c 2004-09-03 05:16:25 UTC (rev 2199)
@@ -642,19 +642,26 @@
 {
struct lsa_LookupPrivDisplayName r;
NTSTATUS status;
+   /* produce a reasonable range of language output without screwing up
+  terminals */
+   uint16 language_id = (random() % 4) + 0x409;
 
printf(testing LookupPrivDisplayName(%s)\n, priv_name-name);

r.in.handle = handle;
r.in.name = priv_name;
+   r.in.language_id = language_id;
+   r.out.language_id = language_id;
r.in.unknown = 0;
-   r.in.unknown2 = 0;
 
status = dcerpc_lsa_LookupPrivDisplayName(p, mem_ctx, r);
if (!NT_STATUS_IS_OK(status)) {
printf(LookupPrivDisplayName failed - %s\n, nt_errstr(status));
return False;
}
+   printf(%s - \%s\  (language 0x%x/0x%x)\n, 
+  priv_name-name, r.out.disp_name-name, 
+  *r.in.language_id, *r.out.language_id);
 
return True;
 }



svn commit: samba-web r304 - in trunk/news: . advocacy announcements developers releases team users

2004-09-02 Thread tpot
Author: tpot
Date: 2004-09-03 05:33:39 + (Fri, 03 Sep 2004)
New Revision: 304

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba-webpath=/trunk/newsrev=304nolog=1

Log:
Remove files now autogenerated by deryck's news script.

Removed:
   trunk/news/advocacy/index.html
   trunk/news/announcements/index.html
   trunk/news/developers/index.html
   trunk/news/index.html
   trunk/news/releases/index.html
   trunk/news/team/index.html
   trunk/news/users/index.html


Changeset:
Deleted: trunk/news/advocacy/index.html
===
--- trunk/news/advocacy/index.html  2004-09-03 04:48:09 UTC (rev 303)
+++ trunk/news/advocacy/index.html  2004-09-03 05:33:39 UTC (rev 304)
@@ -1,12 +0,0 @@
-!--#include virtual=/samba/news/header.html --
-titleadvocacy/ -- news.samba.org/title
-!--#include virtual=/samba/news/header2.html --
-
-h1Advocacy/h1
-
-pStories related to Samba advocacy on news.samba.org are archived here./p
-
-h210 August 2004/h2
-   !--#include virtual=minnesota_ms.html --
-
-!--#include virtual=/samba/news/footer.html --

Deleted: trunk/news/announcements/index.html
===
--- trunk/news/announcements/index.html 2004-09-03 04:48:09 UTC (rev 303)
+++ trunk/news/announcements/index.html 2004-09-03 05:33:39 UTC (rev 304)
@@ -1,17 +0,0 @@
-!--#include virtual=/samba/news/header.html --   
-titleannouncements/ -- news.samba.org/title 
-!--#include virtual=/samba/news/header2.html --
-   
-h1Announcements/h1
-
-pMiscellaneous announcements for news.samba.org are
-archived here./p
-  
-h210 August 2004/h2
-!--#include virtual=accepting.html --
-
-h28 August 2004/h2
-!--#include virtual=redesign.html --
-
-
-!--#include virtual=/samba/news/footer.html --

Deleted: trunk/news/developers/index.html
===
--- trunk/news/developers/index.html2004-09-03 04:48:09 UTC (rev 303)
+++ trunk/news/developers/index.html2004-09-03 05:33:39 UTC (rev 304)
@@ -1,12 +0,0 @@
-!--#include virtual=/samba/news/header.html --
-titledevelopers/ -- news.samba.org/title
-!--#include virtual=/samba/news/header2.html --
-
-h1Samba Developers/h1
-
-pStories related to Samba development and developers on news.samba.org are 
archived here./p
-
-h212 August 2004/h2
-!--#include virtual=plug_progress.html --
-
-!--#include virtual=/samba/news/footer.html --

Deleted: trunk/news/index.html
===
--- trunk/news/index.html   2004-09-03 04:48:09 UTC (rev 303)
+++ trunk/news/index.html   2004-09-03 05:33:39 UTC (rev 304)
@@ -1,64 +0,0 @@
-!--#include virtual=/samba/news/header.html --
-titlenews.samba.org/title
-!--#include virtual=/samba/news/header2.html --
-
-h227 August 2004/h2
-!--#include virtual=/samba/news/releases/comingsoon_3.0.7.html --
-div class=referenceLink: a 
href=/samba/news/releases/#comingsoon_3.0.7releases//a/div
-
-h224 August 2004/h2
-!--#include virtual=/samba/news/releases/openLDAP-samba3.0.6.html --
-div class=referenceLink: a
-href=/samba/news/releases/#openLDAP-samba3.0.6releases//a/div
-
-h223 August 2004/h2
-!--#include virtual=/samba/news/team/cal_update_23Aug.html --
-div class=referenceLink: a
-href=/samba/news/team/#cal_update_23Augteam//a/div
-
-!--#include virtual=/samba/news/users/nine_user.html --
-div class=referenceLink: a
-href=/samba/news/users/#nine_userusers//a/div
-
-h220 August 2004/h2
-!--#include virtual=/samba/news/team/gd.html --
-div class=referenceLink: a
-href=/samba/news/team/#gdteam//a/div
-
-h219 August 2004/h2
-!--#include virtual=/samba/news/releases/3.0.6.html --
-div class=referenceLink: a
-href=/samba/news/releases/#3.0.6releases//a/div
-
-h217 August 2004/h2
-!--#include virtual=/samba/news/users/nlb_singapore.html --
-div class=referenceLink: a
-href=/samba/news/users/#nlb_singaporeusers//a/div
-
-h215 August 2004/h2
-!--#include virtual=/samba/news/team/akademy.html --
-div class=referenceLink: a href=/samba/news/team/#akademyteam//a/div
-
-h213 August 2004/h2
-!--#include virtual=/samba/news/releases/2.2.11.html --
-div class=referenceLink: a 
href=/samba/news/releases/#2.2.11releases//a/div
-
-h212 August 2004/h2
-!--#include virtual=/samba/news/developers/plug_progress.html --
-div class=referenceLink: a 
href=/samba/news/developers/#plug_progressdevelopers//a/div
-
-h210 August 2004/h2
-
-!--#include virtual=/samba/news/advocacy/minnesota_ms.html --
-div class=referenceLink: a 
href=/samba/news/advocacy/#minnesota_msadvocacy//a/div
-
-!--#include virtual=/samba/news/announcements/accepting.html --
-div class=referenceLink: a 
href=/samba/news/announcements/#acceptingannouncements//a/div
-