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

2005-03-12 Thread tpot
Author: tpot
Date: 2005-03-13 01:01:24 + (Sun, 13 Mar 2005)
New Revision: 5778

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

Log:
Remove tdb_set_lock_alarm() function from wrappers at tridge's request.

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  2005-03-12 22:24:46 UTC 
(rev 5777)
+++ branches/SAMBA_4_0/source/scripting/swig/tdb.i  2005-03-13 01:01:24 UTC 
(rev 5778)
@@ -35,13 +35,6 @@
 #undef HAVE_FSTAT
 #endif
 
-/* The tdb_set_lock_alarm() function requires the sig_atomic_t type */
-
-#include "include/config.h"
-#if !defined(HAVE_SIG_ATOMIC_T_TYPE)
-typedef int sig_atomic_t
-#endif
-
 #if (__GNUC__ >= 3)
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
@@ -137,7 +130,6 @@
 void tdb_unlockall(TDB_CONTEXT *tdb);
 
 /* Low level locking functions: use with care */
-void tdb_set_lock_alarm(sig_atomic_t *palarm);
 int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
 int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
 



svn commit: lorikeet r245 - in trunk/ethereal: include pidl/ethereal_headers

2005-03-12 Thread tpot
Author: tpot
Date: 2005-03-13 00:34:15 + (Sun, 13 Mar 2005)
New Revision: 245

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

Log:
Move header files to a common directory.

Added:
   trunk/ethereal/include/config.h
   trunk/ethereal/include/epan/
   trunk/ethereal/include/getopt.h
   trunk/ethereal/include/plugins/
   trunk/ethereal/include/svnversion.h
   trunk/ethereal/include/wiretap/
Removed:
   trunk/ethereal/pidl/ethereal_headers/config.h
   trunk/ethereal/pidl/ethereal_headers/epan/
   trunk/ethereal/pidl/ethereal_headers/getopt.h
   trunk/ethereal/pidl/ethereal_headers/plugins/
   trunk/ethereal/pidl/ethereal_headers/svnversion.h
   trunk/ethereal/pidl/ethereal_headers/wiretap/


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


svn commit: lorikeet r244 - in trunk/ethereal: . include pidl

2005-03-12 Thread tpot
Author: tpot
Date: 2005-03-13 00:23:27 + (Sun, 13 Mar 2005)
New Revision: 244

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

Log:
Move ethereal pidl into its own directory.

Added:
   trunk/ethereal/include/
   trunk/ethereal/pidl/
   trunk/ethereal/pidl/Makefile
   trunk/ethereal/pidl/README
   trunk/ethereal/pidl/atsvc.cap
   trunk/ethereal/pidl/dlinklist.h
   trunk/ethereal/pidl/eparser.c
   trunk/ethereal/pidl/eparser.h
   trunk/ethereal/pidl/ethereal-pidl.patch
   trunk/ethereal/pidl/ethereal_headers/
   trunk/ethereal/pidl/libndr.h
   trunk/ethereal/pidl/moduleinfo.c
   trunk/ethereal/pidl/moduleinfo.h
   trunk/ethereal/pidl/pidl.c
   trunk/ethereal/pidl/talloc.c
   trunk/ethereal/pidl/talloc.h
Removed:
   trunk/ethereal/Makefile
   trunk/ethereal/README
   trunk/ethereal/atsvc.cap
   trunk/ethereal/dlinklist.h
   trunk/ethereal/eparser.c
   trunk/ethereal/eparser.h
   trunk/ethereal/ethereal-pidl.patch
   trunk/ethereal/ethereal_headers/
   trunk/ethereal/include/config.h
   trunk/ethereal/include/epan/
   trunk/ethereal/include/getopt.h
   trunk/ethereal/include/plugins/
   trunk/ethereal/include/svnversion.h
   trunk/ethereal/include/wiretap/
   trunk/ethereal/libndr.h
   trunk/ethereal/moduleinfo.c
   trunk/ethereal/moduleinfo.h
   trunk/ethereal/pidl.c
   trunk/ethereal/talloc.c
   trunk/ethereal/talloc.h


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


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

2005-03-12 Thread tpot
Author: tpot
Date: 2005-03-12 22:24:46 + (Sat, 12 Mar 2005)
New Revision: 5777

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

Log:
At some stage SIG_ATOMIC_T was renamed to sig_atomic_t.  This should
fix abartlet's compile problem.

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  2005-03-12 18:03:54 UTC 
(rev 5776)
+++ branches/SAMBA_4_0/source/scripting/swig/tdb.i  2005-03-12 22:24:46 UTC 
(rev 5777)
@@ -35,14 +35,11 @@
 #undef HAVE_FSTAT
 #endif
 
-/* The tdb_set_lock_alarm() function requires the SIG_ATOMIC_T
-   function from includes.h */
+/* The tdb_set_lock_alarm() function requires the sig_atomic_t type */
 
 #include "include/config.h"
-#if defined(HAVE_SIG_ATOMIC_T_TYPE)
-typedef sig_atomic_t SIG_ATOMIC_T;
-#else
-typedef int SIG_ATOMIC_T;
+#if !defined(HAVE_SIG_ATOMIC_T_TYPE)
+typedef int sig_atomic_t
 #endif
 
 #if (__GNUC__ >= 3)
@@ -140,7 +137,7 @@
 void tdb_unlockall(TDB_CONTEXT *tdb);
 
 /* Low level locking functions: use with care */
-void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm);
+void tdb_set_lock_alarm(sig_atomic_t *palarm);
 int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
 int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
 



svn commit: samba r5769 - in branches/SAMBA_4_0/source/lib/ldb/modules: .

2005-03-12 Thread tpot
Author: tpot
Date: 2005-03-12 09:55:08 + (Sat, 12 Mar 2005)
New Revision: 5769

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

Log:
Fix unused variable warning.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/modules/timestamps.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/modules/timestamps.c
===
--- branches/SAMBA_4_0/source/lib/ldb/modules/timestamps.c  2005-03-12 
09:49:48 UTC (rev 5768)
+++ branches/SAMBA_4_0/source/lib/ldb/modules/timestamps.c  2005-03-12 
09:55:08 UTC (rev 5769)
@@ -247,7 +247,7 @@
 
 static int timestamps_destructor(void *module_ctx)
 {
-   struct ldb_module *ctx = module_ctx;
+   /* struct ldb_module *ctx = module_ctx; */
/* put your clean-up functions here */
return 0;
 }



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

2005-03-02 Thread tpot
Author: tpot
Date: 2005-03-03 06:15:13 + (Thu, 03 Mar 2005)
New Revision: 5645

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

Log:
Add an autoconf test for -Wdeclaration-after-statement so we don't add it
to the configure.developer CFLAGS if it's not supported.

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


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2005-03-03 04:16:37 UTC (rev 
5644)
+++ branches/SAMBA_3_0/source/configure.in  2005-03-03 06:15:13 UTC (rev 
5645)
@@ -239,6 +239,22 @@
 [if eval "test x$enable_developer = xyes"; then
 developer=yes
CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes 
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD 
-DDEVELOPER"
+   # Add -Wdeclaration-after-statement if compiler supports it
+   AC_CACHE_CHECK(
+  [that the C compiler understands -Wdeclaration-after-statement],
+  samba_cv_HAVE_Wdeclaration_after_statement, [
+ AC_TRY_RUN_STRICT([
+   int main(void)
+   {
+   return 0;
+   }],[-Wdeclaration-after-statement],[$CPPFLAGS],[$LDFLAGS],
+   samba_cv_HAVE_Wdeclaration_after_statement=yes,
+   samba_cv_HAVE_Wdeclaration_after_statement=no,
+   samba_cv_HAVE_Wdeclaration_after_statement=cross)
+   ])
+   if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then
+   CFLAGS="${CFLAGS} -Wdeclaration-after-statement"
+   fi
 fi])
 
 AC_ARG_ENABLE(krb5developer, [  --enable-krb5developer  Turn on developer 
warnings and debugging, except -Wstrict-prototypes (default=no)],

Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2005-03-03 04:16:37 UTC (rev 5644)
+++ trunk/source/configure.in   2005-03-03 06:15:13 UTC (rev 5645)
@@ -240,6 +240,22 @@
 [if eval "test x$enable_developer = xyes"; then
 developer=yes
CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes 
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD 
-DDEVELOPER"
+   # Add -Wdeclaration-after-statement if compiler supports it
+   AC_CACHE_CHECK(
+  [that the C compiler understands -Wdeclaration-after-statement],
+  samba_cv_HAVE_Wdeclaration_after_statement, [
+ AC_TRY_RUN_STRICT([
+   int main(void)
+   {
+   return 0;
+   }],[-Wdeclaration-after-statement],[$CPPFLAGS],[$LDFLAGS],
+   samba_cv_HAVE_Wdeclaration_after_statement=yes,
+   samba_cv_HAVE_Wdeclaration_after_statement=no,
+   samba_cv_HAVE_Wdeclaration_after_statement=cross)
+   ])
+   if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then
+   CFLAGS="${CFLAGS} -Wdeclaration-after-statement"
+   fi
 fi])
 
 AC_ARG_ENABLE(krb5developer, [  --enable-krb5developer  Turn on developer 
warnings and debugging, except -Wstrict-prototypes (default=no)],



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

2005-03-01 Thread tpot
Author: tpot
Date: 2005-03-02 00:33:40 + (Wed, 02 Mar 2005)
New Revision: 5612

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

Log:
Add -Wdeclaration-after-statement to CFLAGS for --enable-developer.

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


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2005-03-02 00:15:06 UTC (rev 
5611)
+++ branches/SAMBA_3_0/source/configure.in  2005-03-02 00:33:40 UTC (rev 
5612)
@@ -238,7 +238,7 @@
 AC_ARG_ENABLE(developer, [  --enable-developer  Turn on developer warnings 
and debugging (default=no)],
 [if eval "test x$enable_developer = xyes"; then
 developer=yes
-   CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes 
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD 
-DDEVELOPER"
+   CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes 
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings 
-Wdeclaration-after-statement -DDEBUG_PASSWORD -DDEVELOPER"
 fi])
 
 AC_ARG_ENABLE(krb5developer, [  --enable-krb5developer  Turn on developer 
warnings and debugging, except -Wstrict-prototypes (default=no)],

Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2005-03-02 00:15:06 UTC (rev 5611)
+++ trunk/source/configure.in   2005-03-02 00:33:40 UTC (rev 5612)
@@ -239,7 +239,7 @@
 AC_ARG_ENABLE(developer, [  --enable-developer  Turn on developer warnings 
and debugging (default=no)],
 [if eval "test x$enable_developer = xyes"; then
 developer=yes
-   CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes 
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD 
-DDEVELOPER"
+   CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes 
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings 
-Wdeclaration-after-statement -DDEBUG_PASSWORD -DDEVELOPER"
 fi])
 
 AC_ARG_ENABLE(krb5developer, [  --enable-krb5developer  Turn on developer 
warnings and debugging, except -Wstrict-prototypes (default=no)],



svn commit: samba r5609 - in branches/tmp: .

2005-03-01 Thread tpot
Author: tpot
Date: 2005-03-01 23:36:36 + (Tue, 01 Mar 2005)
New Revision: 5609

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

Log:
Remove abartlet's old branch.

Removed:
   branches/tmp/abartlet-4_0/


Changeset:


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

2005-02-24 Thread tpot
Author: tpot
Date: 2005-02-25 06:26:11 + (Fri, 25 Feb 2005)
New Revision: 5554

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

Log:
Constants and untested IDL for spoolss_SetPrinter()

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.idl2005-02-25 06:16:13 UTC 
(rev 5553)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2005-02-25 06:26:11 UTC 
(rev 5554)
@@ -343,9 +343,23 @@
WERROR spoolss_DeletePrinter(
);
 
+   typedef [v1_enum] enum {
+   SPOOLSS_PRINTER_CONTROL_UNPAUSE= 0,
+   SPOOLSS_PRINTER_CONTROL_PAUSE  = 1,
+   SPOOLSS_PRINTER_CONTROL_RESUME = 2,
+   SPOOLSS_PRINTER_CONTROL_PURGE  = 3,
+   SPOOLSS_PRINTER_CONTROL_SET_STATUS = 4
+   } spoolss_PrinterControl;
+
/**/
/* Function: 0x07 */
WERROR spoolss_SetPrinter(
+   [in,ref] policy_handle *handle,
+   [in] uint32 level,
+   [in,subcontext(4),switch_is(level)] spoolss_PrinterInfo *info,
+   [in] spoolss_DevmodeContainer devmode_ctr,
+   [in,relative,subcontext(0)] security_descriptor *secdesc,
+   [in] spoolss_PrinterControl command
);
 
/**/



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

2005-02-24 Thread tpot
Author: tpot
Date: 2005-02-25 06:16:13 + (Fri, 25 Feb 2005)
New Revision: 5553

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

Log:
Add idl and test for spoolss_AddPort().  It always seems to return
WERR_NOT_SUPPORTED though.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
   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.idl2005-02-25 05:39:01 UTC 
(rev 5552)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl2005-02-25 06:16:13 UTC 
(rev 5553)
@@ -712,6 +712,9 @@
/**/
/* Function: 0x25 */
WERROR spoolss_AddPort(
+  [in] unistr *server_name,
+  [in] uint32 unknown,
+  [in] unistr monitor_name
);
 
/**/

Modified: branches/SAMBA_4_0/source/torture/rpc/spoolss.c
===
--- branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2005-02-25 05:39:01 UTC 
(rev 5552)
+++ branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2005-02-25 06:16:13 UTC 
(rev 5553)
@@ -303,7 +303,7 @@
status = dcerpc_spoolss_EnumPorts(p, mem_ctx, &r);
 
if (!NT_STATUS_IS_OK(status)) {
-   printf("EnumPorts failed -- %s\n", nt_errstr(status));
+   printf("EnumPorts failed - %s\n", nt_errstr(status));
return False;
}
 
@@ -316,7 +316,7 @@
status = dcerpc_spoolss_EnumPorts(p, mem_ctx, &r);
 
if (!NT_STATUS_IS_OK(status)) {
-   printf("EnumPorts failed -- %s\n", nt_errstr(status));
+   printf("EnumPorts failed - %s\n", nt_errstr(status));
return False;
}
 
@@ -329,6 +329,39 @@
return True;
 }
 
+static BOOL test_AddPort(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+   NTSTATUS status;
+   struct spoolss_AddPort r;
+
+   r.in.server_name = talloc_asprintf(mem_ctx, "%s", 
+  dcerpc_server_name(p));
+   r.in.unknown = 0;
+   r.in.monitor_name = "foo";
+
+   printf ("Testing AddPort\n");
+
+   status = dcerpc_spoolss_AddPort(p, mem_ctx, &r);
+
+   if (!NT_STATUS_IS_OK(status)) {
+   printf("AddPort failed - %s\n", nt_errstr(status));
+   return False;
+   }
+
+   /* win2k3 returns WERR_NOT_SUPPORTED */
+
+#if 0
+
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("AddPort failed - %s\n", win_errstr(r.out.result));
+   return False;
+   }
+
+#endif
+
+   return True;
+}
+
 static BOOL test_GetJob(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
  struct policy_handle *handle, uint32_t job_id)
 {
@@ -1095,6 +1128,8 @@
 
ret &= test_OpenPrinter_badnames(p, mem_ctx);
 
+   ret &= test_AddPort(p, mem_ctx);
+
ret &= test_EnumPorts(p, mem_ctx);
 
ret &= test_EnumPrinters(p, mem_ctx);



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

2005-02-24 Thread tpot
Author: tpot
Date: 2005-02-25 05:39:01 + (Fri, 25 Feb 2005)
New Revision: 5552

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

Log:
Don't try to read the value of r.out.result when the dcerpc client
function returns non-OK.  If a non-OK status is returned then some or
all or r.out is likely to be uninitialised.

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/spoolss.c
===
--- branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2005-02-25 05:25:17 UTC 
(rev 5551)
+++ branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2005-02-25 05:39:01 UTC 
(rev 5552)
@@ -55,13 +55,18 @@
status = dcerpc_spoolss_GetPrinter(p, mem_ctx, &r);
}

-   if (!NT_STATUS_IS_OK(status) ||
-   !W_ERROR_IS_OK(r.out.result)) {
-   printf("GetPrinter failed - %s/%s\n", 
-  nt_errstr(status), win_errstr(r.out.result));
+   if (!NT_STATUS_IS_OK(status)) {
+   printf("GetPrinter failed - %s\n", nt_errstr(status));
ret = False;
continue;
}
+   
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("GetPrinter failed - %s\n", 
+  win_errstr(r.out.result));
+   ret = False;
+   continue;
+   }
}
 
return ret;
@@ -174,12 +179,16 @@
}
}
 
-   if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
-   printf("EnumForms failed - %s/%s\n", 
-  nt_errstr(status), win_errstr(r.out.result));
+   if (!NT_STATUS_IS_OK(status)) {
+   printf("EnumForms failed - %s\n", nt_errstr(status));
return False;
}
 
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("EnumForms failed - %s\n", win_errstr(r.out.result));
+   return False;
+   }
+
return True;
 }
 
@@ -195,12 +204,16 @@
 
status = dcerpc_spoolss_DeleteForm(p, mem_ctx, &r);
 
-   if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
-   printf("DeleteForm failed - %s/%s\n", 
-  nt_errstr(status), win_errstr(r.out.result));
+   if (!NT_STATUS_IS_OK(status)) {
+   printf("DeleteForm failed - %s\n", nt_errstr(status));
return False;
}
 
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("DeleteForm failed - %s\n", win_errstr(r.out.result));
+   return False;
+   }
+
return True;
 }
 
@@ -248,12 +261,18 @@
 
status = dcerpc_spoolss_SetForm(p, mem_ctx, &sf);
 
-   if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
-   printf("SetForm failed - %s/%s\n", 
-  nt_errstr(status), win_errstr(r.out.result));
+   if (!NT_STATUS_IS_OK(status)) {
+   printf("SetForm failed - %s\n", nt_errstr(status));
ret = False;
-   /* Fall through to delete */
+   goto done;
}
+
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("SetForm failed - %s\n", 
+  win_errstr(r.out.result));
+   ret = False;
+   goto done;
+   }
}
 
  done:
@@ -454,11 +473,17 @@
 
status = dcerpc_spoolss_GetPrinterData(p, mem_ctx, &r);
 
-   if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
-   printf("GetPrinterData failed - %s/%s\n", 
-  nt_errstr(status), win_errstr(r.out.result));
+   if (!NT_STATUS_IS_OK(status)) {
+   printf("GetPrinterData failed - %s\n", 
+  nt_errstr(status));
return False;
}
+
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("GetPrinterData failed - %s\n", 
+  win_errstr(r.out.result));
+   return False;
+   }
}
 
return True;
@@ -496,11 +521,17 @@
 
status = dcerpc_spoolss_GetPrinterDataEx(p, mem_ctx, &r);
 
