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

2005-01-17 Thread tpot
Author: tpot
Date: 2005-01-18 05:22:30 + (Tue, 18 Jan 2005)
New Revision: 185

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

Log:
Create TODO list of things to remember.

Added:
   trunk/ethereal/plugins/pidl/TODO


Changeset:
Added: trunk/ethereal/plugins/pidl/TODO
===



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

2005-01-16 Thread tpot
Author: tpot
Date: 2005-01-17 06:37:47 + (Mon, 17 Jan 2005)
New Revision: 4798

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

Log:
When dissecting structures, name the protocol tree after the field name,
not the field type (i.e DACL and SACL instead of dom_sid).

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 2005-01-17 06:21:40 UTC 
(rev 4797)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-17 06:37:47 UTC 
(rev 4798)
@@ -592,8 +592,8 @@
s/(ndr_pull_([^\)]*?)\(
   ndr,\ 
   (NDR_[^,]*?),\ 
-  ([^\(].*?)\);)
-   /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$2\", ndr, ett_$2), $4);
+  (&?r->(in|out|)\.?([^\(].*?))\);)
+   /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$6\", ndr, ett_$2), $4);
/smgx;
 
# Add proto_tree parameter to pull function prototypes, e.g



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

2005-01-16 Thread tpot
Author: tpot
Date: 2005-01-17 06:24:03 + (Mon, 17 Jan 2005)
New Revision: 184

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

Log:
Add the name of what we are pointing to when dissecting pointers.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-17 05:42:19 UTC (rev 
183)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-17 06:24:03 UTC (rev 
184)
@@ -1,6 +1,7 @@
 /* ethereal/pidl glue */
 
 #include "eparser.h"
+#include 
 
 struct pidl_pull *pidl_pull_init(tvbuff_t *tvb, int offset, packet_info *pinfo,
 guint8 *drep)
@@ -27,10 +28,34 @@
return NT_STATUS_OK;
 }
 
-NTSTATUS ndr_pull_ptr(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
+NTSTATUS ndr_pull_ptr(struct pidl_pull *ndr, pidl_tree *tree, char *name,
  guint32 *ptr)
 {
-   return ndr_pull_uint32(ndr, tree, hf, ptr);
+   char *ptr_name, *tmp;
+
+   ndr_pull_align(ndr, sizeof(guint32));
+
+   *ptr = (ndr->drep[0] & 0x10)
+   ? tvb_get_letohl(ndr->tvb, ndr->offset)
+   : tvb_get_ntohl(ndr->tvb, ndr->offset);
+   
+   ptr_name = g_strdup(name);
+
+   for (tmp = ptr_name; *tmp; tmp++) {
+   if (*tmp == '_') *tmp = ' ';
+   if (tmp == ptr_name || *(tmp - 1) == ' ')
+   *tmp = toupper(*tmp);
+   }
+   
+   proto_tree_add_text(
+   tree->proto_tree, ndr->tvb, ndr->offset, sizeof(guint32), 
+   "Pointer to %s: 0x%08x", ptr_name, *ptr);
+
+   g_free(ptr_name);
+
+   ndr->offset += 4;
+
+   return NT_STATUS_OK;
 }
 
 NTSTATUS ndr_pull_uint8(struct pidl_pull *ndr, pidl_tree *tree, int hf, 

Modified: trunk/ethereal/plugins/pidl/eparser.h
===
--- trunk/ethereal/plugins/pidl/eparser.h   2005-01-17 05:42:19 UTC (rev 
183)
+++ trunk/ethereal/plugins/pidl/eparser.h   2005-01-17 06:24:03 UTC (rev 
184)
@@ -114,7 +114,7 @@
 NTSTATUS ndr_pull_NTTIME(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
NTTIME *data);
 NTSTATUS ndr_pull_HYPER_T(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
HYPER_T *data);
 void ndr_set_flags(uint32_t *pflags, uint32_t new_flags);
-NTSTATUS ndr_pull_ptr(struct pidl_pull *ndr, pidl_tree *tree, int hf, uint32_t 
*v);
+NTSTATUS ndr_pull_ptr(struct pidl_pull *ndr, pidl_tree *tree, char *name, 
uint32_t *v);
 NTSTATUS ndr_pull_error(struct pidl_pull *ndr, 
enum ndr_err_code err, const char *format, ...);
 NTSTATUS ndr_pull_string(struct pidl_pull *ndr, int ndr_flags, pidl_tree 
*tree, const char **s);



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

2005-01-16 Thread tpot
Author: tpot
Date: 2005-01-17 06:21:40 + (Mon, 17 Jan 2005)
New Revision: 4797

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

Log:
Add the name of what we are pointing to when dissecting pointers.

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 2005-01-17 05:41:18 UTC 
(rev 4796)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-17 06:21:40 UTC 
(rev 4797)
@@ -511,10 +511,10 @@
# of adding a couple of parameters to each function call.
 #
 
-   # Add proto tree and hf argument to ndr_pull_ptr() calls.
+   # Add proto tree and name argument to ndr_pull_ptr() calls.
 
-   s/(ndr_pull_ptr\(ndr,\ ([^\)]*?)\);)
-   /ndr_pull_ptr(ndr, tree, hf_ptr, $2);/smgx;
+   s/(ndr_pull_ptr\(ndr,\ (&_ptr_([^\)]*?))\);)
+   /ndr_pull_ptr(ndr, tree, "$3", $2);/smgx;
 
# Wrap ndr_pull_array_size() and ndr_pull_array_length()
# functions.  Add leading space in front of first parameter so



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

2005-01-16 Thread tpot
Author: tpot
Date: 2005-01-17 05:42:19 + (Mon, 17 Jan 2005)
New Revision: 183

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

Log:
Fix stoopid printf format string bug.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-13 01:04:33 UTC (rev 
182)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-17 05:42:19 UTC (rev 
183)
@@ -411,7 +411,7 @@
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
for (i=0;iproto_tree, ndr->tvb, 
ndr->offset, 0, "Array entry %s", i + 1);
+   item = proto_tree_add_text(tree->proto_tree, ndr->tvb, 
ndr->offset, 0, "Array entry %d", i + 1);
subtrees[i].proto_tree = proto_item_add_subtree(item, 
ett_array);
 
if ((ndr_flags & (NDR_SCALARS|NDR_BUFFERS)) == 
(NDR_SCALARS|NDR_BUFFERS))



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

2005-01-16 Thread tpot
Author: tpot
Date: 2005-01-17 05:41:18 + (Mon, 17 Jan 2005)
New Revision: 4796

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

Log:
Get rid of unecessary #include

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 2005-01-17 04:08:24 UTC 
(rev 4795)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-17 05:41:18 UTC 
(rev 4796)
@@ -471,6 +471,8 @@
# interested in for ehtereal parsers.
#
 
+   next, if /^\#include \"includes.h\"/;
+
# Remove the NDR_CHECK() macro calls.  Ethereal take care of
# this for us as part of the tvbuff_t structure.
 



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

2005-01-15 Thread tpot
Author: tpot
Date: 2005-01-16 06:12:22 + (Sun, 16 Jan 2005)
New Revision: 4773

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

Log:
Handle arrays of scalar types as function arguments.

Add hf for function return value.

Rename struct field members to be named after the structure name 
and element name rather than element name and element type.

Remember which structure or function we are processing and use it
to generate hf fields according to the naming scheme above.

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 2005-01-16 03:44:08 UTC 
(rev 4772)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-16 06:12:22 UTC 
(rev 4773)
@@ -154,6 +154,8 @@
 
$needed{"pull_$fn->{NAME}"} = 1;
 
+   # Add entries for function arguments
+
foreach my $e (@{$fn->{DATA}}) {
 
$e->{PARENT} = $fn;
@@ -161,19 +163,44 @@
 
if (util::is_scalar_type($e->{TYPE})) {
 
-   $needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
+   if (defined($e->{ARRAY_LEN}) or 
+   util::has_property($e, "size_is")) {
+
+   # Array of scalar types
+
+   $needed{"hf_$fn->{NAME}_$e->{NAME}_array"} = {
+   'name' => field2name($e->{NAME}),
+   'type' => $e->{TYPE},
+   'ft'   => "FT_BYTES",
+   'base' => elementbase($e)
+   };
+
+   } else {
+
+   $needed{"hf_$fn->{NAME}_$e->{NAME}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft'   => type2ft($e->{TYPE}),
'base' => elementbase($e)
-   }, if !defined($needed{"hf_$e->{NAME}_$e->{TYPE}"});
+   };
 
+   }
+
$e->{PARENT} = $fn;
 
} else {
$needed{"ett_$e->{TYPE}"} = 1;
}
}
+
+   # Add entry for return value
+
+   $needed{"hf_$fn->{NAME}_result"} = {
+   'name' => field2name('result'),
+   'type' => $fn->{RETURN_TYPE},
+   'ft' => type2ft($fn->{RETURN_TYPE}),
+   'base' => elementbase($fn)
+   };
 }
 
 sub NeededTypedef($)
@@ -201,7 +228,7 @@
 
# Arrays of scalar types are FT_BYTES

-   $needed{"hf_$e->{NAME}_$e->{TYPE}_array"} = {
+   $needed{"hf_$t->{NAME}_$e->{NAME}_array"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft'   => "FT_BYTES",
@@ -210,7 +237,7 @@
 
} else {
 
-   $needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
+   $needed{"hf_$t->{NAME}_$e->{NAME}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft'   => type2ft($e->{TYPE}),
@@ -419,6 +446,8 @@
 pidl "static int hf_array_size = -1;\n";
 pidl "static int hf_result_NTSTATUS = -1;\n";
 
+pidl "\n";
+
 foreach my $y (keys(%needed)) {
pidl "static int $y = -1;\n", if $y =~ /^hf_/;
 }
@@ -433,6 +462,8 @@
 
 # Read through file
 
+my $cur_fn;
+
 while() {
 
#
@@ -466,6 +497,12 @@
 
s/^\#include \".*?ndr_(.*?).h\"$/\#include \"packet-dcerpc-$1.h\"/smg;
 
+#
+# Remember which structure or function we are processing.
+#
+
+$cur_fn = $1, if /NTSTATUS ndr_pull_(.*?)\(struct/;
+
#
# OK start wrapping the ndr_pull functions that actually
# implement the NDR decoding routines.  This mainly consists
@@ -499,7 +536,7 @@
   ([^,]*?),\   # NDR_SCALARS etc
   (r->((in|out).)?([^,]*?)),\  # Pointer to array elements
   (.*?)\);)# Number of elements
-   /ndr_pull_array_$2( ndr, $3, tree, hf_$7_$2_array, $4, $8);/smgx;
+

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

2005-01-15 Thread tpot
Author: tpot
Date: 2005-01-16 01:57:12 + (Sun, 16 Jan 2005)
New Revision: 4771

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

Log:
Fix some indentation.

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 2005-01-16 01:48:08 UTC 
(rev 4770)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-16 01:57:12 UTC 
(rev 4771)
@@ -151,19 +151,25 @@
 sub NeededFunction($)
 {
my $fn = shift;
+
$needed{"pull_$fn->{NAME}"} = 1;
+
foreach my $e (@{$fn->{DATA}}) {
+
$e->{PARENT} = $fn;
$needed{"pull_$e->{TYPE}"} = 1;
 
if (util::is_scalar_type($e->{TYPE})) {
+
$needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft'   => type2ft($e->{TYPE}),
'base' => elementbase($e)
}, if !defined($needed{"hf_$e->{NAME}_$e->{TYPE}"});
+
$e->{PARENT} = $fn;
+
} else {
$needed{"ett_$e->{TYPE}"} = 1;
}
@@ -173,6 +179,7 @@
 sub NeededTypedef($)
 {
my $t = shift;
+
if (util::has_property($t, "public")) {
$needed{"pull_$t->{NAME}"} = 1;
}
@@ -180,7 +187,9 @@
if ($t->{DATA}->{TYPE} eq "STRUCT") {
 
for my $e (@{$t->{DATA}->{ELEMENTS}}) {
+
$e->{PARENT} = $t->{DATA};
+
if ($needed{"pull_$t->{NAME}"}) {
$needed{"pull_$e->{TYPE}"} = 1;
}
@@ -200,6 +209,7 @@
};
 
} else {
+
$needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
@@ -223,12 +233,17 @@
}
 
if ($t->{DATA}->{TYPE} eq "UNION") {
+
for my $e (@{$t->{DATA}->{DATA}}) {
+
$e->{PARENT} = $t->{DATA};
+
if ($e->{TYPE} eq "UNION_ELEMENT") {
+
if ($needed{"pull_$t->{NAME}"}) {
$needed{"pull_$e->{DATA}->{TYPE}"} = 1;
}
+
$needed{"ett_$e->{DATA}{TYPE}"} = 1;
}
}
@@ -237,6 +252,7 @@
}
 
if ($t->{DATA}->{TYPE} eq "ENUM") {
+
$needed{"hf_$t->{NAME}"} = {
'name' => $t->{NAME},
'ft' => 'FT_UINT16',
@@ -250,11 +266,14 @@
 sub BuildNeeded($)
 {
my($interface) = shift;
+
my($data) = $interface->{DATA};
+
foreach my $d (@{$data}) {
($d->{TYPE} eq "FUNCTION") && 
NeededFunction($d);
}
+
foreach my $d (reverse @{$data}) {
($d->{TYPE} eq "TYPEDEF") &&
NeededTypedef($d);
@@ -436,12 +455,12 @@
# Get rid of dcerpc interface structures and functions since
# they are also not very interesting.
 
-next, if /^static const struct dcerpc_interface_call/ .. /^};/;
-next, if /^static const char \* const [a-z]+_endpoint_strings/ ../^};/;
-next, if /^static const struct dcerpc_endpoint_list/ .. /^};/;
-next, if /^const struct dcerpc_interface_table/ .. /^};/;
-next, if /^static NTSTATUS dcerpc_ndr_[a-z]+_init/ .. /^}/;
-next, if /^NTSTATUS dcerpc_[a-z]+_init/ .. /^}/;
+next, if /^static const struct dcerpc_interface_call/ .. /^};/;
+next, if /^static const char \* const [a-z]+_endpoint_strings/ ../^};/;
+next, if /^static const struct dcerpc_endpoint_list/ .. /^};/;
+next, if /^const struct dcerpc_interface_table/ .. /^};/;
+next, if /^static NTSTATUS dcerpc_ndr_[a-z]+_init/ .. /^}/;
+next, if /^NTSTATUS dcerpc_[a-z]+_init/ .. /^}/;
 
# Rewrite includes to packet-dcerpc-foo.h instead of ndr_foo.h
 



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

2005-01-15 Thread tpot
Author: tpot
Date: 2005-01-16 01:48:08 + (Sun, 16 Jan 2005)
New Revision: 4770

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

Log:
Change from processing ndr_*.[ch] files all at once to line-by-line.
I'm hoping this will allow better mapping hf fields to the structures
they are present in which isn't possible at the moment.  (Line mode
allows us to use /foo/ .. /bar/ regexps and to store state during the
processing.

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 2005-01-16 01:28:11 UTC 
(rev 4769)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-16 01:48:08 UTC 
(rev 4770)
@@ -324,10 +324,8 @@
 open(IN, "<$input") || die "can't open $input for reading";
 open(OUT, ">$output") || die "can't open $output for writing";

-# Read in entire file
+# Read through file
 
-undef $/;
-
 while() {
 
# Not interested in ndr_push or ndr_print routines as they
@@ -338,8 +336,8 @@
 
# Get rid of async send and receive function.
 
-   s/^NTSTATUS dcerpc_.*?;\n//smg;
-   s/^struct rpc_request.*?;\n\n//smg;
+   s/^NTSTATUS dcerpc_.*?;//smg;
+   s/^struct rpc_request.*?;//smg;
 
# Rewrite librpc includes
 
@@ -414,10 +412,8 @@
 
 pidl "\n";
 
-# Read in entire file for post-processing
+# Read through file
 
-undef $/;
-
 while() {
 
#
@@ -433,19 +429,19 @@
# We're not interested in ndr_{print,push,size} functions so
# just delete them.
 
-   s/^(static )?NTSTATUS (ndr_push[^\(]+).*?^\}\n\n//smg;
-   s/^void (ndr_print[^\(]+).*?^\}\n\n//smg;
-   s/^size_t (ndr_size[^\(]+).*?^\}\n\n//smg;
+   next, if /^(static )?NTSTATUS ndr_push/ .. /^}/;
+next, if /^void ndr_print/ .. /^}/;
+next, if /^size_t ndr_size/ .. /^}/;
 
# Get rid of dcerpc interface structures and functions since
# they are also not very interesting.
 
-   s/^static const struct dcerpc_interface_call .*?^\};\n\n//smg;  
-   s/^static const char \* const 
([a-z]+)_endpoint_strings.*?^\};\n\n//smgx;
-   s/^static const struct dcerpc_endpoint_list .*?^\};\n\n\n//smg; 
-   s/^const struct dcerpc_interface_table .*?^\};\n\n//smg;
-   s/^static NTSTATUS dcerpc_ndr_([a-z]+)_init.*?^\}\n\n//smg; 
-   s/^NTSTATUS dcerpc_([a-z]+)_init.*?^\}\n\n//smg;
+next, if /^static const struct dcerpc_interface_call/ .. /^};/;
+next, if /^static const char \* const [a-z]+_endpoint_strings/ ../^};/;
+next, if /^static const struct dcerpc_endpoint_list/ .. /^};/;
+next, if /^const struct dcerpc_interface_table/ .. /^};/;
+next, if /^static NTSTATUS dcerpc_ndr_[a-z]+_init/ .. /^}/;
+next, if /^NTSTATUS dcerpc_[a-z]+_init/ .. /^}/;
 
# Rewrite includes to packet-dcerpc-foo.h instead of ndr_foo.h
 
@@ -563,7 +559,7 @@

# Enums
 
-s/(^static\ NTSTATUS\ ndr_pull_(.+?),\ (enum .+?)\))
+s/(^static\ NTSTATUS\ ndr_pull_(.+?),\ (enum\ .+?)\))
/static NTSTATUS ndr_pull_$2, pidl_tree *tree, int hf, $3)/smgx;
s/uint(8|16|32) v;/uint$1_t v;/smg;
s/(ndr_pull_([^\)]*?)\(ndr,\ &v\);)
@@ -574,8 +570,8 @@
 
# Bitmaps
 
-   s/(^NTSTATUS\ ndr_pull_(.+?),\ uint32\ \*r\))
-   /NTSTATUS ndr_pull_$2, pidl_tree *tree, int hf, uint32_t *r)/smgx;
+s/(^(static\ )?NTSTATUS\ ndr_pull_(.+?),\ uint32\ \*r\))
+   /NTSTATUS ndr_pull_$3, pidl_tree *tree, int hf, uint32_t *r)/smgx;
 
pidl $_;
 }



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

2005-01-08 Thread tpot
Author: tpot
Date: 2005-01-09 05:31:59 + (Sun, 09 Jan 2005)
New Revision: 4613

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

Log:
Fix stuff I broke in the last commit with the /x regexp flag.

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 2005-01-09 04:31:32 UTC 
(rev 4612)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-09 05:31:59 UTC 
(rev 4613)
@@ -343,7 +343,8 @@
 
# Rewrite librpc includes
 
-   s/^\#include \"librpc\/gen_ndr\/ndr_(.*?).h\"$/\#include 
\"packet-dcerpc-$1.h\"/smg;
+   s/^\#include\ \"librpc\/gen_ndr\/ndr_(.*?).h\"$
+   /\#include \"packet-dcerpc-$1.h\"/smgx;
 
# Convert samba fixed width types to stdint types
 
@@ -440,8 +441,7 @@
# they are also not very interesting.
 
s/^static const struct dcerpc_interface_call .*?^\};\n\n//smg;  
-   s/^static const char \* const 
-   ([a-z]+)_endpoint_strings.*?^\};\n\n//smgx;
+   s/^static const char \* const 
([a-z]+)_endpoint_strings.*?^\};\n\n//smgx;
s/^static const struct dcerpc_endpoint_list .*?^\};\n\n\n//smg; 
s/^const struct dcerpc_interface_table .*?^\};\n\n//smg;
s/^static NTSTATUS dcerpc_ndr_([a-z]+)_init.*?^\}\n\n//smg; 
@@ -459,32 +459,32 @@
 
# Add proto tree and hf argument to ndr_pull_ptr() calls.
 
-   s/(ndr_pull_ptr\(ndr, ([^\)]*?)\);)/
-   ndr_pull_ptr(ndr, tree, hf_ptr, $2);/smgx;
+   s/(ndr_pull_ptr\(ndr,\ ([^\)]*?)\);)
+   /ndr_pull_ptr(ndr, tree, hf_ptr, $2);/smgx;
 
# Wrap ndr_pull_array_size() and ndr_pull_array_length()
# functions.  Add leading space in front of first parameter so
# we won't get caught by later regexps.
 
-   s/(ndr_pull_array_(size|length)\(ndr, ([^\)]*?)\);)/
-   ndr_pull_array_$2( ndr, tree, $3);/smgx;
+   s/(ndr_pull_array_(size|length)\(ndr,\ ([^\)]*?)\);)
+   /ndr_pull_array_$2( ndr, tree, $3);/smgx;
 
# Add tree argument to ndr_pull_array() and
# ndr_pull_array_foo() calls.
 
s/(ndr_pull_array\(
-  ndr,
-  ([^,]*?),# NDR_SCALARS etc
-  (\(void \*\*\)r->(in|out|)\.?([^,]*?)),  # Pointer to array entries
-  ([^\)].*?)\);)/  # All other arguments
-  ndr_pull_array( ndr, $2, tree, $3, $6);/smgx;
+  ndr,\ 
+  ([^,]*?),\# NDR_SCALARS etc
+  (\(void\ \*\*\)r->(in|out|)\.?([^,]*?)),\ # Pointer to array entries
+  ([^\)].*?)\);)# All other arguments
+   /ndr_pull_array( ndr, $2, tree, $3, $6);/smgx;
 
-   s/(ndr_pull_array_([^\(]*?)\(
-  ndr, 
-  ([^,]*?),# NDR_SCALARS etc
-  (r->((in|out).)?([^,]*?)),   # Pointer to array elements
-  (.*?)\);)/   # Number of elements
-  ndr_pull_array_$2( ndr, $3, tree, hf_$7_$2_array, $4, $8);/smgx;
+   s/(ndr_pull_array_([^\(]*?)\(
+  ndr,\ 
+  ([^,]*?),\   # NDR_SCALARS etc
+  (r->((in|out).)?([^,]*?)),\  # Pointer to array elements
+  (.*?)\);)# Number of elements
+   /ndr_pull_array_$2( ndr, $3, tree, hf_$7_$2_array, $4, $8);/smgx;
  
# Save ndr_pull_relative{1,2}() calls from being wrapped by the
# proceeding regexp by adding a leading space.
@@ -498,21 +498,21 @@
# ndr_pull_uint32(ndr, &r->in.access_mask);
# ndr_pull_uint32(ndr, &r->idx);
 
-   s/(ndr_pull_([^\)]*?)\(
-  ndr, 
+   s/(ndr_pull_([^\)]*?)
+  \(ndr,\ 
   (&?r->((in|out)\.)? # Function args contain leading junk
([^\)]*?)) # Element name
-  \);)/  
-  ndr_pull_$2(ndr, tree, hf_$6_$2, $3);/smgx;
+  \);)  
+   /ndr_pull_$2(ndr, tree, hf_$6_$2, $3);/smgx;
 
# Add tree and hf argument to pulls of "internal" scalars like
# array sizes, levels, etc.
 
s/(ndr_pull_(uint32|uint16)\(
-  ndr,
+  ndr,\ 
   (&_([^\)]*?))# Internal arg names have leading underscore
-  \);)/
-  ndr_pull_$2(ndr, tree, hf_$4, $3);/smgx;
+  \);)
+   /ndr_pull_$2(ndr, tree, hf_$4, $3);/smgx;
 
# Add subtree argument to calls dissecting structures, e.g
#
@@ -520,20 +520,21 @@
# ndr_pull_atsvc_enum_ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr);
 
