svn commit: samba r5357 - in branches/SAMBA_4_0/source/lib/ldb: common include

2005-02-12 Thread tridge
Author: tridge
Date: 2005-02-12 11:30:33 + (Sat, 12 Feb 2005)
New Revision: 5357

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

Log:
added ldb_msg_add_fmt(), for creating formatted ldb record values


Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c
   branches/SAMBA_4_0/source/lib/ldb/include/ldb.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c  2005-02-12 03:10:50 UTC 
(rev 5356)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c  2005-02-12 11:30:33 UTC 
(rev 5357)
@@ -213,6 +213,28 @@
 }
 
 /*
+  add a printf formatted element to a message
+*/
+int ldb_msg_add_fmt(struct ldb_context *ldb, struct ldb_message *msg, 
+   const char *attr_name, const char *fmt, ...)
+{
+   struct ldb_val val;
+   va_list ap;
+   char *str;
+
+   va_start(ap, fmt);
+   str = talloc_vasprintf(msg, fmt, ap);
+   va_end(ap);
+
+   if (str == NULL) return -1;
+
+   val.data   = str;
+   val.length = strlen(str);
+
+   return ldb_msg_add_value(ldb, msg, attr_name, val);
+}
+
+/*
   compare two ldb_message_element structures
   assumes case senistive comparison
 */

Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2005-02-12 03:10:50 UTC 
(rev 5356)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2005-02-12 11:30:33 UTC 
(rev 5357)
@@ -259,6 +259,8 @@
  const struct ldb_val *val);
 int ldb_msg_add_string(struct ldb_context *ldb, struct ldb_message *msg, 
   const char *attr_name, const char *str);