-   if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
-   printf("GetPrinterDataEx failed - %s/%s\n", 
-  nt_errstr(stat

svn commit: samba r5551 - in branches/SAMBA_4_0/source/libcli/resolve: .

2005-02-24 Thread tpot
Author: tpot
Date: 2005-02-25 05:25:17 + (Fri, 25 Feb 2005)
New Revision: 5551

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

Log:
Protect against falling off the end of the name resolve order list
if a name is not found.

Modified:
   branches/SAMBA_4_0/source/libcli/resolve/resolve.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/resolve/resolve.c
===
--- branches/SAMBA_4_0/source/libcli/resolve/resolve.c  2005-02-25 04:59:46 UTC 
(rev 5550)
+++ branches/SAMBA_4_0/source/libcli/resolve/resolve.c  2005-02-25 05:25:17 UTC 
(rev 5551)
@@ -101,7 +101,7 @@
if (method) {
req = method->send_fn(&state->name, c->event_ctx);
}
-   if (req == NULL) state->methods++;
+   if (req == NULL && state->methods[0]) state->methods++;
} while (!req && state->methods[0]);
 
if (req) {



svn commit: samba r5550 - in branches/SAMBA_4_0/source/libcli/resolve: .

2005-02-24 Thread tpot
Author: tpot
Date: 2005-02-25 04:59:46 + (Fri, 25 Feb 2005)
New Revision: 5550

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

Log:
Initialise retry count - valgrind was freaking out because this value
was not set.

Modified:
   branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c
===
--- branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c  2005-02-25 02:22:57 UTC 
(rev 5549)
+++ branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c  2005-02-25 04:59:46 UTC 
(rev 5550)
@@ -129,6 +129,7 @@
state->io_queries[i].in.wins_lookup = wins_lookup;
state->io_queries[i].in.timeout = lp_parm_int(-1, "nbt", 
"timeout", 3);
 
+   state->io_queries[i].in.retries = 0;
state->queries[i] = nbt_name_query_send(state->nbtsock, 
&state->io_queries[i]);
if (!state->queries[i]) goto failed;
 



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

2005-02-12 Thread tpot
Author: tpot
Date: 2005-02-13 00:59:26 + (Sun, 13 Feb 2005)
New Revision: 5369

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

Log:
Rename torture modules so they don't conflict with files in scripting/swig.

Start porting samr torture test to new API.

Added:
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_samr.py
Removed:
   branches/SAMBA_4_0/source/scripting/swig/torture/samr.py
Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/pytorture


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


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

2005-02-12 Thread tpot
Author: tpot
Date: 2005-02-13 00:58:28 + (Sun, 13 Feb 2005)
New Revision: 5368

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

Log:
Fix ups for domain_name field name change.

Implement GetDomPwInfo(), CreateUser2(), RemoveMemberFromForeignDomain(),
DeleteUser().

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.py2005-02-13 00:52:45 UTC 
(rev 5367)
+++ branches/SAMBA_4_0/source/scripting/swig/samr.py2005-02-13 00:58:28 UTC 
(rev 5368)
@@ -93,6 +93,7 @@
 """Wrap up a RPC call and throw an exception is an error was returned."""
 
 result = fn(pipe, args);
+
 if result & 0xc000:
 raise dcerpc.NTSTATUS(result, dcerpc.nt_errstr(result));
 
@@ -146,7 +147,7 @@
 
 r = dcerpc.samr_EnumDomains()
 r.data_in.connect_handle = self.handle
-r.data_in.resume_handle = 1
+r.data_in.resume_handle = 0
 r.data_in.buf_size = -1
 
 domains = []
@@ -169,8 +170,8 @@
 
 r = dcerpc.samr_LookupDomain()
 r.data_in.connect_handle = self.handle
-r.data_in.domain = dcerpc.samr_String()
-r.data_in.domain.string = domain_name
+r.data_in.domain_name = dcerpc.samr_String()
+r.data_in.domain_name.string = domain_name
 
 call_fn(dcerpc.dcerpc_samr_LookupDomain, self.pipe, r)
 
@@ -194,7 +195,17 @@
 
 call_fn(dcerpc.dcerpc_samr_Shutdown, self.pipe, r)
 
+def GetDomPwInfo(self, system_name):
 
+r = dcerpc.samr_GetDomPwInfo()
+r.data_in.domain_name = dcerpc.samr_String()
+r.data_in.domain_name.string = system_name
+
+call_fn(dcerpc.dcerpc_samr_GetDomPwInfo, self.pipe, r)
+
+return r.data_out.info
+
+
 class DomainHandle(SamrHandle):
 
 def QueryDomainInfo(self, level = 2):
@@ -286,7 +297,23 @@
 
 return (r.data_out.user_handle,
 dcerpc.uint32_array_getitem(r.data_out.rid, 0))
-
+
+def CreateUser2(self, account_name, acct_flags = 0x0010,
+access_mask = 0x0200):
+
+r = dcerpc.samr_CreateUser2()
+r.data_in.domain_handle = self.handle
+r.data_in.account_name = dcerpc.samr_String()
+r.data_in.account_name.string = account_name
+r.data_in.acct_flags = acct_flags
+r.data_in.access_mask = access_mask
+
+call_fn(dcerpc.dcerpc_samr_CreateUser2, self.pipe, r)
+
+return (r.data_out.user_handle,
+dcerpc.uint32_array_getitem(r.data_out.access_granted, 0),
+dcerpc.uint32_array_getitem(r.data_out.rid, 0))
+
 def OpenUser(self, rid, access_mask = 0x0200):
 
 r = dcerpc.samr_OpenUser()
@@ -329,9 +356,23 @@
 
 return sid_to_string(r.data_out.sid)
 
+def RemoveMemberFromForeignDomain(self, sid):
 
+r = dcerpc.samr_RemoveMemberFromForeignDomain()
+r.data_in.domain_handle = self.handle
+r.data_in.sid = sid
+
+call_fn(dcerpc.dcerpc_samr_RemoveMemberFromForeignDomain, self.pipe, r)
+
+
 class UserHandle(SamrHandle):
-pass
+
+def DeleteUser(self):
+
+r = dcerpc.samr_DeleteUser()
+r.data_in.user_handle = self.handle
+
+call_fn(dcerpc.dcerpc_samr_DeleteUser, self.pipe, r)
 
 
 class GroupHandle(SamrHandle):
@@ -353,6 +394,7 @@
 
 return ConnectHandle(pipe, r.data_out.connect_handle)
 
+
 def Connect2(pipe, system_name = '', access_mask = 0x0200):
 """Connect to the SAMR pipe."""
 
@@ -364,6 +406,7 @@
 
 return ConnectHandle(pipe, r.data_out.connect_handle)
 
+
 def Connect3(pipe, system_name = '', access_mask = 0x0200):
 
 r = dcerpc.samr_Connect3()
@@ -375,6 +418,7 @@
 
 return ConnectHandle(pipe, r.data_out.connect_handle)
 
+
 def Connect4(pipe, system_name = '', access_mask = 0x0200):
 
 r = dcerpc.samr_Connect4()
@@ -386,6 +430,7 @@
 
 return ConnectHandle(pipe, r.data_out.connect_handle)
 
+
 def Connect5(pipe, system_name = '', access_mask = 0x0200):
 
 r = dcerpc.samr_Connect5()
@@ -418,7 +463,6 @@
 # AddAliasMember
 # DeleteAliasMember
 # GetMembersinAlias
-# DeleteUser
 # QueryUserInfo
 # SetUserInfo
 # ChangePasswordUser
@@ -433,13 +477,11 @@
 # QueryUserInfo2
 # QueryDisplayInfo2
 # GetDisplayEnumerationIndex2
-# CreateUser2
 # QueryDisplayInfo3
 # AddMultipleMembersToAlias
 # RemoveMultipleMembersFromAlias
 # OemChangePasswordUser2
 # ChangePasswordUser2
-# GetDomPwInfo
 # SetUserInfo2
 # SetBootKeyInformation
 # GetBootKeyInformation



svn commit: samba r5364 - in branches/SAMBA_4_0/source: libnet librpc/idl rpc_server/samr torture/rpc

2005-02-12 Thread tpot
Author: tpot
Date: 2005-02-13 00:26:43 + (Sun, 13 Feb 2005)
New Revision: 5364

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

Log:
Rename string fields called 'domain' and 'name' to be 'domain_name'.
Modified:
   branches/SAMBA_4_0/source/libnet/libnet_join.c
   branches/SAMBA_4_0/source/libnet/libnet_passwd.c
   branches/SAMBA_4_0/source/librpc/idl/samr.idl
   branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
   branches/SAMBA_4_0/source/torture/rpc/samr.c
   branches/SAMBA_4_0/source/torture/rpc/samsync.c
   branches/SAMBA_4_0/source/torture/rpc/schannel.c
   branches/SAMBA_4_0/source/torture/rpc/testjoin.c
   branches/SAMBA_4_0/source/torture/rpc/xplogin.c


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


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

2005-02-11 Thread tpot
Author: tpot
Date: 2005-02-12 01:05:16 + (Sat, 12 Feb 2005)
New Revision: 5353

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

Log:
Throw a NTSTATUS exception if a NT error code is returned.

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.py2005-02-12 01:00:15 UTC 
(rev 5352)
+++ branches/SAMBA_4_0/source/scripting/swig/samr.py2005-02-12 01:05:16 UTC 
(rev 5353)
@@ -89,6 +89,16 @@
 return sid
 
 
+def call_fn(fn, pipe, args):
+"""Wrap up a RPC call and throw an exception is an error was returned."""
+
+result = fn(pipe, args);
+if result & 0xc000:
+raise dcerpc.NTSTATUS(result, dcerpc.nt_errstr(result));
+
+return result;
+
+
 class SamrHandle:
 
 def __init__(self, pipe, handle):
@@ -106,7 +116,7 @@
 r = dcerpc.samr_Close()
 r.data_in.handle = self.handle
 
-dcerpc.dcerpc_samr_Close(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_Close, self.pipe, r)
 
 self.handle = None
 
@@ -116,7 +126,7 @@
 r.data_in.handle = self.handle
 r.data_in.sec_info = sec_info
 
-result = dcerpc.dcerpc_samr_QuerySecurity(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_QuerySecurity, self.pipe, r)
 
 return r.data_out.sdbuf
 
@@ -127,7 +137,7 @@
 r.data_in.sec_info = sec_info
 r.data_in.sdbuf = sdbuf
 
-result = dcerpc.dcerpc_samr_SetSecurity(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_SetSecurity, self.pipe, r)
 
 
 class ConnectHandle(SamrHandle):
@@ -143,7 +153,7 @@
 
 while 1:
 
-result = dcerpc.dcerpc_samr_EnumDomains(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_EnumDomains, self.pipe, r)
 
 for i in range(r.data_out.sam.count):
 domains.append(dcerpc.samr_SamEntry_array_getitem(
@@ -162,7 +172,7 @@
 r.data_in.domain = dcerpc.samr_String()
 r.data_in.domain.string = domain_name
 
-result = dcerpc.dcerpc_samr_LookupDomain(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_LookupDomain, self.pipe, r)
 
 return sid_to_string(r.data_out.sid);
 
@@ -173,7 +183,7 @@
 r.data_in.access_mask = access_mask
 r.data_in.sid = string_to_sid(domain_sid)
 
-result = dcerpc.dcerpc_samr_OpenDomain(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_OpenDomain, self.pipe, r)
 
 return DomainHandle(self.pipe, r.data_out.domain_handle)
 
@@ -182,7 +192,7 @@
 r = dcerpc.samr_Shutdown()
 r.data_in.connect_handle = self.handle
 
-result = dcerpc.dcerpc_samr_Shutdown(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_Shutdown, self.pipe, r)
 
 
 class DomainHandle(SamrHandle):
@@ -193,7 +203,7 @@
 r.data_in.domain_handle = self.handle
 r.data_in.level = level
 
-result = dcerpc.dcerpc_samr_QueryDomainInfo(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_QueryDomainInfo, self.pipe, r)
 
 return getattr(r.data_out.info, 'info%d' % level)
 
@@ -203,7 +213,7 @@
 r.data_in.domain_handle = self.handle
 r.data_in.level = level
 
-result = dcerpc.dcerpc_samr_QueryDomainInfo2(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_QueryDomainInfo2, self.pipe, r)
 
 return getattr(r.data_out.info, 'info%d' % level)   
 
@@ -214,7 +224,7 @@
 r.data_in.resume_handle = 0
 r.data_in.max_size = 1000
 
-result = dcerpc.dcerpc_samr_EnumDomainGroups(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_EnumDomainGroups, self.pipe, r)
 
 groups = []
 
@@ -234,7 +244,7 @@
 # no meaning so use 0x like W2K
 r.data_in.acct_flags = 0xL
 
-result = dcerpc.dcerpc_samr_EnumDomainAliases(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_EnumDomainAliases, self.pipe, r)
 
 aliases = []
 
@@ -253,7 +263,7 @@
 r.data_in.acct_flags = user_account_flags
 r.data_in.max_size = 1000
 
-result = dcerpc.dcerpc_samr_EnumDomainUsers(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_EnumDomainUsers, self.pipe, r)
 
 users = []
 
@@ -272,7 +282,7 @@
 r.data_in.account_name.string = account_name
 r.data_in.access_mask = access_mask
 
-result = dcerpc.dcerpc_samr_CreateUser(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_CreateUser, self.pipe, r)
 
 return (r.data_out.user_handle,
 dcerpc.uint32_array_getitem(r.data_out.rid, 0))
@@ -284,7 +294,7 @@
 r.data_in.access_mask = access_mask
 r.data_in.rid = rid
 
-result = dcerpc.dcerpc_samr_OpenUser(self.pipe, r)
+call_fn(dcerpc.dcerpc_samr_OpenUser, self.pipe, r)
 
 retu

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

2005-02-11 Thread tpot
Author: tpot
Date: 2005-02-12 00:54:11 + (Sat, 12 Feb 2005)
New Revision: 5351

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

Log:
Add wrapper for nt_errstr and array functions for samr_ConnectInfo.

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-02-12 00:53:32 UTC 
(rev 5350)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-02-12 00:54:11 UTC 
(rev 5351)
@@ -169,6 +169,8 @@
 
 const char *dcerpc_server_name(struct dcerpc_pipe *p);
 
+char *nt_errstr(NTSTATUS nt_code);
+
 /* Some typemaps for easier access to resume handles.  Really this can
also be done using the uint32 carray functions, but it's a bit of a
hassle.  TODO: Fix memory leak here. */
@@ -228,6 +230,7 @@
them all by hand. */
 
 %array_functions(struct samr_SamEntry, samr_SamEntry_array);
+%array_functions(union samr_ConnectInfo, samr_ConnectInfo_array);
 
 %include "librpc/gen_ndr/misc.i"
 %include "librpc/gen_ndr/security.i"


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

2005-02-11 Thread tpot
Author: tpot
Date: 2005-02-12 00:53:32 + (Sat, 12 Feb 2005)
New Revision: 5350

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

Log:
Implement an input typemap for NTSTATUS.

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.i2005-02-12 00:51:31 UTC 
(rev 5349)
+++ branches/SAMBA_4_0/source/scripting/swig/samba.i2005-02-12 00:53:32 UTC 
(rev 5350)
@@ -46,6 +46,17 @@
$result = PyLong_FromUnsignedLong($1);
 }
 
+%typemap(in) NTSTATUS {
+   if (PyLong_Check($input))
+   $1 = NT_STATUS(PyLong_AsUnsignedLong($input));
+   else if (PyInt_Check($input))
+   $1 = NT_STATUS(PyInt_AsLong($input));
+   else {
+   PyErr_SetString(PyExc_TypeError, "Expected a long or an int");
+   return NULL;
+   }
+}
+
 %typemap(out) NTSTATUS {
 $result = PyLong_FromUnsignedLong(NT_STATUS_V($1));
 }


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

2005-02-11 Thread tpot
Author: tpot
Date: 2005-02-12 00:40:00 + (Sat, 12 Feb 2005)
New Revision: 5348

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

Log:
Implement the remaining samr connect functions and fix up setsecurity.

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.py2005-02-11 23:55:15 UTC 
(rev 5347)
+++ branches/SAMBA_4_0/source/scripting/swig/samr.py2005-02-12 00:40:00 UTC 
(rev 5348)
@@ -118,15 +118,18 @@
 
 result = dcerpc.dcerpc_samr_QuerySecurity(self.pipe, r)
 
-return r.data_out.sdbuf.sd
+return r.data_out.sdbuf
 
-def SetSecurity(self, sec_info = 7):
+def SetSecurity(self, sdbuf, sec_info = 7):
 
 r = dcerpc.samr_SetSecurity()
 r.data_in.handle = self.handle
 r.data_in.sec_info = sec_info
+r.data_in.sdbuf = sdbuf
 
+result = dcerpc.dcerpc_samr_SetSecurity(self.pipe, r)
 
+
 class ConnectHandle(SamrHandle):
 
 def EnumDomains(self):
@@ -329,6 +332,17 @@
 pass
 
 
+def Connect(pipe, access_mask = 0x0200):
+
+r = dcerpc.samr_Connect()
+r.data_in.system_name = dcerpc.new_uint16_array(1)
+dcerpc.uint16_array_setitem(r.data_in.system_name, 0, ord('\\'))
+r.data_in.access_mask = access_mask
+
+result = dcerpc.dcerpc_samr_Connect(pipe, r)
+
+return ConnectHandle(pipe, r.data_out.connect_handle)
+
 def Connect2(pipe, system_name = '', access_mask = 0x0200):
 """Connect to the SAMR pipe."""
 
@@ -340,6 +354,43 @@
 
 return ConnectHandle(pipe, r.data_out.connect_handle)
 
+def Connect3(pipe, system_name = '', access_mask = 0x0200):
+
+r = dcerpc.samr_Connect3()
+r.data_in.system_name = system_name
+r.data_in.unknown = 0
+r.data_in.access_mask = access_mask
+
+result = dcerpc.dcerpc_samr_Connect3(pipe, r)
+
+return ConnectHandle(pipe, r.data_out.connect_handle)
+
+def Connect4(pipe, system_name = '', access_mask = 0x0200):
+
+r = dcerpc.samr_Connect4()
+r.data_in.system_name = system_name
+r.data_in.unknown = 0
+r.data_in.access_mask = access_mask
+
+result = dcerpc.dcerpc_samr_Connect4(pipe, r)
+
+return ConnectHandle(pipe, r.data_out.connect_handle)
+
+def Connect5(pipe, system_name = '', access_mask = 0x0200):
+
+r = dcerpc.samr_Connect5()
+r.data_in.system_name = system_name
+r.data_in.access_mask = access_mask
+r.data_in.level = 1
+r.data_in.info = dcerpc.new_samr_ConnectInfo_array(1)
+r.data_in.info.unknown1 = 0
+r.data_in.info.unknown2 = 0
+
+result = dcerpc.dcerpc_samr_Connect5(pipe, r)
+
+return ConnectHandle(pipe, r.data_out.connect_handle)
+
+
 # CreateDomainGroup
 # CreateDomAlias
 # GetAliasMembership
@@ -379,13 +430,9 @@
 # OemChangePasswordUser2
 # ChangePasswordUser2
 # GetDomPwInfo
-# Connect
 # SetUserInfo2
 # SetBootKeyInformation
 # GetBootKeyInformation
-# Connect3
-# Connect4
 # ChangePasswordUser3
-# Connect5
 # SetDsrmPassword
 # ValidatePassword


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

2005-02-11 Thread tpot
Author: tpot
Date: 2005-02-11 11:18:19 + (Fri, 11 Feb 2005)
New Revision: 5335

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

Log:
Add a Close() method to SamrHandle object.

Add methods for {Query,Set}Security, Shutdown, CreateUser,
Open{User,Group,Alias} and RidToSid.

Time for a torture test I think!

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.py2005-02-11 10:50:54 UTC 
(rev 5334)
+++ branches/SAMBA_4_0/source/scripting/swig/samr.py2005-02-11 11:18:19 UTC 
(rev 5335)
@@ -98,12 +98,35 @@
 
 def __del__(self):
 
+if self.handle is not None:
+self.Close()
+
+def Close(self):
+
 r = dcerpc.samr_Close()
 r.data_in.handle = self.handle
 
 dcerpc.dcerpc_samr_Close(self.pipe, r)
 
+self.handle = None
 
+def QuerySecurity(self, sec_info = 7):
+
+r = dcerpc.samr_QuerySecurity()
+r.data_in.handle = self.handle
+r.data_in.sec_info = sec_info
+
+result = dcerpc.dcerpc_samr_QuerySecurity(self.pipe, r)
+
+return r.data_out.sdbuf.sd
+
+def SetSecurity(self, sec_info = 7):
+
+r = dcerpc.samr_SetSecurity()
+r.data_in.handle = self.handle
+r.data_in.sec_info = sec_info
+
+
 class ConnectHandle(SamrHandle):
 
 def EnumDomains(self):
@@ -151,7 +174,14 @@
 
 return DomainHandle(self.pipe, r.data_out.domain_handle)
 
+def Shutdown(self):
 
+r = dcerpc.samr_Shutdown()
+r.data_in.connect_handle = self.handle
+
+result = dcerpc.dcerpc_samr_Shutdown(self.pipe, r)
+
+
 class DomainHandle(SamrHandle):
 
 def QueryDomainInfo(self, level = 2):
@@ -231,8 +261,75 @@
 
 return users
 
+def CreateUser(self, account_name, access_mask = 0x0200):
 
-def Connect(pipe, system_name = '', access_mask = 0x0200):
+r = dcerpc.samr_CreateUser()
+r.data_in.domain_handle = self.handle
+r.data_in.account_name = dcerpc.samr_String()
+r.data_in.account_name.string = account_name
+r.data_in.access_mask = access_mask
+
+result = dcerpc.dcerpc_samr_CreateUser(self.pipe, r)
+
+return (r.data_out.user_handle,
+dcerpc.uint32_array_getitem(r.data_out.rid, 0))
+
+def OpenUser(self, rid, access_mask = 0x0200):
+
+r = dcerpc.samr_OpenUser()
+r.data_in.domain_handle = self.handle
+r.data_in.access_mask = access_mask
+r.data_in.rid = rid
+
+result = dcerpc.dcerpc_samr_OpenUser(self.pipe, r)
+
+return UserHandle(pipe, r.data_out.user_handle)
+
+def OpenGroup(self, rid, access_mask = 0x0200):
+
+r = dcerpc.samr_OpenGroup()
+r.data_in.domain_handle = self.handle
+r.data_in.access_mask = access_mask
+r.data_in.rid = rid
+
+result = dcerpc.dcerpc_samr_OpenGroup(self.pipe, r)
+
+return GroupHandle(pipe, r.data_out.group_handle)
+
+def OpenAlias(self, rid, access_mask = 0x0200):
+
+r = dcerpc.samr_OpenAlias()
+r.data_in.domain_handle = self.handle
+r.data_in.access_mask = access_mask
+r.data_in.rid = rid
+
+result = dcerpc.dcerpc_samr_OpenAlias(self.pipe, r)
+
+return AliasHandle(pipe, r.data_out.group_handle)
+
+def RidToSid(self, rid):
+
+r = dcerpc.samr_RidToSid()
+r.data_in.domain_handle = self.handle
+
+result = dcerpc.dcerpc_samr_RidToSid(self.pipe, r)
+
+return sid_to_string(r.data_out.sid)
+
+
+class UserHandle(SamrHandle):
+pass
+
+
+class GroupHandle(SamrHandle):
+pass
+
+
+class AliasHandle(SamrHandle):
+pass
+
+
+def Connect2(pipe, system_name = '', access_mask = 0x0200):
 """Connect to the SAMR pipe."""
 
 r = dcerpc.samr_Connect2()
@@ -242,3 +339,53 @@
 result = dcerpc.dcerpc_samr_Connect2(pipe, r)
 
 return ConnectHandle(pipe, r.data_out.connect_handle)
+
+# CreateDomainGroup
+# CreateDomAlias
+# GetAliasMembership
+# LookupNames
+# QueryGroupInfo
+# SetGroupInfo
+# AddGroupMember
+# DeleteDomainGroup
+# DeleteGroupMember
+# QueryGroupMember
+# SetMemberAttributesofGroup
+# QueryAliasInfo
+# SetAliasInfo
+# DeleteDomAlias
+# AddAliasMember
+# DeleteAliasMember
+# GetMembersinAlias
+# DeleteUser
+# QueryUserInfo
+# SetUserInfo
+# ChangePasswordUser
+# GetGroupsForUser
+# QueryDisplayInfo
+# GetDisplayEnumerationIndex
+# TestPrivateFunctionsDomain
+# TestPrivateFunctionsUser
+# GetUserPwInfo
+# RemoveMemberFromForeignDomain
+# QueryDomainInfo2
+# QueryUserInfo2
+# QueryDisplayInfo2
+# GetDisplayEnumerationIndex2
+# CreateUser2
+# QueryDisplayInfo3
+# AddMultipleMembersToAlias
+# RemoveMultipleMembersFromAlias
+# Oem

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

2005-02-09 Thread tpot
Author: tpot
Date: 2005-02-10 03:19:21 + (Thu, 10 Feb 2005)
New Revision: 5293

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

Log:
Map an empty policy handle to None when creating policy handles, and
refuse to accept None as a policy handle when accepting them.  Now we
don't segfault after running the samr_Shutdown() test.

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-02-10 03:16:33 UTC 
(rev 5292)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-02-10 03:19:21 UTC 
(rev 5293)
@@ -182,14 +182,31 @@
$result = PyLong_FromLong(*$1);
 }
 
+%typemap(in) struct policy_handle * {
+
+   if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,
+SWIG_POINTER_EXCEPTION)) == -1) 
+   return NULL;
+
+   if ($1 == NULL) {
+   PyErr_SetString(PyExc_TypeError, "None is not a valid policy 
handle");
+   return NULL;
+   }
+}
+
 /* When returning a policy handle to Python we need to make a copy of
as the talloc context it is created under is destroyed after the
wrapper function returns.  TODO: Fix memory leak created here. */
 
 %typemap(out) struct policy_handle * {
-   struct policy_handle *temp = (struct policy_handle 
*)malloc(sizeof(struct policy_handle));
-   memcpy(temp, $1, sizeof(struct policy_handle));
-   $result = SWIG_NewPointerObj(temp, SWIGTYPE_p_policy_handle, 0);
+   if ($1) {
+   struct policy_handle *temp = (struct policy_handle 
*)malloc(sizeof(struct policy_handle));
+   memcpy(temp, $1, sizeof(struct policy_handle));
+   $result = SWIG_NewPointerObj(temp, SWIGTYPE_p_policy_handle, 0);
+   } else {
+   Py_INCREF(Py_None);
+   $result = Py_None;
+   }
 }
 
 %{



svn commit: samba r5283 - in branches/SAMBA_3_0/source/python: .

2005-02-08 Thread tpot
Author: tpot
Date: 2005-02-08 23:17:44 + (Tue, 08 Feb 2005)
New Revision: 5283

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

Log:
Merge -r5279 and-r5280 from trunk.

Modified:
   branches/SAMBA_3_0/source/python/py_smb.c
   branches/SAMBA_3_0/source/python/py_spoolss.h
   branches/SAMBA_3_0/source/python/py_spoolss_drivers.c
   branches/SAMBA_3_0/source/python/py_spoolss_drivers_conv.c


Changeset:
Modified: branches/SAMBA_3_0/source/python/py_smb.c
===
--- branches/SAMBA_3_0/source/python/py_smb.c   2005-02-08 22:55:24 UTC (rev 
5282)
+++ branches/SAMBA_3_0/source/python/py_smb.c   2005-02-08 23:17:44 UTC (rev 
5283)
@@ -179,6 +179,83 @@
return PyInt_FromLong(result);
 }
 