s/(ndr_pull_([^\)]*?)\(
-  ndr, 
-   

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

2005-01-08 Thread tpot
Author: tpot
Date: 2005-01-09 02:03:59 + (Sun, 09 Jan 2005)
New Revision: 4606

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

Log:
Start adding some more comments and some indentation for the eparser
regexps.  Hopefully this will make things a bit easier to understand
later on.

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 2005-01-09 01:14:26 UTC 
(rev 4605)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-09 02:03:59 UTC 
(rev 4606)
@@ -419,85 +419,130 @@
 
 while() {
 
-   # Ethereal take care of this for us.  It also makes the other
-   # regular expressions easier to write and understand. 
+   #
+# Regexps to do a first pass at removing stuff we aren't
+   # interested in for ehtereal parsers.
+   #
 
+   # Remove the NDR_CHECK() macro calls.  Ethereal take care of
+   # this for us as part of the tvbuff_t structure.
+
s/NDR_CHECK\((.*)\)/$1/g;
 
-   # We're not interested in ndr_print, ndr_push or ndr_size functions.
+   # We're not interested in ndr_{print,push,size} functions so
+   # just delete them.
 
s/^(static )?NTSTATUS (ndr_push[^\(]+).*?^\}\n\n//smg;
s/^void (ndr_print[^\(]+).*?^\}\n\n//smg;
s/^size_t (ndr_size[^\(]+).*?^\}\n\n//smg;
 
-   # Get rid of dcerpc interface structures and functions
+   # Get rid of dcerpc interface structures and functions since
+   # they are also not very interesting.
 
s/^static const struct dcerpc_interface_call .*?^\};\n\n//smg;  
-   s/^static const char \* const ([a-z]+)_endpoint_strings.*?^\};\n\n//smg;
+   s/^static const char \* const 
+   ([a-z]+)_endpoint_strings.*?^\};\n\n//smgx;
s/^static const struct dcerpc_endpoint_list .*?^\};\n\n\n//smg; 
s/^const struct dcerpc_interface_table .*?^\};\n\n//smg;
s/^static NTSTATUS dcerpc_ndr_([a-z]+)_init.*?^\}\n\n//smg; 
s/^NTSTATUS dcerpc_([a-z]+)_init.*?^\}\n\n//smg;
 
-   # Include packet-dcerpc-foo.h instead of ndr_foo.h
+   # Rewrite includes to packet-dcerpc-foo.h instead of ndr_foo.h
 
s/^\#include \".*?ndr_(.*?).h\"$/\#include \"packet-dcerpc-$1.h\"/smg;
 
-   # Call ethereal wrapper for ndr_pull_ptr() function.
+   #
+   # OK start wrapping the ndr_pull functions that actually
+   # implement the NDR decoding routines.  This mainly consists
+   # of adding a couple of parameters to each function call.
+#
 
-   s/(ndr_pull_ptr\(ndr, ([^\)]*?)\);)/ndr_pull_ptr(ndr, tree, hf_ptr, 
$2);/smg;
+   # Add proto tree and hf argument to ndr_pull_ptr() calls.
 
-   # Wrap ndr_pull_array_size() - generate wrapper that won't get
-   # caught by the regex for wrapping scalar values below (i.e
-   # the leading space in front of the first parameter).
+   s/(ndr_pull_ptr\(ndr, ([^\)]*?)\);)/
+   ndr_pull_ptr(ndr, tree, hf_ptr, $2);/smgx;
 
-   s/(ndr_pull_array_(size|length)\(ndr, ([^\)]*?)\);)/ndr_pull_array_$2( 
ndr, tree, $3);/smg;
+   # Wrap ndr_pull_array_size() and ndr_pull_array_length()
+   # functions.  Add leading space in front of first parameter so
+   # we won't get caught by later regexps.
 
-   # Add tree argument to ndr_pull_array()
+   s/(ndr_pull_array_(size|length)\(ndr, ([^\)]*?)\);)/
+   ndr_pull_array_$2( ndr, tree, $3);/smgx;
 
-#get_subtree(tree, \"$2\", ndr, ett_$2)
-#ndr_pull_array( ndr, NDR_SCALARS, tree, (void **)r->aces, sizeof(r->aces[0]), 
r->num_aces, (ndr_pull_flags_fn_t)ndr_pull_security_ace);
-   s/(ndr_pull_array\(ndr, ([^,]*?), ([^,]*?), 
([^\)].*?)\);)/ndr_pull_array( ndr, $2, tree, $3, $4);/smg;
+   # Add tree argument to ndr_pull_array() and
+   # ndr_pull_array_foo() calls.
 
-   s/(ndr_pull_array_([^\(]*?)\(ndr, ([^,]*?), (r->((in|out).)?([^,]*?)), 
(.*?)\);)/ndr_pull_array_$2( ndr, $3, tree, hf_$7_$2_array, $4, $8);/smg;
+   s/(ndr_pull_array\(
+  ndr,
+  ([^,]*?),# NDR_SCALARS etc
+  (\(void \*\*\)r->(in|out|)\.?([^,]*?)),  # Pointer to array entries
+  ([^\)].*?)\);)/  # All other arguments
+  ndr_pull_array( ndr, $2, tree, $3, $6);/smgx;
+
+   s/(ndr_pull_array_([^\(]*?)\(
+  ndr, 
+  ([^,]*?),# NDR_SCALARS etc
+  (r->((in|out).)?([^,]*?)),   # Pointer to array elements
+  (.*?)\);)/   # Number of elements
+  ndr_pull_array_$2( ndr, $3, tree, hf_$7_$2_array, $4, $8);/smgx;
  
-   # Save ndr_pull_relative[12]() calls from being

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

2005-01-07 Thread tpot
Author: tpot
Date: 2005-01-08 00:38:15 + (Sat, 08 Jan 2005)
New Revision: 173

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

Log:
Number array entries.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-05 23:56:35 UTC (rev 
172)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-08 00:38:15 UTC (rev 
173)
@@ -411,7 +411,7 @@
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
for (i=0;iproto_tree, ndr->tvb, 
ndr->offset, 0, "Array entry");
+   item = proto_tree_add_text(tree->proto_tree, ndr->tvb, 
ndr->offset, 0, "Array entry %s", i + 1);
subtrees[i].proto_tree = proto_item_add_subtree(item, 
ett_array);
 
if ((ndr_flags & (NDR_SCALARS|NDR_BUFFERS)) == 
(NDR_SCALARS|NDR_BUFFERS))



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

2005-01-07 Thread tpot
Author: tpot
Date: 2005-01-07 23:23:28 + (Fri, 07 Jan 2005)
New Revision: 4600

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

Log:
Remove Data::Dumper import leftover from debugging.

Return more ethereal types and bases for hf fields.  Currently we 
assume that enums always fit into a uint16 which will probably  have to
change soon.

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 2005-01-07 22:27:18 UTC 
(rev 4599)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-07 23:23:28 UTC 
(rev 4600)
@@ -107,10 +107,13 @@
 {
 my($t) = shift;
  
-return "FT_UINT32", if ($t eq "uint32");
-return "FT_UINT16", if ($t eq "uint16");
-return "FT_UINT8", if ($t eq "uint8");
-return "FT_BYTES";
+return "FT_UINT$1" if $t =~ /uint(8|16|32|64)/;
+return "FT_INT$1" if $t =~ /int(8|16|32|64)/;
+return "FT_UINT64", if ($t eq "HYPER_T" or $t eq "NTTIME");
+
+# Type is an enum
+
+return "FT_UINT16";
 }
 
 # Determine the display base for an element
@@ -123,9 +126,13 @@
return "BASE_" . uc($base);
 }
  
-return "BASE_DEC", if ($e->{TYPE} eq "uint32") or 
-   ($e->{TYPE} eq "uint16") or ($e->{TYPE} eq "uint8");
-return "BASE_NONE";
+return "BASE_DEC", if $e->{TYPE} eq "ENUM";
+return "BASE_DEC", if $e->{TYPE} =~ /u?int(8|16|32|64)/;
+return "BASE_DEC", if $e->{TYPE} eq "NTTIME" or $e->{TYPE} eq "HYPER_T";
+
+# Probably an enum
+
+return "BASE_DEC";
 }
 
 # Convert a IDL structure field name (e.g access_mask) to a prettier
@@ -230,13 +237,10 @@
}
 
if ($t->{DATA}->{TYPE} eq "ENUM") {
-   use Data::Dumper;
-   print Dumper($t);
-
$needed{"hf_$t->{NAME}"} = {
'name' => $t->{NAME},
-   'ft' => 'FT_UINT32',
-   'base' => 'BASE_HEX'
+   'ft' => 'FT_UINT16',
+   'base' => 'BASE_DEC'
};
}
 }



svn commit: samba r4599 - in branches/SAMBA_4_0/source: build/pidl script

2005-01-07 Thread tpot
Author: tpot
Date: 2005-01-07 22:27:18 + (Fri, 07 Jan 2005)
New Revision: 4599

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

Log:
Remove some duplicated code in pidl.pl.

Start working on adding support for bitmaps and enums.

In progress tweaks for arrays of structures.

Modified:
   branches/SAMBA_4_0/source/build/pidl/eparser.pm
   branches/SAMBA_4_0/source/build/pidl/pidl.pl
   branches/SAMBA_4_0/source/script/build_idl.sh


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/eparser.pm
===
--- branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-07 19:32:31 UTC 
(rev 4598)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-07 22:27:18 UTC 
(rev 4599)
@@ -228,6 +228,17 @@
 
$needed{"ett_$t->{NAME}"} = 1;
}
+
+   if ($t->{DATA}->{TYPE} eq "ENUM") {
+   use Data::Dumper;
+   print Dumper($t);
+
+   $needed{"hf_$t->{NAME}"} = {
+   'name' => $t->{NAME},
+   'ft' => 'FT_UINT32',
+   'base' => 'BASE_HEX'
+   };
+   }
 }
 
 #
@@ -342,6 +353,10 @@
 
s/(struct pidl_pull \*ndr, int ndr_flags)/$1, pidl_tree *tree/smg;
 
+   # Bitmaps
+
+   s/(uint32_t \*r\);)/pidl_tree *tree, int hf, $1/smg;
+
pidl $_;
 }
 
@@ -405,10 +420,11 @@
 
s/NDR_CHECK\((.*)\)/$1/g;
 
-   # We're not interested in ndr_print or ndr_push functions.
+   # We're not interested in ndr_print, ndr_push or ndr_size functions.
 
s/^(static )?NTSTATUS (ndr_push[^\(]+).*?^\}\n\n//smg;
s/^void (ndr_print[^\(]+).*?^\}\n\n//smg;
+   s/^size_t (ndr_size[^\(]+).*?^\}\n\n//smg;
 
# Get rid of dcerpc interface structures and functions
 
@@ -435,7 +451,9 @@
 
# Add tree argument to ndr_pull_array()
 
-   s/(ndr_pull_array\(ndr, ([^,]*?), ([^\)].*?)\);)/ndr_pull_array( ndr, 
$2, tree, $3);/smg;
+#get_subtree(tree, \"$2\", ndr, ett_$2)
+#ndr_pull_array( ndr, NDR_SCALARS, tree, (void **)r->aces, sizeof(r->aces[0]), 
r->num_aces, (ndr_pull_flags_fn_t)ndr_pull_security_ace);
+   s/(ndr_pull_array\(ndr, ([^,]*?), ([^,]*?), 
([^\)].*?)\);)/ndr_pull_array( ndr, $2, tree, $3, $4);/smg;
 
s/(ndr_pull_array_([^\(]*?)\(ndr, ([^,]*?), (r->((in|out).)?([^,]*?)), 
(.*?)\);)/ndr_pull_array_$2( ndr, $3, tree, hf_$7_$2_array, $4, $8);/smg;
  
@@ -491,7 +509,19 @@
 
 s/uint(16|32) _level/uint$1_t _level/smg;
 s/ndr_pull_([^\(]*)\(ndr, tree, hf_level, &_level\);/ndr_pull_$1(ndr, 
tree, hf_level_$1, &_level);/smg;
- 
+   
+   # Enums
+
+s/(^static NTSTATUS ndr_pull_(.+?), (enum .+?)\))/static NTSTATUS 
ndr_pull_$2, pidl_tree *tree, int hf, $3)/smg;
+   s/uint(8|16|32) v;/uint$1_t v;/smg;
+   s/(ndr_pull_([^\)]*?)\(ndr, &v\);)/ndr_pull_$2(ndr, tree, hf, &v);/smg;
+
+   s/(ndr_pull_([^\(]+?)\(ndr, &_level\);)/ndr_pull_$2(ndr, tree, hf_$2, 
&_level);/smg;
+
+   # Bitmaps
+
+   s/(^NTSTATUS ndr_pull_(.+?), uint32 \*r\))/NTSTATUS ndr_pull_$2, 
pidl_tree *tree, int hf, uint32_t *r)/smg;
+
pidl $_;
 }
 

Modified: branches/SAMBA_4_0/source/build/pidl/pidl.pl
===
--- branches/SAMBA_4_0/source/build/pidl/pidl.pl2005-01-07 19:32:31 UTC 
(rev 4598)
+++ branches/SAMBA_4_0/source/build/pidl/pidl.pl2005-01-07 22:27:18 UTC 
(rev 4599)
@@ -141,6 +141,10 @@
if ($opt_header) {
my($header) = util::ChangeExtension($output, ".h");
util::FileSave($header, IdlHeader::Parse($pidl));
+   if ($opt_eparser) {
+ my($eparserhdr) = dirname($output) . 
"/packet-dcerpc-$basename.h";
+ IdlEParser::RewriteHeader($pidl, $header, $eparserhdr);
+   }
}
 
if ($opt_client) {
@@ -202,28 +206,12 @@
if ($opt_parser) {
my($parser) = util::ChangeExtension($output, ".c");
IdlParser::Parse($pidl, $parser);
+   if($opt_eparser) {
+ my($eparser) = dirname($output) . 
"/packet-dcerpc-$basename.c";
+ IdlEParser::RewriteC($pidl, $parser, $eparser);
+   }
}
 
-   if ($opt_eparser) {
-
- # Generate regular .c and .h files for marshaling and
- # unmarshaling.
-
- my($parser) = util::ChangeExtension($output, ".c");
- IdlParser::Parse($pidl, $parser);
-
- my($header) = util::ChangeExtension($output, ".h");
- util::FileSave($header, I

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

2005-01-06 Thread tpot
Author: tpot
Date: 2005-01-06 23:08:30 + (Thu, 06 Jan 2005)
New Revision: 4578

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

Log:
Minor cleanup of ndr_pull_array() and ndr_pull_array_foo() regexps.

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 2005-01-06 19:32:39 UTC 
(rev 4577)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-06 23:08:30 UTC 
(rev 4578)
@@ -435,9 +435,9 @@
 
# Add tree argument to ndr_pull_array()
 
-   s/(ndr_pull_array([^\(_]*?)\(ndr, (NDR_[^,]*?), 
([^\)].*?)\);)/ndr_pull_array$2( ndr, $3, tree, $4);/smg;
+   s/(ndr_pull_array\(ndr, ([^,]*?), ([^\)].*?)\);)/ndr_pull_array( ndr, 
$2, tree, $3);/smg;
 
-   s/(ndr_pull_array_([^\(]*?)\(ndr, (NDR_[^,]*?), 
(r->((in|out).)?([^,]*?)), (.*?)\);)/ndr_pull_array_$2( ndr, $3, tree, 
hf_$7_$2_array, $4, $8);/smg;
+   s/(ndr_pull_array_([^\(]*?)\(ndr, ([^,]*?), (r->((in|out).)?([^,]*?)), 
(.*?)\);)/ndr_pull_array_$2( ndr, $3, tree, hf_$7_$2_array, $4, $8);/smg;
  
# Save ndr_pull_relative[12]() calls from being wrapped by the
# proceeding regexp.



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

2005-01-05 Thread tpot
Author: tpot
Date: 2005-01-06 02:36:59 + (Thu, 06 Jan 2005)
New Revision: 4548

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

Log:
Convert to talloc_p() and talloc_array_p() where appropriate.

(swig stuff seems broken atm though)

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/swig.pm
===
--- branches/SAMBA_4_0/source/build/pidl/swig.pm2005-01-06 02:32:43 UTC 
(rev 4547)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm2005-01-06 02:36:59 UTC 
(rev 4548)
@@ -51,7 +51,7 @@
 }
 
 if (!util::is_constant($e->{ARRAY_LEN})) {
-   $result .= "\ts->$prefix$e->{NAME} = talloc(mem_ctx, $size * 
sizeof($type));\n";
+   $result .= "\ts->$prefix$e->{NAME} = talloc_array_p(mem_ctx, $type, 
$size);\n";
 }
 
 $result .= "\tif (!PyDict_GetItemString(obj, \"$e->{NAME}\")) {\n";
@@ -120,7 +120,7 @@
}
}
} else {
-   $result .= "\ts->$prefix$e->{NAME} = talloc(mem_ctx, 
sizeof($e->{TYPE}));\n";
+   $result .= "\ts->$prefix$e->{NAME} = talloc_p(mem_ctx, 
$e->{TYPE});\n";
$result .= "\t*s->$prefix$e->{NAME} = $e->{TYPE}_from_python($obj, 
\"$e->{NAME}\");\n";
}
 } else {
@@ -271,7 +271,7 @@
 $result .= "\t\t\treturn NULL;\n";
 $result .= "\t}\n\n";
 
-$result .= "\ts = talloc(mem_ctx, sizeof(struct $fn->{NAME}));\n\n";
+$result .= "\ts = talloc_p(mem_ctx, struct $fn->{NAME});\n\n";
 
 # Remove this when all elements are initialised
 $result .= "\tmemset(s, 0, sizeof(struct $fn->{NAME}));\n\n";
@@ -411,7 +411,7 @@
 $result .= "\t\treturn NULL;\n";
 $result .= "\t}\n\n";
 
-$result .= "\ts = talloc(mem_ctx, sizeof(struct $s->{NAME}));\n\n";
+$result .= "\ts = talloc_p(mem_ctx, struct $s->{NAME});\n\n";
 
 foreach my $e (@{$s->{DATA}{ELEMENTS}}) {
$result .= FieldFromPython($e, "");
@@ -468,8 +468,42 @@
 $result .= "\treturn obj;\n";
 $result .= "}\n\n";
 
+if (util::has_property($s->{DATA}, "public")) {
+
+   # Generate function to unmarshall a structure. Used
+   # exclusively (?) in the spoolss pipe.
+
+   $result .= "/* Unmarshall a structures from a Python string */\n\n";
+
+   $result .= "NTSTATUS unmarshall_$s->{NAME}(DATA_BLOB *blob, TALLOC_CTX 
*mem_ctx, struct $s->{NAME} *info)\n";
+   $result .= "{\n";
+   $result .= "\tstruct ndr_pull *ndr;\n";
+   $result .= "\tndr = ndr_pull_init_blob(blob, mem_ctx);\n";
+   $result .= "\tif (!ndr) {\n";
+   $result .= "\t\treturn NT_STATUS_NO_MEMORY;\n";
+   $result .= "\t}\n";
+   $result .= "\tNDR_CHECK(ndr_pull_$s->{NAME}(ndr, 
NDR_SCALARS|NDR_BUFFERS, info));\n\n";
+   $result .= "\treturn NT_STATUS_OK;\n";
+   $result .= "}\n\n";
+}
+
 $result .= "%}\n\n";
 
+if (util::has_property($s->{DATA}, "public")) {
+
+   $result .= "%typemap(in, numinputs=0) struct $s->{NAME} *EMPTY (struct 
$s->{NAME} temp_$s->{NAME}) {\n";
+   $result .= "\t\$1 = &temp_$s->{NAME};\n";
+   $result .= "}\n\n";
+
+   $result .= "%typemap(argout) (struct $s->{NAME} *EMPTY) {\n";
+   $result .= "\tTALLOC_CTX *mem_ctx = 
talloc_init(\"unmarshall_$s->{NAME}\");\n\n";
+   $result .= "\t\$result = $s->{NAME}_ptr_to_python(mem_ctx, \$1);\n\n";
+   $result .= "\ttalloc_free(mem_ctx);\n";
+   $result .= "}\n\n";
+
+   $result .= "NTSTATUS unmarshall_$s->{NAME}(DATA_BLOB *blob, TALLOC_CTX 
*mem_ctx, struct $s->{NAME} *EMPTY);\n\n";
+}
+
 return $result;
 }
 
@@ -503,7 +537,7 @@
 $result .= "\t\treturn NULL;\n";
 $result .= "\t}\n\n";
 
-$result .= "\tu = talloc(mem_ctx, sizeof(union $u->{NAME}));\n\n";
+$result .= "\tu = talloc_p(mem_ctx, union $u->{NAME});\n\n";
 
 for my $e (@{$u->{DATA}{DATA}}) {
if (defined $e->{DATA}{NAME}) {



svn commit: samba r4546 - in branches/SAMBA_4_0/source/scripting/swig: .

2005-01-05 Thread tpot
Author: tpot
Date: 2005-01-06 02:10:33 + (Thu, 06 Jan 2005)
New Revision: 4546

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

Log:
Use talloc_p() instad of talloc()

Modified:
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-01-06 00:45:39 UTC 
(rev 4545)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-01-06 02:10:33 UTC 
(rev 4546)
@@ -313,7 +313,7 @@
return;
}
 
-   *s = talloc(mem_ctx, sizeof(DATA_BLOB));
+   *s = talloc_p(mem_ctx, DATA_BLOB);
 
(*s)->length = PyString_Size(obj);
(*s)->data = PyString_AsString(obj);



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

2005-01-04 Thread tpot
Author: tpot
Date: 2005-01-04 23:18:41 + (Tue, 04 Jan 2005)
New Revision: 165

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

Log:
Revert previous commit about giving arrays of scalars their own subtree.
Generate code to display using proto_tree_add_bytes() instead.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-04 21:10:01 UTC (rev 
164)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-04 23:18:41 UTC (rev 
165)
@@ -439,33 +439,42 @@
return NT_STATUS_OK;
 }
 
-static int hf_array_uint8 = -1;
-
 NTSTATUS ndr_pull_array_uint8(struct pidl_pull *ndr, int ndr_flags, 
- pidl_tree *tree, uint8_t *data, uint32_t n)
+ pidl_tree *tree, int hf, uint8_t *data, 
+ uint32_t n)
 {
uint32_t i;
-   if (!(ndr_flags & NDR_SCALARS)) {
+
+   if (!(ndr_flags & NDR_SCALARS))
return NT_STATUS_OK;
-   }
-   for (i = 0; i < n; i++) {
-   ndr_pull_uint8(ndr, tree, hf_array_uint8, data + i);
-   }
+
+   proto_tree_add_bytes(
+   tree->proto_tree, hf, ndr->tvb, ndr->offset, n, 
+   tvb_get_ptr(ndr->tvb, ndr->offset, n));
+
+   ndr->offset += n;
+
return NT_STATUS_OK;
 }
 
-static int hf_array_uint32 = -1;
-
 NTSTATUS ndr_pull_array_uint32(struct pidl_pull *ndr, int ndr_flags, 
-  pidl_tree *tree, uint32_t *data, uint32_t n)
+  pidl_tree *tree, int hf, uint32_t *data, 
+  uint32_t n)
 {
+   int len = n * sizeof(uint32_t);
uint32_t i;
-   if (!(ndr_flags & NDR_SCALARS)) {
+
+   if (!(ndr_flags & NDR_SCALARS))
return NT_STATUS_OK;
-   }
-   for (i = 0; i < n; i++) {
-   ndr_pull_uint32(ndr, tree, hf_array_uint8, data + i);
-   }
+
+   ndr_pull_align(ndr, sizeof(uint32_t));
+
+   proto_tree_add_bytes(
+   tree->proto_tree, hf, ndr->tvb, ndr->offset, len, 
+   tvb_get_ptr(ndr->tvb, ndr->offset, len));
+
+   ndr->offset += len;
+
return NT_STATUS_OK;
 }
 