+int ldb_msg_add_fmt(struct ldb_context *ldb, struct ldb_message *msg, 
+   const char *attr_name, const char *fmt, ...) 
PRINTF_ATTRIBUTE(4,5);
 
 /* compare two message elements - return 0 on match */
 int ldb_msg_element_compare(struct ldb_message_element *el1, 



svn commit: samba r5358 - in branches/SAMBA_4_0/source: include lib libcli/nbt librpc/idl nbt_server

2005-02-12 Thread tridge
Author: tridge
Date: 2005-02-12 11:33:42 + (Sat, 12 Feb 2005)
New Revision: 5358

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

Log:
- added initial WINS server code. It passes most of the NBT-WINS test, but 
doesn't yet
  do secure server WACK responses

- added a ldap_string_to_time() function, for converting a LDAP
  formatted time to a time_t



Added:
   branches/SAMBA_4_0/source/nbt_server/winsdb.c
   branches/SAMBA_4_0/source/nbt_server/winsdb.h
Modified:
   branches/SAMBA_4_0/source/include/structs.h
   branches/SAMBA_4_0/source/lib/time.c
   branches/SAMBA_4_0/source/libcli/nbt/nbtname.c
   branches/SAMBA_4_0/source/librpc/idl/nbt.idl
   branches/SAMBA_4_0/source/nbt_server/config.mk
   branches/SAMBA_4_0/source/nbt_server/defense.c
   branches/SAMBA_4_0/source/nbt_server/nbt_server.h
   branches/SAMBA_4_0/source/nbt_server/packet.c
   branches/SAMBA_4_0/source/nbt_server/winsserver.c


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


svn commit: samba r5359 - in branches/SAMBA_3_0/source: param printing

2005-02-12 Thread jerry
Author: jerry
Date: 2005-02-12 14:41:00 + (Sat, 12 Feb 2005)
New Revision: 5359

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

Log:
BUG 2333: use the lpq command to pass in the correct printer name for 
cups_queue_get().  See comments in code for details
Modified:
   branches/SAMBA_3_0/source/param/loadparm.c
   branches/SAMBA_3_0/source/printing/print_cups.c


Changeset:
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===
--- branches/SAMBA_3_0/source/param/loadparm.c  2005-02-12 11:33:42 UTC (rev 
5358)
+++ branches/SAMBA_3_0/source/param/loadparm.c  2005-02-12 14:41:00 UTC (rev 
5359)
@@ -1226,7 +1226,9 @@
 
case PRINT_CUPS:
 #ifdef HAVE_CUPS
-   string_set(pService-szLpqcommand, );
+   /* set the lpq command to contain the destination 
printer
+  name only.  This is used by cups_queue_get() */
+   string_set(pService-szLpqcommand, %p);
string_set(pService-szLprmcommand, );
string_set(pService-szPrintcommand, );
string_set(pService-szLppausecommand, );

Modified: branches/SAMBA_3_0/source/printing/print_cups.c
===
--- branches/SAMBA_3_0/source/printing/print_cups.c 2005-02-12 11:33:42 UTC 
(rev 5358)
+++ branches/SAMBA_3_0/source/printing/print_cups.c 2005-02-12 14:41:00 UTC 
(rev 5359)
@@ -670,12 +670,13 @@
  * 'cups_queue_get()' - Get all the jobs in the print queue.
  */
 
-static int cups_queue_get(const char *printer_name,
+static int cups_queue_get(const char *sharename,
enum printing_types printing_type,
char *lpq_command,
print_queue_struct **q, 
print_status_struct *status)
 {
+   fstring printername;
http_t  *http = NULL;   /* HTTP connection to server */
ipp_t   *request = NULL,/* IPP Request */
*response = NULL;   /* IPP Response */
@@ -711,8 +712,16 @@
 
*q = NULL;
 
-   DEBUG(5,(cups_queue_get(%s, %p, %p)\n, printer_name, q, status));
+   /* HACK ALERT!!!  The porblem with support the 'printer name' 
+  option is that we key the tdb off the sharename.  So we will 
+  overload the lpq_command string to pass in the printername 
+  (which is basically what we do for non-cups printers ... using 
+  the lpq_command to get the queue listing). */
 
+   fstrcpy( printername, lpq_command );
+
+   DEBUG(5,(cups_queue_get(%s, %p, %p)\n, printername, q, status));
+
/*
 * Make sure we don't ask for passwords...
*/
@@ -733,7 +742,7 @@
 * Generate the printer URI...
*/
 
-   slprintf(uri, sizeof(uri) - 1, ipp://localhost/printers/%s;, 
printer_name);
+   slprintf(uri, sizeof(uri) - 1, ipp://localhost/printers/%s;, 
printername);
 
/*
* Build an IPP_GET_JOBS request, which requires the following
@@ -936,14 +945,14 @@
*/
 
if ((response = cupsDoRequest(http, request, /)) == NULL) {
-   DEBUG(0,(Unable to get printer status for %s - %s\n, 
printer_name,
+   DEBUG(0,(Unable to get printer status for %s - %s\n, 
printername,
 ippErrorString(cupsLastError(;
*q = queue;
goto out;
}
 
if (response-request.status.status_code = IPP_OK_CONFLICT) {
-   DEBUG(0,(Unable to get printer status for %s - %s\n, 
printer_name,
+   DEBUG(0,(Unable to get printer status for %s - %s\n, 
printername,
 ippErrorString(response-request.status.status_code)));
*q = queue;
goto out;



svn commit: samba r5360 - in branches/SAMBA_4_0/source: build/pidl librpc/ndr

2005-02-12 Thread jelmer
Author: jelmer
Date: 2005-02-12 19:28:23 + (Sat, 12 Feb 2005)
New Revision: 5360

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

Log:
Remove a couple of unused functions.

Modified:
   branches/SAMBA_4_0/source/build/pidl/ndr.pm
   branches/SAMBA_4_0/source/build/pidl/util.pm
   branches/SAMBA_4_0/source/librpc/ndr/libndr.h
   branches/SAMBA_4_0/source/librpc/ndr/ndr.c


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/ndr.pm
===
--- branches/SAMBA_4_0/source/build/pidl/ndr.pm 2005-02-12 14:41:00 UTC (rev 
5359)
+++ branches/SAMBA_4_0/source/build/pidl/ndr.pm 2005-02-12 19:28:23 UTC (rev 
5360)
@@ -551,7 +551,7 @@
 
if (util::is_fixed_array($e)) {
ParseElementPrintBuffer($e, $var_prefix);
-   } elsif (util::has_direct_buffers($e)) {
+   } elsif ($e-{POINTERS} || util::array_size($e)) {
pidl \tndr_print_ptr(ndr, \$e-{NAME}\, 
$var_prefix$e-{NAME});\n;
pidl \tndr-depth++;\n;
ParseElementPrintBuffer($e, $var_prefix);

Modified: branches/SAMBA_4_0/source/build/pidl/util.pm
===
--- branches/SAMBA_4_0/source/build/pidl/util.pm2005-02-12 14:41:00 UTC 
(rev 5359)
+++ branches/SAMBA_4_0/source/build/pidl/util.pm2005-02-12 19:28:23 UTC 
(rev 5360)
@@ -306,16 +306,6 @@
return undef;
 }
 
-# determine if an element has a direct buffers component
-sub has_direct_buffers($)
-{
-   my $e = shift;
-   if ($e-{POINTERS} || array_size($e)) {
-   return 1;
-   }
-   return 0;
-}
-
 # return 1 if the string is a C constant
 sub is_constant($)
 {

Modified: branches/SAMBA_4_0/source/librpc/ndr/libndr.h
===
--- branches/SAMBA_4_0/source/librpc/ndr/libndr.h   2005-02-12 14:41:00 UTC 
(rev 5359)
+++ branches/SAMBA_4_0/source/librpc/ndr/libndr.h   2005-02-12 19:28:23 UTC 
(rev 5360)
@@ -234,9 +234,6 @@
 #define NDR_PUSH_ALLOC(ndr, s) NDR_PUSH_ALLOC_SIZE(ndr, s, sizeof(*(s)))
 
 /* these are used when generic fn pointers are needed for ndr push/pull fns */
-typedef NTSTATUS (*ndr_push_fn_t)(struct ndr_push *, void *);
-typedef NTSTATUS (*ndr_pull_fn_t)(struct ndr_pull *, void *);
-
 typedef NTSTATUS (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, void 
*);
 typedef NTSTATUS (*ndr_push_const_fn_t)(struct ndr_push *, int ndr_flags, 
const void *);
 typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void 
*);

Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c
===
--- branches/SAMBA_4_0/source/librpc/ndr/ndr.c  2005-02-12 14:41:00 UTC (rev 
5359)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c  2005-02-12 19:28:23 UTC (rev 
5360)
@@ -469,22 +469,6 @@
   handle subcontext buffers, which in midl land are user-marshalled, but
   we use magic in pidl to make them easier to cope with
 */
-NTSTATUS ndr_pull_subcontext_fn(struct ndr_pull *ndr, size_t sub_size, 
-   void *base, ndr_pull_fn_t fn)
-{
-   struct ndr_pull *ndr2;
-   NDR_ALLOC(ndr, ndr2);
-   NDR_CHECK(ndr_pull_subcontext_header(ndr, sub_size, ndr2));
-   NDR_CHECK(fn(ndr2, base));
-   if (sub_size) {
-   NDR_CHECK(ndr_pull_advance(ndr, ndr2-data_size));
-   } else {
-   NDR_CHECK(ndr_pull_advance(ndr, ndr2-offset));
-   }
-   return NT_STATUS_OK;
-}
-
-
 NTSTATUS ndr_pull_subcontext_flags_fn(struct ndr_pull *ndr, size_t sub_size,
  void *base, ndr_pull_flags_fn_t fn)
 {
@@ -547,24 +531,6 @@
   handle subcontext buffers, which in midl land are user-marshalled, but
   we use magic in pidl to make them easier to cope with
 */
-NTSTATUS ndr_push_subcontext_fn(struct ndr_push *ndr, size_t sub_size, 
-   void *base, ndr_push_fn_t fn)
-{
-   struct ndr_push *ndr2;
-
-   ndr2 = ndr_push_init_ctx(ndr);
-   if (!ndr2) return NT_STATUS_NO_MEMORY;
-
-   ndr2-flags = ndr-flags;
-   NDR_CHECK(fn(ndr2, base));
-   NDR_CHECK(ndr_push_subcontext_header(ndr, sub_size, ndr2));
-   NDR_CHECK(ndr_push_bytes(ndr, ndr2-data, ndr2-offset));
-   return NT_STATUS_OK;
-}
-
-/*
-  handle subcontext buffers for function that take a flags arg
-*/
 NTSTATUS ndr_push_subcontext_flags_fn(struct ndr_push *ndr, size_t sub_size,
  void *base, ndr_push_flags_fn_t fn)
 {



svn commit: samba r5362 - in branches/SAMBA_4_0/source: build/pidl librpc/idl

2005-02-12 Thread jelmer
Author: jelmer
Date: 2005-02-12 23:03:26 + (Sat, 12 Feb 2005)
New Revision: 5362

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

Log:
Add pointer_default() support to pidl. pointer_default() 
is assumed to be ptr if not specified (just like midl).

The validator will warn when ptr is used at the moment, because 
pidl only supports unique, ref and relative at the moment.

Modified:
   branches/SAMBA_4_0/source/build/pidl/ndr.pm
   branches/SAMBA_4_0/source/build/pidl/validator.pm
   branches/SAMBA_4_0/source/librpc/idl/audiosrv.idl
   branches/SAMBA_4_0/source/librpc/idl/browser.idl
   branches/SAMBA_4_0/source/librpc/idl/dbgidl.idl
   branches/SAMBA_4_0/source/librpc/idl/dcerpc.idl
   branches/SAMBA_4_0/source/librpc/idl/dcom.idl
   branches/SAMBA_4_0/source/librpc/idl/drsblobs.idl
   branches/SAMBA_4_0/source/librpc/idl/dsbackup.idl
   branches/SAMBA_4_0/source/librpc/idl/echo.idl
   branches/SAMBA_4_0/source/librpc/idl/efs.idl
   branches/SAMBA_4_0/source/librpc/idl/exchange.idl
   branches/SAMBA_4_0/source/librpc/idl/keysvc.idl
   branches/SAMBA_4_0/source/librpc/idl/mgmt.idl
   branches/SAMBA_4_0/source/librpc/idl/misc.idl
   branches/SAMBA_4_0/source/librpc/idl/msgsvc.idl
   branches/SAMBA_4_0/source/librpc/idl/policyagent.idl
   branches/SAMBA_4_0/source/librpc/idl/rot.idl
   branches/SAMBA_4_0/source/librpc/idl/scerpc.idl
   branches/SAMBA_4_0/source/librpc/idl/security.idl
   branches/SAMBA_4_0/source/librpc/idl/trkwks.idl
   branches/SAMBA_4_0/source/librpc/idl/w32time.idl
   branches/SAMBA_4_0/source/librpc/idl/xattr.idl


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


Build status as of Sun Feb 13 00:00:02 2005

2005-02-12 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2005-02-12 
00:00:38.0 +
+++ /home/build/master/cache/broken_results.txt 2005-02-13 00:00:07.0 
+
@@ -1,22 +1,23 @@
-Build status as of Sat Feb 12 00:00:02 2005
+Build status as of Sun Feb 13 00:00:02 2005
 
 Build counts:
 Tree Total  Broken Panic 
-ccache   36 4  0 
-distcc   37 4  0 
+ccache   37 5  0 
+distcc   37 2  0 
 ppp  22 4  0 
-rsync37 3  0 
+rsync37 2  0 
 samba1  1  1 
 samba-docs   0  0  0 
-samba4   38 8  0 
-samba_3_036 33 1 
+samba4   39 8  0 
+samba_3_036 34 1 
 
 Currently broken builds:
 Host   Tree Compiler   Status
+aix1   samba_3_0gcc 127/?/?/?
 mungerasamba_3_0gccok/ok/ok/ 6/PANIC
 fusberta   samba4   gccok/ 2/?/? 
 fusberta   samba_3_0gccok/ok/ok/ 4
-yurok  samba_3_0gcc 127/?/?/?
+yurok  samba_3_0gccok/ok/ok/ 4
 samba-s390 samba_3_0gccok/ok/ok/ 4
 quango ccache   gcc 137/?/?/?
 quango distcc   gcc 137/?/?/?
@@ -24,25 +25,22 @@
 quango samba_3_0gccok/ok/ok/ 4
 superego   samba_3_0gccok/ok/ok/ 4
 cl012  samba_3_0gccok/ok/ok/ 4
+berks  samba_3_0gccok/ok/ok/ 4
 gc8samba4   gccok/ 1/?/? 
 gc8samba_3_0gccok/ok/ok/ 4
-aretnapdistcc   gcc 127/?/?/?
 aretnapsamba_3_0gccok/ok/ok/ 4
 aretnapccache   iccok/ok/ok/ 1
 aretnapsamba4   iccok/ 1/?/? 
 aretnapsamba_3_0iccok/ok/ok/ 4
 gc4samba_3_0gccok/ok/ok/ 4
-sbfrsyncgccok/ 1/?/? 
-sbfsamba_3_0gccok/ 1/?/? 
 smartserv1 samba_3_0gccok/ok/ok/ 4
 smartserv1 samba_3_0gcc-4.0ok/ok/ok/ 4
 wetlizard  samba_3_0gccok/ok/ok/ 4
-tardis distcc   gccok/ 2/?/? 
-tardis samba_3_0gccok/ok/ok/ 5
+tardis samba_3_0gccok/ok/ok/ 4
 us4samba_3_0cc ok/ 1/?/? 
 us4samba_3_0gccok/ 1/?/? 
 flock  samba4   gccok/ 1/?/? 
-flock  samba_3_0gcc 127/?/?/?
+flock  samba_3_0gccok/ok/ok/ 4
 homer  samba_3_0gccok/ok/ok/ 4
 opisol10   ccache   gccok/ok/ok/ 1
 opisol10   ppp  gccok/ 1/?/? 
@@ -52,7 +50,7 @@
 gc20   samba_3_0gccok/ok/ok/ 4
 sun1   samba4   cc ok/ 2/?/? 
 sun1   samba_3_0cc ok/ 2/?/? 
-sun1   samba_3_0gccok/ok/ok/ 5
+sun1   samba_3_0gccok/ok/ok/ 4
 Isis   ccache   cc  77/?/?/? 
 Isis   distcc   cc  77/?/?/? 
 Isis   rsynccc  77/?/?/? 
@@ -61,6 +59,7 @@
 Isis   ppp  gccok/ 2/?/? 
 Isis   samba_3_0gccok/ok/ok/ 4
 fire1  samba_3_0gccok/ok/ok/ 4
+m30ccache   gccok/ok/ok/ 2
 m30rsyncgccok/ok/ok/ 2
 m30samba4   gccok/ 2/?/? 
 m30samba_3_0gccok/ok/ok/ 1


svn commit: samba r5363 - in branches/SAMBA_4_0/source: build/pidl librpc/ndr

2005-02-12 Thread jelmer
Author: jelmer
Date: 2005-02-13 00:07:17 + (Sun, 13 Feb 2005)
New Revision: 5363

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

Log:
- ndr_%_ptr - ndr_%_unique_ptr
- ndr_%_relative% - ndr_%_relative_ptr%
- Change pointer_default() default to unique 
  (DCE uses ptr as default, MIDL doesn't follow the standard and uses 
unique)

Modified:
   branches/SAMBA_4_0/source/build/pidl/ndr.pm
   branches/SAMBA_4_0/source/librpc/ndr/ndr.c
   branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/ndr.pm
===
--- branches/SAMBA_4_0/source/build/pidl/ndr.pm 2005-02-12 23:03:26 UTC (rev 
5362)
+++ branches/SAMBA_4_0/source/build/pidl/ndr.pm 2005-02-13 00:07:17 UTC (rev 
5363)
@@ -535,11 +535,11 @@
}
 
if (util::has_property($e, relative)) {
-   pidl \tNDR_CHECK(ndr_push_relative1(ndr, 
$var_prefix$e-{NAME}));\n;
+   pidl \tNDR_CHECK(ndr_push_relative_ptr1(ndr, 
$var_prefix$e-{NAME}));\n;
} elsif (util::is_inline_array($e)) {
ParseArrayPush($e, r-, NDR_SCALARS);
} elsif (need_wire_pointer($e)) {
-   pidl \tNDR_CHECK(ndr_push_ptr(ndr, $var_prefix$e-{NAME}));\n;
+   pidl \tNDR_CHECK(ndr_push_unique_ptr(ndr, 
$var_prefix$e-{NAME}));\n;
} elsif (need_alloc($e)) {
# no scalar component
} elsif (my $switch = util::has_property($e, switch_is)) {
@@ -701,11 +701,11 @@
if (util::is_inline_array($e)) {
ParseArrayPull($e, r-, NDR_SCALARS);
} elsif (need_wire_pointer($e)) {
-   pidl \tNDR_CHECK(ndr_pull_ptr(ndr, _ptr_$e-{NAME}));\n;
+   pidl \tNDR_CHECK(ndr_pull_unique_ptr(ndr, 
_ptr_$e-{NAME}));\n;
pidl \tif (_ptr_$e-{NAME}) {\n;
pidl \t\tNDR_ALLOC(ndr, $var_prefix$e-{NAME});\n;
if (util::has_property($e, relative)) {
-   pidl \t\tNDR_CHECK(ndr_pull_relative1(ndr, 
$var_prefix$e-{NAME}, _ptr_$e-{NAME}));\n;
+   pidl \t\tNDR_CHECK(ndr_pull_relative_ptr1(ndr, 
$var_prefix$e-{NAME}, _ptr_$e-{NAME}));\n;
}
pidl \t} else {\n;
pidl \t\t$var_prefix$e-{NAME} = NULL;\n;
@@ -747,7 +747,7 @@
if (need_wire_pointer($e)) {
pidl \tif ($var_prefix$e-{NAME}) {\n;
if (util::has_property($e, relative)) {
-   pidl \t\tNDR_CHECK(ndr_push_relative2(ndr, 
$var_prefix$e-{NAME}));\n;
+   pidl \t\tNDR_CHECK(ndr_push_relative_ptr2(ndr, 
$var_prefix$e-{NAME}));\n;
}
}

@@ -825,7 +825,7 @@
if (util::has_property($e, relative)) {
pidl \t\tstruct ndr_pull_save _relative_save;\n;
pidl \t\tndr_pull_save(ndr, _relative_save);\n;
-   pidl \t\tNDR_CHECK(ndr_pull_relative2(ndr, 
$var_prefix$e-{NAME}));\n;
+   pidl \t\tNDR_CHECK(ndr_pull_relative_ptr2(ndr, 
$var_prefix$e-{NAME}));\n;
}
}

@@ -1585,7 +1585,7 @@
 
if (util::array_size($e)) {
if (need_wire_pointer($e)) {
-   pidl \tNDR_CHECK(ndr_push_ptr(ndr, 
r-$inout.$e-{NAME}));\n;
+   pidl \tNDR_CHECK(ndr_push_unique_ptr(ndr, 
r-$inout.$e-{NAME}));\n;
pidl \tif (r-$inout.$e-{NAME}) {\n;
ParseArrayPush($e, r-$inout., 
NDR_SCALARS|NDR_BUFFERS);
pidl \t}\n;
@@ -1644,7 +1644,7 @@
 
if (util::array_size($e)) {
if (need_wire_pointer($e)) {
-   pidl \tNDR_CHECK(ndr_pull_ptr(ndr, 
_ptr_$e-{NAME}));\n;
+   pidl \tNDR_CHECK(ndr_pull_unique_ptr(ndr, 
_ptr_$e-{NAME}));\n;
pidl \tr-$inout.$e-{NAME} = NULL;\n;
pidl \tif (_ptr_$e-{NAME}) {\n;
} elsif ($inout eq out  util::has_property($e, ref)) {
@@ -1936,7 +1936,9 @@
my $x = shift;
 
if (not util::has_property($x, pointer_default)) {
-   $x-{PROPERTIES}-{pointer_default} = ptr;
+   # MIDL defaults to ptr in DCE compatible mode (/osf)
+   # and unique in Microsoft Extensions mode (default)
+   $x-{PROPERTIES}-{pointer_default} = unique;
}
 
foreach my $d (@{$x-{DATA}}) {
@@ -1947,7 +1949,9 @@
}
}
if ($d-{TYPE} eq FUNCTION) {
-   CheckPointerTypes($d, 
$x-{PROPERTIES}-{pointer_default});
+   CheckPointerTypes($d, 
+   $x-{PROPERTIES}-{pointer_default}  # MIDL 
defaults to ref
+   );
}
}
 }

Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c

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=revroot=sambarev=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=revroot=sambarev=5364


svn commit: samba-docs r359 - in branches/SAMBA_4/manpages: .

2005-02-12 Thread jelmer
Author: jelmer
Date: 2005-02-13 00:46:21 + (Sun, 13 Feb 2005)
New Revision: 359

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

Log:
Update list of supported MIDL attributes.

Modified:
   branches/SAMBA_4/manpages/pidl.1.xml


Changeset:
Modified: branches/SAMBA_4/manpages/pidl.1.xml
===
--- branches/SAMBA_4/manpages/pidl.1.xml2005-02-10 20:27:44 UTC (rev 
358)
+++ branches/SAMBA_4/manpages/pidl.1.xml2005-02-13 00:46:21 UTC (rev 
359)
@@ -200,7 +200,7 @@
 /programlisting
 
 para
-   Let's look at the mutliple ways you can encode an array.
+   Let's look at the multiple ways you can encode an array.
 /para
 
 refsect2
@@ -358,7 +358,7 @@
titleSupported MIDL-compatible properties (attributes is the MIDL 
term)/title
 
para
-in, out, ref, length_is, switch_is, size_is, uuid, case, default, string, 
unique, endpoint, helpstring, object, call_as, local.
+in, out, ref, length_is, switch_is, size_is, uuid, case, default, string, 
unique, ptr, pointer_default, v1_enum, object, helpstring, range, local, 
call_as.
/para
 
 /refsect2
@@ -449,7 +449,7 @@
 refsect2
titleUnsupported MIDL properties/title
 
-paraaggregatable, appobject, async_uuid, bindable, control, cpp_quote, 
defaultbind, defaultcollelem, defaultvalue, defaultvtable, dispinterface, 
displaybind, dual, entry, first_is, helpcontext, helpfile, helpstringcontext, 
helpstringdll, hidden, idl_module, idl_quote, id, iid_is, immediatebind, 
importlib, import, include, includelib, last_is, lcid, licensed, max_is, 
module, ms_union, no_injected_text, nonbrowsable, noncreatable, nonextensible, 
odl, oleautomation, optional, pointer_default, pragma, progid, propget, 
propputref, propput, ptr, range, readonly, requestedit, restricted, retval, 
source, switch_type, transmit_as, uidefault, usesgetlasterror, v1_enum, vararg, 
vi_progid, wire_marshal. /para
+paraaggregatable, appobject, async_uuid, bindable, coclass, control, 
cpp_quote, defaultbind, defaultcollelem, defaultvalue, defaultvtable, 
dispinterface, displaybind, dual, entry, first_is, helpcontext, helpfile, 
helpstringcontext, helpstringdll, hidden, idl_module, idl_quote, id, iid_is, 
immediatebind, importlib, import, include, includelib, last_is, lcid, licensed, 
max_is, module, ms_union, no_injected_text, nonbrowsable, noncreatable, 
nonextensible, odl, oleautomation, optional, pragma, progid, propget, 
propputref, propput, readonly, requestedit, restricted, retval, source, 
switch_type, transmit_as, uidefault, usesgetlasterror, vararg, vi_progid, 
wire_marshal. /para
 
 /refsect2
 



svn commit: samba r5365 - in branches/SAMBA_4_0/source/libnet: .

2005-02-12 Thread mimir
Author: mimir
Date: 2005-02-13 00:48:21 + (Sun, 13 Feb 2005)
New Revision: 5365

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

Log:
Initial code for adding user accounts via libnet call.


rafal


Added:
   branches/SAMBA_4_0/source/libnet/libnet_user.c
   branches/SAMBA_4_0/source/libnet/libnet_user.h
Modified:
   branches/SAMBA_4_0/source/libnet/libnet.h


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet.h
===
--- branches/SAMBA_4_0/source/libnet/libnet.h   2005-02-13 00:26:43 UTC (rev 
5364)
+++ branches/SAMBA_4_0/source/libnet/libnet.h   2005-02-13 00:48:21 UTC (rev 
5365)
@@ -36,3 +36,4 @@
 #include libnet/libnet_time.h
 #include libnet/libnet_rpc.h
 #include libnet/libnet_join.h
+#include libnet/libnet_user.h

Added: branches/SAMBA_4_0/source/libnet/libnet_user.c
===
--- branches/SAMBA_4_0/source/libnet/libnet_user.c  2005-02-13 00:26:43 UTC 
(rev 5364)
+++ branches/SAMBA_4_0/source/libnet/libnet_user.c  2005-02-13 00:48:21 UTC 
(rev 5365)
@@ -0,0 +1,87 @@
+/* 
+   Unix SMB/CIFS implementation.
+   
+   Copyright (C) Rafal Szczesniak [EMAIL PROTECTED] 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
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+
+#include includes.h
+#include libnet/libnet.h
+#include librpc/gen_ndr/ndr_samr.h
+
+
+static NTSTATUS libnet_CreateUser_generic(struct libnet_context *ctx, 
TALLOC_CTX *mem_ctx, union libnet_CreateUser *r)
+{
+   NTSTATUS status;
+   union libnet_CreateUser r2;
+   
+   r2.samr.level = LIBNET_CREATE_USER_SAMR;
+   r2.samr.in.user_name  = r-generic.in.user_name;
+   r2.samr.in.domain_name= r-generic.in.domain_name;
+   
+   status = libnet_CreateUser(ctx, mem_ctx, r2);
+   
+   r-generic.out.error_string   = r2.samr.out.error_string;
+
+   return status;
+}
+
+
+static NTSTATUS libnet_CreateUser_samr(struct libnet_context *ctx, TALLOC_CTX 
*mem_ctx, union libnet_CreateUser *r)
+{
+   NTSTATUS status;
+   union libnet_rpc_connect cn;
+   union libnet_find_pdc fp;
+   
+   /* find domain pdc */
+   fp.generic.level = LIBNET_FIND_PDC_GENERIC;
+   fp.generic.in.domain_name= r-samr.in.domain_name;
+
+   status = libnet_find_pdc(ctx, mem_ctx, fp);
+   if (!NT_STATUS_IS_OK(status)) return status;
+
+   /* connect rpc service of remote server */
+   cn.standard.level  = LIBNET_RPC_CONNECT_STANDARD;
+   cn.standard.in.server_name = fp.generic.out.pdc_name;
+   cn.standard.in.dcerpc_iface_name   = DCERPC_SAMR_NAME;
+   cn.standard.in.dcerpc_iface_uuid   = DCERPC_SAMR_UUID;
+   cn.standard.in.dcerpc_iface_version= DCERPC_SAMR_VERSION;
+
+   status = libnet_rpc_connect(ctx, mem_ctx, cn);
+   if (!NT_STATUS_IS_OK(status)) {
+   r-samr.out.error_string = talloc_asprintf(mem_ctx,
+  Connection to SAMR 
pipe domain '%s' PDC failed: %s\n,
+  
r-samr.in.domain_name, nt_errstr(status));
+   return status;
+   }
+
+   /* create user via samr call (to be continued) */
+   return status;
+}
+
+
+NTSTATUS libnet_CreateUser(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, 
union libnet_CreateUser *r)
+{
+   switch (r-generic.level) {
+   case LIBNET_CREATE_USER_GENERIC:
+   return libnet_CreateUser_generic(ctx, mem_ctx, r);
+   case LIBNET_CREATE_USER_SAMR:
+   return libnet_CreateUser_samr(ctx, mem_ctx, r);
+   }
+
+   return NT_STATUS_INVALID_LEVEL;
+}

Added: branches/SAMBA_4_0/source/libnet/libnet_user.h
===
--- branches/SAMBA_4_0/source/libnet/libnet_user.h  2005-02-13 00:26:43 UTC 
(rev 5364)
+++ branches/SAMBA_4_0/source/libnet/libnet_user.h  2005-02-13 00:48:21 UTC 
(rev 5365)
@@ -0,0 +1,47 @@
+/* 
+   Unix SMB/CIFS implementation.
+   
+   Copyright (C) Rafal Szczesniak [EMAIL PROTECTED] 2005
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public 

svn commit: samba r5366 - in branches/SAMBA_4_0/source/libnet: .

2005-02-12 Thread mimir
Author: mimir
Date: 2005-02-13 00:50:38 + (Sun, 13 Feb 2005)
New Revision: 5366

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

Log:
added initial code for adding user accounts to libnet makefile.
It doesn't do anything useful yet, but at least doesn't break
the build.


rafal


Modified:
   branches/SAMBA_4_0/source/libnet/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/config.mk
===
--- branches/SAMBA_4_0/source/libnet/config.mk  2005-02-13 00:48:21 UTC (rev 
5365)
+++ branches/SAMBA_4_0/source/libnet/config.mk  2005-02-13 00:50:38 UTC (rev 
5366)
@@ -7,7 +7,8 @@
libnet/libnet_passwd.o \
libnet/libnet_time.o \
libnet/libnet_rpc.o \
-   libnet/libnet_join.o
+   libnet/libnet_join.o \
+   libnet/libnet_user.o
 REQUIRED_SUBSYSTEMS = RPC_NDR_SAMR RPC_NDR_SRVSVC
 # End SUBSYSTEM LIBNET
 #



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

2005-02-12 Thread mimir
Author: mimir
Date: 2005-02-13 00:52:45 + (Sun, 13 Feb 2005)
New Revision: 5367

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

Log:
Minor typo fixes.


rafal


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-02-13 00:50:38 UTC (rev 5366)
+++ branches/SAMBA_4_0/prog_guide.txt   2005-02-13 00:52:45 UTC (rev 5367)
@@ -232,7 +232,7 @@
 are extremely important differences in the approach that are worth
 pointing out.
 
-In the Samba3 msrpc code we used explicit parse strucrures for all
+In the Samba3 msrpc code we used explicit parse structures for all
 msrpc functions. The problem is that we didn't just put all of the
 real variables in these structures, we also put in all the artifacts
 as well. A good example is the security descriptor strucrure that
@@ -263,7 +263,7 @@
 *NOT* be in the interface structure.
 
 In Samba3 there were unwritten rules about which variables in a
-strucrure a high level caller has to fill in and which ones are filled
+structure a high level caller has to fill in and which ones are filled
 in by the marshalling code. In Samba4 those rules are gone, because
 the redundent artifact variables are gone. The high level caller just
 sets up the real variables and the marshalling code worries about



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=revroot=sambarev=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 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=revroot=sambarev=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=revroot=sambarev=5369