+static PyObject *py_smb_open(PyObject *self, PyObject *args, PyObject *kw)
+{
+   cli_state_object *cli = (cli_state_object *)self;
+   static char *kwlist[] = { "filename", "flags", 
+ "share_mode", NULL };
+   char *filename;
+   uint32 flags, share_mode = DENY_NONE;
+   int result;
+
+   /* Parse parameters */
+
+   if (!PyArg_ParseTupleAndKeywords(
+   args, kw, "si|i", kwlist, &filename, &flags, &share_mode))
+   return NULL;
+
+   result = cli_open(cli->cli, filename, flags, share_mode);
+
+   if (cli_is_error(cli->cli)) {
+   PyErr_SetString(PyExc_RuntimeError, "open failed");
+   return NULL;
+   }
+
+   /* Return FID */
+
+   return PyInt_FromLong(result);
+}
+
+static PyObject *py_smb_read(PyObject *self, PyObject *args, PyObject *kw)
+{
+   cli_state_object *cli = (cli_state_object *)self;
+   static char *kwlist[] = { "fnum", "offset", "size", NULL };
+   int fnum, offset=0, size=0;
+   ssize_t result;
+   size_t fsize;
+   char *data;
+   PyObject *ret;
+
+   /* Parse parameters */
+
+   if (!PyArg_ParseTupleAndKeywords(
+   args, kw, "i|ii", kwlist, &fnum, &offset, &size))
+   return NULL;
+
+   if (!cli_qfileinfo(cli->cli, fnum, NULL, &fsize, NULL, NULL,
+   NULL, NULL, NULL) &&
+   !cli_getattrE(cli->cli, fnum, NULL, &fsize, NULL, NULL, NULL)) {
+   PyErr_SetString(PyExc_RuntimeError, "getattrib failed");
+   return NULL;
+   }
+
+   if (offset < 0)
+   offset = 0;
+
+   if (size < 1 || size > fsize - offset)
+   size = fsize - offset;
+
+   if (!(data = (char *) malloc((size_t) size))) {
+   PyErr_SetString(PyExc_RuntimeError, "malloc failed");
+   return NULL;
+   }
+
+   result = cli_read(cli->cli, fnum, data, (off_t) offset, (size_t) size);
+
+   if (result==-1 || cli_is_error(cli->cli)) {
+   SAFE_FREE(data);
+   PyErr_SetString(PyExc_RuntimeError, "read failed");
+   return NULL;
+   }
+
+   /* Return a python string */
+
+   ret = Py_BuildValue("s#", data, result);
+   SAFE_FREE(data);
+
+   return ret;
+}
+
 static PyObject *py_smb_close(PyObject *self, PyObject *args,
  PyObject *kw)
 {
@@ -323,6 +400,33 @@
{ "nt_create_andx", (PyCFunction)py_smb_nt_create_andx,
  METH_VARARGS | METH_KEYWORDS, "NT Create&X" },
 
+   { "open", (PyCFunction)py_smb_open,
+ METH_VARARGS | METH_KEYWORDS,
+ "Open a file\n"
+"\n"
+"This function returns a fnum handle to an open file.  The file is\n"
+"opened with flags and optional share mode.  If unspecified, the\n"
+"default share mode is DENY_NONE\n"
+"\n"
+"Example:\n"
+"\n"
+">>> fnum=conn.open(filename, os.O_RDONLY)" },
+
+   { "read", (PyCFunction)py_smb_read,
+ METH_VARARGS | METH_KEYWORDS,
+ "Read from an open file\n"
+"\n"
+"This function returns a string read from an open file starting at\n"
+"offset for size bytes (until EOF is reached).  If unspecified, the\n"
+"default offset is 0, and default size is the remainder of the file.\n"
+"\n"
+"Example:\n"
+"\n"
+">>> conn.read(fnum)   # read entire file\n"
+">>> conn.read(fnum,5) # read entire file from offset 5\n"
+">>> conn.read(fnum,size=64)   # read 64 bytes from start of file\n"
+">>> conn.read(fnum,4096,1024) # read 1024 bytes from offset 4096\n" },
+
{ "close", (PyCFunction)py_smb_close,
  METH_VARARGS | METH_KEY

svn commit: samba r5280 - in trunk/source/python: .

2005-02-08 Thread tpot
Author: tpot
Date: 2005-02-08 20:25:41 + (Tue, 08 Feb 2005)
New Revision: 5280

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

Log:
Add wrappers for cli_open(), cli_read() written by Daniel Jarbee.
Bugzilla #1557.

Modified:
   trunk/source/python/py_smb.c


Changeset:
Modified: trunk/source/python/py_smb.c
===
--- trunk/source/python/py_smb.c2005-02-08 20:19:55 UTC (rev 5279)
+++ trunk/source/python/py_smb.c2005-02-08 20:25:41 UTC (rev 5280)
@@ -179,6 +179,83 @@
return PyInt_FromLong(result);
 }
 
+static PyObject *py_smb_open(PyObject *self, PyObject *args, PyObject *kw)
+{
+   cli_state_object *cli = (cli_state_object *)self;
+   static char *kwlist[] = { "filename", "flags", 
+ "share_mode", NULL };
+   char *filename;
+   uint32 flags, share_mode = DENY_NONE;
+   int result;
+
+   /* Parse parameters */
+
+   if (!PyArg_ParseTupleAndKeywords(
+   args, kw, "si|i", kwlist, &filename, &flags, &share_mode))
+   return NULL;
+
+   result = cli_open(cli->cli, filename, flags, share_mode);
+
+   if (cli_is_error(cli->cli)) {
+   PyErr_SetString(PyExc_RuntimeError, "open failed");
+   return NULL;
+   }
+
+   /* Return FID */
+
+   return PyInt_FromLong(result);
+}
+
+static PyObject *py_smb_read(PyObject *self, PyObject *args, PyObject *kw)
+{
+   cli_state_object *cli = (cli_state_object *)self;
+   static char *kwlist[] = { "fnum", "offset", "size", NULL };
+   int fnum, offset=0, size=0;
+   ssize_t result;
+   size_t fsize;
+   char *data;
+   PyObject *ret;
+
+   /* Parse parameters */
+
+   if (!PyArg_ParseTupleAndKeywords(
+   args, kw, "i|ii", kwlist, &fnum, &offset, &size))
+   return NULL;
+
+   if (!cli_qfileinfo(cli->cli, fnum, NULL, &fsize, NULL, NULL,
+   NULL, NULL, NULL) &&
+   !cli_getattrE(cli->cli, fnum, NULL, &fsize, NULL, NULL, NULL)) {
+   PyErr_SetString(PyExc_RuntimeError, "getattrib failed");
+   return NULL;
+   }
+
+   if (offset < 0)
+   offset = 0;
+
+   if (size < 1 || size > fsize - offset)
+   size = fsize - offset;
+
+   if (!(data = (char *) malloc((size_t) size))) {
+   PyErr_SetString(PyExc_RuntimeError, "malloc failed");
+   return NULL;
+   }
+
+   result = cli_read(cli->cli, fnum, data, (off_t) offset, (size_t) size);
+
+   if (result==-1 || cli_is_error(cli->cli)) {
+   SAFE_FREE(data);
+   PyErr_SetString(PyExc_RuntimeError, "read failed");
+   return NULL;
+   }
+
+   /* Return a python string */
+
+   ret = Py_BuildValue("s#", data, result);
+   SAFE_FREE(data);
+
+   return ret;
+}
+
 static PyObject *py_smb_close(PyObject *self, PyObject *args,
  PyObject *kw)
 {
@@ -323,6 +400,33 @@
{ "nt_create_andx", (PyCFunction)py_smb_nt_create_andx,
  METH_VARARGS | METH_KEYWORDS, "NT Create&X" },
 
+   { "open", (PyCFunction)py_smb_open,
+ METH_VARARGS | METH_KEYWORDS,
+ "Open a file\n"
+"\n"
+"This function returns a fnum handle to an open file.  The file is\n"
+"opened with flags and optional share mode.  If unspecified, the\n"
+"default share mode is DENY_NONE\n"
+"\n"
+"Example:\n"
+"\n"
+">>> fnum=conn.open(filename, os.O_RDONLY)" },
+
+   { "read", (PyCFunction)py_smb_read,
+ METH_VARARGS | METH_KEYWORDS,
+ "Read from an open file\n"
+"\n"
+"This function returns a string read from an open file starting at\n"
+"offset for size bytes (until EOF is reached).  If unspecified, the\n"
+"default offset is 0, and default size is the remainder of the file.\n"
+"\n"
+"Example:\n"
+"\n"
+">>> conn.read(fnum)   # read entire file\n"
+">>> conn.read(fnum,5) # read entire file from offset 5\n"
+">>> conn.read(fnum,size=64)   # read 64 bytes from start of file\n"
+">>> conn.read(fnum,4096,1024) # read 1024 bytes from offset 4096\n" },
+
{ "close", (PyCFunction)py_smb_close,
  METH_VARARGS | METH_KEYWORDS, "Close" },
 



svn commit: samba r5279 - in trunk/source/python: .

2005-02-08 Thread tpot
Author: tpot
Date: 2005-02-08 20:19:55 + (Tue, 08 Feb 2005)
New Revision: 5279

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

Log:
Fix for bugzilla #1564 thanks to Daniel Jarboe.  Convert printer info
dependent files list to a list of strings instead of just returning
'asdf'.

Modified:
   trunk/source/python/py_spoolss.h
   trunk/source/python/py_spoolss_drivers.c
   trunk/source/python/py_spoolss_drivers_conv.c


Changeset:
Modified: trunk/source/python/py_spoolss.h
===
--- trunk/source/python/py_spoolss.h2005-02-08 19:27:18 UTC (rev 5278)
+++ trunk/source/python/py_spoolss.h2005-02-08 20:19:55 UTC (rev 5279)
@@ -67,7 +67,8 @@
 BOOL py_from_DRIVER_INFO_2(PyObject **dict, DRIVER_INFO_2 *info);
 BOOL py_to_DRIVER_INFO_2(DRIVER_INFO_2 *info, PyObject *dict);
 BOOL py_from_DRIVER_INFO_3(PyObject **dict, DRIVER_INFO_3 *info);
-BOOL py_to_DRIVER_INFO_3(DRIVER_INFO_3 *info, PyObject *dict);
+BOOL py_to_DRIVER_INFO_3(DRIVER_INFO_3 *info, PyObject *dict,
+TALLOC_CTX *mem_ctx);
 BOOL py_from_DRIVER_INFO_6(PyObject **dict, DRIVER_INFO_6 *info);
 BOOL py_to_DRIVER_INFO_6(DRIVER_INFO_6 *info, PyObject *dict);
 BOOL py_from_DRIVER_DIRECTORY_1(PyObject **dict, DRIVER_DIRECTORY_1 *info);

Modified: trunk/source/python/py_spoolss_drivers.c
===
--- trunk/source/python/py_spoolss_drivers.c2005-02-08 19:27:18 UTC (rev 
5278)
+++ trunk/source/python/py_spoolss_drivers.c2005-02-08 20:19:55 UTC (rev 
5279)
@@ -365,7 +365,7 @@
case 3:
ctr.info3 = &dinfo.driver_3;
 
-   if (!py_to_DRIVER_INFO_3(&dinfo.driver_3, info)) {
+   if (!py_to_DRIVER_INFO_3(&dinfo.driver_3, info, mem_ctx)) {
PyErr_SetString(spoolss_error,
"error converting to driver info 3");
goto done;

Modified: trunk/source/python/py_spoolss_drivers_conv.c
===
--- trunk/source/python/py_spoolss_drivers_conv.c   2005-02-08 19:27:18 UTC 
(rev 5278)
+++ trunk/source/python/py_spoolss_drivers_conv.c   2005-02-08 20:19:55 UTC 
(rev 5279)
@@ -78,9 +78,49 @@
{ NULL }
 };
 
-static uint16 *to_dependentfiles(PyObject *dict)
+static uint16 *to_dependentfiles(PyObject *list, TALLOC_CTX *mem_ctx)
 {
-   return (uint16 *)"abcd\0";
+   uint32 elements, size=0, pos=0, i;
+   char *str;
+   uint16 *ret = NULL;
+   PyObject *borrowedRef;
+
+   if (!PyList_Check(list)) {
+   goto done;
+   }
+
+   /* calculate size for dependentfiles */
+   elements=PyList_Size(list);
+   for (i = 0; i < elements; i++) {
+   borrowedRef=PyList_GetItem(list, i);
+   if (!PyString_Check(borrowedRef)) 
+   /* non string found, return error */
+   goto done;
+   size+=PyString_Size(borrowedRef)+1;
+   }
+
+   if (!(ret = (uint16*) talloc(mem_ctx,(size+1)*sizeof(uint16
+   goto done;
+
+   /* create null terminated sequence of null terminated strings */
+   for (i = 0; i < elements; i++) {
+   borrowedRef=PyList_GetItem(list, i);
+   str=PyString_AsString(borrowedRef);
+   do {
+   if (pos >= size) {
+   /* dependentfiles too small.  miscalculated? */
+   ret = NULL;
+   goto done;
+   }
+   SSVAL(&ret[pos], 0, str[0]);
+   pos++;
+   } while (*(str++));
+   }
+   /* final null */
+   ret[pos]='\0';
+
+done:
+   return ret; 
 }
 
 BOOL py_from_DRIVER_INFO_1(PyObject **dict, DRIVER_INFO_1 *info)
@@ -122,16 +162,17 @@
return True;
 }
 
-BOOL py_to_DRIVER_INFO_3(DRIVER_INFO_3 *info, PyObject *dict)
+BOOL py_to_DRIVER_INFO_3(DRIVER_INFO_3 *info, PyObject *dict,
+TALLOC_CTX *mem_ctx)
 {
PyObject *obj, *dict_copy = PyDict_Copy(dict);
BOOL result = False;
 
-   if (!(obj = PyDict_GetItemString(dict_copy, "dependent_files")) ||
-   !PyList_Check(obj))
+   if (!(obj = PyDict_GetItemString(dict_copy, "dependent_files")))
goto done;
 
-   info->dependentfiles = to_dependentfiles(obj);
+   if (!(info->dependentfiles = to_dependentfiles(obj, mem_ctx)))
+   goto done;
 
PyDict_DelItemString(dict_copy, "dependent_files");
 



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

2005-02-05 Thread tpot
Author: tpot
Date: 2005-02-06 04:34:29 + (Sun, 06 Feb 2005)
New Revision: 5247

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

Log:
Fix rpcclient to work with new swig interface.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/rpcclient


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/rpcclient
===
--- branches/SAMBA_4_0/source/scripting/swig/rpcclient  2005-02-06 01:12:15 UTC 
(rev 5246)
+++ branches/SAMBA_4_0/source/scripting/swig/rpcclient  2005-02-06 04:34:29 UTC 
(rev 5247)
@@ -7,6 +7,23 @@
 
 import dcerpc, samr
 
+def swig2dict(obj):
+"""Convert a swig object to a dictionary."""
+
+result = {}
+
+for attr in filter(lambda x: type(x) == str, dir(obj)):
+
+if attr[:2] == '__' and attr[-2:] == '__':
+continue
+
+if attr == 'this' or attr == 'thisown':
+continue
+
+result[attr] = getattr(obj, attr)
+
+return result
+
 class rpcclient(Cmd):
 
 prompt = 'rpcclient$ '
@@ -67,7 +84,7 @@
 
 pipe = dcerpc.pipe_connect(
 self.binding,
-dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
+dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
 self.domain, self.username, self.password)
 
 connect_handle = samr.Connect(pipe)
@@ -89,7 +106,7 @@
 
 pipe = dcerpc.pipe_connect(
 self.binding,
-dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
+dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
 self.domain, self.username, self.password)
 
 connect_handle = samr.Connect(pipe)
@@ -110,7 +127,7 @@
 
 pipe = dcerpc.pipe_connect(
 self.binding,
-dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
+dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
 self.domain, self.username, self.password)
 
 connect_handle = samr.Connect(pipe)
@@ -121,22 +138,23 @@
else:
result = domain_handle.QueryDomainInfo()
 
-pprint(result['info'])
+pprint(swig2dict(result))
 
 def do_SamrQueryDomInfo2(self, line):
-   """Return information about a domain designated by its SID. (Windows 
2000 and >)"""
+   """Return information about a domain designated by its SID.
+(Windows 2000 and >)"""
 
usage = 'SamrQueryDomInfo2 DOMAIN_SID [info_level] (Windows 2000 and >)'
parser = OptionParser(usage)
options, args = parser.parse_args(string.split(line))
 
-   if (len(args) == 0) or (len(args) > 2):
+   if len(args) == 0 or len(args) > 2:
print 'usage:', usage
return
 
 pipe = dcerpc.pipe_connect(
 self.binding,
-dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
+dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
 self.domain, self.username, self.password)
 
 connect_handle = samr.Connect(pipe)
@@ -147,7 +165,7 @@
else:
result = domain_handle.QueryDomainInfo2()
 
-pprint(result['info'])
+pprint(swig2dict(result))
 
 def do_SamrEnumDomainGroups(self, line):
"""Return the list of groups of a domain designated by its SID."""
@@ -163,7 +181,7 @@
 
 pipe = dcerpc.pipe_connect(
 self.binding,
-dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
+dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
 self.domain, self.username, self.password)
 
 connect_handle = samr.Connect(pipe)
@@ -171,11 +189,11 @@
 
result = domain_handle.EnumDomainGroups()
 
-for r in result['sam']['entries']:
-print r['name']['name']
+pprint(result)
 
 def do_SamrEnumDomainAliases(self, line):
-"""Return the list of aliases (local groups) of a domain designated by 
its SID."""
+"""Return the list of aliases (local groups) of a domain designated
+by its SID."""
 
usage = 'SamrEnumDomainAliases DOMAIN_SID'
 
@@ -188,7 +206,7 @@
 
 pipe = dcerpc.pipe_connect(
 self.binding,
-dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
+dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
 self.domain, self.username, self.password)
 
 connect_handle = samr.Connect(pipe)
@@ -196,8 +214,7 @@
 
result = domain_handle.EnumDomainAliases()
 
-for r in result['sam']['entries']:
-   

svn commit: samba r5246 - branches/SAMBA_3_0/source/rpc_server trunk/source/rpc_server

2005-02-05 Thread tpot
Author: tpot
Date: 2005-02-06 01:12:15 + (Sun, 06 Feb 2005)
New Revision: 5246

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

Log:
We can't use a pointer to struct lsa_info until is has been
initialised.  Fix for bugzilla #2315.  Can the privileges dude(s)
please verify this?

Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c
   trunk/source/rpc_server/srv_lsa_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c
===
--- branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c   2005-02-06 00:50:55 UTC 
(rev 5245)
+++ branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c   2005-02-06 01:12:15 UTC 
(rev 5246)
@@ -968,7 +968,7 @@
if ( !nt_token_check_domain_rid( p->pipe_user.nt_user_token, 
DOMAIN_GROUP_RID_ADMINS ) )
return NT_STATUS_ACCESS_DENIED;

-   if ( is_privileged_sid( &info->sid ) )
+   if ( is_privileged_sid( &q_u->sid.sid ) )
return NT_STATUS_OBJECT_NAME_COLLISION;
 
/* associate the user/group SID with the (unique) handle. */

Modified: trunk/source/rpc_server/srv_lsa_nt.c
===
--- trunk/source/rpc_server/srv_lsa_nt.c2005-02-06 00:50:55 UTC (rev 
5245)
+++ trunk/source/rpc_server/srv_lsa_nt.c2005-02-06 01:12:15 UTC (rev 
5246)
@@ -968,7 +968,7 @@
if ( !nt_token_check_domain_rid( p->pipe_user.nt_user_token, 
DOMAIN_GROUP_RID_ADMINS ) )
return NT_STATUS_ACCESS_DENIED;

-   if ( is_privileged_sid( &info->sid ) )
+   if ( is_privileged_sid( &q_u->sid.sid ) )
return NT_STATUS_OBJECT_NAME_COLLISION;
 
/* associate the user/group SID with the (unique) handle. */



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

2005-02-05 Thread tpot
Author: tpot
Date: 2005-02-06 00:50:55 + (Sun, 06 Feb 2005)
New Revision: 5245

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

Log:
Remove dead code.

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


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


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

2005-02-05 Thread tpot
Author: tpot
Date: 2005-02-06 00:38:10 + (Sun, 06 Feb 2005)
New Revision: 5244

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

Log:
Convert this module to use the new structure mapping SWIG stuff instead of
the old dictionary based routines.  The SAMR connect, close, enumdomains,
opendomain, enum{users,aliases,groups} functions now work again!

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


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


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

2005-02-05 Thread tpot
Author: tpot
Date: 2005-02-06 00:35:58 + (Sun, 06 Feb 2005)
New Revision: 5243

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

Log:
Woohoo - memory leak city!  Comment out talloc_free() call until I 
figure out a better way to pass tallocated memory around with SWIG.

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-02-06 00:34:44 UTC 
(rev 5242)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-02-06 00:35:58 UTC 
(rev 5243)
@@ -126,7 +126,7 @@
 }
 
 %typemap(freearg) TALLOC_CTX * {
-   talloc_free($1);
+// talloc_free($1);
 }
 
 %typemap(argout) struct dcerpc_pipe ** {



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

2005-02-05 Thread tpot
Author: tpot
Date: 2005-02-06 00:34:44 + (Sun, 06 Feb 2005)
New Revision: 5242

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

Log:
Check that argument is an integer or a long for uint32_t input
typemap.

The uint32_t output typemap must return a Python long as an unsigned
uint32_t cannot be fully represented by a Python int.

Likewise for the NTSTATUS typemap.

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.i2005-02-06 00:18:46 UTC 
(rev 5241)
+++ branches/SAMBA_4_0/source/scripting/swig/samba.i2005-02-06 00:34:44 UTC 
(rev 5242)
@@ -28,11 +28,24 @@
 %apply char { int8_t };
 %apply unsigned int { uint16_t };
 %apply int { int16_t };
-%apply unsigned long { uint32_t };
-%apply long { int32_t };
 %apply unsigned long long { uint64_t };
 %apply long long { int64_t };
 
+%typemap(in) uint32_t {
+   if (PyLong_Check($input))
+   $1 = PyLong_AsUnsignedLong($input);
+   else if (PyInt_Check($input))
+   $1 = PyInt_AsLong($input);
+   else {
+   PyErr_SetString(PyExc_TypeError,"Expected a long or an int");
+   return NULL;
+   }
+}
+
+%typemap(out) uint32_t {
+   $result = PyLong_FromUnsignedLong($1);
+}
+
 %typemap(out) NTSTATUS {
-$result = PyLong_FromLong(NT_STATUS_V($1));
+$result = PyLong_FromUnsignedLong(NT_STATUS_V($1));
 }



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

2005-02-05 Thread tpot
Author: tpot
Date: 2005-02-06 00:18:46 + (Sun, 06 Feb 2005)
New Revision: 5241

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

Log:
Generate swig wrappers for unions as well as structures.

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-02-05 23:10:31 UTC 
(rev 5240)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm2005-02-06 00:18:46 UTC 
(rev 5241)
@@ -709,9 +709,9 @@
 
s/dom_sid2/dom_sid/g;
 
-   # Copy structure definitions
+   # Copy structure and union definitions
 
-   if (/^struct .*? {$/ .. /^\};$/) {
+   if (/^(struct|union) .*? {$/ .. /^\};$/) {
s/\} (in|out);/\} data_$1;/; # "in" is a Python keyword
pidl $_;
next;



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

2005-02-03 Thread tpot
Author: tpot
Date: 2005-02-04 06:35:45 + (Fri, 04 Feb 2005)
New Revision: 5224

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

Log:
Add in/out typemaps for resume handles.  This saves us having to much
around with pointers to just one uint32.

Add an output typemap to copy a policy handle as the talloc context is 
destroyed before the wrapper function returns.  More work here needed 
to avoid memory leaks.

Use the swig carrays.i file to create accessor and setter functions
for fixed width integer types.  Also add functions for struct samr_SamEntry
as it's returned by the LookupDomain RPC.  This really needs to be
done by pidl so I don't have to go through and find all the structures
that are returned in arrays.

Include security.i to give us SIDs and security descriptors.

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-02-04 06:28:50 UTC 
(rev 5223)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-02-04 06:35:45 UTC 
(rev 5224)
@@ -169,10 +169,49 @@
 
 const char *dcerpc_server_name(struct dcerpc_pipe *p);
 
+/* Some typemaps for easier access to resume handles.  Really this can
+   also be done using the uint32 carray functions, but it's a bit of a
+   hassle.  TODO: Fix memory leak here. */
+
+%typemap(in) uint32_t *resume_handle {
+   $1 = malloc(sizeof(*$1));
+   *$1 = PyLong_AsLong($input);
+}
+
+%typemap(out) uint32_t *resume_handle {
+   $result = PyLong_FromLong(*$1);
+}
+
+/* When returning a policy handle to Python we need to make a copy of
+   as the talloc context it is created under is destroyed after the
+   wrapper function returns.  TODO: Fix memory leak created here. */
+
+%typemap(out) struct policy_handle * {
+   struct policy_handle *temp = (struct policy_handle 
*)malloc(sizeof(struct policy_handle));
+   memcpy(temp, $1, sizeof(struct policy_handle));
+   $result = SWIG_NewPointerObj(temp, SWIGTYPE_p_policy_handle, 0);
+}
+
 %{
 #include "librpc/gen_ndr/ndr_misc.h"
+#include "librpc/gen_ndr/ndr_security.h"
 #include "librpc/gen_ndr/ndr_samr.h"
 %}
 
+%include "carrays.i"
+
+/* Some functions for accessing arrays of fixed-width integers. */
+
+%array_functions(uint8_t, uint8_array);
+%array_functions(uint16_t, uint16_array);
+%array_functions(uint32_t, uint32_array);
+
+/* Functions for handling arrays of structures.  It would be nice for 
+   pidl to automatically generating these instead of having to find
+   them all by hand. */
+
+%array_functions(struct samr_SamEntry, samr_SamEntry_array);
+
 %include "librpc/gen_ndr/misc.i"
+%include "librpc/gen_ndr/security.i"
 %include "librpc/gen_ndr/samr.i"



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

2005-02-03 Thread tpot
Author: tpot
Date: 2005-02-04 06:28:50 + (Fri, 04 Feb 2005)
New Revision: 5223

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

Log:
Rename dom_sid2 to dom_sid as we don't care about the difference
for the swig wrappers.

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-02-04 05:13:46 UTC 
(rev 5222)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm2005-02-04 06:28:50 UTC 
(rev 5223)
@@ -704,6 +704,11 @@

 while() {
 
+   # Rename dom_sid2 to dom_sid as we don't care about the difference
+   # for the swig wrappers.
+
+   s/dom_sid2/dom_sid/g;
+
# Copy structure definitions
 
if (/^struct .*? {$/ .. /^\};$/) {
@@ -742,5 +747,4 @@
 close(OUT);   
 }
 
-
 1;



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

2005-02-02 Thread tpot
Author: tpot
Date: 2005-02-03 04:22:37 + (Thu, 03 Feb 2005)
New Revision: 5190

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

Log:
Grr - typo.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/main.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/main.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/main.pm   2005-02-03 04:03:28 UTC 
(rev 5189)
+++ branches/SAMBA_4_0/source/build/smb_build/main.pm   2005-02-03 04:22:37 UTC 
(rev 5190)
@@ -56,7 +56,7 @@
"client/config.mk",
"libcli/libsmb.mk",
"libcli/config.mk",
-   "libcli/security/config.mk"
+   "libcli/security/config.mk",
"scripting/swig/config.mk",
);
 



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

2005-02-02 Thread tpot
Author: tpot
Date: 2005-02-03 04:03:24 + (Thu, 03 Feb 2005)
New Revision: 5188

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

Log:
Add config.mk file for swig.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/main.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/main.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/main.pm   2005-02-03 04:02:48 UTC 
(rev 5187)
+++ branches/SAMBA_4_0/source/build/smb_build/main.pm   2005-02-03 04:03:24 UTC 
(rev 5188)
@@ -57,6 +57,7 @@
"libcli/libsmb.mk",
"libcli/config.mk",
"libcli/security/config.mk"
+   "scripting/swig/config.mk",
);
 
$| = 1;



svn commit: samba r5113 - branches/SAMBA_3_0/examples/auth branches/SAMBA_3_0/examples/pdb trunk/examples/auth trunk/examples/pdb

2005-01-30 Thread tpot
Author: tpot
Date: 2005-01-30 22:50:39 + (Sun, 30 Jan 2005)
New Revision: 5113

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

Log:
Ignore autogenerated files.

Modified:
   branches/SAMBA_3_0/examples/auth/
   branches/SAMBA_3_0/examples/pdb/
   trunk/examples/auth/
   trunk/examples/pdb/


Changeset:

Property changes on: branches/SAMBA_3_0/examples/auth
___
Name: svn:ignore
   + .libs



Property changes on: branches/SAMBA_3_0/examples/pdb
___
Name: svn:ignore
   + .libs



Property changes on: trunk/examples/auth
___
Name: svn:ignore
   + .libs



Property changes on: trunk/examples/pdb
___
Name: svn:ignore
   + .libs




svn commit: samba r5112 - branches/SAMBA_3_0/examples/auth branches/SAMBA_3_0/examples/pdb trunk/examples/auth trunk/examples/pdb

2005-01-30 Thread tpot
Author: tpot
Date: 2005-01-30 22:47:26 + (Sun, 30 Jan 2005)
New Revision: 5112

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

Log:
Fix for shared object creation in examples.  Bugzilla #2058.

Modified:
   branches/SAMBA_3_0/examples/auth/Makefile
   branches/SAMBA_3_0/examples/pdb/Makefile
   trunk/examples/auth/Makefile
   trunk/examples/pdb/Makefile


Changeset:
Modified: branches/SAMBA_3_0/examples/auth/Makefile
===
--- branches/SAMBA_3_0/examples/auth/Makefile   2005-01-30 22:45:46 UTC (rev 
5111)
+++ branches/SAMBA_3_0/examples/auth/Makefile   2005-01-30 22:47:26 UTC (rev 
5112)
@@ -9,7 +9,7 @@
 UBIQX_SRC = ../../source/ubiqx
 SMBWR_SRC = ../../source/smbwrapper
 CFLAGS = -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -Wall -g
-AUTH_OBJS = auth_skel.so
+AUTH_OBJS = auth_skel.la
 
 # Default target
 
@@ -17,8 +17,8 @@
 
 # Pattern rules
 
-%.so: %.lo
-   $(LIBTOOL) --mode=link $(CC) -shared -o $@ $< $(LDFLAGS)
+%.la: %.lo
+   $(LIBTOOL) --mode=link $(CC) -module -o $@ $< $(LDFLAGS)
 
 %.lo: %.c
$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
@@ -28,4 +28,4 @@
 clean:
rm -rf .libs
rm -f core *~ *% *.bak \
-   $(AUTH_OBJS) $(AUTH_OBJS:.so=.o) $(AUTH_OBJS:.so=.lo) 
+   $(AUTH_OBJS) $(AUTH_OBJS:.la=.o) $(AUTH_OBJS:.la=.lo) 

Modified: branches/SAMBA_3_0/examples/pdb/Makefile
===
--- branches/SAMBA_3_0/examples/pdb/Makefile2005-01-30 22:45:46 UTC (rev 
5111)
+++ branches/SAMBA_3_0/examples/pdb/Makefile2005-01-30 22:47:26 UTC (rev 
5112)
@@ -9,7 +9,7 @@
 UBIQX_SRC = ../../source/ubiqx
 SMBWR_SRC = ../../source/smbwrapper
 CFLAGS = -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -Wall -g 
-I/usr/include/heimdal -fPIC
-PDB_OBJS = test.so
+PDB_OBJS = test.la
 
 # Default target
 
@@ -17,8 +17,8 @@
 
 # Pattern rules
 
-%.so: %.lo
-   $(LIBTOOL) --mode=link $(CC) -shared -o $@ $< $(LDFLAGS)
+%.la: %.lo
+   $(LIBTOOL) --mode=link $(CC) -module -o $@ $< $(LDFLAGS) -rpath 
/usr/lib/samba/pdb/
 
 %.lo: %.c
$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
@@ -28,4 +28,4 @@
 clean:
rm -rf .libs
rm -f core *~ *% *.bak \
-   $(PDB_OBJS) $(PDB_OBJS:.so=.o) $(PDB_OBJS:.so=.lo) 
+   $(PDB_OBJS) $(PDB_OBJS:.la=.o) $(PDB_OBJS:.la=.lo) 

Modified: trunk/examples/auth/Makefile
===
--- trunk/examples/auth/Makefile2005-01-30 22:45:46 UTC (rev 5111)
+++ trunk/examples/auth/Makefile2005-01-30 22:47:26 UTC (rev 5112)
@@ -9,7 +9,7 @@
 UBIQX_SRC = ../../source/ubiqx
 SMBWR_SRC = ../../source/smbwrapper
 CFLAGS = -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -Wall -g
-AUTH_OBJS = auth_skel.so
+AUTH_OBJS = auth_skel.la
 
 # Default target
 
@@ -17,8 +17,8 @@
 
 # Pattern rules
 
-%.so: %.lo
-   $(LIBTOOL) --mode=link $(CC) -shared -o $@ $< $(LDFLAGS)
+%.la: %.lo
+   $(LIBTOOL) --mode=link $(CC) -module -o $@ $< $(LDFLAGS)
 
 %.lo: %.c
$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
@@ -28,4 +28,4 @@
 clean:
rm -rf .libs
rm -f core *~ *% *.bak \
-   $(AUTH_OBJS) $(AUTH_OBJS:.so=.o) $(AUTH_OBJS:.so=.lo) 
+   $(AUTH_OBJS) $(AUTH_OBJS:.la=.o) $(AUTH_OBJS:.la=.lo) 

Modified: trunk/examples/pdb/Makefile
===
--- trunk/examples/pdb/Makefile 2005-01-30 22:45:46 UTC (rev 5111)
+++ trunk/examples/pdb/Makefile 2005-01-30 22:47:26 UTC (rev 5112)
@@ -9,7 +9,7 @@
 UBIQX_SRC = ../../source/ubiqx
 SMBWR_SRC = ../../source/smbwrapper
 CFLAGS = -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -Wall -g 
-I/usr/include/heimdal -fPIC
-PDB_OBJS = test.so
+PDB_OBJS = test.la
 
 # Default target
 
@@ -17,8 +17,8 @@
 
 # Pattern rules
 
-%.so: %.lo
-   $(LIBTOOL) --mode=link $(CC) -shared -o $@ $< $(LDFLAGS)
+%.la: %.lo
+   $(LIBTOOL) --mode=link $(CC) -module -o $@ $< $(LDFLAGS) -rpath 
/usr/lib/samba/pdb/
 
 %.lo: %.c
$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
@@ -28,4 +28,4 @@
 clean:
rm -rf .libs
rm -f core *~ *% *.bak \
-   $(PDB_OBJS) $(PDB_OBJS:.so=.o) $(PDB_OBJS:.so=.lo) 
+   $(PDB_OBJS) $(PDB_OBJS:.la=.o) $(PDB_OBJS:.la=.lo) 



svn commit: samba r5111 - branches/SAMBA_3_0/examples/pdb trunk/examples/pdb

2005-01-30 Thread tpot
Author: tpot
Date: 2005-01-30 22:45:46 + (Sun, 30 Jan 2005)
New Revision: 5111

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

Log:
Fix up changed prototype for setsampwent pdb function.

Modified:
   branches/SAMBA_3_0/examples/pdb/test.c
   trunk/examples/pdb/test.c


Changeset:
Modified: branches/SAMBA_3_0/examples/pdb/test.c
===
--- branches/SAMBA_3_0/examples/pdb/test.c  2005-01-30 18:29:12 UTC (rev 
5110)
+++ branches/SAMBA_3_0/examples/pdb/test.c  2005-01-30 22:45:46 UTC (rev 
5111)
@@ -29,7 +29,7 @@
  Start enumeration of the passwd list.
 /
 
-static NTSTATUS testsam_setsampwent(struct pdb_methods *methods, BOOL update)
+static NTSTATUS testsam_setsampwent(struct pdb_methods *methods, BOOL update, 
uint16 acb_mask)
 {
DEBUG(10, ("testsam_setsampwent called\n"));
return NT_STATUS_NOT_IMPLEMENTED;

Modified: trunk/examples/pdb/test.c
===
--- trunk/examples/pdb/test.c   2005-01-30 18:29:12 UTC (rev 5110)
+++ trunk/examples/pdb/test.c   2005-01-30 22:45:46 UTC (rev 5111)
@@ -29,7 +29,7 @@
  Start enumeration of the passwd list.
 /
 
-static NTSTATUS testsam_setsampwent(struct pdb_methods *methods, BOOL update)
+static NTSTATUS testsam_setsampwent(struct pdb_methods *methods, BOOL update, 
uint16 acb_mask)
 {
DEBUG(10, ("testsam_setsampwent called\n"));
return NT_STATUS_NOT_IMPLEMENTED;



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

2005-01-28 Thread tpot
Author: tpot
Date: 2005-01-29 05:05:17 + (Sat, 29 Jan 2005)
New Revision: 5095

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

Log:
uint32 -> uint32_t

%include misc.i to get definition of struct policy_handle

Remove #includes we aren't using just now.

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-29 05:04:23 UTC 
(rev 5094)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-01-29 05:05:17 UTC 
(rev 5095)
@@ -156,7 +156,7 @@
 NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
  const char *binding,
  const char *pipe_uuid,
- uint32 pipe_version,
+ uint32_t pipe_version,
  const char *domain,
  const char *username,
  const char *password);
@@ -171,9 +171,8 @@
 
 %{
 #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_spoolss.h"
 %}
 
+%include "librpc/gen_ndr/misc.i"
 %include "librpc/gen_ndr/samr.i"



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

2005-01-28 Thread tpot
Author: tpot
Date: 2005-01-29 05:04:23 + (Sat, 29 Jan 2005)
New Revision: 5094

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

Log:
Use builtin swig types for converting between fixed width integer types.

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.i2005-01-29 04:11:04 UTC 
(rev 5093)
+++ branches/SAMBA_4_0/source/scripting/swig/samba.i2005-01-29 05:04:23 UTC 
(rev 5094)
@@ -24,18 +24,15 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-%typemap(in) uint32 {
-   if (!PyInt_Check($input) && !PyLong_Check($input)) {
-   PyErr_SetString(PyExc_TypeError, "integer expected");
-   return NULL;
-   }
-   $1 = (uint32_t)PyLong_AsLong($input);
-}
+%apply unsigned char { uint8_t };
+%apply char { int8_t };
+%apply unsigned int { uint16_t };
+%apply int { int16_t };
+%apply unsigned long { uint32_t };
+%apply long { int32_t };
+%apply unsigned long long { uint64_t };
+%apply long long { int64_t };
 
-%typemap(out) uint32 {
-   $result = PyLong_FromLong($1);
-}
-
 %typemap(out) NTSTATUS {
 $result = PyLong_FromLong(NT_STATUS_V($1));
 }



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

2005-01-28 Thread tpot
Author: tpot
Date: 2005-01-29 04:00:14 + (Sat, 29 Jan 2005)
New Revision: 5087

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

Log:
Add --swig to pidl flags so that swig .i files are generated with
make idl.

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-29 03:58:44 UTC 
(rev 5086)
+++ branches/SAMBA_4_0/source/script/build_idl.sh   2005-01-29 04:00:14 UTC 
(rev 5087)
@@ -4,7 +4,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"
+PIDL="$PERL ./build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header 
--parser --server --client --swig"
 
 if [ x$FULLBUILD = xFULL ]; then
   echo Rebuilding all idl files in librpc/idl



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

2005-01-28 Thread tpot
Author: tpot
Date: 2005-01-29 01:42:09 + (Sat, 29 Jan 2005)
New Revision: 5074

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

Log:
Remove dead code.

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


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


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

2005-01-28 Thread tpot
Author: tpot
Date: 2005-01-29 01:39:50 + (Sat, 29 Jan 2005)
New Revision: 5073

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

Log:
Call new autogenerator function for swig stuff instead of old one.

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/pidl.pl
===
--- branches/SAMBA_4_0/source/build/pidl/pidl.pl2005-01-29 00:19:23 UTC 
(rev 5072)
+++ branches/SAMBA_4_0/source/build/pidl/pidl.pl2005-01-29 01:39:50 UTC 
(rev 5073)
@@ -145,6 +145,12 @@
  my($eparserhdr) = dirname($output) . 
"/packet-dcerpc-$basename.h";
  IdlEParser::RewriteHeader($pidl, $header, $eparserhdr);
}
+   if ($opt_swig) {
+ my($filename) = $output;
+ $filename =~ s/\/ndr_/\//;
+ $filename = util::ChangeExtension($filename, ".i");
+ IdlSwig::RewriteHeader($pidl, $header, $filename);
+   }
}
 
if ($opt_client) {
@@ -210,12 +216,6 @@
  my($eparser) = dirname($output) . 
"/packet-dcerpc-$basename.c";
  IdlEParser::RewriteC($pidl, $parser, $eparser);
}
-   if ($opt_swig) {
- my($filename) = $output;
- $filename =~ s/\/ndr_/\//;
- $filename = util::ChangeExtension($filename, ".i");
- util::FileSave($filename, IdlSwig::Parse($pidl));
-   }
}
 
if ($opt_diff) {



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

2005-01-28 Thread tpot
Author: tpot
Date: 2005-01-29 00:19:23 + (Sat, 29 Jan 2005)
New Revision: 5072

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

Log:
oDecrease the amount of autogenerated code (sorry tridge) and use swig's
structure mapping features instead of doing it all ourselves.

This basically works, but has broken all the existing checked in Python
code.

Sample:

pipe = dcerpc.pipe_connect(binding,
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
domain, username, password)

r = dcerpc.samr_Connect2()
r.data_in.system_name = 'foo'
r.data_in.access_mask = 0x0200

result = dcerpc.dcerpc_samr_Connect2(pipe, r)

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-28 23:57:03 UTC 
(rev 5071)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm2005-01-29 00:19:23 UTC 
(rev 5072)
@@ -257,68 +257,6 @@
 $result .= IdlDump::DumpFunction($fn);
 $result .= "*/\n\n";
 
-# Generate function to convert Python dict to structure pointer
-
-$result .= "/* Convert Python dict to struct $fn->{NAME}.in */\n\n";
-
-$result .= "struct $fn->{NAME} *$fn->{NAME}_ptr_from_python(TALLOC_CTX 
*mem_ctx, PyObject *obj, char *name)\n";
-$result .= "{\n";
-
-$result .= "\tstruct $fn->{NAME} *s;\n\n";
-
-$result .= "\tif (!PyDict_Check(obj)) {\n";
-$result .= "\t\tPyErr_Format(PyExc_TypeError, \"Expecting dict value for 
key '%s'\", name);\n";
-$result .= "\t\t\treturn NULL;\n";
-$result .= "\t}\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";
-
-foreach my $e (@{$fn->{DATA}}) {
-   if (util::has_property($e, "in")) {
-   if (util::has_property($e, "ref")) {
-   $result .= "\tif (PyDict_GetItemString(obj, \"$e->{NAME}\") == 
Py_None) {\n";
-   $result .= "\t\tPyErr_Format(PyExc_ValueError, \"Key 
'$e->{NAME}' cannot be None\");\n";
-   $result .= "\t\treturn NULL;\n";
-   $result .= "\t}\n";
-   }
-   $result .= FieldFromPython($e, "in.") ;
-   }
-}
-
-$result .= "\n";
-$result .= "\treturn s;\n";
-$result .= "}\n\n";
-
-# Generate function to convert structure pointer to Python dict
-
-$result .= "/* Convert struct $fn->{NAME}.out to Python dict */\n\n";
-
-$result .= "PyObject *$fn->{NAME}_ptr_to_python(TALLOC_CTX *mem_ctx, 
struct $fn->{NAME} *s";
-
-foreach my $e (@{$fn->{DATA}}) {
-   if (isunion($e->{TYPE})) {
-   $result .= ", int $e->{NAME}_switch_is";
-   }
-}
-$result .= ")\n";
-
-$result .= "{\n";
-
-$result .= "\tPyObject *obj = PyDict_New();\n\n";
-
-foreach my $e (@{$fn->{DATA}}) {
-   $result .= FieldToPython($e, "out.") if util::has_property($e, "out")
-}
-
-$result .= "\n";
-$result .= "\treturn obj;\n";
-$result .= "}\n\n";
-
-$result .= "%}\n\n";
-
 # Input typemap
 
 $result .= "%typemap(in) struct $fn->{NAME} * {\n";
@@ -689,7 +627,6 @@
 
 foreach my $e (@{$data}) {
$result .= ParseFunction($e) if $e->{TYPE} eq "FUNCTION";
-   $result .= ParseTypedef($e) if $e->{TYPE} eq "TYPEDEF";
 }
 
 return $result;
@@ -744,4 +681,66 @@
 return $result;
 }
 
+sub pidl($)
+{
+   print OUT shift;
+}
+
+#
+# rewrite autogenerated header file
+sub RewriteHeader($$$)
+{
+my($idl) = shift;
+my($input) = shift;
+my($output) = shift;
+
+open(IN, "<$input") || die "can't open $input for reading";
+open(OUT, ">$output") || die "can't open $output for writing";
+
+pidl "%{\n";
+pidl "#define data_in in\n";
+pidl "#define data_out out\n";
+pidl "%}\n\n";
+   
+while() {
+
+   # Copy structure definitions
+
+   if (/^struct .*? {$/ .. /^\};$/) {
+   s/\} (in|out);/\} data_$1;/; # "in" is a Python keyword
+   pidl $_;
+   next;
+   }
+
+   # Copy dcerpc functions
+
+   pidl $_ if /^NTSTATUS dcerpc_.*?\(struct dcerpc_pipe/;
+
+   # Copy interface definitions
+
+pidl $_ 
+   if /^\#define DCERPC_.*?_UUID/ or /^\#define DCERPC_.*?_VERSION/;
+}
+
+close(OUT);   
+}
+
+#
+# rewrite autogenerated header file
+sub RewriteC($$$)
+{
+my($idl) = shift;
+my($input) = shift;
+my($output) = shift;
+
+open(IN, "<$input") || die "can't open $input for reading";
+open(OUT, ">>$output") || die "can't open $output for writing";
+   
+while() {
+}
+
+close(OUT);   
+}
+
+
 1;



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

2005-01-28 Thread tpot
Author: tpot
Date: 2005-01-28 23:56:35 + (Fri, 28 Jan 2005)
New Revision: 219

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

Log:
Remove TODO file.

Removed:
   trunk/ethereal/TODO


Changeset:
Deleted: trunk/ethereal/TODO
===
--- trunk/ethereal/TODO 2005-01-28 23:42:24 UTC (rev 218)
+++ trunk/ethereal/TODO 2005-01-28 23:56:35 UTC (rev 219)
@@ -1 +0,0 @@
- - check alignment correct for ndr_pull_NTTIME() and ndr_pull_NTTIME_hyper()



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

2005-01-27 Thread tpot
Author: tpot
Date: 2005-01-27 20:50:17 + (Thu, 27 Jan 2005)
New Revision: 5047

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

Log:
Fix swig dependencies.

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2005-01-27 
15:13:16 UTC (rev 5046)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2005-01-27 
20:50:17 UTC (rev 5047)
@@ -669,19 +669,19 @@
 
 swig: scripting/swig/_tdb.so scripting/swig/_dcerpc.so
 
-scripting/swig/tdb.py: scripting/swig/tdb.i
+scripting/swig/tdb_wrap.c: scripting/swig/tdb.i
swig -python scripting/swig/tdb.i
 
-scripting/swig/_tdb.so: scripting/swig/tdb.py scripting/swig/tdb_wrap.o 
\$(LIBRARY_swig_tdb_DEPEND_LIST)
+scripting/swig/_tdb.so: scripting/swig/tdb_wrap.o 
\$(LIBRARY_swig_tdb_DEPEND_LIST)
\$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_tdb.so 
scripting/swig/tdb_wrap.o \\
\$(LIBRARY_swig_tdb_SHARED_LINK_LIST) 
\$(LIBRARY_swig_tdb_SHARED_LINK_FLAGS)
 
 SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i 
librpc/gen_ndr/spoolss.i
 
-scripting/swig/dcerpc.py: scripting/swig/dcerpc.i scripting/swig/samba.i 
scripting/swig/status_codes.i \$(SWIG_INCLUDES)
+scripting/swig/dcerpc_wrap.c: 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 \$(LIBRARY_swig_dcerpc_DEPEND_LIST)
+scripting/swig/_dcerpc.so: scripting/swig/dcerpc_wrap.o 
\$(LIBRARY_swig_dcerpc_DEPEND_LIST)
\$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_dcerpc.so 
scripting/swig/dcerpc_wrap.o \$(LIBRARY_swig_dcerpc_SHARED_LINK_LIST) 
\$(LIBRARY_swig_dcerpc_SHARED_LINK_FLAGS)
 
 swig_clean:



svn commit: samba r5033 - in branches/SAMBA_4_0/source: build/smb_build script

2005-01-26 Thread tpot
Author: tpot
Date: 2005-01-27 04:41:40 + (Thu, 27 Jan 2005)
New Revision: 5033

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

Log:
Remove --with-eparserdir configure option and eparser_idl make target.
This is all done in the lorikeet/ethereal Makefile now.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/check_path.m4
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm
   branches/SAMBA_4_0/source/script/build_idl.sh


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/check_path.m4
===
--- branches/SAMBA_4_0/source/build/smb_build/check_path.m4 2005-01-27 
04:22:44 UTC (rev 5032)
+++ branches/SAMBA_4_0/source/build/smb_build/check_path.m4 2005-01-27 
04:41:40 UTC (rev 5033)
@@ -107,24 +107,6 @@
 ;;
   esac])
 