@@ -782,8 +791,6 @@
 { &hf_array_size, { "Array size", "eparser.array_size", FT_UINT32, 
BASE_DEC, NULL, 0x0, "Array size", HFILL }},
 { &hf_array_length, { "Array length", "eparser.array_length", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Array length", HFILL }},
 { &hf_array_offset, { "Array offset", "eparser.array_offset", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Array offset", HFILL }},
-{ &hf_array_uint8, { "Uint8 array value", "eparser.uint8_array", 
FT_UINT8, BASE_DEC, NULL, 0x0, "Uint8 array value", HFILL }},
-{ &hf_array_uint32, { "Uint32 array value", "eparser.uint32_array", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Uint32 array value", HFILL }},
 { &hf_subcontext_size16, { "Uint16 subcontext", 
"eparser.subcontext16", FT_UINT16, BASE_DEC, NULL, 0x0, "Uint16 subcontext", 
HFILL }},
 { &hf_subcontext_size32, { "Uint32 subcontext", 
"eparser.subcontext32", FT_UINT32, BASE_DEC, NULL, 0x0, "Uint32 subcontext", 
HFILL }},
 { &hf_dom_sid2_num_auths, { "dom_sid2 num auths", "eparser.num_auths", 
FT_UINT32, BASE_DEC, NULL, 0x0, "dom_sid2 num auths", HFILL }},

Modified: trunk/ethereal/plugins/pidl/eparser.h
===
--- trunk/ethereal/plugins/pidl/eparser.h   2005-01-04 21:10:01 UTC (rev 
164)
+++ trunk/ethereal/plugins/pidl/eparser.h   2005-01-04 23:18:41 UTC (rev 
165)
@@ -127,10 +127,8 @@
NTSTATUS (*pull_fn)(struct pidl_pull *, int, 
pidl_tree *tree, void *));
 NTSTATUS ndr_check_array_size(struct pidl_pull *ndr, void *p, uint32_t size);
-NTSTATUS ndr_pull_array_uint8(struct pidl_pull *ndr, int ndr_flags, 
- pidl_tree *tree, uint8_t *data, uint32_t n);
-NTSTATUS ndr_pull_array_uint32(struct pidl_pull *ndr, int ndr_flags, 
-  pidl_tree *tree, uint32_t *data, uint32_t n);
+NTSTATUS ndr_pull_array_uint8(struct pidl_pull *ndr, int ndr_flags, pidl_tree 
*tree, int hf, uint8_t *data, uint32_t n);
+NTSTATUS ndr_pull_array_uint32(struct pidl_pull *ndr, int ndr_flags, pidl_tree 
*tree, int hf, uint32_t *data, uint32_t n);
 NTSTATUS ndr_pull_time_t(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
 time_t *data);
 NTSTATUS ndr_pull_relative1(struct pidl_pull *ndr, const void *p, uint32_t 
rel_offset);



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

2005-01-04 Thread tpot
Author: tpot
Date: 2005-01-04 23:15:33 + (Tue, 04 Jan 2005)
New Revision: 4517

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

Log:
Revert previous commit about giving arrays of scalars their own subtree.
Generate code to display using proto_tree_add_bytes() instead.

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 2005-01-04 20:26:50 UTC 
(rev 4516)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-04 23:15:33 UTC 
(rev 4517)
@@ -173,35 +173,39 @@
if ($t->{DATA}->{TYPE} eq "STRUCT") {
 
for my $e (@{$t->{DATA}->{ELEMENTS}}) {
-
$e->{PARENT} = $t->{DATA};
-
if ($needed{"pull_$t->{NAME}"}) {
$needed{"pull_$e->{TYPE}"} = 1;
}

if (util::is_scalar_type($e->{TYPE})) {
-
+   
if (defined($e->{ARRAY_LEN}) or 
util::has_property($e, "size_is")) {
 
-   $needed{"ett_$e->{NAME}"} = 1;
+   # Arrays of scalar types are FT_BYTES
+   
+   $needed{"hf_$e->{NAME}_$e->{TYPE}_array"} = {
+   'name' => field2name($e->{NAME}),
+   'type' => $e->{TYPE},
+   'ft'   => "FT_BYTES",
+   'base' => elementbase($e)
+   };
 
} else {
-   
$needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft'   => type2ft($e->{TYPE}),
'base' => elementbase($e)
};
-   
-   $e->{PARENT} = $t->{DATA};
-   
-   if ($needed{"pull_$t->{NAME}"}) {
-   $needed{"pull_$e->{TYPE}"} = 1;
-   }
}
+   
+   $e->{PARENT} = $t->{DATA};
+   
+   if ($needed{"pull_$t->{NAME}"}) {
+   $needed{"pull_$e->{TYPE}"} = 1;
+   }
 
} else {

@@ -433,7 +437,7 @@
 
s/(ndr_pull_array([^\(_]*?)\(ndr, (NDR_[^,]*?), 
([^\)].*?)\);)/ndr_pull_array$2( ndr, $3, tree, $4);/smg;
 
-   s/(ndr_pull_array_([^\(]*?)\(ndr, (NDR_[^,]*?), 
(r->((in|out).)?([^,]*?)), (.*?)\);)/ndr_pull_array_$2( ndr, $3, 
get_subtree(tree, \"$7\", ndr, ett_$7), $4, $8);/smg;
+   s/(ndr_pull_array_([^\(]*?)\(ndr, (NDR_[^,]*?), 
(r->((in|out).)?([^,]*?)), (.*?)\);)/ndr_pull_array_$2( ndr, $3, tree, 
hf_$7_$2_array, $4, $8);/smg;
  
# Save ndr_pull_relative[12]() calls from being wrapped by the
# proceeding regexp.



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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-04 06:37:39 + (Tue, 04 Jan 2005)
New Revision: 162

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

Log:
Check in changes to autogenerated dissectors after the last couple of
bugfixes (hey the diffs for this are actually pretty descriptive of
what has changed).

Modified:
   trunk/ethereal/plugins/pidl/packet-dcerpc-lsa.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-misc.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-samr.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-security.c


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


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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-04 06:35:53 + (Tue, 04 Jan 2005)
New Revision: 4512

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

Log:
Give arrays of scalar types their own subtree.

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 2005-01-04 05:21:24 UTC 
(rev 4511)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-04 06:35:53 UTC 
(rev 4512)
@@ -173,25 +173,36 @@
if ($t->{DATA}->{TYPE} eq "STRUCT") {
 
for my $e (@{$t->{DATA}->{ELEMENTS}}) {
+
$e->{PARENT} = $t->{DATA};
+
if ($needed{"pull_$t->{NAME}"}) {
$needed{"pull_$e->{TYPE}"} = 1;
}

if (util::is_scalar_type($e->{TYPE})) {
+
+   if (defined($e->{ARRAY_LEN}) or 
+   util::has_property($e, "size_is")) {
+
+   $needed{"ett_$e->{NAME}"} = 1;
+
+   } else {

-   $needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
-   'name' => field2name($e->{NAME}),
-   'type' => $e->{TYPE},
-   'ft'   => type2ft($e->{TYPE}),
-   'base' => elementbase($e)
-   };
-   
-   $e->{PARENT} = $t->{DATA};
-   
-   if ($needed{"pull_$t->{NAME}"}) {
-   $needed{"pull_$e->{TYPE}"} = 1;
+   $needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
+   'name' => field2name($e->{NAME}),
+   'type' => $e->{TYPE},
+   'ft'   => type2ft($e->{TYPE}),
+   'base' => elementbase($e)
+   };
+   
+   $e->{PARENT} = $t->{DATA};
+   
+   if ($needed{"pull_$t->{NAME}"}) {
+   $needed{"pull_$e->{TYPE}"} = 1;
+   }
}
+
} else {

$needed{"ett_$e->{TYPE}"} = 1;
@@ -420,8 +431,10 @@
 
# Add tree argument to ndr_pull_array()
 
-   s/(ndr_pull_array([^\(]*?)\(ndr, (NDR_[^,]*?), 
([^\)].*?)\);)/ndr_pull_array$2( ndr, $3, tree, $4);/smg;
+   s/(ndr_pull_array([^\(_]*?)\(ndr, (NDR_[^,]*?), 
([^\)].*?)\);)/ndr_pull_array$2( ndr, $3, tree, $4);/smg;
 
+   s/(ndr_pull_array_([^\(]*?)\(ndr, (NDR_[^,]*?), 
(r->((in|out).)?([^,]*?)), (.*?)\);)/ndr_pull_array_$2( ndr, $3, 
get_subtree(tree, \"$7\", ndr, ett_$7), $4, $8);/smg;
+ 
# Save ndr_pull_relative[12]() calls from being wrapped by the
# proceeding regexp.
 



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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-04 06:30:55 + (Tue, 04 Jan 2005)
New Revision: 161

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

Log:
Add some prototypes to fix a couple of compiler warnings.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.h
===
--- trunk/ethereal/plugins/pidl/eparser.h   2005-01-04 05:43:59 UTC (rev 
160)
+++ trunk/ethereal/plugins/pidl/eparser.h   2005-01-04 06:30:55 UTC (rev 
161)
@@ -111,6 +111,8 @@
 NTSTATUS ndr_pull_int16(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
int16_t *v);
 NTSTATUS ndr_pull_int32(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
int32_t *v);
 NTSTATUS ndr_pull_int64(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
int64_t *v);
+NTSTATUS ndr_pull_NTTIME(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
NTTIME *data);
+NTSTATUS ndr_pull_HYPER_T(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
HYPER_T *data);
 void ndr_set_flags(uint32_t *pflags, uint32_t new_flags);
 NTSTATUS ndr_pull_ptr(struct pidl_pull *ndr, pidl_tree *tree, int hf, uint32_t 
*v);
 NTSTATUS ndr_pull_error(struct pidl_pull *ndr, 



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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-04 05:43:59 + (Tue, 04 Jan 2005)
New Revision: 160

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

Log:
When creating subtrees for ndr structures, make the name a bit
friendlier looking than the IDL field name.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-03 23:38:34 UTC (rev 
159)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-04 05:43:59 UTC (rev 
160)
@@ -517,6 +517,7 @@
GSList *l;
proto_item *item;
struct subtree_info *info;
+   char *item_name, *tmp;
 
if (!tree->proto_tree)
return tree;
@@ -530,13 +531,31 @@
return &info->subtree;
}

+   /* Create a more friendly looking name */
+
+   item_name = g_strdup(name);
+   
+   for(tmp = item_name; *tmp; tmp++) { /* Underscores to spaces */
+   if (*tmp == '_')
+   *tmp = ' ';
+   }
+
+   for(tmp = item_name; *tmp; tmp++) { /* Capitalise each word */
+   if (tmp == item_name || *(tmp - 1) == ' ') 
+   *tmp = toupper(*tmp);
+   }
+
/* Create new subtree entry */

info = (struct subtree_info *)g_malloc(sizeof(struct subtree_info));

info->name = g_strdup(name);
+
item = proto_tree_add_text(
-   tree->proto_tree, ndr->tvb, ndr->offset, 0, name);
+   tree->proto_tree, ndr->tvb, ndr->offset, 0, item_name);
+
+   g_free(item_name);
+
info->subtree.subtree_list = NULL;
info->subtree.proto_tree = proto_item_add_subtree(item, ett);
 



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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-04 05:21:24 + (Tue, 04 Jan 2005)
New Revision: 4511

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

Log:
Remove a crapload of dead code.

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


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


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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-03 23:38:34 + (Mon, 03 Jan 2005)
New Revision: 159

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

Log:
Register field info for subcontext sizes, array length and offset, and
num auths.

samr now completely decodes!

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-03 23:30:15 UTC (rev 
158)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-03 23:38:34 UTC (rev 
159)
@@ -563,29 +563,6 @@
return ndr_token_peek(&ndr->array_size_list, p);
 }
 
-void proto_register_eparser(void)
-{
-static hf_register_info hf[] = {
-{ &hf_string4_len, { "Length", "eparser.string4_length", FT_UINT32, 
BASE_DEC, NULL, 0x0, "String4 length", HFILL }},
-{ &hf_string4_offset, { "Offset", "eparser.string4_offset", FT_UINT32, 
BASE_DEC, NULL, 0x0, "String4 offset", HFILL }},
-{ &hf_string4_len2, { "Length2", "eparser.string4_length2", FT_UINT32, 
BASE_DEC, NULL, 0x0, "String4 length2", HFILL }},
-{ &hf_string_data, { "Data", "eparser.string_data", FT_NONE, 
BASE_NONE, NULL, 0x0, "String data", HFILL }},
-{ &hf_array_size, { "Array size", "eparser.array_size", FT_UINT32, 
BASE_DEC, NULL, 0x0, "Array size", HFILL }},
-{ &hf_array_uint8, { "Uint8 array value", "eparser.uint8_array", 
FT_UINT8, BASE_DEC, NULL, 0x0, "Uint8 array value", HFILL }},
-{ &hf_array_uint32, { "Uint32 array value", "eparser.uint32_array", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Uint32 array value", HFILL }},
-};
-
-static gint *ett[] = {
-   &ett_array,
-};
-
-int proto_dcerpc;
-
-proto_dcerpc = proto_get_id_by_filter_name("dcerpc");
-proto_register_field_array(proto_dcerpc, hf, array_length(hf));
-proto_register_subtree_array(ett, array_length(ett));
-}
-
 NTSTATUS ndr_pull_relative1(struct pidl_pull *ndr, const void *p, uint32_t 
rel_offset)
 {
if (ndr->flags & LIBNDR_FLAG_RELATIVE_CURRENT) {
@@ -622,7 +599,8 @@
 }
 
 
-static int hf_subcontext_size = -1;
+static int hf_subcontext_size16 = -1;
+static int hf_subcontext_size32 = -1;
 
 /*
   handle subcontext buffers, which in midl land are user-marshalled, but
@@ -643,7 +621,7 @@
 
case 2: {
uint16_t size;
-   ndr_pull_uint16(ndr, tree, hf_subcontext_size, &size);
+   ndr_pull_uint16(ndr, tree, hf_subcontext_size16, &size);
if (size == 0) return NT_STATUS_OK;
ndr_pull_subcontext(ndr, ndr2, size);
break;
@@ -651,7 +629,7 @@
 
case 4: {
uint32_t size;
-   ndr_pull_uint32(ndr, tree, hf_subcontext_size, &size);
+   ndr_pull_uint32(ndr, tree, hf_subcontext_size32, &size);
if (size == 0) return NT_STATUS_OK;
ndr_pull_subcontext(ndr, ndr2, size);
break;
@@ -774,3 +752,32 @@
 }
 
 gint hf_conformant_size = -1;
+
+void proto_register_eparser(void)
+{
+static hf_register_info hf[] = {
+{ &hf_string4_len, { "Length", "eparser.string4_length", FT_UINT32, 
BASE_DEC, NULL, 0x0, "String4 length", HFILL }},
+{ &hf_string4_offset, { "Offset", "eparser.string4_offset", FT_UINT32, 
BASE_DEC, NULL, 0x0, "String4 offset", HFILL }},
+{ &hf_string4_len2, { "Length2", "eparser.string4_length2", FT_UINT32, 
BASE_DEC, NULL, 0x0, "String4 length2", HFILL }},
+{ &hf_string_data, { "Data", "eparser.string_data", FT_NONE, 
BASE_NONE, NULL, 0x0, "String data", HFILL }},
+{ &hf_array_size, { "Array size", "eparser.array_size", FT_UINT32, 
BASE_DEC, NULL, 0x0, "Array size", HFILL }},
+{ &hf_array_length, { "Array length", "eparser.array_length", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Array length", HFILL }},
+{ &hf_array_offset, { "Array offset", "eparser.array_offset", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Array offset", HFILL }},
+{ &hf_array_uint8, { "Uint8 array value", "eparser.uint8_array", 
FT_UINT8, BASE_DEC, NULL, 0x0, "Uint8 array value", HFILL }},
+{ &hf_array_uint32, { "Uint32 array value", "eparser.uint32_array", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Uint32 array value", HFILL }},
+

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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-03 23:30:15 + (Mon, 03 Jan 2005)
New Revision: 158

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

Log:
Call registration functions for misc.idl and security.idl in plugin
init.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/pidl.c
===
--- trunk/ethereal/plugins/pidl/pidl.c  2005-01-03 22:50:58 UTC (rev 157)
+++ trunk/ethereal/plugins/pidl/pidl.c  2005-01-03 23:30:15 UTC (rev 158)
@@ -10,14 +10,13 @@
 void proto_reg_handoff_dcerpc_pidl_lsarpc(void);
 
 void proto_register_eparser(void);
+void proto_register_dcerpc_pidl_misc(void);
+void proto_register_dcerpc_pidl_security(void);
+
 void proto_register_dcerpc_pidl_atsvc(void);
 void proto_register_dcerpc_pidl_samr(void);
 void proto_register_dcerpc_pidl_lsarpc(void);
 
-extern int proto_dcerpc_pidl_atsvc;
-extern int proto_dcerpc_pidl_samr;
-extern int proto_dcerpc_pidl_lsarpc;
-
 #ifndef ENABLE_STATIC
 
 G_MODULE_EXPORT void
@@ -41,14 +40,12 @@
 
   proto_register_eparser();
 
-  if (proto_dcerpc_pidl_atsvc == -1)
- proto_register_dcerpc_pidl_atsvc();
+  proto_register_dcerpc_pidl_misc();
+  proto_register_dcerpc_pidl_security();
 
-  if (proto_dcerpc_pidl_samr == -1)
- proto_register_dcerpc_pidl_samr();
-
-  if (proto_dcerpc_pidl_lsarpc == -1)
- proto_register_dcerpc_pidl_lsarpc();
+  proto_register_dcerpc_pidl_atsvc();
+  proto_register_dcerpc_pidl_samr();
+  proto_register_dcerpc_pidl_lsarpc();
 }
 
 #endif



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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-03 23:28:45 + (Mon, 03 Jan 2005)
New Revision: 4509

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

Log:
Add missing cr.

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/parser.pm
===
--- branches/SAMBA_4_0/source/build/pidl/parser.pm  2005-01-03 14:45:17 UTC 
(rev 4508)
+++ branches/SAMBA_4_0/source/build/pidl/parser.pm  2005-01-03 23:28:45 UTC 
(rev 4509)
@@ -551,7 +551,7 @@
pidl "\tif (_ptr_$e->{NAME}) {\n";
pidl "\t\tNDR_ALLOC(ndr, $var_prefix$e->{NAME});\n";
if (util::has_property($e, "relative")) {
-   pidl "\t\tNDR_CHECK(ndr_pull_relative1(ndr, 
$var_prefix$e->{NAME}, _ptr_$e->{NAME}));";
+   pidl "\t\tNDR_CHECK(ndr_pull_relative1(ndr, 
$var_prefix$e->{NAME}, _ptr_$e->{NAME}));\n";
}
pidl "\t} else {\n";
pidl "\t\t$var_prefix$e->{NAME} = NULL;\n";



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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-03 22:50:58 + (Mon, 03 Jan 2005)
New Revision: 157

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

Log:
Add function prototypes for ndr_pull_*_fn_t.

Fix bug in prototype for ndr_pull_relative2().

Initialise array_length_list and relative_list.  

Fix parameters to function called in ndr_pull_subcontext_flags_fn.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-03 22:47:53 UTC (rev 
156)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-03 22:50:58 UTC (rev 
157)
@@ -15,6 +15,8 @@
ndr->drep = drep;
ndr->flags = NDR_SCALARS|NDR_BUFFERS|LIBNDR_FLAG_REF_ALLOC; 
ndr->array_size_list = NULL;
+   ndr->array_length_list = NULL;
+   ndr->relative_list = NULL;
 
return ndr;
 }
@@ -598,7 +600,7 @@
   pull a relative object - stage2
   called during BUFFERS processing
 */
-NTSTATUS ndr_pull_relative2(struct ndr_pull *ndr, const void *p)
+NTSTATUS ndr_pull_relative2(struct pidl_pull *ndr, const void *p)
 {
uint32_t rel_offset;
ndr_token_retrieve(&ndr->relative_list, p, &rel_offset);
@@ -668,7 +670,7 @@
struct pidl_pull *ndr2;
NDR_ALLOC(ndr, ndr2);
ndr_pull_subcontext_header(ndr, tree, sub_size, ndr2);
-   fn(ndr2, NDR_SCALARS|NDR_BUFFERS, base);
+   fn(ndr2, NDR_SCALARS|NDR_BUFFERS, tree, base);
if (sub_size) {
ndr_pull_advance(ndr, tvb_length(ndr2->tvb));
} else {

Modified: trunk/ethereal/plugins/pidl/eparser.h
===
--- trunk/ethereal/plugins/pidl/eparser.h   2005-01-03 22:47:53 UTC (rev 
156)
+++ trunk/ethereal/plugins/pidl/eparser.h   2005-01-03 22:50:58 UTC (rev 
157)
@@ -92,6 +92,12 @@
 
 extern gint hf_conformant_size;
 
+/* these are used when generic fn pointers are needed for ndr push/pull fns */
+typedef NTSTATUS (*ndr_pull_fn_t)(struct pidl_pull *, void *);
+
+typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct pidl_pull *, int ndr_flags, 
pidl_tree *tree, void *);
+typedef NTSTATUS (*ndr_pull_union_fn_t)(struct pidl_pull *, int ndr_flags, 
pidl_tree *tree, uint32_t, void *);
+
 // Prototypes for libndr functions
 
 NTSTATUS ndr_pull_struct_start(struct pidl_pull *ndr);
@@ -126,6 +132,7 @@
 NTSTATUS ndr_pull_time_t(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
 time_t *data);
 NTSTATUS ndr_pull_relative1(struct pidl_pull *ndr, const void *p, uint32_t 
rel_offset);
+NTSTATUS ndr_pull_relative2(struct pidl_pull *ndr, const void *p);
 void ndr_pull_save(struct pidl_pull *ndr, struct ndr_pull_save *save);
 void ndr_pull_restore(struct pidl_pull *ndr, struct ndr_pull_save *save);
 NTSTATUS ndr_pull_subcontext_flags_fn(struct pidl_pull *ndr, pidl_tree *tree,



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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-03 22:47:53 + (Mon, 03 Jan 2005)
New Revision: 156

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

Log:
Remove libndr function typedefs as we want to modify them to use
struct pidl_pull.

Modified:
   trunk/ethereal/plugins/pidl/libndr.h


Changeset:
Modified: trunk/ethereal/plugins/pidl/libndr.h
===
--- trunk/ethereal/plugins/pidl/libndr.h2005-01-03 22:46:19 UTC (rev 
155)
+++ trunk/ethereal/plugins/pidl/libndr.h2005-01-03 22:47:53 UTC (rev 
156)
@@ -252,17 +252,3 @@
 } while (0)
 
 #define NDR_PUSH_ALLOC(ndr, s) NDR_PUSH_ALLOC_SIZE(ndr, s, sizeof(*(s)))
-
-/* these are used when generic fn pointers are needed for ndr push/pull fns */
-typedef NTSTATUS (*ndr_push_fn_t)(struct ndr_push *, void *);
-typedef NTSTATUS (*ndr_pull_fn_t)(struct ndr_pull *, void *);
-
-typedef NTSTATUS (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, void 
*);
-typedef NTSTATUS (*ndr_push_const_fn_t)(struct ndr_push *, int ndr_flags, 
const void *);
-typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void 
*);
-typedef NTSTATUS (*ndr_push_union_fn_t)(struct ndr_push *, int ndr_flags, 
uint32_t, void *);
-typedef NTSTATUS (*ndr_pull_union_fn_t)(struct ndr_pull *, int ndr_flags, 
uint32_t, void *);
-typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, void *);
-typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, 
void *);
-typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, 
uint32_t, void *);
-



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

2005-01-03 Thread tpot
Author: tpot
Date: 2005-01-03 22:46:19 + (Mon, 03 Jan 2005)
New Revision: 155

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

Log:
Initialise samr and lsa dissectors.  Cleanup to remove a bunch of warnings.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/pidl.c
===
--- trunk/ethereal/plugins/pidl/pidl.c  2005-01-03 20:34:57 UTC (rev 154)
+++ trunk/ethereal/plugins/pidl/pidl.c  2005-01-03 22:46:19 UTC (rev 155)
@@ -6,19 +6,25 @@
 #include "plugins/plugin_api.h"
 
 void proto_reg_handoff_dcerpc_pidl_atsvc(void);
+void proto_reg_handoff_dcerpc_pidl_samr(void);
+void proto_reg_handoff_dcerpc_pidl_lsarpc(void);
+
+void proto_register_eparser(void);
 void proto_register_dcerpc_pidl_atsvc(void);
-//void proto_reg_handoff_dcerpc_pidl_misc(void);
-//void proto_register_dcerpc_pidl_misc(void);
+void proto_register_dcerpc_pidl_samr(void);
+void proto_register_dcerpc_pidl_lsarpc(void);
 
 extern int proto_dcerpc_pidl_atsvc;
-//extern int proto_dcerpc_pidl_misc;
+extern int proto_dcerpc_pidl_samr;
+extern int proto_dcerpc_pidl_lsarpc;
 
 #ifndef ENABLE_STATIC
 
 G_MODULE_EXPORT void
 plugin_reg_handoff(void){
proto_reg_handoff_dcerpc_pidl_atsvc();
-// proto_reg_handoff_dcerpc_pidl_misc();
+   proto_reg_handoff_dcerpc_pidl_samr();
+   proto_reg_handoff_dcerpc_pidl_lsarpc();
 }
 
 G_MODULE_EXPORT void
@@ -38,17 +44,11 @@
   if (proto_dcerpc_pidl_atsvc == -1)
  proto_register_dcerpc_pidl_atsvc();
 
-#if 0
-  if (proto_dcerpc_pidl_misc == -1)
- proto_register_dcerpc_pidl_misc();
-
   if (proto_dcerpc_pidl_samr == -1)
  proto_register_dcerpc_pidl_samr();
 
   if (proto_dcerpc_pidl_lsarpc == -1)
  proto_register_dcerpc_pidl_lsarpc();
-#endif
-
 }
 
 #endif



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

2005-01-02 Thread tpot
Author: tpot
Date: 2005-01-03 00:36:27 + (Mon, 03 Jan 2005)
New Revision: 151

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

Log:
Add dissectors for misc, security, lsa and samr idl files.

Modified:
   trunk/ethereal/plugins/pidl/Makefile.am


Changeset:
Modified: trunk/ethereal/plugins/pidl/Makefile.am
===
--- trunk/ethereal/plugins/pidl/Makefile.am 2005-01-03 00:35:58 UTC (rev 
150)
+++ trunk/ethereal/plugins/pidl/Makefile.am 2005-01-03 00:36:27 UTC (rev 
151)
@@ -30,7 +30,11 @@
 
 pidl_la_SOURCES = pidl.c eparser.c talloc.c talloc.h dlinklist.h \
moduleinfo.h moduleinfo.c \
-   packet-dcerpc-atsvc.c
+   packet-dcerpc-misc.c packet-dcerpc-misc.h \
+   packet-dcerpc-security.c packet-dcerpc-security.h \
+   packet-dcerpc-atsvc.c packet-dcerpc-atsvc.h \
+   packet-dcerpc-lsa.c packet-dcerpc-lsa.h \
+   packet-dcerpc-samr.c packet-dcerpc-samr.h
 
 # This is only required for talloc.o but I can't figure out the
 # right automake foo for that.



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

2005-01-02 Thread tpot
Author: tpot
Date: 2005-01-03 00:35:58 + (Mon, 03 Jan 2005)
New Revision: 150

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

Log:
Fiddle with svn:ignore properties.

Modified:
   trunk/ethereal/plugins/pidl/


Changeset:

Property changes on: trunk/ethereal/plugins/pidl
___
Name: svn:ignore
   - .deps
.libs
pidl.loT
Makefile
Makefile.in

   + .deps
.libs
pidl.loT
Makefile
Makefile.in
ndr_*.c
ndr_*.h





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

2005-01-02 Thread tpot
Author: tpot
Date: 2005-01-03 00:34:30 + (Mon, 03 Jan 2005)
New Revision: 149

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

Log:
Add helper functions for arrays and relative structures.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-03 00:30:03 UTC (rev 
148)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-03 00:34:30 UTC (rev 
149)
@@ -583,3 +583,192 @@
 proto_register_field_array(proto_dcerpc, hf, array_length(hf));
 proto_register_subtree_array(ett, array_length(ett));
 }
+
+NTSTATUS ndr_pull_relative1(struct pidl_pull *ndr, const void *p, uint32_t 
rel_offset)
+{
+   if (ndr->flags & LIBNDR_FLAG_RELATIVE_CURRENT) {
+   return ndr_token_store(ndr, &ndr->relative_list, p, 
+  rel_offset + ndr->offset - 4);
+   } else {
+   return ndr_token_store(ndr, &ndr->relative_list, p, rel_offset);
+   }
+}
+
+/*
+  pull a relative object - stage2
+  called during BUFFERS processing
+*/
+NTSTATUS ndr_pull_relative2(struct ndr_pull *ndr, const void *p)
+{
+   uint32_t rel_offset;
+   ndr_token_retrieve(&ndr->relative_list, p, &rel_offset);
+   return ndr_pull_set_offset(ndr, rel_offset);
+}
+
+/* save the offset/size of the current ndr state */
+void ndr_pull_save(struct pidl_pull *ndr, struct ndr_pull_save *save)
+{
+   save->offset = ndr->offset;
+// save->data_size = ndr->data_size;
+}
+
+/* restore the size/offset of a ndr structure */
+void ndr_pull_restore(struct pidl_pull *ndr, struct ndr_pull_save *save)
+{
+   ndr->offset = save->offset;
+// ndr->data_size = save->data_size;
+}
+
+
+static int hf_subcontext_size = -1;
+
+/*
+  handle subcontext buffers, which in midl land are user-marshalled, but
+  we use magic in pidl to make them easier to cope with
+*/
+static NTSTATUS ndr_pull_subcontext_header(struct pidl_pull *ndr, 
+  pidl_tree *tree,
+  size_t sub_size,
+  struct pidl_pull *ndr2)
+{
+   switch (sub_size) {
+   case 0: {
+   uint32_t size = tvb_length(ndr->tvb) - ndr->offset;
+   if (size == 0) return NT_STATUS_OK;
+   ndr_pull_subcontext(ndr, ndr2, size);
+   break;
+   }
+
+   case 2: {
+   uint16_t size;
+   ndr_pull_uint16(ndr, tree, hf_subcontext_size, &size);
+   if (size == 0) return NT_STATUS_OK;
+   ndr_pull_subcontext(ndr, ndr2, size);
+   break;
+   }
+
+   case 4: {
+   uint32_t size;
+   ndr_pull_uint32(ndr, tree, hf_subcontext_size, &size);
+   if (size == 0) return NT_STATUS_OK;
+   ndr_pull_subcontext(ndr, ndr2, size);
+   break;
+   }
+   default:
+   return ndr_pull_error(ndr, NDR_ERR_SUBCONTEXT, "Bad subcontext 
size %d", 
+ sub_size);
+   }
+   return NT_STATUS_OK;
+}
+
+NTSTATUS ndr_pull_subcontext_flags_fn(struct pidl_pull *ndr, pidl_tree *tree,
+ size_t sub_size, void *base, 
+ ndr_pull_flags_fn_t fn)
+{
+   struct pidl_pull *ndr2;
+   NDR_ALLOC(ndr, ndr2);
+   ndr_pull_subcontext_header(ndr, tree, sub_size, ndr2);
+   fn(ndr2, NDR_SCALARS|NDR_BUFFERS, base);
+   if (sub_size) {
+   ndr_pull_advance(ndr, tvb_length(ndr2->tvb));
+   } else {
+   ndr_pull_advance(ndr, ndr2->offset);
+   }
+   return NT_STATUS_OK;
+}
+
+/*
+  create an ndr sub-context based on an existing context. The new context 
starts
+  at the current offset, with the given size limit
+*/
+NTSTATUS ndr_pull_subcontext(struct pidl_pull *ndr, struct pidl_pull *ndr2, 
uint32_t size)
+{
+   *ndr2 = *ndr;
+   ndr2->tvb = tvb_new_subset(ndr->tvb, ndr->offset, size, size);
+   ndr2->offset = 0;
+   ndr2->flags = ndr->flags;
+   return NT_STATUS_OK;
+}
+
+NTSTATUS ndr_pull_set_offset(struct pidl_pull *ndr, uint32_t ofs)
+{
+   ndr->offset = ofs;
+   if (ndr->offset > tvb_length(ndr->tvb)) {
+   return ndr_pull_error(ndr, NDR_ERR_BUFSIZE, 
+ "ndr_pull_set_offset %u failed",
+ ofs);
+   }
+   return NT_STATUS_OK;
+}
+
+/*
+  advance by 'size' bytes
+*/
+NTSTATUS ndr_pull_advance(struct pidl_pull *ndr, uint32_t size)
+{
+   ndr->offset += size;
+   if (ndr->

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

2005-01-02 Thread tpot
Author: tpot
Date: 2005-01-03 00:30:03 + (Mon, 03 Jan 2005)
New Revision: 148

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

Log:
Check in some more autogenerated parsers.  These compile (woot!) but do
not run just at the moment.

Added:
   trunk/ethereal/plugins/pidl/packet-dcerpc-lsa.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-lsa.h
   trunk/ethereal/plugins/pidl/packet-dcerpc-misc.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-misc.h
   trunk/ethereal/plugins/pidl/packet-dcerpc-samr.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-samr.h
   trunk/ethereal/plugins/pidl/packet-dcerpc-security.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-security.h


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


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

2005-01-02 Thread tpot
Author: tpot
Date: 2005-01-03 00:26:50 + (Mon, 03 Jan 2005)
New Revision: 4495

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

Log:
Some more regexps for handling stuff in the lsa and samr pipes -
various types of arrays and relative structures.

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 2005-01-02 23:53:14 UTC 
(rev 4494)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-03 00:26:50 UTC 
(rev 4495)
@@ -1224,13 +1224,17 @@
# caught by the regex for wrapping scalar values below (i.e
# the leading space in front of the first parameter).
 
-   s/(ndr_pull_array_size\(ndr, ([^\)]*?)\);)/ndr_pull_array_size( ndr, 
tree, $2);/smg;
+   s/(ndr_pull_array_(size|length)\(ndr, ([^\)]*?)\);)/ndr_pull_array_$2( 
ndr, tree, $3);/smg;
 
# Add tree argument to ndr_pull_array()
 
s/(ndr_pull_array([^\(]*?)\(ndr, (NDR_[^,]*?), 
([^\)].*?)\);)/ndr_pull_array$2( ndr, $3, tree, $4);/smg;
 
+   # Save ndr_pull_relative[12]() calls from being wrapped by the
+   # proceeding regexp.
 
+   s/ndr_pull_(relative1|relative2)\((.*?);/ndr_pull_$1( $2;/smg;
+
# Call ethereal wrappers for pull of scalar values in
# structures and functions:
#
@@ -1257,6 +1261,10 @@
 
s/^((static )?NTSTATUS ndr_pull_([^\(]*?)\(struct ndr_pull \*ndr, int 
(ndr_)?flags)/$1, proto_tree \*tree/smg;
 
+   # Add proto_tree parameter to ndr_pull_subcontext_flags_fn()
+
+s/(ndr_pull_subcontext_flags_fn\(ndr)(.*?);/$1, tree$2;/smg;
+
# Get rid of ndr_pull_error() calls.  Ethereal should take
# care of buffer overruns and inconsistent array sizes for us.
 
@@ -1270,6 +1278,11 @@
 
s/struct ndr_pull \*ndr/struct pidl_pull \*ndr/smg;
 
+   # Fix some internal variable declarations
+
+s/uint(16|32) _level/uint$1_t _level/smg;
+s/ndr_pull_([^\(]*)\(ndr, tree, hf_level, &_level\);/ndr_pull_$1(ndr, 
tree, hf_level_$1, &_level);/smg;
+ 
pidl $_;
 }
 



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

2005-01-02 Thread tpot
Author: tpot
Date: 2005-01-02 23:25:54 + (Sun, 02 Jan 2005)
New Revision: 147

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

Log:
Remove an obsolete file.

Removed:
   trunk/ethereal/plugins/pidl/includes.h


Changeset:
Deleted: trunk/ethereal/plugins/pidl/includes.h
===
--- trunk/ethereal/plugins/pidl/includes.h  2005-01-02 21:08:54 UTC (rev 
146)
+++ trunk/ethereal/plugins/pidl/includes.h  2005-01-02 23:25:54 UTC (rev 
147)
@@ -1 +0,0 @@
-#include "eparser.h"



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

2005-01-02 Thread tpot
Author: tpot
Date: 2005-01-02 23:25:25 + (Sun, 02 Jan 2005)
New Revision: 4489

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

Log:
Remove an obsolete file.

Removed:
   branches/SAMBA_4_0/source/build/pidl/includes.h


Changeset:
Deleted: branches/SAMBA_4_0/source/build/pidl/includes.h
===
--- branches/SAMBA_4_0/source/build/pidl/includes.h 2005-01-02 23:09:11 UTC 
(rev 4488)
+++ branches/SAMBA_4_0/source/build/pidl/includes.h 2005-01-02 23:25:25 UTC 
(rev 4489)
@@ -1,3 +0,0 @@
-#include "packet-dcerpc-proto.h"
-
-



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

2005-01-01 Thread tpot
Author: tpot
Date: 2005-01-02 03:57:04 + (Sun, 02 Jan 2005)
New Revision: 145

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

Log:
Update README for ethereal pidl parsers.

Modified:
   trunk/ethereal/README


Changeset:
Modified: trunk/ethereal/README
===
--- trunk/ethereal/README   2005-01-02 03:22:55 UTC (rev 144)
+++ trunk/ethereal/README   2005-01-02 03:57:04 UTC (rev 145)
@@ -1,41 +1,57 @@
 Build instructions for ethereal pidl parsers
 
 
+In the following instructions the pseudo command lines use $ETHEREAL
+to represent the location of a checkout of the ethereal source code
+and $LORIKEET to represent a checkout of the lorikeet source code.
+
 To build the parsers:
 
   1) Apply the ethereal-pidl.patch to introduce the new plugin into
  the ethereal build system.
 
+  $ cd $ETHEREAL/trunk
+  $ patch -p0 < $LORIKEET/trunk/ethereal/ethereal-pidl.patch
+
   2) Copy the contents of the plugins/pidl directory into a
  subdirectory called pidl in the ethereal plugins directory.
 
-  3) Run pidl with the --eparser option and copy the autogenerated
- packet-dcerpc-*.[ch] and ndr_*.h files from the librpc/gen_ndr
- directory into the plugins/pidl directory.
+  $ rsync -av $LORIKEET/trunk/ethereal/plugins/pidl $ETHEREAL/trunk/plugins
 
- or 
+  3) Configure and build ethereal
 
- Configure Samba4 with the --with-eparserdir=
- option, and do 'make eparser_idl'.
+  $ cd $ETHEREAL/trunk
+  $ ./autogen.sh && ./configure && make
 
-  4) Build ethereal as you normally would (run autogen, configure,
- make etc).  
+  4) Now ethereal loads its plugins from /usr/lib/ethereal/plugins or
+ from $HOME/.ethereal/plugins so I usually make a link from the
+ ethereal pidl directory to here:
 
-Note that you can modify and build a plugin separately from the full
-ethereal program.  This speeds up development muchly as the linking
-for ethereal and tethereal does not need to be performed.
+  $ ln -s $ETHEREAL/trunk/ethereal/plugins/pidl/.libs $HOME/.ethereal/plugins
 
+  (Ugh - libtool)
 
-Installation:
+  5) Load up ethereal on the atsvc.cap file and check that the
+ protocol name for frame 17 is 'pidl_atsvc'.  When you restart
+ ethereal the plugin should be loaded.  Any dynamic linking errors
+ will be displayed on standard error.
 
-  1) Copy the pidl.so file from the .libs directory (ha ha - libtool)
- and place it in the site-specific ethereal plugins directory
- [where is this?] or in $HOME/.ethereal/plugins
+At the moment, the lorikett directory contains enough code to build a
+parser that parses the ATSVC pipe.  Some further work is needed to get
+unions working but after that dissectors for the remaining pipes
+should be relatively simple.
 
-  2) When you restart ethereal the plugin should be loaded.  Any
- dynamic linking errors will be displayed on standard error.
+To build dissectors from the idl files, configure samba like:
 
+  1) cd $SAMBA/branches/SAMBA_4_0/source && \
+ ./configure --with-eparserdir=$LORIKEET/trunk/ethereal/plugins/pidl
+  
+  2) make eparser_idl
 
+This should generate a whole bunch of packet-dcerpc-*.[ch] files.
+Edit $LORIKEET/trunk/ethereal/plugins/pidl/Makefile.am to compile and
+link in parsers other than ATSVC.
+
 Other notes:
 
   - The plugin protocol names are currently 'pidl_foo', where foo is
@@ -43,4 +59,4 @@
 duplicate protocol names.
 
 
-Enjoy!
+Enjoy!  Please send feedback to [EMAIL PROTECTED]



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

2005-01-01 Thread tpot
Author: tpot
Date: 2005-01-02 03:24:57 + (Sun, 02 Jan 2005)
New Revision: 4471

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

Log:
Running 'make eparser_idl' doesn't need --header anymore.

Modified:
   branches/SAMBA_4_0/source/script/build_idl.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/build_idl.sh
===
--- branches/SAMBA_4_0/source/script/build_idl.sh   2005-01-02 03:10:28 UTC 
(rev 4470)
+++ branches/SAMBA_4_0/source/script/build_idl.sh   2005-01-02 03:24:57 UTC 
(rev 4471)
@@ -5,7 +5,7 @@
 [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
 
 PIDL="$PERL ./build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header 
--parser --server --client"
-EPARSERPIDL="$PERL ./build/pidl/pidl.pl --output $EPARSERPREFIX/ndr_ --parse 
--header --eparser"
+EPARSERPIDL="$PERL ./build/pidl/pidl.pl --output $EPARSERPREFIX/ndr_ --parse 
--eparser"
 
 if [ x$FULLBUILD = xFULL ]; then
   echo Rebuilding all idl files in librpc/idl



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

2005-01-01 Thread tpot
Author: tpot
Date: 2005-01-02 03:22:55 + (Sun, 02 Jan 2005)
New Revision: 144

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

Log:
For the curious - check in the output of eparser.pm for the atsvc pipe,
also a capture of smbtorture running the RPC-ATSVC test.

Added:
   trunk/ethereal/plugins/pidl/atsvc.cap
   trunk/ethereal/plugins/pidl/packet-dcerpc-atsvc.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-atsvc.h


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


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

2005-01-01 Thread tpot
Author: tpot
Date: 2005-01-02 03:18:49 + (Sun, 02 Jan 2005)
New Revision: 143

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

Log:
Various modifications to the ethereal pidl glue.

Added:
   trunk/ethereal/plugins/pidl/includes.h
Modified:
   trunk/ethereal/plugins/pidl/Makefile.am
   trunk/ethereal/plugins/pidl/eparser.c
   trunk/ethereal/plugins/pidl/eparser.h
   trunk/ethereal/plugins/pidl/pidl.c


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


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

2005-01-01 Thread tpot
Author: tpot
Date: 2005-01-02 03:14:42 + (Sun, 02 Jan 2005)
New Revision: 142

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

Log:
Remove obsolete code.

Removed:
   trunk/ethereal/plugins/pidl/ndr_lsa.h
   trunk/ethereal/plugins/pidl/ndr_misc.h
   trunk/ethereal/plugins/pidl/ndr_samr.h


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


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

2005-01-01 Thread tpot
Author: tpot
Date: 2005-01-02 03:12:50 + (Sun, 02 Jan 2005)
New Revision: 141

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

Log:
Check in some bits of samba used by the ethereal parser.

Added:
   trunk/ethereal/plugins/pidl/dlinklist.h
   trunk/ethereal/plugins/pidl/libndr.h
   trunk/ethereal/plugins/pidl/talloc.c
   trunk/ethereal/plugins/pidl/talloc.h


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


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

2005-01-01 Thread tpot
Author: tpot
Date: 2005-01-02 00:00:43 + (Sun, 02 Jan 2005)
New Revision: 4469

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

Log:
Version n + 1 of the pidl ethereal parser generator.  This version is
based on the idea of manipulating the .c and .h files generated by 
parser.pm with perl regexps and glueing it all together to make an 
ethereal plugin.  

I thought this was a pretty crazy idea to start off with but it has 
turned out to be not as complicated as I thought and has the huge advantage
of not duplicating any of the difficult code in parser.pm.

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


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


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

2005-01-01 Thread tpot
Author: tpot
Date: 2005-01-01 23:18:59 + (Sat, 01 Jan 2005)
New Revision: 4468

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

Log:
Don't be a slacker and leave out parameter names when generating
prototypes for ndr push/pull/print functions.

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/header.pm
===
--- branches/SAMBA_4_0/source/build/pidl/header.pm  2005-01-01 05:08:41 UTC 
(rev 4467)
+++ branches/SAMBA_4_0/source/build/pidl/header.pm  2005-01-01 23:18:59 UTC 
(rev 4468)
@@ -188,21 +188,21 @@
 }
 
 if ($d->{DATA}{TYPE} eq "STRUCT") {
-   $res .= "NTSTATUS ndr_push_$d->{NAME}(struct ndr_push *, int , 
struct $d->{NAME} *);\n";
-   $res .= "NTSTATUS ndr_pull_$d->{NAME}(struct ndr_pull *, int , 
struct $d->{NAME} *);\n";
+   $res .= "NTSTATUS ndr_push_$d->{NAME}(struct ndr_push *ndr, int 
ndr_flags, struct $d->{NAME} *r);\n";
+   $res .= "NTSTATUS ndr_pull_$d->{NAME}(struct ndr_pull *ndr, int 
ndr_flags, struct $d->{NAME} *r);\n";
if (!util::has_property($d->{DATA}, "noprint")) {
-   $res .= "void ndr_print_$d->{NAME}(struct ndr_print *, 
const char *, struct $d->{NAME} *);\n";
+   $res .= "void ndr_print_$d->{NAME}(struct ndr_print *ndr, 
const char *name, struct $d->{NAME} *r);\n";
}
 
if (needed::is_needed("ndr_size_$d->{NAME}")) {
-   $res .= "size_t ndr_size_$d->{NAME}(int , const struct 
$d->{NAME} *, int );\n";
+   $res .= "size_t ndr_size_$d->{NAME}(int ret, const struct 
$d->{NAME} *r, int flags);\n";
}
 }
 if ($d->{DATA}{TYPE} eq "UNION") {
-   $res .= "NTSTATUS ndr_push_$d->{NAME}(struct ndr_push *, int, int, 
union $d->{NAME} *);\n";
-   $res .= "NTSTATUS ndr_pull_$d->{NAME}(struct ndr_pull *, int, int, 
union $d->{NAME} *);\n";
+   $res .= "NTSTATUS ndr_push_$d->{NAME}(struct ndr_push *ndr, int 
ndr_flags, int level, union $d->{NAME} *r);\n";
+   $res .= "NTSTATUS ndr_pull_$d->{NAME}(struct ndr_pull *ndr, int 
ndr_flags, int level, union $d->{NAME} *r);\n";
if (!util::has_property($d->{DATA}, "noprint")) {
-   $res .= "void ndr_print_$d->{NAME}(struct ndr_print *, 
const char *, int, union $d->{NAME} *);\n";
+   $res .= "void ndr_print_$d->{NAME}(struct ndr_print *ndr, 
const char *name, int level, union $d->{NAME} *r);\n";
}
 }
 }