-#
-# set configuration directory location
-eparserdir=""
-
-AC_ARG_WITH(eparserdir,
-[  --with-eparserdir=DIRWhere to put output for the Ethereal/PIDL plugin],
-[ case "$withval" in
-  yes|no)
-  #
-  # Just in case anybody does it
-  #
-AC_MSG_ERROR([--with-eparserdir called without argument])
-  ;;
-  * )
-eparserdir="$withval"
-;;
-  esac])
-
 AC_SUBST(configdir)
 AC_SUBST(lockdir)
 AC_SUBST(piddir)
@@ -132,7 +114,6 @@
 AC_SUBST(privatedir)
 AC_SUBST(bindir)
 AC_SUBST(sbindir)
-AC_SUBST(eparserdir)
 
 debug=no
 AC_ARG_ENABLE(debug, 

Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2005-01-27 
04:22:44 UTC (rev 5032)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2005-01-27 
04:41:40 UTC (rev 5033)
@@ -32,7 +32,6 @@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
[EMAIL PROTECTED]@
 
 BASEDIR= [EMAIL PROTECTED]@
 BINDIR = [EMAIL PROTECTED]@
@@ -132,9 +131,6 @@
 idl: build/pidl/idl.pm
[EMAIL PROTECTED]"[EMAIL PROTECTED]@\" PERL=\"\$(PERL)\" 
script/build_idl.sh PARTIAL
 
-eparser_idl: build/pidl/idl.pm
-   CPP=\"[EMAIL PROTECTED]@\" PERL=\"\$(PERL)\" 
EPARSERPREFIX=\"\$(eparserdir)\" script/build_idl.sh EPARSER 
-
 build/pidl/idl.pm: build/pidl/idl.yp
-yapp -s build/pidl/idl.yp
 

Modified: branches/SAMBA_4_0/source/script/build_idl.sh
===
--- branches/SAMBA_4_0/source/script/build_idl.sh   2005-01-27 04:22:44 UTC 
(rev 5032)
+++ branches/SAMBA_4_0/source/script/build_idl.sh   2005-01-27 04:41:40 UTC 
(rev 5033)
@@ -5,7 +5,6 @@
 [ -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 --parser --eparser"
 
 if [ x$FULLBUILD = xFULL ]; then
   echo Rebuilding all idl files in librpc/idl
@@ -13,12 +12,6 @@
   exit 0
 fi
 
-if [ x$FULLBUILD = xEPARSER ]; then
-  echo Rebuilding all idl files in librpc/idl
-  $EPARSERPIDL librpc/idl/*.idl || exit 1
-  exit 0
-fi
-
 list=""
 
 for f in librpc/idl/*.idl; do



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

2005-01-26 Thread tpot
Author: tpot
Date: 2005-01-27 04:36:18 + (Thu, 27 Jan 2005)
New Revision: 214

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

Log:
Update patch - someone added another plugin which broke it.

Modified:
   trunk/ethereal/ethereal-pidl.patch


Changeset:
Modified: trunk/ethereal/ethereal-pidl.patch
===
--- trunk/ethereal/ethereal-pidl.patch  2005-01-27 04:36:18 UTC (rev 213)
+++ trunk/ethereal/ethereal-pidl.patch  2005-01-27 04:36:18 UTC (rev 214)
@@ -1,8 +1,8 @@
 Index: configure.in
 ===
 configure.in   (revision 11574)
+--- configure.in   (revision 13180)
 +++ configure.in   (working copy)
-@@ -1189,6 +1189,7 @@
+@@ -1243,6 +1243,7 @@
plugins/mgcp/Makefile
plugins/opsi/Makefile
plugins/pcli/Makefile
@@ -12,14 +12,14 @@
plugins/rtnet/Makefile
 Index: plugins/Makefile.am
 ===
 plugins/Makefile.am(revision 11574)
+--- plugins/Makefile.am(revision 13180)
 +++ plugins/Makefile.am(working copy)
 @@ -21,7 +21,7 @@
  # along with this program; if not, write to the Free Software
  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  
--SUBDIRS = acn artnet asn1 ciscosm docsis enttec giop gryphon irda lwres 
megaco mgcp opsi pcli rdm rlm rtnet rudp v5ua
-+SUBDIRS = acn artnet asn1 ciscosm docsis enttec giop gryphon irda lwres 
megaco mgcp opsi pcli pidl rdm rlm rtnet rudp v5ua
+-SUBDIRS = acn artnet asn1 ciscosm docsis enttec giop gryphon irda lwres mate 
megaco mgcp opsi pcli rdm rlm rtnet rudp v5ua
++SUBDIRS = acn artnet asn1 ciscosm docsis enttec giop gryphon irda lwres mate 
megaco mgcp opsi pcli pidl rdm rlm rtnet rudp v5ua
  
  plugindir = @plugindir@
  



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

2005-01-26 Thread tpot
Author: tpot
Date: 2005-01-27 01:06:50 + (Thu, 27 Jan 2005)
New Revision: 5026

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

Log:
Don't build the swig stuff by default until it's a bit more stable.

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-26 22:49:54 UTC 
(rev 5025)
+++ branches/SAMBA_4_0/source/script/build_idl.sh   2005-01-27 01:06:50 UTC 
(rev 5026)
@@ -4,7 +4,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 --swig"
+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 --parser --eparser"
 
 if [ x$FULLBUILD = xFULL ]; then



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

2005-01-26 Thread tpot
Author: tpot
Date: 2005-01-26 22:34:30 + (Wed, 26 Jan 2005)
New Revision: 5024

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

Log:
Fix build.

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/pidl.pl
===
--- branches/SAMBA_4_0/source/build/pidl/pidl.pl2005-01-26 21:51:00 UTC 
(rev 5023)
+++ branches/SAMBA_4_0/source/build/pidl/pidl.pl2005-01-26 22:34:30 UTC 
(rev 5024)
@@ -145,12 +145,6 @@
  my($eparserhdr) = dirname($output) . 
"/packet-dcerpc-$basename.h";
  IdlEParser::RewriteHeader($pidl, $header, $eparserhdr);
}
-   if ($opt_swig) {
- my($filename) = $output;
- $filename =~ s/\/ndr_/\//;
- $filename = util::ChangeExtension($filename, ".i");
- IdlSwig::RewriteHeader($pidl, $header, $filename);
-   }
}
 
if ($opt_client) {
@@ -220,7 +214,7 @@
  my($filename) = $output;
  $filename =~ s/\/ndr_/\//;
  $filename = util::ChangeExtension($filename, ".i");
- IdlSwig::RewriteC($pidl, $parser, $filename);
+ util::FileSave($pidl, IdlSwig::Parse($pidl));
}
}
 



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

2005-01-26 Thread tpot
Author: tpot
Date: 2005-01-26 20:46:58 + (Wed, 26 Jan 2005)
New Revision: 5019

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

Log:
Some tweaks to building the swig .i files.

Modified:
   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/pidl.pl
===
--- branches/SAMBA_4_0/source/build/pidl/pidl.pl2005-01-26 20:43:55 UTC 
(rev 5018)
+++ branches/SAMBA_4_0/source/build/pidl/pidl.pl2005-01-26 20:46:58 UTC 
(rev 5019)
@@ -145,6 +145,12 @@
  my($eparserhdr) = dirname($output) . 
"/packet-dcerpc-$basename.h";
  IdlEParser::RewriteHeader($pidl, $header, $eparserhdr);
}
+   if ($opt_swig) {
+ my($filename) = $output;
+ $filename =~ s/\/ndr_/\//;
+ $filename = util::ChangeExtension($filename, ".i");
+ IdlSwig::RewriteHeader($pidl, $header, $filename);
+   }
}
 
if ($opt_client) {
@@ -210,15 +216,14 @@
  my($eparser) = dirname($output) . 
"/packet-dcerpc-$basename.c";
  IdlEParser::RewriteC($pidl, $parser, $eparser);
}
+   if ($opt_swig) {
+ my($filename) = $output;
+ $filename =~ s/\/ndr_/\//;
+ $filename = util::ChangeExtension($filename, ".i");
+ IdlSwig::RewriteC($pidl, $parser, $filename);
+   }
}
 
-   if ($opt_swig) {
-   my($filename) = $output;
-   $filename =~ s/\/ndr_/\//;
-   $filename = util::ChangeExtension($filename, ".i");
-   util::FileSave($filename, IdlSwig::Parse($pidl));
-   }
-
if ($opt_diff) {
my($tempfile) = util::ChangeExtension($output, ".tmp");
util::FileSave($tempfile, IdlDump::Dump($pidl));

Modified: branches/SAMBA_4_0/source/script/build_idl.sh
===
--- branches/SAMBA_4_0/source/script/build_idl.sh   2005-01-26 20:43:55 UTC 
(rev 5018)
+++ branches/SAMBA_4_0/source/script/build_idl.sh   2005-01-26 20:46:58 UTC 
(rev 5019)
@@ -4,7 +4,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"
+PIDL="$PERL ./build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header 
--parser --server --client --swig"
 EPARSERPIDL="$PERL ./build/pidl/pidl.pl --output $EPARSERPREFIX/ndr_ --parse 
--header --parser --eparser"
 
 if [ x$FULLBUILD = xFULL ]; then



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

2005-01-26 Thread tpot
Author: tpot
Date: 2005-01-26 20:43:55 + (Wed, 26 Jan 2005)
New Revision: 5018

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

Log:
Initialise required subsystems (by hand, generated by substituting
BINARY for LIBRARY in config.mk).

Cut things down to just the samr pipe for the moment.

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-26 20:41:58 UTC 
(rev 5017)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-01-26 20:43:55 UTC 
(rev 5018)
@@ -341,6 +341,46 @@
werror_exception = PyErr_NewException("_dcerpc.WERROR", NULL, NULL);
PyDict_SetItemString(d, "NTSTATUS", ntstatus_exception);
PyDict_SetItemString(d, "WERROR", werror_exception);
+
+/* BINARY swig_dcerpc INIT */
+
+   extern NTSTATUS dcerpc_misc_init(void);
+   extern NTSTATUS dcerpc_krb5pac_init(void);
+   extern NTSTATUS dcerpc_samr_init(void);
+   extern NTSTATUS dcerpc_dcerpc_init(void);
+   extern NTSTATUS auth_sam_init(void);
+   extern NTSTATUS dcerpc_lsa_init(void);
+   extern NTSTATUS dcerpc_netlogon_init(void);
+   extern NTSTATUS gensec_init(void);
+   extern NTSTATUS auth_developer_init(void);
+   extern NTSTATUS gensec_spnego_init(void);
+   extern NTSTATUS auth_winbind_init(void);
+   extern NTSTATUS gensec_gssapi_init(void);
+   extern NTSTATUS gensec_ntlmssp_init(void);
+   extern NTSTATUS dcerpc_nbt_init(void);
+   extern NTSTATUS auth_anonymous_init(void);
+   extern NTSTATUS gensec_krb5_init(void);
+   extern NTSTATUS dcerpc_schannel_init(void);
+   extern NTSTATUS dcerpc_epmapper_init(void);
+   if (NT_STATUS_IS_ERR(dcerpc_misc_init())) exit(1);
+   if (NT_STATUS_IS_ERR(dcerpc_krb5pac_init())) exit(1);
+   if (NT_STATUS_IS_ERR(dcerpc_samr_init())) exit(1);
+   if (NT_STATUS_IS_ERR(dcerpc_dcerpc_init())) exit(1);
+   if (NT_STATUS_IS_ERR(auth_sam_init())) exit(1);
+   if (NT_STATUS_IS_ERR(dcerpc_lsa_init())) exit(1);
+   if (NT_STATUS_IS_ERR(dcerpc_netlogon_init())) exit(1);
+   if (NT_STATUS_IS_ERR(gensec_init())) exit(1);
+   if (NT_STATUS_IS_ERR(auth_developer_init())) exit(1);
+   if (NT_STATUS_IS_ERR(gensec_spnego_init())) exit(1);
+   if (NT_STATUS_IS_ERR(auth_winbind_init())) exit(1);
+   if (NT_STATUS_IS_ERR(gensec_gssapi_init())) exit(1);
+   if (NT_STATUS_IS_ERR(gensec_ntlmssp_init())) exit(1);
+   if (NT_STATUS_IS_ERR(dcerpc_nbt_init())) exit(1);
+   if (NT_STATUS_IS_ERR(auth_anonymous_init())) exit(1);
+   if (NT_STATUS_IS_ERR(gensec_krb5_init())) exit(1);
+   if (NT_STATUS_IS_ERR(dcerpc_schannel_init())) exit(1);
+   if (NT_STATUS_IS_ERR(dcerpc_epmapper_init())) exit(1);
+
 %}
 
 %typemap(in, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe 
*temp_dcerpc_pipe) {
@@ -402,12 +442,4 @@
 #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"
-%include "librpc/gen_ndr/spoolss.i"
-
-/* The status codes must be included last otherwise the automatically
-   generated .i files get confused.  This is kind of yucky. */
-
-%include "status_codes.i"



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

2005-01-26 Thread tpot
Author: tpot
Date: 2005-01-26 20:41:58 + (Wed, 26 Jan 2005)
New Revision: 5017

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

Log:
Fix bug in output typemap for uint32 (!)

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.i2005-01-26 20:40:59 UTC 
(rev 5016)
+++ branches/SAMBA_4_0/source/scripting/swig/samba.i2005-01-26 20:41:58 UTC 
(rev 5017)
@@ -33,7 +33,7 @@
 }
 
 %typemap(out) uint32 {
-   $1 = PyLong_FromLong($input);
+   $result = PyLong_FromLong($1);
 }
 
 %typemap(out) NTSTATUS {



svn commit: samba r5016 - in branches/SAMBA_4_0/source: build/smb_build scripting/swig

2005-01-26 Thread tpot
Author: tpot
Date: 2005-01-26 20:40:59 + (Wed, 26 Jan 2005)
New Revision: 5016

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

Log:
Use LIBRARY instead of BINARY for inserting the swig stuff into the
build system.  This still generates bogus targets (i.e 
bin/swig_dcerpc.so.0.0.1) and the subsystem initialisation needs to be
done by hand but it is less of a hack.

Removed:
   branches/SAMBA_4_0/source/scripting/swig/dummymain.c
Modified:
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm
   branches/SAMBA_4_0/source/scripting/swig/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2005-01-26 
20:36:44 UTC (rev 5015)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2005-01-26 
20:40:59 UTC (rev 5016)
@@ -676,17 +676,17 @@
 scripting/swig/tdb.py: scripting/swig/tdb.i
swig -python scripting/swig/tdb.i
 
-scripting/swig/_tdb.so: scripting/swig/tdb.py scripting/swig/tdb_wrap.o 
\$(BINARY_swig_tdb_LINK_LIST)
+scripting/swig/_tdb.so: scripting/swig/tdb.py scripting/swig/tdb_wrap.o 
\$(LIBRARY_swig_tdb_DEPEND_LIST)
\$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_tdb.so 
scripting/swig/tdb_wrap.o \\
-   \$(BINARY_swig_tdb_LINK_LIST) \$(BINARY_swig_tdb_LINK_FLAGS)
+   \$(LIBRARY_swig_tdb_SHARED_LINK_LIST) 
\$(LIBRARY_swig_tdb_SHARED_LINK_FLAGS)
 
-SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i 
librpc/gen_ndr/winreg.i librpc/gen_ndr/spoolss.i
+SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i 
librpc/gen_ndr/spoolss.i
 
 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 \$(BINARY_swig_dcerpc_DEPEND_LIST)
-   \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_dcerpc.so 
scripting/swig/dcerpc_wrap.o \$(BINARY_swig_dcerpc_DEPEND_LIST) 
\$(BINARY_swig_dcerpc_LINK_FLAGS)
+scripting/swig/_dcerpc.so: scripting/swig/dcerpc.py 
scripting/swig/dcerpc_wrap.o \$(LIBRARY_swig_dcerpc_DEPEND_LIST)
+   \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_dcerpc.so 
scripting/swig/dcerpc_wrap.o \$(LIBRARY_swig_dcerpc_SHARED_LINK_LIST) 
\$(LIBRARY_swig_dcerpc_SHARED_LINK_FLAGS)
 
 swig_clean:
-rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc \\

Modified: branches/SAMBA_4_0/source/scripting/swig/config.mk
===
--- branches/SAMBA_4_0/source/scripting/swig/config.mk  2005-01-26 20:36:44 UTC 
(rev 5015)
+++ branches/SAMBA_4_0/source/scripting/swig/config.mk  2005-01-26 20:40:59 UTC 
(rev 5016)
@@ -1,7 +1,11 @@
-[BINARY::swig_tdb]
-OBJ_FILES = scripting/swig/dummymain.o
+[LIBRARY::swig_tdb]
+MAJOR_VERSION = 0
+MINOR_VERSION = 0
+RELEASE_VERSION = 1
 REQUIRED_SUBSYSTEMS = LIBTDB
 
-[BINARY::swig_dcerpc]
-OBJ_FILES = scripting/swig/dummymain.o
+[LIBRARY::swig_dcerpc]
+MAJOR_VERSION = 0
+MINOR_VERSION = 0
+RELEASE_VERSION = 1
 REQUIRED_SUBSYSTEMS = LIBCLI NDR_MISC LIBBASIC CONFIG RPC_NDR_SAMR

Deleted: branches/SAMBA_4_0/source/scripting/swig/dummymain.c
===
--- branches/SAMBA_4_0/source/scripting/swig/dummymain.c2005-01-26 
20:36:44 UTC (rev 5015)
+++ branches/SAMBA_4_0/source/scripting/swig/dummymain.c2005-01-26 
20:40:59 UTC (rev 5016)
@@ -1,9 +0,0 @@
-/* 
- * Dummy main function as the build system doesn't seem to create a
- * dependency list for a subsystem.
- */
-
-int main(void)
-{
-   return 0;
-}



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-26 07:18:50 + (Wed, 26 Jan 2005)
New Revision: 200

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

Log:
Update autogenerated files.

Modified:
   trunk/ethereal/plugins/pidl/packet-dcerpc-atsvc.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-drsuapi.c
   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
   trunk/ethereal/plugins/pidl/packet-dcerpc-winreg.c


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


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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-26 07:06:22 + (Wed, 26 Jan 2005)
New Revision: 5010

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

Log:
Handle weird-ass NTTIME_1sec and NTTIME_hyper types.

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-26 06:51:39 UTC 
(rev 5009)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-26 07:06:22 UTC 
(rev 5010)
@@ -117,7 +117,8 @@
  
 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");
+return "FT_UINT64", if $t eq "HYPER_T" or $t eq "NTTIME"
+   or $t eq "NTTIME_1sec" or $t eq "NTTIME_hyper";
 
 # Type is an enum
 



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-26 06:51:39 + (Wed, 26 Jan 2005)
New Revision: 5009

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

Log:
Put bitmaps in 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-26 06:29:10 UTC 
(rev 5008)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-26 06:51:39 UTC 
(rev 5009)
@@ -319,6 +319,8 @@
'bitmask' => "$2"
};
}
+
+   $needed{"ett_$t->{NAME}"} = 1;
}
 }
 
@@ -645,10 +647,13 @@
pidl $_;
 
if (defined($bitmaps{$cur_fn})) {
+   pidl "\t{\n\t\tproto_tree *subtree = NULL;\n\n";
+   pidl "\t\tif (tree->proto_tree)\n\t\t\tsubtree = 
proto_item_add_subtree(tree->proto_tree->last_child, ett_$cur_fn);\n\n";
foreach my $e (@{$bitmaps{$cur_fn}->{DATA}{ELEMENTS}}) {
$e =~ /^(.*?) \( (.*?) \)$/;
-   pidl "\tproto_tree_add_boolean(tree->proto_tree, 
hf_${cur_fn}_$1, ndr->tvb, ndr->offset - sizeof(v), sizeof(v), v);\n";
+   pidl "\t\tproto_tree_add_boolean(subtree, hf_${cur_fn}_$1, 
ndr->tvb, ndr->offset - sizeof(v), sizeof(v), v);\n";
}
+   pidl "\t}\n";
}
 
next;



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-26 06:29:10 + (Wed, 26 Jan 2005)
New Revision: 5008

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

Log:
32-bits is the default bitmap size.

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-26 05:24:13 UTC 
(rev 5007)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-26 06:29:10 UTC 
(rev 5008)
@@ -215,11 +215,10 @@
 {
 my $e = shift;
 
-return "32", if util::has_property($e->{DATA}, "bitmap32bit");
 return "16", if util::has_property($e->{DATA}, "bitmap16bit");
 return "8", if util::has_property($e->{DATA}, "bitmap8bit");
 
-die("can't calculate bitmap size for $e->{NAME}");
+return "32";
 }
 
 sub NeededTypedef($)



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-26 05:24:13 + (Wed, 26 Jan 2005)
New Revision: 5007

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