@@ -308,13 +308,13 @@
 my $fn = shift;
 my $name = $fn->{NAME};

-$res .= "void ndr_print_$name(struct ndr_print *, const char *, int, 
struct $name *);\n";
+$res .= "void ndr_print_$name(struct ndr_print *ndr, const char *name, int 
flags, struct $name *r);\n";
 
if (util::has_property($interface, "object")) {
-   $res .= "NTSTATUS dcom_$interface->{NAME}_$name (struct 
dcom_interface_p *, TALLOC_CTX *mem_ctx, struct $name *);\n";
+   $res .= "NTSTATUS dcom_$interface->{NAME}_$name (struct 
dcom_interface_p *d, TALLOC_CTX *mem_ctx, struct $name *r);\n";
} else {
-   $res .= "NTSTATUS dcerpc_$name(struct dcerpc_pipe *, TALLOC_CTX *, 
struct $name *);\n";
-   $res .= "struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *, 
TALLOC_CTX *, struct $name *);\n";
+   $res .= "NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX 
*mem_ctx, struct $name *r);\n";
+   $res .= "struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, 
TALLOC_CTX *mem_ctx, struct $name *r);\n";
}
 $res .= "\n";
 }
@@ -332,7 +332,7 @@
 
my $data = $interface->{DATA};
foreach my $d (@{$data}) {
-   $res .= "\tNTSTATUS (*$d->{NAME}) (struct dcom_interface_p *, 
TALLOC_CTX *mem_ctx, struct $d->{NAME} *);\n" if ($d->{TYPE} eq "FUNCTION");
+   $res .= "\tNTSTATUS (*$d->{NAME}) (struct dcom_interface_p *d, 
TALLOC_CTX *mem_ctx, struct $d->{NAME} *r);\n" if ($d->{TYPE} eq "FUNCTION");
}
$res .= "};\n\n";
 }