Log:
Fix bug in regexp where we were eating the strings "in" or "out" from
structure names if they started with those strings.

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-26 04:50:04 UTC 
(rev 5006)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-26 05:24:13 UTC 
(rev 5007)
@@ -698,8 +698,8 @@
s/(ndr_pull_([^\)]*?)\(
   ndr,\ 
   (NDR_[^,]*?),\ 
-  (&?r->(in|out|)\.?([^\(].*?))\);)
-   /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$6\", ndr, ett_$2), 
$4);
+  (&?r->((in|out)\.)?([^\(].*?))\);)
+   /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$7\", ndr, ett_$2), 
$4);
/smgx;
}
 
@@ -709,7 +709,7 @@
s/(ndr_pull_([^\)]*?)\(
   ndr,\ 
   (NDR_[^,]*?),\ 
-  (&?r->(in|out|)\.?([^\(].*?))\);)
+  (&?r->((in|out)\.)?([^\(].*?))\);)
/ndr_pull_$2(ndr, $3, get_subtree(tree, \"$2\", ndr, ett_$2), 
$4);
/smgx;
}



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-26 04:50:04 + (Wed, 26 Jan 2005)
New Revision: 5006

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

Log:
Implement parsing of pidl bitmaps in ethereal parsers.  This works
well but needs to be stuck in a 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-26 04:34:16 UTC 
(rev 5005)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-26 04:50:04 UTC 
(rev 5006)
@@ -10,6 +10,7 @@
 
 # the list of needed functions
 my %needed;
+my %bitmaps;
 
 my $module;
 my $if_uuid;
@@ -210,6 +211,17 @@
};
 }
 
+sub bitmapbase($)
+{
+my $e = shift;
+
+return "32", if util::has_property($e->{DATA}, "bitmap32bit");
+return "16", if util::has_property($e->{DATA}, "bitmap16bit");
+return "8", if util::has_property($e->{DATA}, "bitmap8bit");
+
+die("can't calculate bitmap size for $e->{NAME}");
+}
+
 sub NeededTypedef($)
 {
my $t = shift;
@@ -296,12 +308,15 @@
}
 
if ($t->{DATA}->{TYPE} eq "BITMAP") {
+
+   $bitmaps{$t->{NAME}} = $t;
+
foreach my $e (@{$t->{DATA}{ELEMENTS}}) {
$e =~ /^(.*?) \( (.*?) \)$/;
$needed{"hf_$t->{NAME}_$1"} = {
-   'name' => "$t->{NAME} $1",
+   'name' => "$1",
'ft' => "FT_BOOLEAN",
-   'base' => "32",
+   'base' => bitmapbase($t),
'bitmask' => "$2"
};
}
@@ -615,9 +630,6 @@
 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\);)
-   /ndr_pull_$2(ndr, tree, hf, &v);/smgx;
-
s/(ndr_pull_([^\(]+?)\(ndr,\ &_level\);)
/ndr_pull_$2(ndr, tree, hf_${cur_fn}_level, &_level);/smgx;
 
@@ -626,6 +638,23 @@
 s/(^(static\ )?NTSTATUS\ ndr_pull_(.+?),\ uint(8|16|32)\ \*r\))
/NTSTATUS ndr_pull_$3, pidl_tree *tree, int hf, uint$4_t *r)/smgx;
 
+if (/ndr_pull_([^\)]*?)\(ndr, &v\);/) {
+
+   s/(ndr_pull_([^\)]*?)\(ndr,\ &v\);)
+   /ndr_pull_$2(ndr, tree, hf, &v);/smgx;
+
+   pidl $_;
+
+   if (defined($bitmaps{$cur_fn})) {
+   foreach my $e (@{$bitmaps{$cur_fn}->{DATA}{ELEMENTS}}) {
+   $e =~ /^(.*?) \( (.*?) \)$/;
+   pidl "\tproto_tree_add_boolean(tree->proto_tree, 
hf_${cur_fn}_$1, ndr->tvb, ndr->offset - sizeof(v), sizeof(v), v);\n";
+   }
+   }
+
+   next;
+   }
+
# Call ethereal wrappers for pull of scalar values in
# structures and functions, e.g
#



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-26 04:34:16 + (Wed, 26 Jan 2005)
New Revision: 5005

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

Log:
Add missing size specifiers to various bitmaps.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/dssetup.idl
   branches/SAMBA_4_0/source/librpc/idl/netlogon.idl
   branches/SAMBA_4_0/source/librpc/idl/samr.idl
   branches/SAMBA_4_0/source/librpc/idl/svcctl.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/dssetup.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/dssetup.idl2005-01-26 03:19:42 UTC 
(rev 5004)
+++ branches/SAMBA_4_0/source/librpc/idl/dssetup.idl2005-01-26 04:34:16 UTC 
(rev 5005)
@@ -24,7 +24,7 @@
DS_ROLE_PRIMARY_DC = 5
} dssetup_DsRole;
 
-   typedef bitmap {
+   typedef [bitmap32bit] bitmap {
DS_ROLE_PRIMARY_DS_RUNNING  = 0x0001,
DS_ROLE_PRIMARY_DS_MIXED_MODE   = 0x0002,
DS_ROLE_UPGRADE_IN_PROGRESS = 0x0004,

Modified: branches/SAMBA_4_0/source/librpc/idl/netlogon.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/netlogon.idl   2005-01-26 03:19:42 UTC 
(rev 5004)
+++ branches/SAMBA_4_0/source/librpc/idl/netlogon.idl   2005-01-26 04:34:16 UTC 
(rev 5005)
@@ -1096,7 +1096,7 @@
//
/* Function 0x28 */
 
-   typedef bitmap {
+   typedef [bitmap32bit] bitmap {
NETR_TRUST_FLAG_IN_FOREST = 0x0001,
NETR_TRUST_FLAG_OUTBOUND  = 0x0002,
NETR_TRUST_FLAG_TREEROOT  = 0x0004,
@@ -1112,7 +1112,7 @@
NETR_TRUST_TYPE_DCE = 4
} netr_TrustType;
 
-   typedef bitmap {
+   typedef [bitmap32bit] bitmap {
NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE = 0x0001,
NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY   = 0x0002,
NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN = 0x0004,

Modified: branches/SAMBA_4_0/source/librpc/idl/samr.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/samr.idl   2005-01-26 03:19:42 UTC 
(rev 5004)
+++ branches/SAMBA_4_0/source/librpc/idl/samr.idl   2005-01-26 04:34:16 UTC 
(rev 5005)
@@ -16,7 +16,7 @@
 ] interface samr
 {
/* account control (acct_flags) bits */
-   typedef [public] bitmap {
+   typedef [public,bitmap32bit] bitmap {
ACB_DISABLED  = 0x0001,  /* 1 = User account disabled */
ACB_HOMDIRREQ = 0x0002,  /* 1 = Home directory required */
ACB_PWNOTREQ  = 0x0004,  /* 1 = User password not required 
*/
@@ -664,7 +664,7 @@
} samr_UserInfo20;
 
/* this defines the bits used for fields_present in info21 */
-   typedef bitmap {
+   typedef [bitmap32bit] bitmap {
SAMR_FIELD_NAME = 0x0002,
SAMR_FIELD_DESCRIPTION  = 0x0010,
SAMR_FIELD_COMMENT  = 0x0020,

Modified: branches/SAMBA_4_0/source/librpc/idl/svcctl.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/svcctl.idl 2005-01-26 03:19:42 UTC 
(rev 5004)
+++ branches/SAMBA_4_0/source/librpc/idl/svcctl.idl 2005-01-26 04:34:16 UTC 
(rev 5005)
@@ -46,7 +46,7 @@
const int SERVICE_STATE_INACTIVE = 0x02;
const int SERVICE_STATE_ALL  = 0x00;
 
-   typedef [public] bitmap {
+   typedef [public,bitmap32bit] bitmap {
SV_TYPE_WORKSTATION   = 0x0001,
SV_TYPE_SERVER= 0x0002,
SV_TYPE_SQLSERVER = 0x0004,



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-25 23:14:46 + (Tue, 25 Jan 2005)
New Revision: 4993

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

Log:
Generate nicer name for enum hf.

Start work on supporting bitmaps.

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-25 22:56:13 UTC 
(rev 4992)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-25 23:14:46 UTC 
(rev 4993)
@@ -288,12 +288,24 @@
if ($t->{DATA}->{TYPE} eq "ENUM") {
 
$needed{"hf_$t->{NAME}"} = {
-   'name' => $t->{NAME},
+   'name' => field2name($t->{NAME}),
'ft' => 'FT_UINT16',
'base' => 'BASE_DEC',
'strings' => "VALS($t->{NAME}_vals)"
};
}
+
+   if ($t->{DATA}->{TYPE} eq "BITMAP") {
+   foreach my $e (@{$t->{DATA}{ELEMENTS}}) {
+   $e =~ /^(.*?) \( (.*?) \)$/;
+   $needed{"hf_$t->{NAME}_$1"} = {
+   'name' => "$t->{NAME} $1",
+   'ft' => "FT_BOOLEAN",
+   'base' => "32",
+   'bitmask' => "$2"
+   };
+   }
+   }
 }
 
 #
@@ -766,7 +778,8 @@
next, if !($x =~ /^hf_/);
pidl "\t{ &$x,\n";
$needed{$x}{strings} = "NULL", if !defined($needed{$x}{strings});
-   pidl "\t  { \"$needed{$x}{name}\", \"$x\", $needed{$x}{ft}, 
$needed{$x}{base}, $needed{$x}{strings}, 0, \"$x\", HFILL }},\n";
+   $needed{$x}{bitmask} = "0", if !defined($needed{$x}{bitmask});
+   pidl "\t  { \"$needed{$x}{name}\", \"$x\", $needed{$x}{ft}, 
$needed{$x}{base}, $needed{$x}{strings}, $needed{$x}{bitmask}, \"$x\", HFILL 
}},\n";
 }
 
 pidl "\t};\n\n";



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-25 22:38:57 + (Tue, 25 Jan 2005)
New Revision: 4991

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

Log:
Remove debugging statement.

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-25 22:33:44 UTC 
(rev 4990)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-25 22:38:57 UTC 
(rev 4991)
@@ -369,7 +369,6 @@
 sub ParseEnum($)
 {
 my ($e) = shift;
-print Dumper($e);
 
 pidl "static const value_string $e->{PARENT}{NAME}_vals[] =\n";
 pidl "{\n";



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-25 22:33:44 + (Tue, 25 Jan 2005)
New Revision: 4990

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

Log:
Generate value strings for pidl enumerations.

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-25 20:36:24 UTC 
(rev 4989)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-25 22:33:44 UTC 
(rev 4990)
@@ -290,7 +290,8 @@
$needed{"hf_$t->{NAME}"} = {
'name' => $t->{NAME},
'ft' => 'FT_UINT16',
-   'base' => 'BASE_DEC'
+   'base' => 'BASE_DEC',
+   'strings' => "VALS($t->{NAME}_vals)"
};
}
 }
@@ -363,6 +364,25 @@
 }
 
 #
+# generate code to parse an enum
+
+sub ParseEnum($)
+{
+my ($e) = shift;
+print Dumper($e);
+
+pidl "static const value_string $e->{PARENT}{NAME}_vals[] =\n";
+pidl "{\n";
+
+foreach my $x (@{$e->{ELEMENTS}}) {
+   $x =~ /([^=]*)=(.*)/;
+   pidl "\t{ $1, \"$1\" },\n";
+}
+
+pidl "};\n\n";
+}
+
+#
 # rewrite autogenerated header file
 sub RewriteHeader($$$)
 {
@@ -475,11 +495,29 @@
 
#
 # Regexps to do a first pass at removing stuff we aren't
-   # interested in for ehtereal parsers.
+   # interested in for ethereal parsers.
#
 
next, if /^\#include \"includes.h\"/;
 
+   # Rewrite includes to packet-dcerpc-foo.h instead of ndr_foo.h
+
+   s/^\#include \".*?ndr_(.*?).h\"$/\#include \"packet-dcerpc-$1.h\"/smg;
+
+   if (/\.h\"$/) {
+   pidl $_;
+   foreach my $x (@{$idl}) {
+   if ($x->{TYPE} eq "INTERFACE") { 
+   foreach my $y (@{$x->{INHERITED_DATA}}) {
+   if ($y->{TYPE} eq "TYPEDEF") {
+   ParseEnum($y->{DATA}), if $y->{DATA}{TYPE} eq 
"ENUM";
+   }
+   }
+   }
+   }
+   next;
+   }
+
# Remove the NDR_CHECK() macro calls.  Ethereal take care of
# this for us as part of the tvbuff_t structure.
 
@@ -502,10 +540,6 @@
 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
-
-   s/^\#include \".*?ndr_(.*?).h\"$/\#include \"packet-dcerpc-$1.h\"/smg;
-
 #
 # Remember which structure or function we are processing.
 #
@@ -587,13 +621,22 @@
# ndr_pull_uint32(ndr, &r->in.access_mask);
# ndr_pull_uint32(ndr, &r->idx);
 
-   s/(ndr_pull_([^\)]*?)
-  \(ndr,\ 
-  (&?r->((in|out)\.)? # Function args contain leading junk
-   ([^\)]*?)) # Element name
-  \);)  
-   /ndr_pull_$2(ndr, tree, hf_${cur_fn}_$6, $3);/smgx;
+if (/(ndr_pull_([^\)]*?)\(ndr, (&?r->((in|out)\.)?([^\)]*?))\);)/) {
 
+   my $pull_type = "${cur_fn}_$6";
+
+   if (defined($needed{"hf_$2"})) {
+   $pull_type = "$2";
+   }
+
+   s/(ndr_pull_([^\)]*?)
+  \(ndr,\ 
+  (&?r->((in|out)\.)? # Function args contain leading junk
+   ([^\)]*?)) # Element name
+  \);)  
+   /ndr_pull_$2(ndr, tree, hf_$pull_type, $3);/smgx;
+   }
+
# Add tree and hf argument to pulls of "internal" scalars like
# array sizes, levels, etc.
 
@@ -723,7 +766,8 @@
 foreach my $x (keys(%needed)) {
next, if !($x =~ /^hf_/);
pidl "\t{ &$x,\n";
-   pidl "\t  { \"$needed{$x}{name}\", \"$x\", $needed{$x}{ft}, 
$needed{$x}{base}, NULL, 0, \"$x\", HFILL }},\n";
+   $needed{$x}{strings} = "NULL", if !defined($needed{$x}{strings});
+   pidl "\t  { \"$needed{$x}{name}\", \"$x\", $needed{$x}{ft}, 
$needed{$x}{base}, $needed{$x}{strings}, 0, \"$x\", HFILL }},\n";
 }
 
 pidl "\t};\n\n";



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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-25 11:38:39 + (Tue, 25 Jan 2005)
New Revision: 4983

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

Log:
On second thoughts don't include the config.mk file for the swig stuff
just yet.  More testing required.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/main.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/main.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/main.pm   2005-01-25 11:21:25 UTC 
(rev 4982)
+++ branches/SAMBA_4_0/source/build/smb_build/main.pm   2005-01-25 11:38:39 UTC 
(rev 4983)
@@ -56,7 +56,6 @@
"libcli/config.mk",
"libcli/security/config.mk",
"winbind/config.mk",
-   "scripting/swig/config.mk"
);
 
$| = 1;



svn commit: samba r4982 - in branches/SAMBA_4_0/source: build/smb_build scripting/swig

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-25 11:21:25 + (Tue, 25 Jan 2005)
New Revision: 4982

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

Log:
Start to move swig dependencies into new build system.  Unfortunately
I can only get something useful happening by using the BINARY keyword
as nothing else seems to generate dependency lists that can be used
when linking the swig shared libraries.  Anyway this is a lot nicer
than having lots of junk in makefile.pm.

Added:
   branches/SAMBA_4_0/source/scripting/swig/config.mk
   branches/SAMBA_4_0/source/scripting/swig/dummymain.c
Modified:
   branches/SAMBA_4_0/source/build/smb_build/main.pm
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/main.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/main.pm   2005-01-25 10:20:24 UTC 
(rev 4981)
+++ branches/SAMBA_4_0/source/build/smb_build/main.pm   2005-01-25 11:21:25 UTC 
(rev 4982)
@@ -55,7 +55,8 @@
"libcli/libsmb.mk",
"libcli/config.mk",
"libcli/security/config.mk",
-   "winbind/config.mk"
+   "winbind/config.mk",
+   "scripting/swig/config.mk"
);
 
$| = 1;

Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2005-01-25 
10:20:24 UTC (rev 4981)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2005-01-25 
11:21:25 UTC (rev 4982)
@@ -673,49 +673,20 @@
 
 swig: scripting/swig/_tdb.so scripting/swig/_dcerpc.so
 
-PYTHON_TDB_OBJ = lib/tdb/common/tdb.o lib/tdb/common/spinlock.o
-
 scripting/swig/tdb.py: scripting/swig/tdb.i
swig -python scripting/swig/tdb.i
 
-scripting/swig/_tdb.so: scripting/swig/tdb.py scripting/swig/tdb_wrap.o 
\$(PYTHON_TDB_OBJ)
+scripting/swig/_tdb.so: scripting/swig/tdb.py scripting/swig/tdb_wrap.o 
\$(BINARY_swig_tdb_LINK_LIST)
\$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_tdb.so 
scripting/swig/tdb_wrap.o \\
-   \$(PYTHON_TDB_OBJ)
+   \$(BINARY_swig_tdb_LINK_LIST) \$(BINARY_swig_tdb_LINK_FLAGS)
 