svn commit: samba r4341 - in branches/SAMBA_4_0/source/utils/net: .

2004-12-22 Thread tpot
Author: tpot
Date: 2004-12-23 04:09:25 + (Thu, 23 Dec 2004)
New Revision: 4341

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

Log:
Fix const warning.

Modified:
   branches/SAMBA_4_0/source/utils/net/net_password.c


Changeset:
Modified: branches/SAMBA_4_0/source/utils/net/net_password.c
===
--- branches/SAMBA_4_0/source/utils/net/net_password.c  2004-12-23 03:02:57 UTC 
(rev 4340)
+++ branches/SAMBA_4_0/source/utils/net/net_password.c  2004-12-23 04:09:25 UTC 
(rev 4341)
@@ -165,7 +165,7 @@
return 0;   
 }
 
-static const struct net_functable const net_password_functable[] = {
+static const struct net_functable net_password_functable[] = {
{"change", net_password_change, net_password_change_usage,  
net_password_change_help},
{"set", net_password_set, net_password_set_usage,  
net_password_set_help},
{NULL, NULL}



svn commit: samba r4273 - in branches/SAMBA_3_0/source/libads: .

2004-12-18 Thread tpot
Author: tpot
Date: 2004-12-19 03:23:10 + (Sun, 19 Dec 2004)
New Revision: 4273

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

Log:
Same fix for r4272 in SAMBA_3_0 branch.

Modified:
   branches/SAMBA_3_0/source/libads/ads_status.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ads_status.c
===
--- branches/SAMBA_3_0/source/libads/ads_status.c   2004-12-19 03:22:14 UTC 
(rev 4272)
+++ branches/SAMBA_3_0/source/libads/ads_status.c   2004-12-19 03:23:10 UTC 
(rev 4273)
@@ -116,10 +116,10 @@
{
uint32 msg_ctx;
uint32 minor;
+   gss_buffer_desc msg1, msg2;
 
msg_ctx = 0;

-   gss_buffer_desc msg1, msg2;
msg1.value = NULL;
msg2.value = NULL;
gss_display_status(&minor, status.err.rc, GSS_C_GSS_CODE,



svn commit: samba r4272 - in trunk/source/libads: .

2004-12-18 Thread tpot
Author: tpot
Date: 2004-12-19 03:22:14 + (Sun, 19 Dec 2004)
New Revision: 4272

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

Log:
Move variable declaration before first statement in block.

Modified:
   trunk/source/libads/ads_status.c


Changeset:
Modified: trunk/source/libads/ads_status.c
===
--- trunk/source/libads/ads_status.c2004-12-19 01:02:45 UTC (rev 4271)
+++ trunk/source/libads/ads_status.c2004-12-19 03:22:14 UTC (rev 4272)
@@ -116,10 +116,10 @@
{
uint32 msg_ctx;
uint32 minor;
+   gss_buffer_desc msg1, msg2;
 
msg_ctx = 0;

-   gss_buffer_desc msg1, msg2;
msg1.value = NULL;
msg2.value = NULL;
gss_display_status(&minor, status.err.rc, GSS_C_GSS_CODE,



svn commit: samba r4271 - in trunk/source: .

2004-12-18 Thread tpot
Author: tpot
Date: 2004-12-19 01:02:45 + (Sun, 19 Dec 2004)
New Revision: 4271

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

Log:
Bugzilla #1988.  Apparently this fixes linking on AIX 5.3 for non-gcc compilers.

Modified:
   trunk/source/configure.in


Changeset:
Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2004-12-19 00:53:52 UTC (rev 4270)
+++ trunk/source/configure.in   2004-12-19 01:02:45 UTC (rev 4271)
@@ -1224,6 +1224,7 @@
if test "${GCC}" != "yes"; then
## for funky AIX compiler using strncpy()
CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT 
-qmaxmem=32000"
+   PICSUFFIX="po.o"
fi
 
AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a 
block])



svn commit: samba r4270 - branches/SAMBA_3_0/source/lib trunk/source/lib

2004-12-18 Thread tpot
Author: tpot
Date: 2004-12-19 00:53:52 + (Sun, 19 Dec 2004)
New Revision: 4270

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

Log:
Add some const as a fix for bugzilla #2135.

Modified:
   branches/SAMBA_3_0/source/lib/replace.c
   trunk/source/lib/replace.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/replace.c
===
--- branches/SAMBA_3_0/source/lib/replace.c 2004-12-19 00:52:08 UTC (rev 
4269)
+++ branches/SAMBA_3_0/source/lib/replace.c 2004-12-19 00:53:52 UTC (rev 
4270)
@@ -420,7 +420,7 @@
 
 #ifndef HAVE_VSYSLOG
 #ifdef HAVE_SYSLOG
- void vsyslog (int facility_priority, char *format, va_list arglist)
+ void vsyslog (int facility_priority, const char *format, va_list arglist)
 {
char *msg = NULL;
vasprintf(&msg, format, arglist);

Modified: trunk/source/lib/replace.c
===
--- trunk/source/lib/replace.c  2004-12-19 00:52:08 UTC (rev 4269)
+++ trunk/source/lib/replace.c  2004-12-19 00:53:52 UTC (rev 4270)
@@ -420,7 +420,7 @@
 
 #ifndef HAVE_VSYSLOG
 #ifdef HAVE_SYSLOG
- void vsyslog (int facility_priority, char *format, va_list arglist)
+ void vsyslog (int facility_priority, const char *format, va_list arglist)
 {
char *msg = NULL;
vasprintf(&msg, format, arglist);



svn commit: samba r4268 - in branches/SAMBA_3_0/source: include profile torture

2004-12-18 Thread tpot
Author: tpot
Date: 2004-12-19 00:31:31 + (Sun, 19 Dec 2004)
New Revision: 4268

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

Log:
Merge fix for bugzilla #2150.

Modified:
   branches/SAMBA_3_0/source/include/includes.h
   branches/SAMBA_3_0/source/profile/profile.c
   branches/SAMBA_3_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/includes.h
===
--- branches/SAMBA_3_0/source/include/includes.h2004-12-19 00:13:24 UTC 
(rev 4267)
+++ branches/SAMBA_3_0/source/include/includes.h2004-12-19 00:31:31 UTC 
(rev 4268)
@@ -1202,15 +1202,6 @@
 #define LOG_DEBUG   7   /* debug-level messages */
 #endif
 
-/* NetBSD doesn't have these */
-#ifndef SHM_R
-#define SHM_R 0400
-#endif
-
-#ifndef SHM_W
-#define SHM_W 0200
-#endif
-
 #if HAVE_KERNEL_SHARE_MODES
 #ifndef LOCK_MAND 
 #define LOCK_MAND  32  /* This is a mandatory flock */

Modified: branches/SAMBA_3_0/source/profile/profile.c
===
--- branches/SAMBA_3_0/source/profile/profile.c 2004-12-19 00:13:24 UTC (rev 
4267)
+++ branches/SAMBA_3_0/source/profile/profile.c 2004-12-19 00:31:31 UTC (rev 
4268)
@@ -22,7 +22,7 @@
 #include "includes.h"
 
 #ifdef WITH_PROFILE
-#define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6))
+#define IPC_PERMS ((S_IRUSR | S_IWUSR) | S_IRGRP | S_IROTH)
 #endif /* WITH_PROFILE */
 
 #ifdef WITH_PROFILE

Modified: branches/SAMBA_3_0/source/torture/torture.c
===
--- branches/SAMBA_3_0/source/torture/torture.c 2004-12-19 00:13:24 UTC (rev 
4267)
+++ branches/SAMBA_3_0/source/torture/torture.c 2004-12-19 00:31:31 UTC (rev 
4268)
@@ -70,7 +70,7 @@
int shmid;
void *ret;
 
-   shmid = shmget(IPC_PRIVATE, size, SHM_R | SHM_W);
+   shmid = shmget(IPC_PRIVATE, size, S_IRUSR | S_IWUSR);
if (shmid == -1) {
printf("can't get shared memory\n");
exit(1);



svn commit: samba r4266 - in trunk/source: include profile torture

2004-12-18 Thread tpot
Author: tpot
Date: 2004-12-19 00:11:18 + (Sun, 19 Dec 2004)
New Revision: 4266

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

Log:
Use sys/types.h constants for permissions in shmget() call.  Bugzilla
#2150 filed by lukem.  (Shared memory is only used in smbtorture now).

Modified:
   trunk/source/include/includes.h
   trunk/source/profile/profile.c
   trunk/source/torture/torture.c


Changeset:
Modified: trunk/source/include/includes.h
===
--- trunk/source/include/includes.h 2004-12-19 00:09:22 UTC (rev 4265)
+++ trunk/source/include/includes.h 2004-12-19 00:11:18 UTC (rev 4266)
@@ -1209,15 +1209,6 @@
 #define LOG_DEBUG   7   /* debug-level messages */
 #endif
 
-/* NetBSD doesn't have these */
-#ifndef SHM_R
-#define SHM_R 0400
-#endif
-
-#ifndef SHM_W
-#define SHM_W 0200
-#endif
-
 #if HAVE_KERNEL_SHARE_MODES
 #ifndef LOCK_MAND 
 #define LOCK_MAND  32  /* This is a mandatory flock */

Modified: trunk/source/profile/profile.c
===
--- trunk/source/profile/profile.c  2004-12-19 00:09:22 UTC (rev 4265)
+++ trunk/source/profile/profile.c  2004-12-19 00:11:18 UTC (rev 4266)
@@ -22,7 +22,7 @@
 #include "includes.h"
 
 #ifdef WITH_PROFILE
-#define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6))
+#define IPC_PERMS ((S_IRUSR | S_IWUSR) | S_IRGRP | S_IROTH)
 #endif /* WITH_PROFILE */
 
 #ifdef WITH_PROFILE

Modified: trunk/source/torture/torture.c
===
--- trunk/source/torture/torture.c  2004-12-19 00:09:22 UTC (rev 4265)
+++ trunk/source/torture/torture.c  2004-12-19 00:11:18 UTC (rev 4266)
@@ -70,7 +70,7 @@
int shmid;
void *ret;
 
-   shmid = shmget(IPC_PRIVATE, size, SHM_R | SHM_W);
+   shmid = shmget(IPC_PRIVATE, size, S_IRUSR | S_IWUSR);
if (shmid == -1) {
printf("can't get shared memory\n");
exit(1);



svn commit: samba r4265 - in trunk/source/rpc_server: .

2004-12-18 Thread tpot
Author: tpot
Date: 2004-12-19 00:09:22 + (Sun, 19 Dec 2004)
New Revision: 4265

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

Log:
Unremove unused extern (?) as it is actually used.

Modified:
   trunk/source/rpc_server/srv_spoolss_nt.c


Changeset:
Modified: trunk/source/rpc_server/srv_spoolss_nt.c
===
--- trunk/source/rpc_server/srv_spoolss_nt.c2004-12-18 23:31:17 UTC (rev 
4264)
+++ trunk/source/rpc_server/srv_spoolss_nt.c2004-12-19 00:09:22 UTC (rev 
4265)
@@ -5847,6 +5847,7 @@
 pipes_struct *p, SEC_DESC_BUF *secdesc_ctr)
 {
SEC_DESC_BUF *new_secdesc_ctr = NULL, *old_secdesc_ctr = NULL;
+   struct current_user user;
WERROR result;
int snum;
 



svn commit: samba r4260 - branches/SAMBA_3_0/source/nsswitch trunk/source/nsswitch

2004-12-17 Thread tpot
Author: tpot
Date: 2004-12-17 22:16:30 + (Fri, 17 Dec 2004)
New Revision: 4260

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

Log:
Change the license for the winbindd external interface more liberal.

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h
   trunk/source/nsswitch/winbindd_nss.h


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h   2004-12-17 21:59:47 UTC 
(rev 4259)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h   2004-12-17 22:16:30 UTC 
(rev 4260)
@@ -5,20 +5,9 @@
 
Copyright (C) Tim Potter 2000

-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-   
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-   
-   You should have received a copy of the GNU Library General Public
-   License along with this library; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA  02111-1307, USA.   
+   You are free to use this interface definition in any way you see
+   fit, including without restriction, using this header in your own
+   products. You do not need to give any attribution.  
 */
 
 #ifndef SAFE_FREE

Modified: trunk/source/nsswitch/winbindd_nss.h
===
--- trunk/source/nsswitch/winbindd_nss.h2004-12-17 21:59:47 UTC (rev 
4259)
+++ trunk/source/nsswitch/winbindd_nss.h2004-12-17 22:16:30 UTC (rev 
4260)
@@ -5,20 +5,9 @@
 
Copyright (C) Tim Potter 2000

-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-   
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-   
-   You should have received a copy of the GNU Library General Public
-   License along with this library; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA  02111-1307, USA.   
+   You are free to use this interface definition in any way you see
+   fit, including without restriction, using this header in your own
+   products. You do not need to give any attribution.  
 */
 
 #ifndef SAFE_FREE



svn commit: samba r4259 - branches/SAMBA_3_0/source/utils trunk/source/utils

2004-12-17 Thread tpot
Author: tpot
Date: 2004-12-17 21:59:47 + (Fri, 17 Dec 2004)
New Revision: 4259

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

Log:
Fix cast in SMB_XMALLOC_ARRAY.  Bugzilla #2168.

Modified:
   branches/SAMBA_3_0/source/utils/ntlm_auth.c
   trunk/source/utils/ntlm_auth.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/ntlm_auth.c
===
--- branches/SAMBA_3_0/source/utils/ntlm_auth.c 2004-12-17 13:14:22 UTC (rev 
4258)
+++ branches/SAMBA_3_0/source/utils/ntlm_auth.c 2004-12-17 21:59:47 UTC (rev 
4259)
@@ -753,7 +753,7 @@
 
/* Server negTokenInit (mech offerings) */
spnego.type = SPNEGO_NEG_TOKEN_INIT;
-   spnego.negTokenInit.mechTypes = SMB_XMALLOC_ARRAY(char *, 3);
+   spnego.negTokenInit.mechTypes = SMB_XMALLOC_ARRAY(const char *, 3);
 #ifdef HAVE_KRB5
spnego.negTokenInit.mechTypes[0] = smb_xstrdup(OID_KERBEROS5_OLD);
spnego.negTokenInit.mechTypes[1] = smb_xstrdup(OID_NTLMSSP);

Modified: trunk/source/utils/ntlm_auth.c
===
--- trunk/source/utils/ntlm_auth.c  2004-12-17 13:14:22 UTC (rev 4258)
+++ trunk/source/utils/ntlm_auth.c  2004-12-17 21:59:47 UTC (rev 4259)
@@ -753,7 +753,7 @@
 
/* Server negTokenInit (mech offerings) */
spnego.type = SPNEGO_NEG_TOKEN_INIT;
-   spnego.negTokenInit.mechTypes = SMB_XMALLOC_ARRAY(char *, 3);
+   spnego.negTokenInit.mechTypes = SMB_XMALLOC_ARRAY(const char *, 3);
 #ifdef HAVE_KRB5
spnego.negTokenInit.mechTypes[0] = smb_xstrdup(OID_KERBEROS5_OLD);
spnego.negTokenInit.mechTypes[1] = smb_xstrdup(OID_NTLMSSP);



svn commit: samba r4200 - in branches/SAMBA_4_0/source/gtk/tools: .

2004-12-13 Thread tpot
Author: tpot
Date: 2004-12-14 06:23:01 + (Tue, 14 Dec 2004)
New Revision: 4200

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

Log:
Fix some more warnings.

Modified:
   branches/SAMBA_4_0/source/gtk/tools/gregedit.c


Changeset:
Modified: branches/SAMBA_4_0/source/gtk/tools/gregedit.c
===
--- branches/SAMBA_4_0/source/gtk/tools/gregedit.c  2004-12-14 06:17:33 UTC 
(rev 4199)
+++ branches/SAMBA_4_0/source/gtk/tools/gregedit.c  2004-12-14 06:23:01 UTC 
(rev 4200)
@@ -582,7 +582,7 @@
 
g_signal_connect ((gpointer) open_nt4, "activate",
  G_CALLBACK 
(on_open_file_activate),
- (gconstpointer)"nt4");
+ (gpointer)"nt4");
}
 
if(reg_has_backend("w95")) {
@@ -591,7 +591,7 @@
 
g_signal_connect ((gpointer) open_w95, "activate",
  G_CALLBACK 
(on_open_file_activate),
- (gconstpointer)"w95");
+ (gpointer)"w95");
}
 
if(reg_has_backend("gconf")) {
@@ -618,7 +618,7 @@
 
g_signal_connect ((gpointer) open_ldb, "activate",
  G_CALLBACK 
(on_open_file_activate),
- (gconstpointer)"ldb");
+ (gpointer)"ldb");
}
 
save = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);


svn commit: samba r4201 - in branches/SAMBA_4_0/source/utils/net: .

2004-12-13 Thread tpot
Author: tpot
Date: 2004-12-14 06:25:19 + (Tue, 14 Dec 2004)
New Revision: 4201

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

Log:
Remove duplicate const.

Modified:
   branches/SAMBA_4_0/source/utils/net/net.c


Changeset:
Modified: branches/SAMBA_4_0/source/utils/net/net.c
===
--- branches/SAMBA_4_0/source/utils/net/net.c   2004-12-14 06:23:01 UTC (rev 
4200)
+++ branches/SAMBA_4_0/source/utils/net/net.c   2004-12-14 06:25:19 UTC (rev 
4201)
@@ -136,7 +136,7 @@
 }
 
 /* main function table */
-static const struct net_functable const net_functable[] = {
+static const struct net_functable net_functable[] = {
{"password", net_password, net_password_usage, net_password_help},
{"time", net_time, net_time_usage, net_time_help},
 


svn commit: samba r4197 - in branches/SAMBA_4_0/source/lib/crypto: .

2004-12-13 Thread tpot
Author: tpot
Date: 2004-12-14 06:09:04 + (Tue, 14 Dec 2004)
New Revision: 4197

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

Log:
Remove silly extra const.

Modified:
   branches/SAMBA_4_0/source/lib/crypto/md5.c
   branches/SAMBA_4_0/source/lib/crypto/md5.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/crypto/md5.c
===
--- branches/SAMBA_4_0/source/lib/crypto/md5.c  2004-12-14 05:51:01 UTC (rev 
4196)
+++ branches/SAMBA_4_0/source/lib/crypto/md5.c  2004-12-14 06:09:04 UTC (rev 
4197)
@@ -58,7 +58,7 @@
  * Update context to reflect the concatenation of another buffer full
  * of bytes.
  */
-void MD5Update(struct MD5Context *ctx, const uint8_t const *buf, uint_t len)
+void MD5Update(struct MD5Context *ctx, const uint8_t *buf, uint_t len)
 {
 register uint32_t t;
 

Modified: branches/SAMBA_4_0/source/lib/crypto/md5.h
===
--- branches/SAMBA_4_0/source/lib/crypto/md5.h  2004-12-14 05:51:01 UTC (rev 
4196)
+++ branches/SAMBA_4_0/source/lib/crypto/md5.h  2004-12-14 06:09:04 UTC (rev 
4197)
@@ -12,7 +12,7 @@
 };
 
 void MD5Init(struct MD5Context *context);
-void MD5Update(struct MD5Context *context, const uint8_t const *buf,
+void MD5Update(struct MD5Context *context, const uint8_t *buf,
   uint_t len);
 void MD5Final(uint8_t digest[16], struct MD5Context *context);
 


svn commit: samba r4099 - in branches/SAMBA_4_0/source/smb_server: .

2004-12-08 Thread tpot
Author: tpot
Date: 2004-12-08 10:36:14 + (Wed, 08 Dec 2004)
New Revision: 4099

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

Log:
Spelling fixes.

Modified:
   branches/SAMBA_4_0/source/smb_server/negprot.c
   branches/SAMBA_4_0/source/smb_server/signing.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/negprot.c
===
--- branches/SAMBA_4_0/source/smb_server/negprot.c  2004-12-08 10:24:10 UTC 
(rev 4098)
+++ branches/SAMBA_4_0/source/smb_server/negprot.c  2004-12-08 10:36:14 UTC 
(rev 4099)
@@ -62,7 +62,7 @@
 
if (req->smb_conn->signing.mandatory_signing) {
smbsrv_terminate_connection(req->smb_conn, 
-   "CORE does not support SMB signing, 
and it is mandetory\n");
+   "CORE does not support SMB signing, 
and it is mandatory\n");
return;
}
 
@@ -95,7 +95,7 @@
 
if (req->smb_conn->signing.mandatory_signing) {
smbsrv_terminate_connection(req->smb_conn, 
-   "COREPLUS does not support SMB 
signing, and it is mandetory\n");
+   "COREPLUS does not support SMB 
signing, and it is mandatory\n");
return;
}
 
@@ -146,7 +146,7 @@
 
if (req->smb_conn->signing.mandatory_signing) {
smbsrv_terminate_connection(req->smb_conn, 
-   "LANMAN1 does not support SMB 
signing, and it is mandetory\n");
+   "LANMAN1 does not support SMB 
signing, and it is mandatory\n");
return;
}
 
@@ -195,7 +195,7 @@
 
if (req->smb_conn->signing.mandatory_signing) {
smbsrv_terminate_connection(req->smb_conn, 
-   "LANMAN2 does not support SMB 
signing, and it is mandetory\n");
+   "LANMAN2 does not support SMB 
signing, and it is mandatory\n");
return;
}
 

Modified: branches/SAMBA_4_0/source/smb_server/signing.c
===
--- branches/SAMBA_4_0/source/smb_server/signing.c  2004-12-08 10:24:10 UTC 
(rev 4098)
+++ branches/SAMBA_4_0/source/smb_server/signing.c  2004-12-08 10:36:14 UTC 
(rev 4099)
@@ -84,8 +84,8 @@
srv_setup_signing(smb_conn, session_key, response);
smb_conn->signing.next_seq_num = 2;
if (smb_conn->signing.mandatory_signing) {
-   DEBUG(5, ("Configured for mandetory signing, 'good 
packet seen' forced on\n"));
-   /* if this is mandetory, then
+   DEBUG(5, ("Configured for mandatory signing, 'good 
packet seen' forced on\n"));
+   /* if this is mandatory, then
 * pretend we have seen a
 * valid packet, so we don't
 * turn it off */



svn commit: samba-web r442 - in trunk/GUI: .

2004-11-28 Thread tpot
Author: tpot
Date: 2004-11-28 22:31:38 + (Sun, 28 Nov 2004)
New Revision: 442

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

Log:
Add another Samba GUI.

Modified:
   trunk/GUI/index.html


Changeset:
Modified: trunk/GUI/index.html
===
--- trunk/GUI/index.html2004-11-23 21:44:30 UTC (rev 441)
+++ trunk/GUI/index.html2004-11-28 22:31:38 UTC (rev 442)
@@ -12,6 +12,16 @@
 of them are listed below and I will add the others as soon as I can
 find the URLs.
 
+GOsa - A  PHP-based administration tool for role-based managing of
+accounts and systems in LDAP databases.
+
+http://alioth.debian.org/projects/gosa";>GOsa is a
+PHP-based administration tool for role-based managing of accounts and
+systems in LDAP databases. Standard configurations can manage generic,
+POSIX/shadow, postfix/cyrus/sieve, pureftpd, fax, and samba 2/3
+accounts in LDAP. It has plugins for system/terminal management. The
+look and feel can be easily adapted to users' needs.
+
 Smb4K - An SMB share browser for KDE
 
 http://smb4k.berlios.de/";>Smb4K is an SMB share



svn commit: samba r3928 - branches/SAMBA_3_0/source/rpc_parse trunk/source/rpc_parse

2004-11-23 Thread tpot
Author: tpot
Date: 2004-11-23 20:50:16 + (Tue, 23 Nov 2004)
New Revision: 3928

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

Log:
Fix duplicate call to pdb_get_acct_desc().  Bugzilla #2080.

Modified:
   branches/SAMBA_3_0/source/rpc_parse/parse_samr.c
   trunk/source/rpc_parse/parse_samr.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_parse/parse_samr.c
===
--- branches/SAMBA_3_0/source/rpc_parse/parse_samr.c2004-11-23 17:38:32 UTC 
(rev 3927)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_samr.c2004-11-23 20:50:16 UTC 
(rev 3928)
@@ -1666,7 +1666,7 @@
}

init_unistr2(&sam->str[i].uni_srv_name, username, 
UNI_FLAGS_NONE);
-   init_unistr2(&sam->str[i].uni_srv_desc, pdb_get_acct_desc(pwd), 
UNI_FLAGS_NONE);
+   init_unistr2(&sam->str[i].uni_srv_desc, acct_desc, 
UNI_FLAGS_NONE);
 
init_sam_entry2(&sam->sam[i], start_idx + i + 1,
  &sam->str[i].uni_srv_name, &sam->str[i].uni_srv_desc,

Modified: trunk/source/rpc_parse/parse_samr.c
===
--- trunk/source/rpc_parse/parse_samr.c 2004-11-23 17:38:32 UTC (rev 3927)
+++ trunk/source/rpc_parse/parse_samr.c 2004-11-23 20:50:16 UTC (rev 3928)
@@ -1666,7 +1666,7 @@
}

init_unistr2(&sam->str[i].uni_srv_name, username, 
UNI_FLAGS_NONE);
-   init_unistr2(&sam->str[i].uni_srv_desc, pdb_get_acct_desc(pwd), 
UNI_FLAGS_NONE);
+   init_unistr2(&sam->str[i].uni_srv_desc, acct_desc, 
UNI_FLAGS_NONE);
 
init_sam_entry2(&sam->sam[i], start_idx + i + 1,
  &sam->str[i].uni_srv_name, &sam->str[i].uni_srv_desc,



svn commit: samba r3870 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-11-18 Thread tpot
Author: tpot
Date: 2004-11-19 02:57:35 + (Fri, 19 Nov 2004)
New Revision: 3870

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

Log:
Delete wrappers for tdb_lockkeys() and tdb_unlockkeys().

Modified:
   branches/SAMBA_4_0/source/scripting/swig/tdb.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/tdb.i
===
--- branches/SAMBA_4_0/source/scripting/swig/tdb.i  2004-11-19 02:35:48 UTC 
(rev 3869)
+++ branches/SAMBA_4_0/source/scripting/swig/tdb.i  2004-11-19 02:57:35 UTC 
(rev 3870)
@@ -136,8 +136,6 @@
 TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key);
 int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state);
 int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_lockkeys(TDB_CONTEXT *tdb, u32 number, TDB_DATA keys[]);
-void tdb_unlockkeys(TDB_CONTEXT *tdb);
 int tdb_lockall(TDB_CONTEXT *tdb);
 void tdb_unlockall(TDB_CONTEXT *tdb);
 



svn commit: samba r3607 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-11-07 Thread tpot
Author: tpot
Date: 2004-11-07 22:05:18 + (Sun, 07 Nov 2004)
New Revision: 3607

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

Log:
EnumDomainAlises doesn't take a max_size parameter.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/samr.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/samr.py
===
--- branches/SAMBA_4_0/source/scripting/swig/samr.py2004-11-07 21:30:59 UTC 
(rev 3606)
+++ branches/SAMBA_4_0/source/scripting/swig/samr.py2004-11-07 22:05:18 UTC 
(rev 3607)
@@ -183,7 +183,6 @@
 # acct_flags in SamrEnumerateAliasesInDomain has probably
 # no meaning so use 0x like W2K
 r['acct_flags'] = 0x
-r['max_size'] = 1000
 
 result = dcerpc.samr_EnumDomainAliases(self.pipe, r)
 



svn commit: samba r3590 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-11-06 Thread tpot
Author: tpot
Date: 2004-11-07 01:11:11 + (Sun, 07 Nov 2004)
New Revision: 3590

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

Log:
Add some more commands to rpcclient from a patch by jbm.  Add 
SamrQueryDomInfo, SamrQueryDomInfo2, SamrEnumDomainAliases, and
SamrEnumDomainUsers.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/rpcclient
   branches/SAMBA_4_0/source/scripting/swig/samr.py


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


svn commit: samba r3589 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-11-06 Thread tpot
Author: tpot
Date: 2004-11-07 01:09:14 + (Sun, 07 Nov 2004)
New Revision: 3589

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

Log:
Add some extra status codes.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/status_codes.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/status_codes.i
===
--- branches/SAMBA_4_0/source/scripting/swig/status_codes.i 2004-11-07 
00:41:43 UTC (rev 3588)
+++ branches/SAMBA_4_0/source/scripting/swig/status_codes.i 2004-11-07 
01:09:14 UTC (rev 3589)
@@ -543,6 +543,8 @@
 #define WERR_CAN_NOT_COMPLETE 1003
 #define WERR_INVALID_SECURITY_DESCRIPTOR 1338
 #define WERR_SERVER_UNAVAILABLE 1722
+#define WERR_UNKNOWN_PRINTER_DRIVER 1797
+#define WERR_INVALID_ENVIRONMENT 1805
 #define WERR_INVALID_FORM_NAME 1902
 #define WERR_INVALID_FORM_SIZE 1903
 #define WERR_BUF_TOO_SMALL 2123



svn commit: samba r3588 - in branches/SAMBA_4_0/source/scripting/swig: . torture

2004-11-06 Thread tpot
Author: tpot
Date: 2004-11-07 00:41:43 + (Sun, 07 Nov 2004)
New Revision: 3588

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

Log:
Fix bug in converting SIDs containing large unsigned integers from Python.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
   branches/SAMBA_4_0/source/scripting/swig/torture/samr.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-11-07 00:40:41 UTC 
(rev 3587)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-11-07 00:41:43 UTC 
(rev 3588)
@@ -119,9 +119,9 @@
}
 
if (PyLong_Check(obj))
-   return (uint32)PyLong_AsLong(obj);
-   else
-   return (uint32)PyInt_AsLong(obj);
+   return (uint32)PyLong_AsUnsignedLongMask(obj);
+
+   return (uint32)PyInt_AsLong(obj);
 }
 
 PyObject *uint32_to_python(uint32 obj)

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/samr.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/samr.py2004-11-07 
00:40:41 UTC (rev 3587)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/samr.py2004-11-07 
00:41:43 UTC (rev 3588)
@@ -864,6 +864,18 @@
 
 result = dcerpc.samr_Connect(pipe, r)
 
+# Test that we can parse a SID that contains a sub_auth that can't
+# be held in a python int.
+
+r = {}
+r['connect_handle'] = result['connect_handle']
+r['access_mask'] = 0x0200
+r['sid'] = {'sid_rev_num': 1, 'id_auth': [0, 0, 0, 0, 0, 5],
+'num_auths': 4,
+'sub_auths': [21, 737922324, 3002806791L, 1285293260]}
+
+result = dcerpc.samr_OpenDomain(pipe, r)
+
 def runtests(binding, domain, username, password):
 
 print 'Testing SAMR pipe'



svn commit: samba r3587 - in branches/SAMBA_4_0/source/build/smb_build: .

2004-11-06 Thread tpot
Author: tpot
Date: 2004-11-07 00:40:41 + (Sun, 07 Nov 2004)
New Revision: 3587

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

Log:
Add status_codes.i as a dependencies for dcerpc.i

Modified:
   branches/SAMBA_4_0/source/build/smb_build/makefile.pl


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pl
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pl   2004-11-06 
23:23:15 UTC (rev 3586)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pl   2004-11-07 
00:40:41 UTC (rev 3587)
@@ -785,7 +785,7 @@
 
 SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i 
librpc/gen_ndr/winreg.i librpc/gen_ndr/spoolss.i
 
-scripting/swig/dcerpc.py: scripting/swig/dcerpc.i scripting/swig/samba.i 
\$(SWIG_INCLUDES)
+scripting/swig/dcerpc.py: scripting/swig/dcerpc.i scripting/swig/samba.i 
scripting/swig/status_codes.i \$(SWIG_INCLUDES)
swig -python scripting/swig/dcerpc.i
 
 scripting/swig/_dcerpc.so: scripting/swig/dcerpc.py 
scripting/swig/dcerpc_wrap.o \$(PYTHON_DCERPC_OBJ)



svn commit: samba r3521 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

2004-11-03 Thread tpot
Author: tpot
Date: 2004-11-04 06:40:28 + (Thu, 04 Nov 2004)
New Revision: 3521

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

Log:
Collect printer driver names in EnumPrinterDrivers.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-11-04 03:21:44 
UTC (rev 3520)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-11-04 06:40:28 
UTC (rev 3521)
@@ -408,12 +408,13 @@
 
 result = ResizeBufferCall(dcerpc.spoolss_EnumPrinterDrivers, pipe, r)
 
-for driver in dcerpc.unmarshall_spoolss_DriverInfo_array(
-result['buffer'], r['level'], result['count']):
+drivers = dcerpc.unmarshall_spoolss_DriverInfo_array(
+result['buffer'], r['level'], result['count'])
 
-print driver
+if level == 1:
+driver_names = map(lambda x: x['info1']['driver_name'], drivers)
+
 
-
 def test_PrintServer(pipe):
 
 handle = test_OpenPrinterEx(pipe, None)



svn commit: samba r3506 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

2004-11-02 Thread tpot
Author: tpot
Date: 2004-11-03 06:29:22 + (Wed, 03 Nov 2004)
New Revision: 3506

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

Log:
Test EnumPorts function.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-11-03 06:12:42 
UTC (rev 3505)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-11-03 06:29:22 
UTC (rev 3506)
@@ -104,15 +104,22 @@
 
 print 'spoolss_EnumPorts()'
 
-r = {}
-r['handle'] = handle
-r['level'] = 1
-r['buffer'] = None
-r['buf_size'] = 0
+for level in [1, 2]:
 
-result = ResizeBufferCall(dcerpc.spoolss_EnumPorts, pipe, r)
+r = {}
+r['handle'] = handle
+r['servername'] = None
+r['level'] = level
 
+result = ResizeBufferCall(dcerpc.spoolss_EnumPorts, pipe, r)
 
+ports = dcerpc.unmarshall_spoolss_PortInfo_array(
+result['buffer'], r['level'], result['count'])
+
+if level == 1:
+port_names = map(lambda x: x['info1']['port_name'], ports)
+
+
 def test_DeleteForm(pipe, handle, formname):
 
 r = {}
@@ -377,6 +384,7 @@
 handle = test_OpenPrinterEx(pipe, printername)
 
 test_GetPrinter(pipe, handle)
+test_EnumPorts(pipe, handle)
 test_EnumForms(pipe, handle)
 test_AddForm(pipe, handle)
 test_EnumJobs(pipe, handle)



svn commit: samba r3505 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-11-02 Thread tpot
Author: tpot
Date: 2004-11-03 06:12:42 + (Wed, 03 Nov 2004)
New Revision: 3505

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

Log:
#include dynconfig.h

Modified:
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-11-03 06:12:07 UTC (rev 
3504)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-11-03 06:12:42 UTC (rev 
3505)
@@ -34,6 +34,7 @@
 #endif
 
 #include "includes.h"
+#include "dynconfig.h"
 
 #undef strcpy
 



svn commit: samba r3504 - branches/SAMBA_3_0/source/python/samba trunk/source/python/samba

2004-11-02 Thread tpot
Author: tpot
Date: 2004-11-03 06:12:07 + (Wed, 03 Nov 2004)
New Revision: 3504

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

Log:
Fix incorrectly applied patch.  My fault - sorry!

Modified:
   branches/SAMBA_3_0/source/python/samba/printerdata.py
   trunk/source/python/samba/printerdata.py


Changeset:
Modified: branches/SAMBA_3_0/source/python/samba/printerdata.py
===
--- branches/SAMBA_3_0/source/python/samba/printerdata.py   2004-11-03 02:18:57 
UTC (rev 3503)
+++ branches/SAMBA_3_0/source/python/samba/printerdata.py   2004-11-03 06:12:07 
UTC (rev 3504)
@@ -62,4 +62,5 @@
 return self.hnd.getprinterdataex(self.key, key)['data']
 
 def __getitem__(self, key):
-return self.printerdata_ex_subkey(self.host, key, self.creds, access)
+return self.printerdata_ex_subkey(
+self.host, key, self.creds, self.access)

Modified: trunk/source/python/samba/printerdata.py
===
--- trunk/source/python/samba/printerdata.py2004-11-03 02:18:57 UTC (rev 3503)
+++ trunk/source/python/samba/printerdata.py2004-11-03 06:12:07 UTC (rev 3504)
@@ -62,4 +62,5 @@
 return self.hnd.getprinterdataex(self.key, key)['data']
 
 def __getitem__(self, key):
-return self.printerdata_ex_subkey(self.host, key, self.creds, access)
+return self.printerdata_ex_subkey(
+self.host, key, self.creds, self.access)



svn commit: samba r3474 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-11-02 Thread tpot
Author: tpot
Date: 2004-11-02 11:06:00 + (Tue, 02 Nov 2004)
New Revision: 3474

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

Log:
Add conversion functions for the time_t type.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-11-02 11:05:25 UTC (rev 
3473)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-11-02 11:06:00 UTC (rev 
3474)
@@ -197,6 +197,29 @@
return PyLong_FromUnsignedLongLong(obj);
 }
 
+time_t time_t_from_python(PyObject *obj, char *name)
+{
+   if (obj == NULL) {
+   PyErr_Format(PyExc_ValueError, "Expecting key %s", name);
+   return 0;
+   }
+
+   if (!PyLong_Check(obj) && !PyInt_Check(obj)) {
+   PyErr_Format(PyExc_TypeError, "Expecting int or long value for %s", 
name);
+   return 0;
+   }
+
+   if (PyLong_Check(obj))
+   return (time_t)PyLong_AsUnsignedLongLong(obj);
+   else
+   return (time_t)PyInt_AsUnsignedLongMask(obj);
+}
+
+PyObject *time_t_to_python(time_t obj)
+{
+   return PyLong_FromUnsignedLongLong(obj);
+}
+
 HYPER_T HYPER_T_from_python(PyObject *obj, char *name)
 {
if (obj == NULL) {



svn commit: samba r3473 - in branches/SAMBA_4_0/source/build/smb_build: .

2004-11-02 Thread tpot
Author: tpot
Date: 2004-11-02 11:05:25 + (Tue, 02 Nov 2004)
New Revision: 3473

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

Log:
Add LIBCRYPTO_OBJS to python extensions.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/makefile.pl


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pl
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pl   2004-11-02 10:13:26 
UTC (rev 3472)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pl   2004-11-02 11:05:25 
UTC (rev 3473)
@@ -778,7 +778,8 @@
 \$(SUBSYSTEM_LIB_WINBIND_CLIENT_OBJS) \\
 \$(SUBSYSTEM_SOCKET_OBJS) \\
 \$(SUBSYSTEM_LIBREPLACE_OBJS) \\
-\$(SUBSYSTEM_LIBNETIF_OBJS)
+\$(SUBSYSTEM_LIBNETIF_OBJS) \\
+\$(SUBSYSTEM_LIBCRYPTO_OBJS)
 
 PYTHON_DCERPC_LIBS = -lldap
 



svn commit: samba r3460 - in branches/SAMBA_4_0/source/build/smb_build: .

2004-11-01 Thread tpot
Author: tpot
Date: 2004-11-02 04:26:48 + (Tue, 02 Nov 2004)
New Revision: 3460

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

Log:
Add LIBNDR_GEN_OBJS and LIBNETIF_OBJS to swig objs.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/makefile.pl


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pl
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pl   2004-11-02 04:22:57 
UTC (rev 3459)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pl   2004-11-02 04:26:48 
UTC (rev 3460)
@@ -772,6 +772,7 @@
 
 PYTHON_DCERPC_OBJ = \$(SUBSYSTEM_LIBRPC_RAW_OBJS) \\
\$(SUBSYSTEM_LIBNDR_RAW_OBJS) \\
+   \$(SUBSYSTEM_LIBNDR_GEN_OBJS) \\
\$(SUBSYSTEM_LIBBASIC_OBJS) \\
\$(SUBSYSTEM_CONFIG_OBJS) \\
\$(SUBSYSTEM_LIBTDB_OBJS) \\
@@ -789,7 +790,8 @@
\$(SUBSYSTEM_DCERPC_COMMON_OBJS) \\
 \$(SUBSYSTEM_LIB_WINBIND_CLIENT_OBJS) \\
 \$(SUBSYSTEM_SOCKET_OBJS) \\
-\$(SUBSYSTEM_LIBREPLACE_OBJS)
+\$(SUBSYSTEM_LIBREPLACE_OBJS) \\
+\$(SUBSYSTEM_LIBNETIF_OBJS)
 
 PYTHON_DCERPC_LIBS = -lldap
 



svn commit: samba r3459 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-11-01 Thread tpot
Author: tpot
Date: 2004-11-02 04:22:57 + (Tue, 02 Nov 2004)
New Revision: 3459

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

Log:
Fix cut&paste error in copyright header.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/samba.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/samba.i
===
--- branches/SAMBA_4_0/source/scripting/swig/samba.i2004-11-02 04:17:30 UTC (rev 
3458)
+++ branches/SAMBA_4_0/source/scripting/swig/samba.i2004-11-02 04:22:57 UTC (rev 
3459)
@@ -5,8 +5,8 @@

Copyright (C) 2004 Tim Potter <[EMAIL PROTECTED]>
 
- ** NOTE! The following LGPL license applies to the tdb
- ** library. This does NOT imply that all of Samba is released
+ ** NOTE! The following LGPL license applies to the swig
+ ** definitions. This does NOT imply that all of Samba is released
  ** under the LGPL

This library is free software; you can redistribute it and/or



svn commit: samba r3456 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-11-01 Thread tpot
Author: tpot
Date: 2004-11-02 03:47:24 + (Tue, 02 Nov 2004)
New Revision: 3456

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

Log:
Add appropriate #includes to fix Python extensions build.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-11-02 03:44:52 UTC (rev 
3455)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-11-02 03:47:24 UTC (rev 
3456)
@@ -371,6 +371,14 @@
 
 const char *dcerpc_server_name(struct dcerpc_pipe *p);
 
+%{
+#include "librpc/gen_ndr/ndr_misc.h"
+#include "librpc/gen_ndr/ndr_lsa.h"
+#include "librpc/gen_ndr/ndr_samr.h"
+#include "librpc/gen_ndr/ndr_winreg.h"
+#include "librpc/gen_ndr/ndr_spoolss.h"
+%}
+
 %include "librpc/gen_ndr/misc.i"
 %include "librpc/gen_ndr/lsa.i"
 %include "librpc/gen_ndr/samr.i"



svn commit: samba r3430 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

2004-11-01 Thread tpot
Author: tpot
Date: 2004-11-01 11:51:35 + (Mon, 01 Nov 2004)
New Revision: 3430

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

Log:
Add tests for EnumPrinterDataEx, SetPrinterDataEx (doesn't work),
EnumPrinterDrivers.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-11-01 11:34:54 
UTC (rev 3429)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-11-01 11:51:35 
UTC (rev 3430)
@@ -21,7 +21,7 @@
 
 def test_OpenPrinterEx(pipe, printer):
 
-print 'testing spoolss_OpenPrinterEx(%s)' % printer
+print 'spoolss_OpenPrinterEx(%s)' % printer
 
 printername = '%s' % dcerpc.dcerpc_server_name(pipe)
 
@@ -66,7 +66,7 @@
 
 for level in [0, 1, 2, 3, 4, 5, 6, 7]:
 
-print 'test_GetPrinter(level = %d)' % level
+print 'spoolss_GetPrinter(level = %d)' % level
 
 r['level'] = level
 r['buffer'] = None
@@ -77,7 +77,7 @@
 
 def test_EnumForms(pipe, handle):
 
-print 'testing spoolss_EnumForms'
+print 'spoolss_EnumForms()'
 
 r = {}
 r['handle'] = handle
@@ -102,7 +102,7 @@
 
 def test_EnumPorts(pipe, handle):
 
-print 'testing spoolss_EnumPorts'
+print 'spoolss_EnumPorts()'
 
 r = {}
 r['handle'] = handle
@@ -136,7 +136,7 @@
 
 def test_SetForm(pipe, handle, form):
 
-print 'testing spoolss_SetForm'
+print 'spoolss_SetForm()'
 
 r = {}
 r['handle'] = handle
@@ -156,7 +156,7 @@
 
 def test_AddForm(pipe, handle):
 
-print 'testing spoolss_AddForm'
+print 'spoolss_AddForm()'
 
 formname = '__testform__'
 
@@ -197,7 +197,7 @@
 
 def test_EnumJobs(pipe, handle):
 
-print 'testing spoolss_EnumJobs'
+print 'spoolss_EnumJobs()'
 
 r = {}
 r['handle'] = handle
@@ -232,7 +232,7 @@
 
 def test_EnumPrinterData(pipe, handle):
 
-print 'test_EnumPrinterData'
+print 'test_EnumPrinterData()'
 
 enum_index = 0
 
@@ -268,9 +268,42 @@
 enum_index += 1
 
 
+def test_SetPrinterDataEx(pipe, handle):
+
+valuename = '__printerdataextest__'
+data = '12345'
+
+r = {}
+r['handle'] = handle
+r['key_name'] = 'DsSpooler'
+r['value_name'] = valuename
+r['type'] = 3
+r['buffer'] = data
+r['buf_size'] = len(data)
+
+result = dcerpc.spoolss_SetPrinterDataEx(pipe, r)
+
+
+def test_EnumPrinterDataEx(pipe, handle):
+
+r = {}
+r['handle'] = handle
+r['key_name'] = 'DsSpooler'
+r['buf_size'] = 0
+
+result = dcerpc.spoolss_EnumPrinterDataEx(pipe, r)
+
+if result['result'] == dcerpc.WERR_MORE_DATA:
+r['buf_size'] = result['buf_size']
+
+result = dcerpc.spoolss_EnumPrinterDataEx(pipe, r)
+
+# TODO: test spoolss_GetPrinterDataEx()
+
+
 def test_SetPrinterData(pipe, handle):
 
-print 'testing spoolss_SetPrinterData'
+print 'testing spoolss_SetPrinterData()'
 
 valuename = '__printerdatatest__'
 data = '12345'
@@ -299,7 +332,7 @@
 
 def test_EnumPrinters(pipe):
 
-print 'testing spoolss_EnumPrinters'
+print 'testing spoolss_EnumPrinters()'
 
 printer_names = None
 
@@ -348,10 +381,31 @@
 test_AddForm(pipe, handle)
 test_EnumJobs(pipe, handle)
 test_EnumPrinterData(pipe, handle)
+test_EnumPrinterDataEx(pipe, handle)
 test_SetPrinterData(pipe, handle)
+#   test_SetPrinterDataEx(pipe, handle)
 test_ClosePrinter(pipe, handle)
 
 
+def test_EnumPrinterDrivers(pipe):
+
+print 'test spoolss_EnumPrinterDrivers()'
+
+for level in [1, 2, 3]:
+
+r = {}
+r['server'] = None
+r['environment'] = None
+r['level'] = level
+
+result = ResizeBufferCall(dcerpc.spoolss_EnumPrinterDrivers, pipe, r)
+
+for driver in dcerpc.unmarshall_spoolss_DriverInfo_array(
+result['buffer'], r['level'], result['count']):
+
+print driver
+
+
 def test_PrintServer(pipe):
 
 handle = test_OpenPrinterEx(pipe, None)
@@ -370,4 +424,5 @@
 domain, username, password)
 
 test_EnumPrinters(pipe)
+test_EnumPrinterDrivers(pipe)
 test_PrintServer(pipe)



svn commit: samba r3429 - in branches/SAMBA_4_0/source/librpc/idl: .

2004-11-01 Thread tpot
Author: tpot
Date: 2004-11-01 11:34:54 + (Mon, 01 Nov 2004)
New Revision: 3429

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

Log:
Fix IDL for EnumPrinterDataEx()

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-11-01 10:30:34 UTC (rev 
3428)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-11-01 11:34:54 UTC (rev 
3429)
@@ -836,7 +836,11 @@
/**/
/* Function: 0x4f */
WERROR spoolss_EnumPrinterDataEx(
-   [in,ref] policy_handle *handle
+   [in,ref] policy_handle *handle,
+   [in] unistr key_name,
+   [out] DATA_BLOB buffer,
+   [in,out] uint32 buf_size,
+   [out] uint32 count
);
 
/**/



svn commit: samba r3411 - in branches/SAMBA_4_0/source/scripting/swig: . torture

2004-10-31 Thread tpot
Author: tpot
Date: 2004-10-31 11:35:31 + (Sun, 31 Oct 2004)
New Revision: 3411

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

Log:
Ignore some autogenerated files.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:

Property changes on: branches/SAMBA_4_0/source/scripting/swig
___
Name: svn:ignore
   - *.pyc
_*.so
*_wrap.c

   + *.pyc
_*.so
*_wrap.c
dcerpc.py
tdb.py


Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 11:33:40 
UTC (rev 3410)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 11:35:31 
UTC (rev 3411)
@@ -267,6 +267,7 @@
  
 enum_index += 1
 
+
 def test_SetPrinterData(pipe, handle):
 
 print 'testing spoolss_SetPrinterData'
@@ -293,7 +294,9 @@
 print 'SetPrinterData: mismatch'
 sys.exit(1)
 
+dcerpc.spoolss_DeletePrinterData(pipe, r)
 
+
 def test_EnumPrinters(pipe):
 
 print 'testing spoolss_EnumPrinters'



svn commit: samba r3410 - in branches/SAMBA_4_0/source: build/pidl scripting/swig scripting/swig/torture

2004-10-31 Thread tpot
Author: tpot
Date: 2004-10-31 11:33:40 + (Sun, 31 Oct 2004)
New Revision: 3410

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

Log:
Handle conversion of DATA_BLOBs and pointers to DATA_BLOBs from python.

Modified:
   branches/SAMBA_4_0/source/build/pidl/swig.pm
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/swig.pm
===
--- branches/SAMBA_4_0/source/build/pidl/swig.pm2004-10-31 11:33:30 UTC (rev 
3409)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm2004-10-31 11:33:40 UTC (rev 
3410)
@@ -97,7 +97,11 @@
 }
 
 if ($e->{TYPE} eq "DATA_BLOB") {
-   $result .= "\tDATA_BLOB_ptr_from_python(mem_ctx, &s->$prefix$e->{NAME}, $obj, 
\"$e->{NAME}\");\n";
+   if ($e->{POINTERS} == 0) {
+   $result .= "\tDATA_BLOB_from_python(mem_ctx, &s->$prefix$e->{NAME}, $obj, 
\"$e->{NAME}\");\n";
+   } else {
+   $result .= "\tDATA_BLOB_ptr_from_python(mem_ctx, &s->$prefix$e->{NAME}, 
$obj, \"$e->{NAME}\");\n";
+   }
return $result;
 }
 

Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-10-31 11:33:30 UTC (rev 
3409)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-10-31 11:33:40 UTC (rev 
3410)
@@ -254,6 +254,23 @@
 #define dom_sid2_ptr_to_python dom_sid_ptr_to_python
 #define dom_sid2_ptr_from_python dom_sid_ptr_from_python
 
+void DATA_BLOB_from_python(TALLOC_CTX *mem_ctx, DATA_BLOB *s,
+  PyObject *obj, char name)
+{
+   if (obj == NULL) {
+   PyErr_Format(PyExc_ValueError, "Expecting key %s", name);
+   return;
+   }
+
+   if (!PyString_Check(obj)) {
+   PyErr_Format(PyExc_TypeError, "Expecting string value for key '%s'", 
name);
+   return;
+   }
+
+   s->length = PyString_Size(obj);
+   s->data = PyString_AsString(obj);
+}
+
 void DATA_BLOB_ptr_from_python(TALLOC_CTX *mem_ctx, DATA_BLOB **s, 
   PyObject *obj, char *name)
 {

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 11:33:30 
UTC (rev 3409)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 11:33:40 
UTC (rev 3410)
@@ -267,9 +267,33 @@
  
 enum_index += 1
 
-sys.exit(1)
+def test_SetPrinterData(pipe, handle):
 
+print 'testing spoolss_SetPrinterData'
 
+valuename = '__printerdatatest__'
+data = '12345'
+
+r = {}
+r['handle'] = handle
+r['value_name'] = valuename
+r['type'] = 3   # REG_BINARY
+r['buffer'] = data
+r['real_len'] = 5
+
+dcerpc.spoolss_SetPrinterData(pipe, r)
+
+s = {}
+s['handle'] = handle
+s['value_name'] = valuename
+
+result = ResizeBufferCall(dcerpc.spoolss_GetPrinterData, pipe, r)
+
+if result['buffer'] != data:
+print 'SetPrinterData: mismatch'
+sys.exit(1)
+
+
 def test_EnumPrinters(pipe):
 
 print 'testing spoolss_EnumPrinters'
@@ -321,6 +345,7 @@
 test_AddForm(pipe, handle)
 test_EnumJobs(pipe, handle)
 test_EnumPrinterData(pipe, handle)
+test_SetPrinterData(pipe, handle)
 test_ClosePrinter(pipe, handle)
 
 



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

2004-10-30 Thread tpot
Author: tpot
Date: 2004-10-31 05:46:18 + (Sun, 31 Oct 2004)
New Revision: 3406

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

Log:
Don't throw a werror exception for WERR_NO_MORE_ITEMS and WERR_MORE_DATA.

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/swig.pm
===
--- branches/SAMBA_4_0/source/build/pidl/swig.pm2004-10-31 05:45:52 UTC (rev 
3405)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm2004-10-31 05:46:18 UTC (rev 
3406)
@@ -358,7 +358,9 @@
 
 if (!($fn->{RETURN_TYPE} eq "NTSTATUS")) {
$result .= "\tif (!W_ERROR_IS_OK(arg3->out.result) && \n";
-   $result .= "\t\t!(W_ERROR_EQUAL(arg3->out.result, WERR_INSUFFICIENT_BUFFER))) 
{\n";
+   $result .= "\t\t!(W_ERROR_EQUAL(arg3->out.result, WERR_INSUFFICIENT_BUFFER)) 
&&\n";
+   $result .= "\t\t!(W_ERROR_EQUAL(arg3->out.result, WERR_NO_MORE_ITEMS)) &&\n";
+   $result .= "\t\t!(W_ERROR_EQUAL(arg3->out.result, WERR_MORE_DATA))) {\n";
$result .= "\t\tset_werror_exception(W_ERROR_V(arg3->out.result));\n";
$result .= "\t\tgoto fail;\n";
$result .= "\t}\n";



svn commit: samba r3405 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

2004-10-30 Thread tpot
Author: tpot
Date: 2004-10-31 05:45:52 + (Sun, 31 Oct 2004)
New Revision: 3405

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

Log:
Test EnumPrinterData and GetPrinterData.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 05:45:05 
UTC (rev 3404)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 05:45:52 
UTC (rev 3405)
@@ -9,7 +9,8 @@
 
 result = fn(pipe, r)
 
-if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER or \
+   result['result'] == dcerpc.WERR_MORE_DATA:
 r['buffer'] = result['buf_size'] * '\x00'
 r['buf_size'] = result['buf_size']
 
@@ -226,6 +227,49 @@
 sys.exit(1)
 
 
+# TODO: AddJob, DeleteJob, ScheduleJob
+
+
+def test_EnumPrinterData(pipe, handle):
+
+print 'test_EnumPrinterData'
+
+enum_index = 0
+
+while 1:
+
+r = {}
+r['handle'] = handle
+r['enum_index'] = enum_index
+
+r['value_offered'] = 0
+r['data_size'] = 0
+
+result = dcerpc.spoolss_EnumPrinterData(pipe, r)
+
+r['value_offered'] = result['value_needed']
+r['data_size'] = result['data_size']
+
+result = dcerpc.spoolss_EnumPrinterData(pipe, r)
+
+if result['result'] == dcerpc.WERR_NO_MORE_ITEMS:
+break
+
+s = {}
+s['handle'] = handle
+s['value_name'] = result['value_name']
+
+result2 = ResizeBufferCall(dcerpc.spoolss_GetPrinterData, pipe, s)
+
+if result['buffer'][:result2['buf_size']] != result2['buffer']:
+print 'EnumPrinterData/GetPrinterData mismatch'
+sys.exit(1)
+ 
+enum_index += 1
+
+sys.exit(1)
+
+
 def test_EnumPrinters(pipe):
 
 print 'testing spoolss_EnumPrinters'
@@ -276,6 +320,7 @@
 test_EnumForms(pipe, handle)
 test_AddForm(pipe, handle)
 test_EnumJobs(pipe, handle)
+test_EnumPrinterData(pipe, handle)
 test_ClosePrinter(pipe, handle)
 
 
@@ -283,6 +328,8 @@
 
 handle = test_OpenPrinterEx(pipe, None)
 
+# EnumForms and AddForm tests return WERR_BADFID here (??)
+
 test_ClosePrinter(pipe, handle)
 
 



svn commit: samba r3404 - in branches/SAMBA_4_0/source/librpc/idl: .

2004-10-30 Thread tpot
Author: tpot
Date: 2004-10-31 05:45:05 + (Sun, 31 Oct 2004)
New Revision: 3404

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

Log:
Rename name of DATA_BLOB in GetPrinterData()

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-31 04:41:57 UTC (rev 
3403)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-31 05:45:05 UTC (rev 
3404)
@@ -785,7 +785,7 @@
[out]lstring value_name,
[out]uint32 value_needed,
[out]uint32 printerdata_type,
-   [out]DATA_BLOB data,
+   [out]DATA_BLOB buffer,
[in,out,ref] uint32 *data_size
);
 



svn commit: samba r3403 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

2004-10-30 Thread tpot
Author: tpot
Date: 2004-10-31 04:41:57 + (Sun, 31 Oct 2004)
New Revision: 3403

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

Log:
Add test for operations on print server handle.

Add tests for EnumJobs, GetJob.

Oops - forgot to EnumPrinters at level2.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 04:37:35 
UTC (rev 3402)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 04:41:57 
UTC (rev 3403)
@@ -22,9 +22,13 @@
 
 print 'testing spoolss_OpenPrinterEx(%s)' % printer
 
+printername = '%s' % dcerpc.dcerpc_server_name(pipe)
+
+if printer is not None:
+printername = printername + '\\%s' % printer
+
 r = {}
-r['printername'] = '%s\\%s' % \
-   (dcerpc.dcerpc_server_name(pipe), printer)
+r['printername'] = printername
 r['datatype'] = None
 r['devmode_ctr'] = {}
 r['devmode_ctr']['size'] = 0
@@ -190,6 +194,38 @@
 test_DeleteForm(pipe, handle, formname)
 
 
+def test_EnumJobs(pipe, handle):
+
+print 'testing spoolss_EnumJobs'
+
+r = {}
+r['handle'] = handle
+r['firstjob'] = 0
+r['numjobs'] = 0x
+r['level'] = 1
+
+result = ResizeBufferCall(dcerpc.spoolss_EnumJobs, pipe, r)
+
+if result['buffer'] is None:
+return
+
+jobs = dcerpc.unmarshall_spoolss_JobInfo_array(
+result['buffer'], r['level'], result['count'])
+
+for job in jobs:
+
+s = {}
+s['handle'] = handle
+s['job_id'] = job['info1']['job_id']
+s['level'] = 1
+
+result = ResizeBufferCall(dcerpc.spoolss_GetJob, pipe, s)
+
+if result['info'] != job:
+print 'EnumJobs: mismatch: %s != %s' % (result['info'], job)
+sys.exit(1)
+
+
 def test_EnumPrinters(pipe):
 
 print 'testing spoolss_EnumPrinters'
@@ -200,36 +236,56 @@
 r['flags'] = 0x02
 r['server'] = None
 
-for level in [0, 1, 4, 5]:
+for level in [0, 1, 2, 4, 5]:
 
 print 'test_EnumPrinters(level = %d)' % level
 
 r['level'] = level
-r['buf_size'] = 0
-r['buffer'] = None
 
-result = ResizeBufferCall(dcerpc.spoolss_EnumPrinters,pipe, r)
+result = ResizeBufferCall(dcerpc.spoolss_EnumPrinters, pipe, r)
 
 printers = dcerpc.unmarshall_spoolss_PrinterInfo_array(
 result['buffer'], r['level'], result['count'])
 
-if level == 1:
-printer_names = map(
-lambda x: string.split(x['info1']['name'], ',')[0], printers)
+if level == 2:
+for p in printers:
 
-for printer in printer_names:
+# A nice check is for the specversion in the
+# devicemode.  This has always been observed to be
+# 1025.
 
-handle = test_OpenPrinterEx(pipe, printer)
+if p['info2']['devmode']['specversion'] != 1025:
+print 'test_EnumPrinters: specversion != 1025'
+sys.exit(1)
 
+r['level'] = 1
+result = ResizeBufferCall(dcerpc.spoolss_EnumPrinters, pipe, r)
+
+for printer in dcerpc.unmarshall_spoolss_PrinterInfo_array(
+result['buffer'], r['level'], result['count']):
+
+if string.find(printer['info1']['name'], '') == 0:
+print 'Skipping remote printer %s' % printer['info1']['name']
+continue
+
+printername = string.split(printer['info1']['name'], ',')[0]
+
+handle = test_OpenPrinterEx(pipe, printername)
+
 test_GetPrinter(pipe, handle)
-
 test_EnumForms(pipe, handle)
-
 test_AddForm(pipe, handle)
-
+test_EnumJobs(pipe, handle)
 test_ClosePrinter(pipe, handle)
-
 
+
+def test_PrintServer(pipe):
+
+handle = test_OpenPrinterEx(pipe, None)
+
+test_ClosePrinter(pipe, handle)
+
+
 def runtests(binding, domain, username, password):
 
 print 'Testing SPOOLSS pipe'
@@ -239,3 +295,4 @@
 domain, username, password)
 
 test_EnumPrinters(pipe)
+test_PrintServer(pipe)



svn commit: samba r3402 - in branches/SAMBA_4_0/source/librpc/idl: .

2004-10-30 Thread tpot
Author: tpot
Date: 2004-10-31 04:37:35 + (Sun, 31 Oct 2004)
New Revision: 3402

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

Log:
Fix idl for spoolss_JobInfo1.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-31 03:54:20 UTC (rev 
3401)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-31 04:37:35 UTC (rev 
3402)
@@ -225,12 +225,12 @@
 
typedef struct {
uint32 job_id;
-   [relative] nstring printer_name;
-   [relative] nstring server_name;
-   [relative] nstring user_name;
-   [relative] nstring document_name;
-   [relative] nstring data_type;
-   [relative] nstring text_status;
+   [relative] nstring *printer_name;
+   [relative] nstring *server_name;
+   [relative] nstring *user_name;
+   [relative] nstring *document_name;
+   [relative] nstring *data_type;
+   [relative] nstring *text_status;
uint32 status;
uint32 priority;
uint32 position;



svn commit: samba r3401 - in branches/SAMBA_4_0/source: librpc/idl scripting/swig/torture

2004-10-30 Thread tpot
Author: tpot
Date: 2004-10-31 03:54:20 + (Sun, 31 Oct 2004)
New Revision: 3401

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

Log:
Fix IDL for SetForm RPC.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-31 03:26:30 UTC (rev 
3400)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-31 03:54:20 UTC (rev 
3401)
@@ -483,13 +483,28 @@
[in,out,ref] uint32 *buf_size
);
 
+   typedef struct {
+   uint32 flags;
+   unistr *formname;
+   uint32 width;
+   uint32 length;
+   uint32 left;
+   uint32 top;
+   uint32 right;
+   uint32 bottom;
+   } spoolss_SetFormInfo1;
+
+   typedef union {
+   [case(1)] spoolss_AddFormInfo1 *info1;
+   } spoolss_SetFormInfo;
+
/**/
/* Function: 0x21 */
WERROR spoolss_SetForm(
[in,ref] policy_handle *handle,
[in] unistr formname,
[in] uint32 level,
-   [in,switch_is(level)] spoolss_AddFormInfo info
+   [in,switch_is(level)] spoolss_SetFormInfo info
);
 
typedef [nodiscriminant,public] union {

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 03:26:30 
UTC (rev 3400)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 03:54:20 
UTC (rev 3401)
@@ -129,6 +129,26 @@
 return result['info']['info1']
 
 
+def test_SetForm(pipe, handle, form):
+
+print 'testing spoolss_SetForm'
+
+r = {}
+r['handle'] = handle
+r['level'] = 1
+r['formname'] = form['info1']['formname']
+r['info'] = form
+
+dcerpc.spoolss_SetForm(pipe, r)
+
+newform = test_GetForm(pipe, handle, r['formname'])
+
+if form['info1'] != newform:
+print 'SetForm: mismatch: %s != %s' % \
+  (r['info']['info1'], f)
+sys.exit(1)
+
+
 def test_AddForm(pipe, handle):
 
 print 'testing spoolss_AddForm'
@@ -141,13 +161,13 @@
 r['info'] = {}
 r['info']['info1'] = {}
 r['info']['info1']['formname'] = formname
-r['info']['info1']['flags'] = 0
-r['info']['info1']['width'] = 1
-r['info']['info1']['length'] = 2
-r['info']['info1']['left'] = 3
-r['info']['info1']['top'] = 4
-r['info']['info1']['right'] = 5
-r['info']['info1']['bottom'] = 6
+r['info']['info1']['flags'] = 0x0002
+r['info']['info1']['width'] = 100
+r['info']['info1']['length'] = 100
+r['info']['info1']['left'] = 0
+r['info']['info1']['top'] = 1000
+r['info']['info1']['right'] = 2000
+r['info']['info1']['bottom'] = 3000
 
 try:
 result = dcerpc.spoolss_AddForm(pipe, r)
@@ -159,14 +179,13 @@
 f = test_GetForm(pipe, handle, formname)
 
 if r['info']['info1'] != f:
-print 'Form type mismatch: %s != %s' % \
+print 'AddForm: mismatch: %s != %s' % \
   (r['info']['info1'], f)
 sys.exit(1)
 
 r['formname'] = formname
-r['info']['info1']['unknown'] = 1
 
-dcerpc.spoolss_SetForm(pipe, r)
+test_SetForm(pipe, handle, r['info'])
 
 test_DeleteForm(pipe, handle, formname)
 



svn commit: samba r3396 - in branches/SAMBA_4_0/source: librpc/idl scripting/swig/torture torture/rpc

2004-10-30 Thread tpot
Author: tpot
Date: 2004-10-30 23:35:34 + (Sat, 30 Oct 2004)
New Revision: 3396

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

Log:
Rename form_name -> formname.  This time, check smbtorture builds before
committing.  (-:

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
   branches/SAMBA_4_0/source/torture/rpc/spoolss.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-30 23:19:09 UTC (rev 
3395)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-30 23:35:34 UTC (rev 
3396)
@@ -487,7 +487,7 @@
/* Function: 0x21 */
WERROR spoolss_SetForm(
[in,ref] policy_handle *handle,
-   [in] unistr form_name,
+   [in] unistr formname,
[in] uint32 level,
[in,switch_is(level)] spoolss_AddFormInfo info
);

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-30 23:19:09 
UTC (rev 3395)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-30 23:35:34 
UTC (rev 3396)
@@ -163,8 +163,11 @@
   (r['info']['info1'], f)
 sys.exit(1)
 
-# TODO: test spoolss_SetForm()
+r['formname'] = formname
+r['info']['info1']['unknown'] = 1
 
+dcerpc.spoolss_SetForm(pipe, r)
+
 test_DeleteForm(pipe, handle, formname)
 
 

Modified: branches/SAMBA_4_0/source/torture/rpc/spoolss.c
===
--- branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2004-10-30 23:19:09 UTC (rev 
3395)
+++ branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2004-10-30 23:35:34 UTC (rev 
3396)
@@ -248,7 +248,7 @@
struct spoolss_SetForm sf;
 
sf.in.handle = handle;
-   sf.in.form_name = formname;
+   sf.in.formname = formname;
sf.in.level = 1;
sf.in.info.info1 = &form;
form.width = 1234;



svn commit: samba r3311 - in branches/SAMBA_4_0/source: librpc/idl scripting/swig/torture

2004-10-27 Thread tpot
Author: tpot
Date: 2004-10-28 06:17:38 + (Thu, 28 Oct 2004)
New Revision: 3311

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3311&nolog=1

Log:
Consistency updates for form name members.

Add tests for EnumForms, GetForm, AddForm, DeleteForm.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-28 06:16:32 UTC (rev 
3310)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-28 06:17:38 UTC (rev 
3311)
@@ -101,7 +101,7 @@
 
typedef struct {
uint32 flags;
-   [relative] nstring *name;
+   [relative] nstring *formname;
uint32 width;
uint32 length;
uint32 left;
@@ -444,7 +444,7 @@
 
typedef struct {
uint32 flags;
-   [relative] unistr *name;
+   [relative] unistr *formname;
uint32 width;
uint32 length;
uint32 left;

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-28 06:16:32 
UTC (rev 3310)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-28 06:17:38 
UTC (rev 3311)
@@ -1,6 +1,23 @@
-import string
+import sys, string
 import dcerpc
 
+
+def ResizeBufferCall(fn, pipe, r):
+
+r['buffer'] = None
+r['buf_size'] = 0
+
+result = fn(pipe, r)
+
+if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+r['buffer'] = result['buf_size'] * '\x00'
+r['buf_size'] = result['buf_size']
+
+result = fn(pipe, r)
+
+return result
+
+
 def test_OpenPrinterEx(pipe, printer):
 
 print 'testing spoolss_OpenPrinterEx(%s)' % printer
@@ -50,16 +67,9 @@
 r['buffer'] = None
 r['buf_size'] = 0
 
-result = dcerpc.spoolss_GetPrinter(pipe, r)
+result = ResizeBufferCall(dcerpc.spoolss_GetPrinter, pipe, r)
 
-if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
-r['buffer'] = result['buf_size'] * '\x00'
-r['buf_size'] = result['buf_size']
 
-result = dcerpc.spoolss_GetPrinter(pipe, r)
-
-print result
-
 def test_EnumForms(pipe, handle):
 
 print 'testing spoolss_EnumForms'
@@ -70,17 +80,21 @@
 r['buffer'] = None
 r['buf_size'] = 0
 
-result = dcerpc.spoolss_EnumForms(pipe, r)
+result = ResizeBufferCall(dcerpc.spoolss_EnumForms, pipe, r)
 
-if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
-r['buffer'] = result['buf_size'] * '\x00'
-r['buf_size'] = result['buf_size']
+forms = dcerpc.unmarshall_spoolss_FormInfo_array(
+result['buffer'], r['level'], result['count'])
 
-result = dcerpc.spoolss_EnumForms(pipe, r)
+for form in forms:
 
-print result
-   
+r = {}
+r['handle'] = handle
+r['formname'] = form['info1']['formname']
+r['level'] = 1
 
+result = ResizeBufferCall(dcerpc.spoolss_GetForm, pipe, r)
+
+
 def test_EnumPorts(pipe, handle):
 
 print 'testing spoolss_EnumPorts'
@@ -91,17 +105,69 @@
 r['buffer'] = None
 r['buf_size'] = 0
 
-result = dcerpc.spoolss_EnumPorts(pipe, r)
+result = ResizeBufferCall(dcerpc.spoolss_EnumPorts, pipe, r)
 
-if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
-r['buffer'] = result['buf_size'] * '\x00'
-r['buf_size'] = result['buf_size']
 
-result = dcerpc.spoolss_EnumPorts(pipe, r)
+def test_DeleteForm(pipe, handle, formname):
 
-print result
-   
+r = {}
+r['handle'] = handle
+r['formname'] = formname
 
+dcerpc.spoolss_DeleteForm(pipe, r)
+
+
+def test_GetForm(pipe, handle, formname):
+
+r = {}
+r['handle'] = handle
+r['formname'] = formname
+r['level'] = 1
+
+result = ResizeBufferCall(dcerpc.spoolss_GetForm, pipe, r)
+
+return result['info']['info1']
+
+
+def test_AddForm(pipe, handle):
+
+print 'testing spoolss_AddForm'
+
+formname = '__testform__'
+
+r = {}
+r['handle'] = handle
+r[&#

svn commit: samba r3310 - in branches/SAMBA_4_0/source/build/smb_build: .

2004-10-27 Thread tpot
Author: tpot
Date: 2004-10-28 06:16:32 + (Thu, 28 Oct 2004)
New Revision: 3310

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/build/smb_build&rev=3310&nolog=1

Log:
Update dependencies for swig wrappers.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/makefile.pl


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pl
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pl   2004-10-28 06:14:10 
UTC (rev 3309)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pl   2004-10-28 06:16:32 
UTC (rev 3310)
@@ -774,7 +774,9 @@
\$(SUBSYSTEM_CHARSET_OBJS) \\
\$(SUBSYSTEM_LIBSMB_OBJS) \\
\$(SUBSYSTEM_DCERPC_COMMON_OBJS) \\
-\$(SUBSYSTEM_LIB_WINBIND_CLIENT_OBJS)
+\$(SUBSYSTEM_LIB_WINBIND_CLIENT_OBJS) \\
+\$(SUBSYSTEM_SOCKET_OBJS) \\
+\$(SUBSYSTEM_LIBREPLACE_OBJS)
 
 PYTHON_DCERPC_LIBS = -lldap
 



svn commit: samba r3309 - in branches/SAMBA_4_0/source/scripting/swig: .

2004-10-27 Thread tpot
Author: tpot
Date: 2004-10-28 06:14:10 + (Thu, 28 Oct 2004)
New Revision: 3309

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig&rev=3309&nolog=1

Log:
Add wrapper for dcerpc_server_name() function.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-10-28 06:13:42 UTC (rev 
3308)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2004-10-28 06:14:10 UTC (rev 
3309)
@@ -352,6 +352,8 @@
$1 = &temp_data_blob;
 }
 
+const char *dcerpc_server_name(struct dcerpc_pipe *p);
+
 %include "librpc/gen_ndr/misc.i"
 %include "librpc/gen_ndr/lsa.i"
 %include "librpc/gen_ndr/samr.i"



svn commit: samba r3308 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

2004-10-27 Thread tpot
Author: tpot
Date: 2004-10-28 06:13:42 + (Thu, 28 Oct 2004)
New Revision: 3308

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig/torture&rev=3308&nolog=1

Log:
Handle servers that don't have samr_Connect5.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/samr.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/samr.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/samr.py2004-10-28 05:09:42 
UTC (rev 3307)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/samr.py2004-10-28 06:13:42 
UTC (rev 3308)
@@ -15,8 +15,8 @@
 s = {}
 s['handle'] = result['connect_handle']
 
-dcerpc.samr_Close(pipe, s)
-
+handle = result['connect_handle']
+  
 print 'testing samr_Connect2'
 
 r = {}
@@ -69,9 +69,16 @@
 r['info']['info1']['unknown1'] = 0
 r['info']['info1']['unknown2'] = 0
 
-result = dcerpc.samr_Connect5(pipe, r)
+try:
+result = dcerpc.samr_Connect5(pipe, r)
+s = {}
+s['handle'] = result['connect_handle']
+dcerpc.samr_Close(pipe, s)
+except dcerpc.NTSTATUS, arg:
+if arg[0] != dcerpc.NT_STATUS_NET_WRITE_FAULT:
+raise
 
-return result['connect_handle']
+return handle
 
 def test_QuerySecurity(pipe, handle):
 



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

2004-10-27 Thread tpot
Author: tpot
Date: 2004-10-28 03:58:17 + (Thu, 28 Oct 2004)
New Revision: 3303

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/build/pidl&rev=3303&nolog=1

Log:
Call pull function for correct type instead of spoolss_PrinterInfo when
unmarshalling arrays.

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/swig.pm
===
--- branches/SAMBA_4_0/source/build/pidl/swig.pm2004-10-28 03:40:35 UTC (rev 
3302)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm2004-10-28 03:58:17 UTC (rev 
3303)
@@ -599,7 +599,7 @@
$result .= "\tfor (i=0;i

svn commit: samba r3302 - in branches/SAMBA_4_0/source: librpc/idl scripting/swig/torture

2004-10-27 Thread tpot
Author: tpot
Date: 2004-10-28 03:40:35 + (Thu, 28 Oct 2004)
New Revision: 3302

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3302&nolog=1

Log:
The security descriptors in spoolss_PrinterInfo2 and spoolss_PrinterInfo3
need to be marked as subcontext(0).

GetPrinter tests now work for all info levels!

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-27 22:41:14 UTC (rev 
3301)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-28 03:40:35 UTC (rev 
3302)
@@ -123,7 +123,7 @@
[relative] nstring *printprocessor;
[relative] nstring *datatype;
[relative] nstring *parameters;
-   [relative] security_descriptor *secdesc;
+   [relative,subcontext(0)] security_descriptor *secdesc;
uint32 attributes;
uint32 priority;
uint32 defaultpriority;
@@ -136,7 +136,7 @@
 
typedef struct {
uint32 flags;
-   security_descriptor secdesc;
+   [subcontext(0)] security_descriptor secdesc;
} spoolss_PrinterInfo3;
 
typedef struct {

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-27 22:41:14 
UTC (rev 3301)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-28 03:40:35 
UTC (rev 3302)
@@ -6,7 +6,8 @@
 print 'testing spoolss_OpenPrinterEx(%s)' % printer
 
 r = {}
-r['printername'] = 'win2k3dc\\%s' % printer
+r['printername'] = '%s\\%s' % \
+   (dcerpc.dcerpc_server_name(pipe), printer)
 r['datatype'] = None
 r['devmode_ctr'] = {}
 r['devmode_ctr']['size'] = 0
@@ -41,16 +42,16 @@
 r = {}
 r['handle'] = handle
 
-for level in [1, 2, 3]:
+for level in [0, 1, 2, 3, 4, 5, 6, 7]:
 
+print 'test_GetPrinter(level = %d)' % level
+
 r['level'] = level
 r['buffer'] = None
 r['buf_size'] = 0
 
 result = dcerpc.spoolss_GetPrinter(pipe, r)
 
-print result
-
 if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
 r['buffer'] = result['buf_size'] * '\x00'
 r['buf_size'] = result['buf_size']
@@ -59,7 +60,48 @@
 
 print result
 
+def test_EnumForms(pipe, handle):
 
+print 'testing spoolss_EnumForms'
+
+r = {}
+r['handle'] = handle
+r['level'] = 1
+r['buffer'] = None
+r['buf_size'] = 0
+
+result = dcerpc.spoolss_EnumForms(pipe, r)
+
+if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+r['buffer'] = result['buf_size'] * '\x00'
+r['buf_size'] = result['buf_size']
+
+result = dcerpc.spoolss_EnumForms(pipe, r)
+
+print result
+   
+
+def test_EnumPorts(pipe, handle):
+
+print 'testing spoolss_EnumPorts'
+
+r = {}
+r['handle'] = handle
+r['level'] = 1
+r['buffer'] = None
+r['buf_size'] = 0
+
+result = dcerpc.spoolss_EnumPorts(pipe, r)
+
+if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+r['buffer'] = result['buf_size'] * '\x00'
+r['buf_size'] = result['buf_size']
+
+result = dcerpc.spoolss_EnumPorts(pipe, r)
+
+print result
+   
+
 def test_EnumPrinters(pipe):
 
 print 'testing spoolss_EnumPrinters'
@@ -70,8 +112,10 @@
 r['flags'] = 0x02
 r['server'] = None
 
-for level in [1, 2, 4, 5]:
+for level in [0, 1, 4, 5]:
 
+print 'test_EnumPrinters(level = %d)' % level
+
 r['level'] = level
 r['buf_size'] = 0
 r['buffer'] = None
@@ -87,7 +131,10 @@
 printers = dcerpc.unmarshall_spoolss_PrinterInfo_array(
 result['buffer'], r['level'], result['count'])
 
-if printer_names is None:
+from pprint import pprint
+pprint(printers)
+
+if level == 1:
 printer_names = map(
 lambda x: string.split(x['info1']['name'], ',')[0], printers)
 



svn commit: samba r3287 - in branches/SAMBA_4_0/source/librpc/idl: .

2004-10-27 Thread tpot
Author: tpot
Date: 2004-10-27 07:45:52 + (Wed, 27 Oct 2004)
New Revision: 3287

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/librpc/idl&rev=3287&nolog=1

Log:
The devicename and formname fields in a device mode are fixed length
strings.  Not sure how to write this as idl which maps to a char * but
at least devicemodes can be pulled off the wire sucessfully.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-27 05:30:29 UTC (rev 
3286)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-27 07:45:52 UTC (rev 
3287)
@@ -55,7 +55,7 @@
} spoolss_PrinterInfo0;
 
typedef struct {
-   nstring devicename;
+   uint16 devicename[32];
uint16 specversion;
uint16 driverversion;
uint16 size;
@@ -74,7 +74,7 @@
uint16 yresolution;
uint16 ttoption;
uint16 collate;
-   nstring formname;
+   uint16 formname[32];
uint16 logpixels;
uint32 bitsperpel;
uint32 pelswidth;



svn commit: samba r3250 - in branches/SAMBA_4_0/source/librpc/idl: .

2004-10-26 Thread tpot
Author: tpot
Date: 2004-10-26 07:17:23 + (Tue, 26 Oct 2004)
New Revision: 3250

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/librpc/idl&rev=3250&nolog=1

Log:
Add idl for printer info level 0.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-26 07:11:49 UTC (rev 
3249)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-26 07:17:23 UTC (rev 
3250)
@@ -12,6 +12,49 @@
 ] interface spoolss
 {
typedef struct {
+   uint16 year;
+   uint16 month;
+   uint16 day_of_week;
+   uint16 day;
+   uint16 hour;
+   uint16 minute;
+   uint16 second;
+   uint16 millisecond;
+   } spoolss_Time;
+
+   typedef struct {
+   [relative] nstring *printername;
+   [relative] nstring *servername;
+   uint32 cjobs;
+   uint32 total_jobs;
+   uint32 total_bytes;
+   spoolss_Time time;  
+   uint32 global_counter;
+   uint32 total_pages;
+   uint32 version;
+   uint32 unknown10;
+   uint32 unknown11;
+   uint32 unknown12;
+   uint32 session_counter;
+   uint32 unknown14;
+   uint32 printer_errors;
+   uint32 unknown16;
+   uint32 unknown17;
+   uint32 unknown18;
+   uint32 unknown19;
+   uint32 change_id;
+   uint32 unknown21;
+   uint32 status;
+   uint32 unknown23;
+   uint32 c_setprinter;
+   uint16 unknown25;
+   uint16 unknown26;
+   uint32 unknown27;
+   uint32 unknown28;
+   uint32 unknown29;
+   } spoolss_PrinterInfo0;
+
+   typedef struct {
nstring devicename;
uint16 specversion;
uint16 driverversion;
@@ -120,6 +163,7 @@
} spoolss_PrinterInfo7;
 
typedef [nodiscriminant,public] union {
+   [case(0)] spoolss_PrinterInfo0 info0;
[case(1)] spoolss_PrinterInfo1 info1;
[case(2)] spoolss_PrinterInfo2 info2;
[case(3)] spoolss_PrinterInfo3 info3;
@@ -180,17 +224,6 @@
);
 
typedef struct {
-   uint16 year;
-   uint16 month;
-   uint16 day_of_week;
-   uint16 day;
-   uint16 hour;
-   uint16 minute;
-   uint16 second;
-   uint16 millisecond;
-   } spoolss_Time;
-
-   typedef struct {
uint32 job_id;
[relative] nstring printer_name;
[relative] nstring server_name;



svn commit: samba r3228 - branches/SAMBA_3_0/source/python trunk/source/python

2004-10-25 Thread tpot
Author: tpot
Date: 2004-10-26 01:37:19 + (Tue, 26 Oct 2004)
New Revision: 3228

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=3228&nolog=1

Log:
Fix for bugzilla #1884 from Brett Funderburg.  Use the value of 
desired_access passed in to the lsa open policy routine.  Use a default
value that netapps and windows likes as well.

Modified:
   branches/SAMBA_3_0/source/python/py_lsa.c
   trunk/source/python/py_lsa.c


Changeset:
Modified: branches/SAMBA_3_0/source/python/py_lsa.c
===
--- branches/SAMBA_3_0/source/python/py_lsa.c   2004-10-26 00:59:06 UTC (rev 3227)
+++ branches/SAMBA_3_0/source/python/py_lsa.c   2004-10-26 01:37:19 UTC (rev 3228)
@@ -55,7 +55,7 @@
static char *kwlist[] = { "servername", "creds", "access", NULL };
char *server, *errstr;
PyObject *creds = NULL, *result = NULL;
-   uint32 desired_access = MAXIMUM_ALLOWED_ACCESS;
+   uint32 desired_access = GENERIC_EXECUTE_ACCESS;
struct cli_state *cli = NULL;
NTSTATUS ntstatus;
TALLOC_CTX *mem_ctx = NULL;
@@ -90,7 +90,7 @@
}
 
ntstatus = cli_lsa_open_policy(cli, mem_ctx, True,
-  SEC_RIGHTS_MAXIMUM_ALLOWED, &hnd);
+  desired_access, &hnd);
 
if (!NT_STATUS_IS_OK(ntstatus)) {
PyErr_SetObject(lsa_ntstatus, py_ntstatus_tuple(ntstatus));

Modified: trunk/source/python/py_lsa.c
===
--- trunk/source/python/py_lsa.c2004-10-26 00:59:06 UTC (rev 3227)
+++ trunk/source/python/py_lsa.c2004-10-26 01:37:19 UTC (rev 3228)
@@ -55,7 +55,7 @@
static char *kwlist[] = { "servername", "creds", "access", NULL };
char *server, *errstr;
PyObject *creds = NULL, *result = NULL;
-   uint32 desired_access = MAXIMUM_ALLOWED_ACCESS;
+   uint32 desired_access = GENERIC_EXECUTE_ACCESS;
struct cli_state *cli = NULL;
NTSTATUS ntstatus;
TALLOC_CTX *mem_ctx = NULL;
@@ -90,7 +90,7 @@
}
 
ntstatus = cli_lsa_open_policy(cli, mem_ctx, True,
-  SEC_RIGHTS_MAXIMUM_ALLOWED, &hnd);
+  desired_access, &hnd);
 
if (!NT_STATUS_IS_OK(ntstatus)) {
PyErr_SetObject(lsa_ntstatus, py_ntstatus_tuple(ntstatus));



svn commit: samba r3217 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

2004-10-25 Thread tpot
Author: tpot
Date: 2004-10-25 13:06:31 + (Mon, 25 Oct 2004)
New Revision: 3217

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig/torture&rev=3217&nolog=1

Log:
Start of a spoolss_GetPrinter test.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-25 12:54:52 
UTC (rev 3216)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-25 13:06:31 
UTC (rev 3217)
@@ -36,6 +36,30 @@
 dcerpc.spoolss_ClosePrinter(pipe, r)
 
 
+def test_GetPrinter(pipe, handle):
+
+r = {}
+r['handle'] = handle
+
+for level in [1, 2, 3]:
+
+r['level'] = level
+r['buffer'] = None
+r['buf_size'] = 0
+
+result = dcerpc.spoolss_GetPrinter(pipe, r)
+
+print result
+
+if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+r['buffer'] = result['buf_size'] * '\x00'
+r['buf_size'] = result['buf_size']
+
+result = dcerpc.spoolss_GetPrinter(pipe, r)
+
+print result
+
+
 def test_EnumPrinters(pipe):
 
 print 'testing spoolss_EnumPrinters'
@@ -71,6 +95,8 @@
 
 handle = test_OpenPrinterEx(pipe, printer)
 
+test_GetPrinter(pipe, handle)
+
 test_ClosePrinter(pipe, handle)
 
 



svn commit: samba r3216 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

2004-10-25 Thread tpot
Author: tpot
Date: 2004-10-25 12:54:52 + (Mon, 25 Oct 2004)
New Revision: 3216

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig/torture&rev=3216&nolog=1

Log:
Add tests for OpenPrinterEx and ClosePrinter.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-25 12:44:53 
UTC (rev 3215)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-25 12:54:52 
UTC (rev 3216)
@@ -1,24 +1,79 @@
+import string
 import dcerpc
 
+def test_OpenPrinterEx(pipe, printer):
+
+print 'testing spoolss_OpenPrinterEx(%s)' % printer
+
+r = {}
+r['printername'] = 'win2k3dc\\%s' % printer
+r['datatype'] = None
+r['devmode_ctr'] = {}
+r['devmode_ctr']['size'] = 0
+r['devmode_ctr']['devmode'] = None
+r['access_mask'] = 0x0200
+r['level'] = 1
+r['userlevel'] = {}
+r['userlevel']['level1'] = {}
+r['userlevel']['level1']['size'] = 0
+r['userlevel']['level1']['client'] = None
+r['userlevel']['level1']['user'] = None
+r['userlevel']['level1']['build'] = 1381
+r['userlevel']['level1']['major'] = 2
+r['userlevel']['level1']['minor'] = 0
+r['userlevel']['level1']['processor'] = 0
+
+result = dcerpc.spoolss_OpenPrinterEx(pipe, r)
+
+return result['handle']
+
+
+def test_ClosePrinter(pipe, handle):
+
+r = {}
+r['handle'] = handle
+
+dcerpc.spoolss_ClosePrinter(pipe, r)
+
+
 def test_EnumPrinters(pipe):
 
+print 'testing spoolss_EnumPrinters'
+
+printer_names = None
+
 r = {}
 r['flags'] = 0x02
 r['server'] = None
-r['level'] = 1
-r['buffer'] = None
-r['buf_size'] = 0
 
-result = dcerpc.spoolss_EnumPrinters(pipe, r)
+for level in [1, 2, 4, 5]:
 
-if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
-r['buffer'] = result['buf_size'] * '\x00'
-r['buf_size'] = result['buf_size']
+r['level'] = level
+r['buf_size'] = 0
+r['buffer'] = None
 
 result = dcerpc.spoolss_EnumPrinters(pipe, r)
 
-print dcerpc.unmarshall_spoolss_PrinterInfo_array(result['buffer'], r['level'], 
result['count'])
+if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+r['buffer'] = result['buf_size'] * '\x00'
+r['buf_size'] = result['buf_size']
 
+result = dcerpc.spoolss_EnumPrinters(pipe, r)
+
+printers = dcerpc.unmarshall_spoolss_PrinterInfo_array(
+result['buffer'], r['level'], result['count'])
+
+if printer_names is None:
+printer_names = map(
+lambda x: string.split(x['info1']['name'], ',')[0], printers)
+
+for printer in printer_names:
+
+handle = test_OpenPrinterEx(pipe, printer)
+
+test_ClosePrinter(pipe, handle)
+
+
 def runtests(binding, domain, username, password):
 
 print 'Testing SPOOLSS pipe'



svn commit: samba r3215 - in branches/SAMBA_4_0/source/librpc/idl: .

2004-10-25 Thread tpot
Author: tpot
Date: 2004-10-25 12:44:53 + (Mon, 25 Oct 2004)
New Revision: 3215

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/librpc/idl&rev=3215&nolog=1

Log:
access_required -> access_mask for OpenPrinterEx

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-25 11:55:13 UTC (rev 
3214)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2004-10-25 12:44:53 UTC (rev 
3215)
@@ -705,7 +705,7 @@
[in]  unistr *printername,
[in]  unistr *datatype,
[in]  spoolss_DevmodeContainer devmode_ctr,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[in]  uint32 level,
[in,switch_is(level)] spoolss_UserLevel userlevel,
[out,ref] policy_handle *handle



svn commit: samba r3204 - in branches/SAMBA_4_0/source: build/pidl scripting/swig/torture

2004-10-25 Thread tpot
Author: tpot
Date: 2004-10-25 07:31:59 + (Mon, 25 Oct 2004)
New Revision: 3204

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3204&nolog=1

Log:
Got unpacking of an array of PrinterInfo union elements working.  Phew.

Modified:
   branches/SAMBA_4_0/source/build/pidl/swig.pm
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/swig.pm
===
--- branches/SAMBA_4_0/source/build/pidl/swig.pm2004-10-25 07:24:46 UTC (rev 
3203)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm2004-10-25 07:31:59 UTC (rev 
3204)
@@ -462,61 +462,8 @@
 $result .= "\treturn obj;\n";
 $result .= "}\n\n";
 
-# Generate function to convert DATA_BLOB to Python dict and an array
-# of Python dicts.
-
-if (util::has_property($s->{DATA}, "public")) {
-
-   $result .= "/* Convert a Python string to a struct $s->{NAME} python dict 
*/\n\n";
-   $result .= "NTSTATUS unmarshall_$s->{NAME}(TALLOC_CTX *mem_ctx, DATA_BLOB 
*blob, struct $s->{NAME} *s)\n";
-   $result .= "{\n";
-   $result .= "\tstruct ndr_pull *ndr = ndr_pull_init_blob(blob, mem_ctx);\n";
-   $result .= "\tNTSTATUS result;\n\n";
-   $result .= "\tresult = ndr_pull_struct_blob(blob, mem_ctx, s, 
ndr_pull_$s->{NAME});\n";
-   $result .= "\treturn result;\n";
-   $result .= "}\n\n";
-
-   $result .= "/* Convert a Python string to an array of struct $s->{NAME} python 
dicts */\n\n";
-   $result .= "NTSTATUS unmarshall_$s->{NAME}_array(TALLOC_CTX *mem_ctx, 
DATA_BLOB *blob, uint32 count, struct $s->{NAME} **s)\n";
-   $result .= "{\n";
-   $result .= "\tstruct ndr_pull *ndr = ndr_pull_init_blob(blob, mem_ctx);\n";
-   $result .= "\tNTSTATUS result;\n\n";
-   $result .= "\t*s = talloc(mem_ctx, sizeof(struct $s->{NAME}) * count);\n\n";
-   $result .= "\tresult = ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, *s, 
sizeof(struct $s->{NAME}), count, ndr_pull_$s->{NAME});\n\n";
-   $result .= "\treturn result;\n";
-   $result .= "}\n\n";
-}
-
 $result .= "%}\n\n";
 
-if (util::has_property($s->{DATA}, "public")) {
-
-   $result .= "%typemap(in, numinputs=0) struct $s->{NAME} *EMPTY (struct 
$s->{NAME} temp_$s->{NAME}) {\n";
-   $result .= "\t\$1 = &temp_$s->{NAME};\n";
-   $result .= "}\n\n";
-
-   $result .= "%typemap(argout) struct $s->{NAME} *EMPTY {\n";
-   $result .= "\tTALLOC_CTX *mem_ctx = talloc_init(\"typemap(argout) $s->{NAME} 
*\");\n\n";
-   $result .= "\t\$result = $s->{NAME}_ptr_to_python(mem_ctx, \$1);\n";
-   $result .= "}\n\n";
-
-   $result .= "NTSTATUS unmarshall_$s->{NAME}(TALLOC_CTX *mem_ctx, DATA_BLOB 
*blob, struct $s->{NAME} *EMPTY);\n\n";
-
-   $result .= "%typemap(in, numinputs=0) struct $s->{NAME} **ARRAY (struct 
$s->{NAME} *temp_$s->{NAME}) {\n";
-   $result .= "\t\$1 = &temp_$s->{NAME};\n";
-   $result .= "}\n\n";
-
-   $result .= "%typemap(argout) (uint32 count, struct $s->{NAME} **ARRAY) {\n";
-   $result .= "\tTALLOC_CTX *mem_ctx = talloc_init(\"typemap(argout) $s->{NAME} 
**\");\n";
-   $result .= "\tuint32 i;\n\n";
-   $result .= "\t\$result = PyList_New(\$1);\n\n";
-   $result .= "\tfor (i = 0; i < \$1; i++)\n";
-   $result .= "\t\tPyList_SetItem(\$result, i, 
spoolss_PrinterInfo1_ptr_to_python(mem_ctx, \$2[i]));\n";
-   $result .= "}\n\n";
-
-   $result .= "NTSTATUS unmarshall_$s->{NAME}_array(TALLOC_CTX *mem_ctx, 
DATA_BLOB *blob, uint32 count, struct $s->{NAME} **ARRAY);\n\n";
-}
-
 return $result;
 }
 
@@ -633,8 +580,52 @@
 
 $result .= "}\n\n";
 
+if (util::has_property($u->{DATA}, "public")) {
+
+   # Generate function to unmarshall an array of structures.
+   # Used exclusively (?) in the spoolss pipe.
+
+   $result .= "/* Unmarshall an array of structures from a Python string */\n\n";
+
+   $result .= "NTSTATUS unmarshall_$u->{NAME}_array(DATA_BLOB *blob, TALLOC_CTX 
*mem_ctx, uint32 level, uint32 count, union $u->{NAME} **info)\n";
+   $result .= "{\n";
+   $result .= "\tint i;\n";
+   $result .= "\tstruct ndr_pull *ndr;\n";
+   $result .= "\tndr = ndr_pull_init_blob(blob, mem_ctx);\n";
+   $re

<    1   2   3   4   5   6   7   8   9   10   >