-PYTHON_DCERPC_OBJ = \$(SUBSYSTEM_LIBRPC_RAW_OBJS) \\
-   \$(SUBSYSTEM_LIBDCOM_OBJS) \\
-   \$(SUBSYSTEM_LIBNDR_RAW_OBJS) \\
-   \$(SUBSYSTEM_LIBNDR_GEN_OBJS) \\
-   \$(SUBSYSTEM_LIBBASIC_OBJS) \\
-   \$(SUBSYSTEM_CONFIG_OBJS) \\
-   \$(SUBSYSTEM_LIBTDB_OBJS) \\
-   \$(SUBSYSTEM_SCHANNELDB_OBJS) \\
-   \$(SUBSYSTEM_GENSEC_OBJS) \\
-   \$(SUBSYSTEM_LIBCLI_UTILS_OBJS) \\
-   \$(SUBSYSTEM_LIBCLI_RAW_OBJS) \\
-   \$(SUBSYSTEM_LIBCLI_AUTH_OBJS) \\
-   \$(SUBSYSTEM_LIBCLI_NMB_OBJS) \\
-   \$(SUBSYSTEM_AUTH_OBJS) \\
-   \$(SUBSYSTEM_SAMDB_OBJS) \\
-   \$(SUBSYSTEM_LIBLDB_OBJS) \\
-   \$(SUBSYSTEM_CHARSET_OBJS) \\
-   \$(SUBSYSTEM_LIBSMB_OBJS) \\
-   \$(SUBSYSTEM_DCERPC_COMMON_OBJS) \\
-\$(SUBSYSTEM_LIB_WINBIND_CLIENT_OBJS) \\
-\$(SUBSYSTEM_SOCKET_OBJS) \\
-\$(SUBSYSTEM_LIBREPLACE_OBJS) \\
-\$(SUBSYSTEM_LIBNETIF_OBJS) \\
-\$(SUBSYSTEM_LIBCRYPTO_OBJS)
-
-PYTHON_DCERPC_LIBS = -lldap
-
 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 
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)
-   \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_dcerpc.so 
scripting/swig/dcerpc_wrap.o \$(PYTHON_DCERPC_OBJ) \$(PYTHON_DCERPC_LIBS)
+scripting/swig/_dcerpc.so: scripting/swig/dcerpc.py 
scripting/swig/dcerpc_wrap.o \$(BINARY_swig_dcerpc_DEPEND_LIST)
+   \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_dcerpc.so 
scripting/swig/dcerpc_wrap.o \$(BINARY_swig_dcerpc_DEPEND_LIST) 
\$(BINARY_swig_dcerpc_LINK_FLAGS)
 
 swig_clean:
-rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc \\

Added: branches/SAMBA_4_0/source/scripting/swig/config.mk
===
--- branches/SAMBA_4_0/source/scripting/swig/config.mk  2005-01-25 10:20:24 UTC 
(rev 4981)
+++ branches/SAMBA_4_0/source/scripting/swig/config.mk  2005-01-25 11:21:25 UTC 
(rev 4982)
@@ -0,0 +1,7 @@
+[BINARY::swig_tdb]
+OBJ_FILES = scripting/swig/dummymain.o
+REQUIRED_SUBSYSTEMS = LIBTDB
+
+[BINARY::swig_dcerpc]
+OBJ_FILES = scripting/swig/dummymain.o
+REQUIRED_SUBSYSTEMS = LIBCLI NDR_MISC LIBBASIC CONFIG RPC_NDR_SAMR

Added: branches/SAMBA_4_0/source/scripting/swig/dummymain.c
===
--- branches/SAMBA_4_0/source/scripting/swig/dummymain.c 

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

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-25 10:20:24 + (Tue, 25 Jan 2005)
New Revision: 4981

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

Log:
Fix swig 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   2005-01-25 10:03:57 UTC 
(rev 4980)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i   2005-01-25 10:20:24 UTC 
(rev 4981)
@@ -368,7 +368,7 @@
/* Set REF_ALLOC flag so we don't have to do too much extra
   mucking around with ref variables in ndr unmarshalling. */
 
-   (*$1)->flags |= DCERPC_NDR_REF_ALLOC;
+   (*$1)->conn->flags |= DCERPC_NDR_REF_ALLOC;
 
/* Return swig handle on dcerpc_pipe */
 
@@ -399,14 +399,12 @@
 #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"
-%include "librpc/gen_ndr/winreg.i"
 %include "librpc/gen_ndr/spoolss.i"
 
 /* The status codes must be included last otherwise the automatically



svn commit: samba r4980 - in branches/SAMBA_4_0/source: include ntvfs/ipc torture/rap

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-25 10:03:57 + (Tue, 25 Jan 2005)
New Revision: 4980

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

Log:
Copy RAP callno constants from Samba 3 and start to use them.

Modified:
   branches/SAMBA_4_0/source/include/rap.h
   branches/SAMBA_4_0/source/ntvfs/ipc/ipc_rap.c
   branches/SAMBA_4_0/source/torture/rap/rap.c


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


svn commit: samba r4979 - in branches/SAMBA_4_0/source/ntvfs/ipc: .

2005-01-25 Thread tpot
Author: tpot
Date: 2005-01-25 09:46:00 + (Tue, 25 Jan 2005)
New Revision: 4979

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

Log:
Return NT_STATUS_INVALID_SYSTEM_SERVICE for unimplemented RAP calls as
this is what win2k3 does.

Modified:
   branches/SAMBA_4_0/source/ntvfs/ipc/ipc_rap.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/ipc/ipc_rap.c
===
--- branches/SAMBA_4_0/source/ntvfs/ipc/ipc_rap.c   2005-01-25 05:51:42 UTC 
(rev 4978)
+++ branches/SAMBA_4_0/source/ntvfs/ipc/ipc_rap.c   2005-01-25 09:46:00 UTC 
(rev 4979)
@@ -417,7 +417,7 @@
call->ndr_push_param->flags = RAPNDR_FLAGS;
call->ndr_push_data->flags = RAPNDR_FLAGS;
 
-   result = NT_STATUS_NOT_IMPLEMENTED;
+   result = NT_STATUS_INVALID_SYSTEM_SERVICE;
 
for (i=0; api_commands[i].name != NULL; i++) {
if (api_commands[i].id == call->callno) {



svn commit: samba r4975 - in branches/SAMBA_4_0/source/torture/rap: .

2005-01-24 Thread tpot
Author: tpot
Date: 2005-01-25 02:07:27 + (Tue, 25 Jan 2005)
New Revision: 4975

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

Log:
Update usage of talloc in rap torture code.

Don't use ZERO_STRUCTP() when creating a new struct rap_call.

Modified:
   branches/SAMBA_4_0/source/torture/rap/rap.c


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


svn commit: samba r4974 - in branches/SAMBA_4_0: .

2005-01-24 Thread tpot
Author: tpot
Date: 2005-01-25 01:39:44 + (Tue, 25 Jan 2005)
New Revision: 4974

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

Log:
Update location of talloc_guide.txt

Modified:
   branches/SAMBA_4_0/prog_guide.txt


Changeset:
Modified: branches/SAMBA_4_0/prog_guide.txt
===
--- branches/SAMBA_4_0/prog_guide.txt   2005-01-25 01:21:59 UTC (rev 4973)
+++ branches/SAMBA_4_0/prog_guide.txt   2005-01-25 01:39:44 UTC (rev 4974)
@@ -193,9 +193,10 @@
 How to use talloc
 -
 
-Please see the separate document, talloc_guide.txt in this
-directory. You _must_ read this if you want to program in Samba4.
+Please see the separate document, source/lib/talloc/talloc_guide.txt
+You _must_ read this if you want to program in Samba4.
 
+
 Interface Structures
 
 



svn commit: samba r4973 - in branches/SAMBA_4_0/source/torture: . rap

2005-01-24 Thread tpot
Author: tpot
Date: 2005-01-25 01:21:59 + (Tue, 25 Jan 2005)
New Revision: 4973

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

Log:
Add a RAP scanner to smbtorture.  win2k has call numbers 0-215 although
the cifs tr lists 250-318 also.

Modified:
   branches/SAMBA_4_0/source/torture/rap/rap.c
   branches/SAMBA_4_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rap/rap.c
===
--- branches/SAMBA_4_0/source/torture/rap/rap.c 2005-01-25 01:19:02 UTC (rev 
4972)
+++ branches/SAMBA_4_0/source/torture/rap/rap.c 2005-01-25 01:21:59 UTC (rev 
4973)
@@ -2,6 +2,7 @@
Unix SMB/CIFS implementation.
test suite for various RAP operations
Copyright (C) Volker Lendecke 2004
+   Copyright (C) Tim Potter 2005

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -183,8 +184,10 @@
trans.in.trans_name = "\\PIPE\\LANMAN";
 
NDR_CHECK(ndr_push_uint16(params, call->callno));
-   NDR_CHECK(ndr_push_string(params, NDR_SCALARS, call->paramdesc));
-   NDR_CHECK(ndr_push_string(params, NDR_SCALARS, call->datadesc));
+   if (call->paramdesc)
+   NDR_CHECK(ndr_push_string(params, NDR_SCALARS, 
call->paramdesc));
+   if (call->datadesc)
+   NDR_CHECK(ndr_push_string(params, NDR_SCALARS, call->datadesc));
 
param_blob = ndr_push_blob(call->ndr_push_param);
NDR_CHECK(ndr_push_bytes(params, param_blob.data,
@@ -445,3 +448,28 @@
talloc_destroy(mem_ctx);
return ret;
 }
+
+BOOL torture_rap_scan(void)
+{
+   struct smbcli_state *cli;
+   uint16 callno;
+
+   if (!torture_open_connection(&cli)) {
+   return False;
+   }
+   
+   for (callno = 0; callno < 0x; callno++) {
+   struct rap_call *call = new_rap_cli_call(callno);
+   NTSTATUS result;
+
+   result = rap_cli_do_call(cli, cli, call);
+
+   if (NT_STATUS_EQUAL(result, NT_STATUS_INVALID_PARAMETER))
+   printf("callno %d is RAP call\n", callno);
+
+   destroy_rap_call(call);
+   }
+
+   torture_close_connection(cli);
+   return True;
+}

Modified: branches/SAMBA_4_0/source/torture/torture.c
===
--- branches/SAMBA_4_0/source/torture/torture.c 2005-01-25 01:19:02 UTC (rev 
4972)
+++ branches/SAMBA_4_0/source/torture/torture.c 2005-01-25 01:21:59 UTC (rev 
4973)
@@ -2380,6 +2380,7 @@
{"SCAN-CASETABLE", torture_casetable, 0},
{"SCAN-PIPE_NUMBER", run_pipe_number, 0},
{"SCAN-IOCTL",  torture_ioctl_test, 0},
+   {"SCAN-RAP",  torture_rap_scan, 0},
 
/* rpc testers */
 {"RPC-LSA", torture_rpc_lsa, 0},



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

2005-01-23 Thread tpot
Author: tpot
Date: 2005-01-23 11:06:06 + (Sun, 23 Jan 2005)
New Revision: 199

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

Log:
A nopull dissector for policy handle by calling the dissect_nt_policy_hnd
function from packet-dcerpc-nt.  #ifdef'ed out for the moment though.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-21 08:25:06 UTC (rev 
198)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-23 11:06:06 UTC (rev 
199)
@@ -3,6 +3,8 @@
 #include "eparser.h"
 #include 
 
+#include "epan/dissectors/packet-dcerpc-nt.h"
+
 struct pidl_pull *pidl_pull_init(tvbuff_t *tvb, int offset, packet_info *pinfo,
 guint8 *drep)
 {
@@ -856,6 +858,22 @@
return NT_STATUS_OK;
 }
 
+#if 0
+
+static int hf_hnd = -1;
+
+NTSTATUS ndr_pull_policy_handle(struct pidl_pull *ndr, int ndr_flags,
+   pidl_tree *tree, struct policy_handle *data)
+{
+   ndr->offset = dissect_nt_policy_hnd(
+   ndr->tvb, ndr->offset, ndr->pinfo, tree->proto_tree, 
+   ndr->drep, hf_hnd, (e_ctx_hnd *)data, NULL, FALSE, FALSE);
+
+   return NT_STATUS_OK;
+}
+
+#endif
+
 gint hf_conformant_size = -1;
 
 void proto_register_eparser(void)
@@ -871,6 +889,15 @@
 { &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, { "Num Auths", "eparser.num_auths", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Num Auths", HFILL }},
+
+#if 0
+
+   { &hf_hnd,
+ { "Context handle", "eparser.hnd", FT_BYTES, BASE_NONE,
+   NULL, 0x0, "Policy handle", HFILL }},
+
+#endif
+
 };
 
 static gint *ett[] = {



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

2005-01-23 Thread tpot
Author: tpot
Date: 2005-01-23 11:03:20 + (Sun, 23 Jan 2005)
New Revision: 4940

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

Log:
Add a variable to hold a list of typedefs for which we shouldn't generate
a dissector for.  A hand written dissector needs to be added to eparser.c
for the plugin to link.

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-23 09:03:05 UTC 
(rev 4939)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-23 11:03:20 UTC 
(rev 4940)
@@ -22,6 +22,13 @@
 }
 
 #
+# a list of annotations 
+
+my $nopull_typedefs = {
+#"policy_handle" => "1",
+};
+
+#
 # work out is a parse function should be declared static or not
 sub fn_prefix($)
 {
@@ -462,7 +469,7 @@
 
 # Read through file
 
-my $cur_fn;
+my $cur_fn = "";
 
 while() {
 
@@ -505,6 +512,18 @@
 
 $cur_fn = $1, if /NTSTATUS ndr_pull_(.*?)\(struct/;
 
+# Skip functions we have marked as nopull
+
+my $skip_fn = 0;
+
+foreach my $f (keys(%{$nopull_typedefs})) {
+   $skip_fn = 1, if $cur_fn eq $f;
+   }
+
+$cur_fn = "", if /^}/;
+
+next, if $skip_fn;
+
#
# OK start wrapping the ndr_pull functions that actually
# implement the NDR decoding routines.  This mainly consists



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

2005-01-22 Thread tpot
Author: tpot
Date: 2005-01-22 08:09:10 + (Sat, 22 Jan 2005)
New Revision: 4930

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

Log:
Update my copyright.

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-22 07:53:23 UTC 
(rev 4929)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-22 08:09:10 UTC 
(rev 4930)
@@ -1,7 +1,7 @@
 ###
 # Samba4 parser generator for IDL structures
 # Copyright [EMAIL PROTECTED] 2000-2003
-# Copyright [EMAIL PROTECTED] 2001,2004
+# Copyright [EMAIL PROTECTED] 2001,2004-2005
 # released under the GNU GPL
 
 package IdlEParser;



svn commit: samba r4929 - in test: .

2005-01-21 Thread tpot
Author: tpot
Date: 2005-01-22 07:53:23 + (Sat, 22 Jan 2005)
New Revision: 4929

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

Log:
Test again.

Modified:
   test/dummy


Changeset:
Modified: test/dummy
===
--- test/dummy  2005-01-22 07:47:35 UTC (rev 4928)
+++ test/dummy  2005-01-22 07:53:23 UTC (rev 4929)
@@ -1,7 +1 @@
 commit test
-
-test 3
-foo
-foo2
-foo3
-foo4



svn commit: samba r4928 - in test: .

2005-01-21 Thread tpot
Author: tpot
Date: 2005-01-22 07:47:35 + (Sat, 22 Jan 2005)
New Revision: 4928

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

Log:
Testing fsfs backend for websvn.

Modified:
   test/dummy


Changeset:
Modified: test/dummy
===
--- test/dummy  2005-01-22 05:36:32 UTC (rev 4927)
+++ test/dummy  2005-01-22 07:47:35 UTC (rev 4928)
@@ -4,3 +4,4 @@
 foo
 foo2
 foo3
+foo4



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

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-20 05:57:05 + (Thu, 20 Jan 2005)
New Revision: 4865

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

Log:
Fix up subtree name when dissecting unions.  E.g in LSA, The subtree
used to be called something like "Level, R->out.info" but now is called
"Lsa PolicyInformation".

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-20 01:19:57 UTC 
(rev 4864)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-20 05:57:05 UTC 
(rev 4865)
@@ -584,18 +584,34 @@
   \);)
/ndr_pull_$2(ndr, tree, hf_$4, $3);/smgx;
 
-   # Add subtree argument to calls dissecting structures, e.g
+   # Add subtree argument to calls dissecting structures/unions, e.g
#
# ndr_pull_string(ndr, NDR_SCALARS|NDR_BUFFERS, &r->command);
# ndr_pull_atsvc_enum_ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr);
 
-   s/(ndr_pull_([^\)]*?)\(
-  ndr,\ 
-  (NDR_[^,]*?),\ 
-  (&?r->(in|out|)\.?([^\(].*?))\);)
-   /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$6\", ndr, ett_$2), $4);
-   /smgx;
+# Three argument version is for structures
 
+if (/ndr_pull([^\)]*?)\(ndr, (NDR_[^,]*?), ([^,]*?)\);/) {
+
+   s/(ndr_pull_([^\)]*?)\(
+  ndr,\ 
+  (NDR_[^,]*?),\ 
+  (&?r->(in|out|)\.?([^\(].*?))\);)
+   /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$6\", ndr, ett_$2), 
$4);
+   /smgx;
+   }
+
+# Four argument version if for unions
+
+if (/ndr_pull([^\)]*?)\(ndr, (NDR_[SB][^,]*?), ([^,]*?), ([^,]*?)\);/) 
{
+   s/(ndr_pull_([^\)]*?)\(
+  ndr,\ 
+  (NDR_[^,]*?),\ 
+  (&?r->(in|out|)\.?([^\(].*?))\);)
+   /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$2\", ndr, ett_$2), 
$4);
+   /smgx;
+   }
+
# Add proto_tree parameter to pull function prototypes, e.g
#
# static NTSTATUS ndr_pull_atsvc_JobInfo(struct ndr_pull *ndr, 



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

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-20 05:55:27 + (Thu, 20 Jan 2005)
New Revision: 195

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

Log:
Make more friendly name for hf_dom_sid2_num_auths.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-19 11:07:10 UTC (rev 
194)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-20 05:55:27 UTC (rev 
195)
@@ -870,7 +870,7 @@
 { &hf_array_offset, { "Array offset", "eparser.array_offset", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Array offset", 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 }},
+{ &hf_dom_sid2_num_auths, { "Num Auths", "eparser.num_auths", 
FT_UINT32, BASE_DEC, NULL, 0x0, "Num Auths", HFILL }},
 };
 
 static gint *ett[] = {



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

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-19 11:24:29 + (Wed, 19 Jan 2005)
New Revision: 4842

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

Log:
Set the end of a structure so that when you click on the proto tree,
the hex display window highlights the part of the buffer occupied by
the structure.  Cool!

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-19 10:17:46 UTC 
(rev 4841)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-19 11:24:29 UTC 
(rev 4842)
@@ -630,6 +630,10 @@
 s/(u?)int(8|16|32) _level;/$1int$2_t _level;/smg;
 s/ndr_pull_([^\(]*)\(ndr,\ tree,\ hf_level,\ &_level\);
 /ndr_pull_$1(ndr, tree, hf_level_$1, &_level);/smgx;
+
+# Set the end of a structure
+   
+s/(ndr_pull_struct_end.*)/$1\tproto_item_set_end(tree->proto_tree, 
ndr->tvb, ndr->offset);\n/smg;

pidl $_;
 }



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

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-19 11:07:10 + (Wed, 19 Jan 2005)
New Revision: 194

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

Log:
Dissect strings that have the STR_SIZE4 flag as used by WINREG.  Ethereal
can now dissect the capture produced by RPC-WINREG, except for the
QueryMultipleValues response (?).

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-19 10:19:31 UTC (rev 
193)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-19 11:07:10 UTC (rev 
194)
@@ -273,8 +273,6 @@
if (len2 > 65535)
return ndr_pull_error(ndr, NDR_ERR_STRING, "bad len 
offset");
 
-   data = g_malloc(len2*2);
-
item = proto_tree_add_none_format(
tree->proto_tree, hf_string_data, ndr->tvb,
ndr->offset, len2 * 2, "Data");
@@ -289,41 +287,40 @@
}
 
g_free(s);
-   g_free(data);
 
ndr->offset += len2 * 2;
 
break;
}
 
-   case LIBNDR_FLAG_STR_SIZE4:
+   case LIBNDR_FLAG_STR_SIZE4: {
+   proto_item *item;
+   char *s;
 
-   g_warning("%d: unimplemented string flags 0x%x",
- ndr->pinfo->fd->num, 
- ndr->flags & LIBNDR_STRING_FLAGS);
-   
-#if 0
+   ndr_pull_uint32(ndr, tree, hf_string4_len, &len1);
 
-   ndr_pull_uint32(ndr, &len1);
-   NDR_PULL_NEED_BYTES(ndr, len1*2);
-   if (len1 == 0) {
-   *s = talloc_strdup(ndr->mem_ctx, "");
+   if (len1 == 0)
break;
+
+   item = proto_tree_add_none_format(
+   tree->proto_tree, hf_string_data, ndr->tvb,
+   ndr->offset, len1 * 2, "Data");
+
+   s = tvb_fake_unicode(ndr->tvb, ndr->offset, len1, TRUE);
+
+   if (strlen(s) > 0) {
+   proto_item_append_text(item, ": %s", s);
+   if (item && item->parent) 
+   proto_item_append_text(
+   item->parent, ": %s", s);
}
-   ret = convert_string_talloc(ndr->mem_ctx, chset, CH_UNIX, 
-   ndr->data+ndr->offset, 
-   len1*2,
-   (const void **)&as);
-   if (ret == -1) {
-   return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
- "Bad character conversion");
-   }
-   ndr_pull_advance(ndr, len1*2);
-   *s = as;
 
-#endif
+   g_free(s);
 
+   ndr->offset += len1 * 2;
+
break;
+   }
 
case LIBNDR_FLAG_STR_NULLTERM:
 



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

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-19 10:19:31 + (Wed, 19 Jan 2005)
New Revision: 193

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

Log:
Add dissector for drsuapi.

Added:
   trunk/ethereal/plugins/pidl/packet-dcerpc-drsuapi.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-drsuapi.h
Modified:
   trunk/ethereal/plugins/pidl/Makefile.am
   trunk/ethereal/plugins/pidl/pidl.c


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


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

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-19 10:18:44 + (Wed, 19 Jan 2005)
New Revision: 192

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

Log:
Handle DATA_BLOB's and NTTIME_1sec's.

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-19 06:28:34 UTC (rev 
191)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-19 10:18:44 UTC (rev 
192)
@@ -133,6 +133,12 @@
return NT_STATUS_OK;
 }
 
+NTSTATUS ndr_pull_NTTIME_1sec(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
+NTTIME *data)
+{
+   return ndr_pull_NTTIME(ndr, tree, hf, data);
+}
+
 NTSTATUS ndr_pull_NTTIME_hyper(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
   NTTIME *data)
 {
@@ -835,6 +841,24 @@
return ndr_token_store(ndr, &ndr->array_length_list, p, length);
 }
 
+NTSTATUS ndr_pull_DATA_BLOB(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
+   DATA_BLOB *data)
+{
+   data->length = (ndr->drep[0] & 0x10)
+   ? tvb_get_letohl(ndr->tvb, ndr->offset)
+   : tvb_get_ntohl(ndr->tvb, ndr->offset);
+
+   ndr->offset += sizeof(guint32);
+
+   if (data->length) {
+   data->data = tvb_get_ptr(ndr->tvb, ndr->offset, data->length);
+   ndr->offset += data->length;
+   } else
+   data->data = NULL;
+
+   return NT_STATUS_OK;
+}
+
 gint hf_conformant_size = -1;
 
 void proto_register_eparser(void)

Modified: trunk/ethereal/plugins/pidl/eparser.h
===
--- trunk/ethereal/plugins/pidl/eparser.h   2005-01-19 06:28:34 UTC (rev 
191)
+++ trunk/ethereal/plugins/pidl/eparser.h   2005-01-19 10:18:44 UTC (rev 
192)
@@ -37,8 +37,15 @@
 typedef uint32_t WERROR;
 typedef uint64_t NTTIME;
 typedef uint64_t NTTIME_hyper;
+typedef uint64_t NTTIME_1sec;
 typedef uint64_t HYPER_T;
 
+typedef struct data_blob
+{
+   uint8_t *data;
+   size_t length;
+} DATA_BLOB;
+
 #define NT_STATUS_OK0x
 #define NT_STATUS_BUFFER_TOO_SMALL  0xC023
 #define NT_STATUS_INTERNAL_ERROR0xC0e5
@@ -115,6 +122,7 @@
 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_NTTIME_1sec(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
NTTIME *data);
 NTSTATUS ndr_pull_NTTIME_hyper(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);
@@ -151,6 +159,8 @@
 uint32_t ndr_get_array_length(struct pidl_pull *ndr, const void *p);
 NTSTATUS ndr_pull_array_length(struct pidl_pull *ndr, pidl_tree *tree, const 
void *p);
 
+NTSTATUS ndr_pull_DATA_BLOB(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
DATA_BLOB *data);
+
 // Just about everything uses stuff from misc.idl
 
 #include "packet-dcerpc-misc.h"



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

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-19 10:17:46 + (Wed, 19 Jan 2005)
New Revision: 4841

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

Log:
Handle levels that are signed integer types.

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-19 09:58:29 UTC 
(rev 4840)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-19 10:17:46 UTC 
(rev 4841)
@@ -627,7 +627,7 @@
 
# Fix some internal variable declarations
 
-s/uint(16|32) _level;/uint$1_t _level;/smg;
+s/(u?)int(8|16|32) _level;/$1int$2_t _level;/smg;
 s/ndr_pull_([^\(]*)\(ndr,\ tree,\ hf_level,\ &_level\);
 /ndr_pull_$1(ndr, tree, hf_level_$1, &_level);/smgx;




svn commit: linux-cifs-client r21 - in hooks: .

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-19 08:19:47 + (Wed, 19 Jan 2005)
New Revision: 21

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=linux-cifs-client&rev=21

Log:
Push change to websvn.

Modified:
   hooks/post-commit


Changeset:
Modified: hooks/post-commit
===
--- hooks/post-commit   2004-12-16 22:11:52 UTC (rev 20)
+++ hooks/post-commit   2005-01-19 08:19:47 UTC (rev 21)
@@ -39,3 +39,13 @@
 ${REPOS}/hooks/commit-email.pl -s "svn commit: ${NAME}" "${REPOS}" "${REV}" 
[EMAIL PROTECTED]
 (cd ${REPOS}/hooks; ./hot-backup.py ${REPOS} /backup/svn_backup/${NAME} &)
 ${REPOS}/hooks/synchooks.sh "${REPOS}" "${REV}"
+
+# Create a delta to apply to the websvn repository and send it over
+# to dp3.
+ 
+(
+delta=/tmp/delta-${NAME}-`seq -f%08g ${REV} ${REV}`
+ 
+svnadmin dump ${REPOS} --incremental -r ${REV} > $delta
+rsync $delta dp3::svn-deltas && rm -f $delta
+) &



svn commit: samba-web r509 - in hooks: .

2005-01-19 Thread tpot
Author: tpot
Date: 2005-01-19 08:14:33 + (Wed, 19 Jan 2005)
New Revision: 509

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

Log:
Push change to websvn.

Modified:
   hooks/post-commit


Changeset:
Modified: hooks/post-commit
===
--- hooks/post-commit   2005-01-17 16:46:13 UTC (rev 508)
+++ hooks/post-commit   2005-01-19 08:14:33 UTC (rev 509)
@@ -39,3 +39,13 @@
 ${REPOS}/hooks/commit-email.pl -s "svn commit: ${NAME}" "${REPOS}" "${REV}" 
[EMAIL PROTECTED]
 (cd ${REPOS}/hooks; ./hot-backup.py ${REPOS} /backup/svn_backup/${NAME} &)
 ${REPOS}/hooks/synchooks.sh "${REPOS}" "${REV}"
+
+# Create a delta to apply to the websvn repository and send it over
+# to dp3.
+ 
+(
+delta=/tmp/delta-${NAME}-`seq -f%08g ${REV} ${REV}`
+ 
+svnadmin dump ${REPOS} --incremental -r ${REV} > $delta
+rsync $delta dp3::svn-deltas && rm -f $delta
+) &



svn commit: lorikeet r191 - in hooks: .

2005-01-18 Thread tpot
Author: tpot
Date: 2005-01-19 06:28:34 + (Wed, 19 Jan 2005)
New Revision: 191

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

Log:
Add scriptlet to send deltas to dp3.

Modified:
   hooks/post-commit


Changeset:
Modified: hooks/post-commit
===
--- hooks/post-commit   2005-01-19 06:06:38 UTC (rev 190)
+++ hooks/post-commit   2005-01-19 06:28:34 UTC (rev 191)
@@ -39,3 +39,13 @@
 ${REPOS}/hooks/commit-email.pl -s "svn commit: ${NAME}" "${REPOS}" "${REV}" 
[EMAIL PROTECTED]
 (cd ${REPOS}/hooks; ./hot-backup.py ${REPOS} /backup/svn_backup/${NAME} &)
 ${REPOS}/hooks/synchooks.sh "${REPOS}" "${REV}"
+
+# Create a delta to apply to the websvn repository and send it over
+# to dp3.
+
+(
+   delta=/tmp/delta-${NAME}-`seq -f%08g ${REV} ${REV}`
+
+   svnadmin dump ${REPOS} --incremental -r ${REV} > $delta
+   rsync $delta dp3::svn-deltas && rm -f $delta
+) &



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

2005-01-18 Thread tpot
Author: tpot
Date: 2005-01-19 06:06:38 + (Wed, 19 Jan 2005)
New Revision: 190

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

Log:
Add WINREG parser.  Doesn't work 100% as some of the string flags aren't
supported in eparser.c yet.

Added:
   trunk/ethereal/plugins/pidl/packet-dcerpc-winreg.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-winreg.h
Modified:
   trunk/ethereal/plugins/pidl/Makefile.am
   trunk/ethereal/plugins/pidl/pidl.c


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


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

2005-01-18 Thread tpot
Author: tpot
Date: 2005-01-19 06:05:25 + (Wed, 19 Jan 2005)
New Revision: 189

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

Log:
Add parsers for WERROR and arrays of uint16's.

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-18 06:54:15 UTC (rev 
188)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-19 06:05:25 UTC (rev 
189)
@@ -159,6 +159,16 @@
return NT_STATUS_OK;
 }
 
+NTSTATUS ndr_pull_WERROR(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
+WERROR *data)
+{
+   ndr->offset = dissect_doserror(
+   ndr->tvb, ndr->offset, ndr->pinfo, tree->proto_tree,
+   ndr->drep, hf, data);
+
+   return NT_STATUS_OK;
+}
+
 NTSTATUS ndr_pull_HYPER_T(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
  HYPER_T *data)
 {
@@ -472,8 +482,6 @@
  pidl_tree *tree, int hf, uint8_t *data, 
  uint32_t n)
 {
-   uint32_t i;
-
if (!(ndr_flags & NDR_SCALARS))
return NT_STATUS_OK;
 
@@ -491,7 +499,6 @@
   uint32_t n)
 {
int len = n * sizeof(uint32_t);
-   uint32_t i;
 
if (!(ndr_flags & NDR_SCALARS))
return NT_STATUS_OK;
@@ -507,6 +514,26 @@
return NT_STATUS_OK;
 }
 
+NTSTATUS ndr_pull_array_uint16(struct pidl_pull *ndr, int ndr_flags, 
+  pidl_tree *tree, int hf, uint16_t *data, 
+  uint32_t n)
+{
+   int len = n * sizeof(uint16_t);
+
+   if (!(ndr_flags & NDR_SCALARS))
+   return NT_STATUS_OK;
+
+   ndr_pull_align(ndr, sizeof(uint16_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;
+}
+
 NTSTATUS ndr_pull_struct_start(struct pidl_pull *ndr)
 {
return NT_STATUS_OK;
@@ -516,8 +543,8 @@
 {
 }
 
-NTSTATUS ndr_pull_error(struct pidl_pull *ndr, 
-   enum ndr_err_code err, const char *format, ...)
+NTSTATUS ndr_pull_error(struct pidl_pull *ndr, enum ndr_err_code err, 
+   const char *format, ...)
 {
return NT_STATUS_OK;
 }

Modified: trunk/ethereal/plugins/pidl/eparser.h
===
--- trunk/ethereal/plugins/pidl/eparser.h   2005-01-18 06:54:15 UTC (rev 
188)
+++ trunk/ethereal/plugins/pidl/eparser.h   2005-01-19 06:05:25 UTC (rev 
189)
@@ -34,6 +34,7 @@
 // Some miscellaneous glue to include libndr.h
 
 typedef uint32_t NTSTATUS;
+typedef uint32_t WERROR;
 typedef uint64_t NTTIME;
 typedef uint64_t NTTIME_hyper;
 typedef uint64_t HYPER_T;
@@ -44,6 +45,7 @@
 #define NT_STATUS_NO_MEMORY 0xC017
 #define NT_STATUS_ARRAY_BOUNDS_EXCEEDED 0xC08c
 #define NT_STATUS_INVALID_PARAMETER0xC057
+#define NT_STATUS_INVALID_PARAMETER_MIX 0xC030
 
 #define NT_STATUS_IS_OK(x) ((x) == NT_STATUS_OK)
 
@@ -121,6 +123,7 @@
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);
 NTSTATUS ndr_pull_NTSTATUS(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
NTSTATUS *status);
+NTSTATUS ndr_pull_WERROR(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
NTSTATUS *status);
 NTSTATUS ndr_pull_array_size(struct pidl_pull *ndr, pidl_tree *tree, const 
void *p);
 uint32_t ndr_get_array_size(struct pidl_pull *ndr, const void *p);
 NTSTATUS ndr_pull_array(struct pidl_pull *ndr, int ndr_flags, 
@@ -130,6 +133,7 @@
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, int hf, uint8_t *data, uint32_t n);
+NTSTATUS ndr_pull_array_uint16(struct pidl_pull *ndr, int ndr_flags, pidl_tree 
*tree, int hf, uint16_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);



svn commit: samba r4838 - in hooks: .

2005-01-18 Thread tpot
Author: tpot
Date: 2005-01-19 05:02:17 + (Wed, 19 Jan 2005)
New Revision: 4838

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

Log:
Add some comments.

Modified:
   hooks/post-commit


Changeset:
Modified: hooks/post-commit
===
--- hooks/post-commit   2005-01-19 04:42:12 UTC (rev 4837)
+++ hooks/post-commit   2005-01-19 05:02:17 UTC (rev 4838)
@@ -36,9 +36,20 @@
 REV="$2"
 NAME=`basename ${REPOS}`
 
+# Send email to everyone
+
 ${REPOS}/hooks/commit-email.pl -s "svn commit: ${NAME}" "${REPOS}" "${REV}" 
[EMAIL PROTECTED]
+
+# Keep a hot backup of the repository
+
 (cd ${REPOS}/hooks; ./hot-backup.py ${REPOS} /backup/svn_backup/${NAME} &)
+
+# Update hooks directory if this commit has changed it. (Syn chooks - ha ha).
+
 ${REPOS}/hooks/synchooks.sh "${REPOS}" "${REV}"
+
+# Run ciabot script for a nice web front end to the commit messages.
+
 (python2.2 /home/svnanon/bin/ciabot_svn.py ${REPOS} ${REV} Samba &)
 
 # Create a delta to apply to the websvn repository and send it over



svn commit: samba r4837 - in test: .

2005-01-18 Thread tpot
Author: tpot
Date: 2005-01-19 04:42:12 + (Wed, 19 Jan 2005)
New Revision: 4837

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

Log:
Final (?) test.

Modified:
   test/dummy


Changeset:
Modified: test/dummy
===
--- test/dummy  2005-01-19 04:35:06 UTC (rev 4836)
+++ test/dummy  2005-01-19 04:42:12 UTC (rev 4837)
@@ -3,3 +3,4 @@
 test 3
 foo
 foo2
+foo3



svn commit: samba r4836 - in test: .

2005-01-18 Thread tpot
Author: tpot
Date: 2005-01-19 04:35:06 + (Wed, 19 Jan 2005)
New Revision: 4836

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

Log:
Another test.

Modified:
   test/dummy


Changeset:
Modified: test/dummy
===
--- test/dummy  2005-01-19 04:28:04 UTC (rev 4835)
+++ test/dummy  2005-01-19 04:35:06 UTC (rev 4836)
@@ -2,3 +2,4 @@
 
 test 3
 foo
+foo2



svn commit: samba r4835 - in test: .

2005-01-18 Thread tpot
Author: tpot
Date: 2005-01-19 04:28:04 + (Wed, 19 Jan 2005)
New Revision: 4835

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

Log:
Testing post-commit hook changes.

Modified:
   test/dummy


Changeset:
Modified: test/dummy
===
--- test/dummy  2005-01-19 04:21:47 UTC (rev 4834)
+++ test/dummy  2005-01-19 04:28:04 UTC (rev 4835)
@@ -1,3 +1,4 @@
 commit test
 
 test 3
+foo



svn commit: samba r4834 - in hooks: .

2005-01-18 Thread tpot
Author: tpot
Date: 2005-01-19 04:21:47 + (Wed, 19 Jan 2005)
New Revision: 4834

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

Log:
Create a delta to apply to the websvn repository and send it over
to dp3.  This is in preparation for getting rid of rsync as the 
method for synchronising the websvn repository with the real one.

Modified:
   hooks/post-commit


Changeset:
Modified: hooks/post-commit
===
--- hooks/post-commit   2005-01-19 03:34:49 UTC (rev 4833)
+++ hooks/post-commit   2005-01-19 04:21:47 UTC (rev 4834)
@@ -41,3 +41,12 @@
 ${REPOS}/hooks/synchooks.sh "${REPOS}" "${REV}"
 (python2.2 /home/svnanon/bin/ciabot_svn.py ${REPOS} ${REV} Samba &)
 
+# Create a delta to apply to the websvn repository and send it over
+# to dp3.
+
+(
+   delta=/tmp/delta-${NAME}-`seq -f%08g ${REV} ${REV}`
+
+   svnadmin dump ${REPOS} --incremental -r ${REV} > $delta
+   rsync $delta dp3::svn-deltas && rm -f $delta
+) &



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

2005-01-17 Thread tpot
Author: tpot
Date: 2005-01-18 06:54:15 + (Tue, 18 Jan 2005)
New Revision: 188

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

Log:
Check in autogenerated files.

Modified:
   trunk/ethereal/plugins/pidl/TODO
   trunk/ethereal/plugins/pidl/packet-dcerpc-atsvc.c
   trunk/ethereal/plugins/pidl/packet-dcerpc-atsvc.h
   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 (13509 lines) to include; please use WebSVN to 
see it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=188


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

2005-01-17 Thread tpot
Author: tpot
Date: 2005-01-18 06:50:47 + (Tue, 18 Jan 2005)
New Revision: 187

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

Log:
Handle arrays of structures that contain buffers properly.

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


Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===
--- trunk/ethereal/plugins/pidl/eparser.c   2005-01-18 05:33:05 UTC (rev 
186)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-18 06:50:47 UTC (rev 
187)
@@ -432,41 +432,39 @@
NTSTATUS (*pull_fn)(struct pidl_pull *, int, 
pidl_tree *tree, void *))
 {
-   pidl_tree *subtrees;
-   char *p = base;
+   char *p = base, buf[255];
uint32_t i;
 
-   subtrees = (pidl_tree *)g_malloc(sizeof(pidl_tree) * count);
-   memset(subtrees, 0, sizeof(pidl_tree) * count);
-
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+
for (i=0;iproto_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))
-   pull_fn(ndr, NDR_SCALARS, &subtrees[i], p);
-   else
-   pull_fn(ndr, NDR_SCALARS, tree, p);
+   snprintf(buf, sizeof(buf) - 1, "Array element %d", i + 1);
+   buf[sizeof(buf) - 1] = 0;
 
-   p += elsize;
+   pull_fn(ndr, NDR_SCALARS, 
+   get_subtree(tree, buf, ndr, ett_array), p);
 
+   p += elsize;
}
+
if (!(ndr_flags & NDR_BUFFERS)) goto done;
+
 buffers:
p = base;
+
for (i=0;i

svn commit: samba r4816 - in branches/SAMBA_4_0/source/include: .

2005-01-17 Thread tpot
Author: tpot
Date: 2005-01-18 06:38:11 + (Tue, 18 Jan 2005)
New Revision: 4816

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

Log:
Note that NTTIME is 4-byte aligned which makes the comment about alignment
for NTTIME_hyper make a bit more sense.

Modified:
   branches/SAMBA_4_0/source/include/smb.h


Changeset:
Modified: branches/SAMBA_4_0/source/include/smb.h
===
--- branches/SAMBA_4_0/source/include/smb.h 2005-01-18 05:32:35 UTC (rev 
4815)
+++ branches/SAMBA_4_0/source/include/smb.h 2005-01-18 06:38:11 UTC (rev 
4816)
@@ -199,7 +199,7 @@
 /* 8 byte aligned 'hyper' type from MS IDL */
 typedef uint64_t HYPER_T;
 
-/* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30 */
+/* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30, 4 byte 
aligned */
 typedef uint64_t NTTIME;
 
 /* 64 bit time (100 nanosec) 1601, but 8 byte aligned 'hyper' type */



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

2005-01-17 Thread tpot
Author: tpot
Date: 2005-01-18 05:33:05 + (Tue, 18 Jan 2005)
New Revision: 186

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

Log:
Handle NTTIME_hyper types.  Not sure whether the alignment is correct
though.

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-18 05:22:30 UTC (rev 
185)
+++ trunk/ethereal/plugins/pidl/eparser.c   2005-01-18 05:33:05 UTC (rev 
186)
@@ -133,6 +133,12 @@
return NT_STATUS_OK;
 }
 
+NTSTATUS ndr_pull_NTTIME_hyper(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
+  NTTIME *data)
+{
+   return ndr_pull_NTTIME(ndr, tree, hf, data);
+}
+
 NTSTATUS ndr_pull_time_t(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
 time_t *data)
 {

Modified: trunk/ethereal/plugins/pidl/eparser.h
===
--- trunk/ethereal/plugins/pidl/eparser.h   2005-01-18 05:22:30 UTC (rev 
185)
+++ trunk/ethereal/plugins/pidl/eparser.h   2005-01-18 05:33:05 UTC (rev 
186)
@@ -35,6 +35,7 @@
 
 typedef uint32_t NTSTATUS;
 typedef uint64_t NTTIME;
+typedef uint64_t NTTIME_hyper;
 typedef uint64_t HYPER_T;
 
 #define NT_STATUS_OK0x
@@ -112,6 +113,7 @@
 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_NTTIME_hyper(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, char *name, 
uint32_t *v);



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

2005-01-17 Thread tpot
Author: tpot
Date: 2005-01-18 05:32:35 + (Tue, 18 Jan 2005)
New Revision: 4815

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

Log:
Handle uint8 and uint16 bitmap types.

Break out arguments to proto_register_protocol() so they can be renamed
easily.  Unfortunately the "pidl_" prefix will have to stick around if/when
the old dissectors are removed because the filter and short names clash.

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-18 04:06:58 UTC 
(rev 4814)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-18 05:32:35 UTC 
(rev 4815)
@@ -559,8 +559,8 @@
 
# Bitmaps
 
-s/(^(static\ )?NTSTATUS\ ndr_pull_(.+?),\ uint32\ \*r\))
-   /NTSTATUS ndr_pull_$3, pidl_tree *tree, int hf, uint32_t *r)/smgx;
+s/(^(static\ )?NTSTATUS\ ndr_pull_(.+?),\ uint(8|16|32)\ \*r\))
+   /NTSTATUS ndr_pull_$3, pidl_tree *tree, int hf, uint$4_t *r)/smgx;
 
# Call ethereal wrappers for pull of scalar values in
# structures and functions, e.g
@@ -698,8 +698,15 @@
 
 if (defined($if_uuid)) {
 
-   pidl "\tproto_dcerpc_pidl_$module = 
proto_register_protocol(\"pidl_$module\", \"pidl_$module\", 
\"pidl_$module\");\n\n";
+   # These can be changed to non-pidl names if the old dissectors
+   # in epan/dissctors are deleted.
 
+   my $name = uc($module) . " (pidl)";
+   my $short_name = "pidl_$module";
+   my $filter_name = "pidl_$module";
+
+   pidl "\tproto_dcerpc_pidl_$module = proto_register_protocol(\"$name\", 
\"$short_name\", \"$filter_name\");\n\n";
+
pidl "\tproto_register_field_array(proto_dcerpc_pidl_$module, hf, 
array_length (hf));\n";
pidl "\tproto_register_subtree_array(ett, array_length(ett));\n";
 



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