svn commit: samba r26677 - in branches/SAMBA_4_0/source/lib/tdb: . python/tests

2008-01-06 Thread tpot
Author: tpot
Date: 2008-01-06 23:17:55 + (Sun, 06 Jan 2008)
New Revision: 26677

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

Log:
Implement and test iter{keys,values,items} for tdb bindings.

Use tempfile.mkstemp() instead of os.tmpnam() in tests.

Modified:
   branches/SAMBA_4_0/source/lib/tdb/python/tests/simple.py
   branches/SAMBA_4_0/source/lib/tdb/tdb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/python/tests/simple.py
===
--- branches/SAMBA_4_0/source/lib/tdb/python/tests/simple.py2008-01-06 
22:01:31 UTC (rev 26676)
+++ branches/SAMBA_4_0/source/lib/tdb/python/tests/simple.py2008-01-06 
23:17:55 UTC (rev 26677)
@@ -8,7 +8,7 @@
 
 import tdb
 from unittest import TestCase
-import os
+import os, tempfile
 
 
 class OpenTdbTests(TestCase):
@@ -19,7 +19,7 @@
 class SimpleTdbTests(TestCase):
 def setUp(self):
 super(SimpleTdbTests, self).setUp()
-self.tdb = tdb.Tdb(os.tmpnam(), 0, tdb.DEFAULT, os.O_CREAT|os.O_RDWR)
+self.tdb = tdb.Tdb(tempfile.mkstemp()[1], 0, tdb.DEFAULT, 
os.O_CREAT|os.O_RDWR)
 self.assertNotEqual(None, self.tdb)
 
 def tearDown(self):
@@ -82,6 +82,13 @@
 self.tdb[brainslug] = 2
 self.assertEquals([(bla, 1), (brainslug, 2)], self.tdb.items())
 
+def test_iteritems(self):
+self.tdb[bloe] = 2
+self.tdb[bla] = 25
+i = self.tdb.iteritems()
+self.assertEquals(set([(bla, 25), (bloe, 2)]),
+  set([i.next(), i.next()]))
+
 def test_transaction_cancel(self):
 self.tdb[bloe] = 2
 self.tdb.transaction_start()
@@ -107,11 +114,23 @@
 self.tdb[bla] = 25
 self.assertEquals([bla, bloe], self.tdb.keys())
 
+def test_iterkeys(self):
+self.tdb[bloe] = 2
+self.tdb[bla] = 25
+i = self.tdb.iterkeys()
+self.assertEquals(set([bloe, bla]), set([i.next(), i.next()]))
+
 def test_values(self):
 self.tdb[bloe] = 2
 self.tdb[bla] = 25
 self.assertEquals([25, 2], self.tdb.values())
 
+def test_itervalues(self):
+self.tdb[bloe] = 2
+self.tdb[bla] = 25
+i = self.tdb.itervalues()
+self.assertEquals(set([25, 2]), set([i.next(), i.next()]))
+
 def test_clear(self):
 self.tdb[bloe] = 2
 self.tdb[bla] = 25

Modified: branches/SAMBA_4_0/source/lib/tdb/tdb.i
===
--- branches/SAMBA_4_0/source/lib/tdb/tdb.i 2008-01-06 22:01:31 UTC (rev 
26676)
+++ branches/SAMBA_4_0/source/lib/tdb/tdb.i 2008-01-06 23:17:55 UTC (rev 
26677)
@@ -263,8 +263,18 @@
 for k in iter(self):
 del(self[k])
 
-# TODO: iterkeys, itervalues, iteritems
+def iterkeys(self):
+for k in iter(self):
+yield k
+   
+def itervalues(self):
+for k in iter(self):
+yield self[k]
 
+def iteritems(self):
+for k in iter(self):
+yield (k, self[k])
+
 # TODO: any other missing methods for container types
 }
 } tdb;



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

2008-01-06 Thread tpot
Author: tpot
Date: 2008-01-06 23:42:46 + (Sun, 06 Jan 2008)
New Revision: 26678

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

Log:
Check in auto-generated swig files.

Modified:
   branches/SAMBA_4_0/source/lib/tdb/tdb.py
   branches/SAMBA_4_0/source/lib/tdb/tdb_wrap.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/tdb.py
===
--- branches/SAMBA_4_0/source/lib/tdb/tdb.py2008-01-06 23:17:55 UTC (rev 
26677)
+++ branches/SAMBA_4_0/source/lib/tdb/tdb.py2008-01-06 23:42:46 UTC (rev 
26678)
@@ -1,5 +1,5 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.33
+# Version 1.3.31
 #
 # Don't modify this file, modify the SWIG interface instead.
 
@@ -164,7 +164,17 @@
 for k in iter(self):
 del(self[k])
 
+def iterkeys(self):
+for k in iter(self):
+yield k
+   
+def itervalues(self):
+for k in iter(self):
+yield self[k]
 
+def iteritems(self):
+for k in iter(self):
+yield (k, self[k])
 
 
 

Modified: branches/SAMBA_4_0/source/lib/tdb/tdb_wrap.c
===
--- branches/SAMBA_4_0/source/lib/tdb/tdb_wrap.c2008-01-06 23:17:55 UTC 
(rev 26677)
+++ branches/SAMBA_4_0/source/lib/tdb/tdb_wrap.c2008-01-06 23:42:46 UTC 
(rev 26678)
@@ -1,6 +1,6 @@
 /* 
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.33
+ * Version 1.3.31
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not 
make
@@ -17,14 +17,14 @@
 
 /* template workaround for compilers that cannot correctly implement the C++ 
standard */
 #ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC)  (__SUNPRO_CC = 0x560)
-#  define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 
*/
-/* If we find a maximum version that requires this, the test would be __HP_aCC 
= 35500 for A.03.55 */
-#  define SWIGTEMPLATEDISAMBIGUATOR template
+# if defined(__SUNPRO_CC)
+#   if (__SUNPRO_CC = 0x560)
+# define SWIGTEMPLATEDISAMBIGUATOR template
+#   else
+# define SWIGTEMPLATEDISAMBIGUATOR 
+#   endif
 # else
-#  define SWIGTEMPLATEDISAMBIGUATOR
+#   define SWIGTEMPLATEDISAMBIGUATOR 
 # endif
 #endif
 
@@ -107,13 +107,7 @@
 # define _CRT_SECURE_NO_DEPRECATE
 #endif
 
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ 
library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE)  defined(_MSC_VER)  
!defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
 
-
-
 /* Python.h has to appear first */
 #include Python.h
 
@@ -349,7 +343,7 @@
 while ((*f2 == ' ')  (f2 != l2)) ++f2;
 if (*f1 != *f2) return (*f1  *f2) ? 1 : -1;
   }
-  return (int)((l1 - f1) - (l2 - f2));
+  return (l1 - f1) - (l2 - f2);
 }
 
 /*
@@ -1096,14 +1090,14 @@
 /* Unpack the argument tuple */
 
 SWIGINTERN int
-SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, 
Py_ssize_t max, PyObject **objs)
+SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, 
PyObject **objs)
 {
   if (!args) {
 if (!min  !max) {
   return 1;
 } else {
   PyErr_Format(PyExc_TypeError, %s expected %s%d arguments, got none, 
-  name, (min == max ?  : at least ), (int)min);
+  name, (min == max ?  : at least ), min);
   return 0;
 }
   }  
@@ -,14 +1105,14 @@
 PyErr_SetString(PyExc_SystemError, UnpackTuple() argument list is not a 
tuple);
 return 0;
   } else {
-register Py_ssize_t l = PyTuple_GET_SIZE(args);
+register int l = PyTuple_GET_SIZE(args);
 if (l  min) {
   PyErr_Format(PyExc_TypeError, %s expected %s%d arguments, got %d, 
-  name, (min == max ?  : at least ), (int)min, (int)l);
+  name, (min == max ?  : at least ), min, l);
   return 0;
 } else if (l  max) {
   PyErr_Format(PyExc_TypeError, %s expected %s%d arguments, got %d, 
-  name, (min == max ?  : at most ), (int)max, (int)l);
+  name, (min == max ?  : at most ), max, l);
   return 0;
 } else {
   register int i;
@@ -1597,11 +1591,9 @@
 (unaryfunc)0, /*nb_float*/
 (unaryfunc)PySwigObject_oct,  /*nb_oct*/
 (unaryfunc)PySwigObject_hex,  /*nb_hex*/
-#if PY_VERSION_HEX = 0x0205 /* 2.5.0 */
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add - nb_index */
-#elif PY_VERSION_HEX = 0x0202 /* 2.2.0 */
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add - nb_inplace_true_divide 
*/
-#elif PY_VERSION_HEX = 0x0200 /* 2.0.0 */
+#if PY_VERSION_HEX

svn commit: samba r25329 - in branches/SAMBA_4_0/source/libcli/swig: .

2007-09-25 Thread tpot
Author: tpot
Date: 2007-09-26 01:26:36 + (Wed, 26 Sep 2007)
New Revision: 25329

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

Log:
A solution to SWIG not being able to handle a structure and a function
having the same name.  Hey we can now query nbt names from Python.

Modified:
   branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i
===
--- branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i  2007-09-26 01:02:52 UTC 
(rev 25328)
+++ branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i  2007-09-26 01:26:36 UTC 
(rev 25329)
@@ -37,10 +37,6 @@
 
 #undef strcpy
 
-/* Loadparm parameters */
-
-static struct loadparm_context lp_ctx;
-
 %}
 
 %apply bool { BOOL };
@@ -132,11 +128,17 @@
 %include carrays.i
 %array_functions(char *, char_ptr_array);
 
-%rename(do_nbt_name_query) nbt_name_query;
+NTSTATUS do_nbt_name_query(struct nbt_name_socket *nbtsock, 
+  TALLOC_CTX *mem_ctx, struct nbt_name_query *io);
 
-NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock, 
-   TALLOC_CTX *mem_ctx, struct nbt_name_query *io);
+%{
+NTSTATUS do_nbt_name_query(struct nbt_name_socket *nbtsock, 
+  TALLOC_CTX *mem_ctx, struct nbt_name_query *io)
+{
+   return nbt_name_query(nbtsock, mem_ctx, io);
+}
+%}
 
 %init %{
-  loadparm_init(lp_ctx);
+  lp_load();
 %}



svn commit: samba r25348 - in branches/SAMBA_4_0/source: libcli libcli/swig scripting/swig

2007-09-25 Thread tpot
Author: tpot
Date: 2007-09-26 03:08:40 + (Wed, 26 Sep 2007)
New Revision: 25348

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

Log:
Start working on another Python wrapper.

Added:
   branches/SAMBA_4_0/source/libcli/swig/libcli_smb.i
Modified:
   branches/SAMBA_4_0/source/libcli/config.mk
   branches/SAMBA_4_0/source/scripting/swig/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/config.mk
===
--- branches/SAMBA_4_0/source/libcli/config.mk  2007-09-26 02:06:36 UTC (rev 
25347)
+++ branches/SAMBA_4_0/source/libcli/config.mk  2007-09-26 03:08:40 UTC (rev 
25348)
@@ -59,6 +59,11 @@
 OBJ_FILES = swig/libcli_nbt_wrap.o
 PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-CONFIG
 
+[LIBRARY::swig_libcli_smb]
+LIBRARY_REALNAME = swig/_libcli_smb.$(SHLIBEXT)
+OBJ_FILES = swig/libcli_smb_wrap.o
+PUBLIC_DEPENDENCIES = LIBCLI_SMB DYNCONFIG LIBSAMBA-CONFIG
+
 [SUBSYSTEM::LIBCLI_DGRAM]
 OBJ_FILES = \
dgram/dgramsocket.o \

Added: branches/SAMBA_4_0/source/libcli/swig/libcli_smb.i
===
--- branches/SAMBA_4_0/source/libcli/swig/libcli_smb.i  2007-09-26 02:06:36 UTC 
(rev 25347)
+++ branches/SAMBA_4_0/source/libcli/swig/libcli_smb.i  2007-09-26 03:08:40 UTC 
(rev 25348)
@@ -0,0 +1,18 @@
+%module libcli_smb
+
+%{
+#include includes.h
+#include lib/talloc/talloc.h
+#include lib/events/events.h
+#include libcli/raw/libcliraw.h
+%}
+
+TALLOC_CTX *talloc_init(char *name);
+int talloc_free(TALLOC_CTX *ptr);
+struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
+
+struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,
+TALLOC_CTX *mem_ctx,
+struct event_context 
*event_ctx);
+
+void smbcli_sock_dead(struct smbcli_socket *sock);

Modified: branches/SAMBA_4_0/source/scripting/swig/config.mk
===
--- branches/SAMBA_4_0/source/scripting/swig/config.mk  2007-09-26 02:06:36 UTC 
(rev 25347)
+++ branches/SAMBA_4_0/source/scripting/swig/config.mk  2007-09-26 03:08:40 UTC 
(rev 25348)
@@ -9,7 +9,7 @@
 
 # Swig extensions
 swig: lib/tdb/swig/_tdb.$(SHLIBEXT) lib/ldb/swig/_ldb.$(SHLIBEXT) \
-   libcli/swig/_libcli_nbt.$(SHLIBEXT)
+   libcli/swig/_libcli_nbt.$(SHLIBEXT) libcli/swig/_libcli_smb.$(SHLIBEXT)
 
 .SUFFIXES: _wrap.c .i
 



svn commit: samba r25220 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2007-09-18 Thread tpot
Author: tpot
Date: 2007-09-19 01:57:26 + (Wed, 19 Sep 2007)
New Revision: 25220

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

Log:
Comment out obsolete functions.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2007-09-18 23:19:04 UTC 
(rev 25219)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2007-09-19 01:57:26 UTC 
(rev 25220)
@@ -234,6 +234,6 @@
 
 /* DN operations */
 
-struct ldb_dn *ldb_dn_explode(void *mem_ctx, const char *dn);
+/* struct ldb_dn *ldb_dn_explode(void *mem_ctx, const char *dn); */
 
-char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *dn);
+/* char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *dn); */



svn commit: samba r25221 - in branches/SAMBA_4_0/source/libcli/swig: .

2007-09-18 Thread tpot
Author: tpot
Date: 2007-09-19 01:59:06 + (Wed, 19 Sep 2007)
New Revision: 25221

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

Log:
Experiment with Jelmer's new generic loadparm code.

Modified:
   branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i
===
--- branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i  2007-09-19 01:57:26 UTC 
(rev 25220)
+++ branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i  2007-09-19 01:59:06 UTC 
(rev 25221)
@@ -31,11 +31,16 @@
 #include lib/talloc/talloc.h
 #include lib/events/events.h
 #include libcli/nbt/libnbt.h
+#include param/param.h
 
 /* Undo strcpy safety macro as it's used by swig )-: */
 
 #undef strcpy
 
+/* Loadparm parameters */
+
+static struct loadparm_context lp_ctx;
+
 %}
 
 %apply bool { BOOL };
@@ -132,4 +137,6 @@
 NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock, 
TALLOC_CTX *mem_ctx, struct nbt_name_query *io);
 
-void lp_load(void);
+%init %{
+  loadparm_init(lp_ctx);
+%}



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

2007-09-09 Thread tpot
Author: tpot
Date: 2007-09-09 06:39:24 + (Sun, 09 Sep 2007)
New Revision: 25044

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

Log:
The has_key() method should return a boolean, not an integer.

Add TODO for missing iterator and other oddball methods.

Modified:
   branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py   2007-09-09 01:08:50 UTC 
(rev 25043)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py   2007-09-09 06:39:24 UTC 
(rev 25044)
@@ -69,7 +69,7 @@
 tdb_delete(self.tdb, key)
 
 def has_key(self, key):
-return tdb_exists(self.tdb, key)
+return tdb_exists(self.tdb, key) != 0
 
 # Tdb iterator
 
@@ -113,3 +113,7 @@
 def clear(self):
 for k in iter(self):
 del(self[k])
+
+# TODO: iterkeys, itervalues, iteritems
+
+# TODO: any other missing methods for container types



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

2007-09-09 Thread tpot
Author: tpot
Date: 2007-09-09 06:41:15 + (Sun, 09 Sep 2007)
New Revision: 25045

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

Log:
Add constants for enum TDB_ERROR.

Remove some functions that I don't think should be in at the moment -
tdb_open_ex(), tdb_reopen{,_all} and locking functions.  Locking
functions may come back at a later stage along with transaction support.

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2007-09-09 06:39:24 UTC 
(rev 25044)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2007-09-09 06:41:15 UTC 
(rev 25045)
@@ -102,8 +102,22 @@
 #define TDB_CONVERT 16 /* convert endian (internal use) */
 #define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */
 
-/* Throw an IOError exception if tdb_open() or tdb_open_ex() returns NULL */
+enum TDB_ERROR {
+ TDB_SUCCESS=0, 
+ TDB_ERR_CORRUPT, 
+ TDB_ERR_IO, 
+ TDB_ERR_LOCK, 
+ TDB_ERR_OOM, 
+ TDB_ERR_EXISTS, 
+ TDB_ERR_NOLOCK, 
+ TDB_ERR_LOCK_TIMEOUT,
+ TDB_ERR_NOEXIST, 
+ TDB_ERR_EINVAL, 
+ TDB_ERR_RDONLY
+};
 
+/* Throw an IOError exception from errno if tdb_open() returns NULL */
+
 %exception {
$action
if (result == NULL) {
@@ -115,17 +129,8 @@
 TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
  int open_flags, mode_t mode);
 
-TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
-int open_flags, mode_t mode,
-tdb_log_func log_fn,
-tdb_hash_func hash_fn);
-
 %exception;
 
-int tdb_reopen(TDB_CONTEXT *tdb);
-
-int tdb_reopen_all(int parent_longlived);
-
 enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
 
 const char *tdb_errorstr(TDB_CONTEXT *tdb);
@@ -147,13 +152,3 @@
 int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state);
 
 int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);
-
-int tdb_lockall(TDB_CONTEXT *tdb);
-
-void tdb_unlockall(TDB_CONTEXT *tdb);
-
-/* Low level locking functions: use with care */
-
-int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
-
-int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);



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

2007-09-09 Thread tpot
Author: tpot
Date: 2007-09-09 12:02:51 + (Sun, 09 Sep 2007)
New Revision: 25046

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

Log:
Ditch tdb_traverse() as it doesn't lend itself to any Python idioms
and the semantics can be reproduced using tdb_firstkey() and
tdb_nextkey().  Oh, and also because I can't figure out how to get SWIG
to do exactly what I want here.

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2007-09-09 06:41:15 UTC 
(rev 25045)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2007-09-09 12:02:51 UTC 
(rev 25046)
@@ -149,6 +149,4 @@
 
 TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key);
 
-int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state);
-
 int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);



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

2007-09-07 Thread tpot
Author: tpot
Date: 2007-09-08 01:40:24 + (Sat, 08 Sep 2007)
New Revision: 25018

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

Log:
Remove non-existent tdb_logging_function() as well as less useful
functions such as tdb_dump_all() and tdb_printfreelist().

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2007-09-08 01:39:31 UTC 
(rev 25017)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2007-09-08 01:40:24 UTC 
(rev 25018)
@@ -126,8 +126,6 @@
 
 int tdb_reopen_all(int parent_longlived);
 
-void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func);
-
 enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
 
 const char *tdb_errorstr(TDB_CONTEXT *tdb);
@@ -159,9 +157,3 @@
 int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
 
 int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
-
-/* Debug functions. Not used in production. */
-
-void tdb_dump_all(TDB_CONTEXT *tdb);
-
-int tdb_printfreelist(TDB_CONTEXT *tdb);



svn commit: samba r23753 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2007-07-08 Thread tpot
Author: tpot
Date: 2007-07-09 01:49:49 + (Mon, 09 Jul 2007)
New Revision: 23753

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

Log:
Fix bitrot afflicting the ldb Python swig bindings.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2007-07-09 00:48:07 UTC 
(rev 23752)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2007-07-09 01:49:49 UTC 
(rev 23753)
@@ -37,8 +37,9 @@
 
 /* Include headers */
 
+#include lib/replace/replace.h
+#include lib/talloc/talloc.h
 #include lib/ldb/include/ldb.h
-#include lib/talloc/talloc.h
 
 %}
 
@@ -179,7 +180,6 @@
struct ldb_dn *dn;
unsigned int num_elements;
struct ldb_message_element *elements;
-   void *private_data;
 };
 
 /*
@@ -213,11 +213,11 @@
 
 int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, 
const char *options[]);
 
-int ldb_search(struct ldb_context *ldb, const struct ldb_dn *base, enum 
ldb_scope scope, const char *expression, const char * const *attrs, struct 
ldb_result **OUT);
+int ldb_search(struct ldb_context *ldb, struct ldb_dn *base, enum ldb_scope 
scope, const char *expression, const char * const *attrs, struct ldb_result 
**OUT);
 
-int ldb_delete(struct ldb_context *ldb, const struct ldb_dn *dn);
+int ldb_delete(struct ldb_context *ldb, struct ldb_dn *dn);
 
-int ldb_rename(struct ldb_context *ldb, const struct ldb_dn *olddn, const 
struct ldb_dn *newdn);
+int ldb_rename(struct ldb_context *ldb, struct ldb_dn *olddn, struct ldb_dn 
*newdn);
 
 int ldb_add(struct ldb_context *ldb, const struct ldb_message *message);
 
@@ -227,11 +227,11 @@
 
 struct ldb_message_element *ldb_msg_find_element(const struct ldb_message 
*msg, const char *attr_name);
 
-int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *INPUT);
+int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *val, struct ldb_message_element **return_el);
 
 void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr);
 
-int ldb_msg_sanity_check(struct ldb_message *msg);
+int ldb_msg_sanity_check(struct ldb_context *ldb, const struct ldb_message 
*msg);
 
 /* DN operations */
 



svn commit: samba r21289 - in branches/SAMBA_4_0/source/lib/replace: .

2007-02-11 Thread tpot
Author: tpot
Date: 2007-02-12 01:11:14 + (Mon, 12 Feb 2007)
New Revision: 21289

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

Log:
Update svn:ignore properties for standalone build.

Modified:
   branches/SAMBA_4_0/source/lib/replace/


Changeset:

Property changes on: branches/SAMBA_4_0/source/lib/replace
___
Name: svn:ignore
   - *.hd
readline.h
*.d
*.ho
config.h.in
configure

   + *.hd
readline.h
*.d
*.ho
config.h
config.h.in
config.log
config.status
configure
Makefile




svn commit: samba r21290 - in branches/SAMBA_4_0/source/lib/replace: .

2007-02-11 Thread tpot
Author: tpot
Date: 2007-02-12 01:12:55 + (Mon, 12 Feb 2007)
New Revision: 21290

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

Log:
Whoops - add some more svn:ignore entries.

Modified:
   branches/SAMBA_4_0/source/lib/replace/


Changeset:

Property changes on: branches/SAMBA_4_0/source/lib/replace
___
Name: svn:ignore
   - *.hd
readline.h
*.d
*.ho
config.h
config.h.in
config.log
config.status
configure
Makefile

   + *.hd
readline.h
*.d
*.ho
config.h
config.h.in
config.log
config.status
configure
Makefile
libreplace.a
testsuite




svn commit: samba-web r1054 - in trunk/team: .

2006-11-05 Thread tpot
Author: tpot
Date: 2006-11-05 22:04:27 + (Sun, 05 Nov 2006)
New Revision: 1054

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

Log:
Add some more alumni.

Modified:
   trunk/team/index.html


Changeset:
Modified: trunk/team/index.html
===
--- trunk/team/index.html   2006-11-03 14:32:46 UTC (rev 1053)
+++ trunk/team/index.html   2006-11-05 22:04:27 UTC (rev 1054)
@@ -92,15 +92,19 @@
 ul
 liDavid Bannon/li
 lia href=mailto:[EMAIL PROTECTED]Paul Blackman/a/li
+liJohn Blair/li
 lia href=mailto:[EMAIL PROTECTED]Matt Chapman/a/li
 lia href=mailto:[EMAIL PROTECTED]Elrond/a/li
+liDave Fenwick/li
 lia href=mailto:[EMAIL PROTECTED]Shirish Kalele/a/li
 lia href=mailto:[EMAIL PROTECTED]Peter Kelly/a/li
 lia href=mailto:[EMAIL PROTECTED]Luke Leighton/a/li
 lia href=mailto:[EMAIL PROTECTED]Eckart Meyer/a/li
 lia href=mailto:[EMAIL PROTECTED]Alexandre Oliva/a/li
+liJean-François Micouleau/li
 lia href=http://sourcefrog.net/;Martin Pool/a/li
 lia href=mailto:[EMAIL PROTECTED]John Reilly/a/li
+liBrian Roberson/li
 lia href=mailto:[EMAIL PROTECTED]Sander Striker/a/li
 lia href=mailto:[EMAIL PROTECTED]Motonobu Takahashi/a/li
 /ul



svn commit: samba-web r1055 - in trunk/team: .

2006-11-05 Thread tpot
Author: tpot
Date: 2006-11-05 22:08:17 + (Sun, 05 Nov 2006)
New Revision: 1055

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

Log:
Remove some alumni from active members list.

Modified:
   trunk/team/index.html


Changeset:
Modified: trunk/team/index.html
===
--- trunk/team/index.html   2006-11-05 22:04:27 UTC (rev 1054)
+++ trunk/team/index.html   2006-11-05 22:08:17 UTC (rev 1055)
@@ -45,7 +45,6 @@
 lia href=http://www.plainjoe.org/;Gerald Carter/a/li
 
 lia href=http://samba.org/~gd;Guuml;nther Deschner/a/li
-lia href=mailto:[EMAIL PROTECTED]David Fenwick/a/li
 lia href=mailto:[EMAIL PROTECTED]Steve French/a/li
 lia href=mailto:[EMAIL PROTECTED]Paul Green/a/li
 lia href=http://ubiqx.org/;Chris Hertel/a/li
@@ -63,12 +62,10 @@
 lispan style=color:#EE;Derrell Lipman/span/li
 lia href=mailto:[EMAIL PROTECTED]Jim McDonough/a/li
 lia href=mailto:[EMAIL PROTECTED]Stefan Metzmacher/a/li
-lia href=mailto:[EMAIL PROTECTED]Jean Francois Micouleau/a/li
 lia href=http://samba.org/~lmuelle/;Lars Muuml;ller/a/li
 
 lia href=mailto:[EMAIL PROTECTED]James Peach/a/li
 lia href=mailto:[EMAIL PROTECTED]Tim Potter/a/li
-lia href=mailto:[EMAIL PROTECTED]Brian Roberson/a/li
 lia href=http://www.richardsharpe.com;Richard Sharpe/a/li
 lia href=mailto:[EMAIL PROTECTED]Dan Shearer/a/li
 lia href=mailto:[EMAIL PROTECTED]Simo Sorce/a/li



svn commit: samba-web r1006 - in trunk/devel: .

2006-07-03 Thread tpot
Author: tpot
Date: 2006-07-03 21:56:33 + (Mon, 03 Jul 2006)
New Revision: 1006

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

Log:
Missing whitespace.

Modified:
   trunk/devel/index.html


Changeset:
Modified: trunk/devel/index.html
===
--- trunk/devel/index.html  2006-07-03 10:57:21 UTC (rev 1005)
+++ trunk/devel/index.html  2006-07-03 21:56:33 UTC (rev 1006)
@@ -84,7 +84,7 @@
 
 pPlease coordinate all development efforts on the a href=mailto:[EMAIL 
PROTECTED]samba-technical/a mailing list.  For more information about the 
list, or to join the list, go to the a 
href=http://lists.samba.org/mailman/listinfo/samba-technical;samba technical 
mailing list/a page.  The main samba development channel on IRC is 
i#samba-technical/i, server iirc.freenode.net/i.  Please don't ask user 
questions in this channel (users see i#samba/i).  Channel logs are 
available a href=http://irc.vernstok.nl/samba-technical.php;here/a./p
 
-pAlso, please see our policy concerninga 
href=/samba/devel/copyright-policy.htmlcontributor copyright/a./p
+pAlso, please see our policy concerning a 
href=/samba/devel/copyright-policy.htmlcontributor copyright/a./p
 
 br /
 h3a name=learnLearn More/a/h3



svn commit: samba-web r1007 - in trunk/devel: .

2006-07-03 Thread tpot
Author: tpot
Date: 2006-07-03 21:58:21 + (Mon, 03 Jul 2006)
New Revision: 1007

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

Log:
Fix broken link to roadmap.

Modified:
   trunk/devel/index.html


Changeset:
Modified: trunk/devel/index.html
===
--- trunk/devel/index.html  2006-07-03 21:56:33 UTC (rev 1006)
+++ trunk/devel/index.html  2006-07-03 21:58:21 UTC (rev 1007)
@@ -67,7 +67,7 @@
a href=/samba/ftp/samba4/Technical Previews/a of this code base 
are available 
for download.  Be aware that these snapshots are intended for testing 
purposes 
only and not for use in production environments.  For more information, 
see 
-   the a href=roadmap-4.0.htmlroad map document/a./p
+   the a href=/samba/devel/roadmap-4.0.htmlroad map document/a./p
 pExample checkout command:/p/li
   /ul
 



svn commit: samba r16090 - in branches/SAMBA_4_0/source/lib/ldb: ldb_sqlite3 modules

2006-06-07 Thread tpot
Author: tpot
Date: 2006-06-08 03:57:57 + (Thu, 08 Jun 2006)
New Revision: 16090

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

Log:
Fix standalone build after the rename of enum ldb_request_type in 
r15944.

Hey idra I think a better rename would be to keep the LDB_REQ suffix 
here to remain consistent with the other enums (e.g ldb_reply_type, 
ldb_async_wait_type and ldb_async_state).

Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
   branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c
   branches/SAMBA_4_0/source/lib/ldb/modules/schema.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c 2006-06-08 
03:35:39 UTC (rev 16089)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c 2006-06-08 
03:57:57 UTC (rev 16090)
@@ -1990,7 +1990,7 @@

switch (req-operation) {
 
-   case LDB_REQ_SEARCH:
+   case LDB_SEARCH:
return lsql_search_bytree(module,
  req-op.search.base,
  req-op.search.scope, 
@@ -1998,21 +1998,21 @@
  req-op.search.attrs, 
  req-op.search.res);
 
-   case LDB_REQ_ADD:
+   case LDB_ADD:
return lsql_add(module, req-op.add.message);
 
-   case LDB_REQ_MODIFY:
+   case LDB_MODIFY:
return lsql_modify(module, req-op.mod.message);
 
-   case LDB_REQ_DELETE:
+   case LDB_DELETE:
return lsql_delete(module, req-op.del.dn);
 
-   case LDB_REQ_RENAME:
+   case LDB_RENAME:
return lsql_rename(module,
req-op.rename.olddn,
req-op.rename.newdn);
 
-   case LDB_ASYNC_SEARCH:
+   case LDB_SEARCH:
return lsql_search_async(module,
req-op.search.base,
req-op.search.scope, 
@@ -2022,28 +2022,28 @@
req-async.callback,
req-async.handle);
 /*
-   case LDB_ASYNC_ADD:
+   case LDB_ADD:
return lsql_add_async(module,
req-op.add.message,
req-async.context,
req-async.callback,
req-async.handle);
 
-   case LDB_ASYNC_MODIFY:
+   case LDB_MODIFY:
return lsql_modify_async(module,
req-op.mod.message,
req-async.context,
req-async.callback,
req-async.handle);
 */
-   case LDB_ASYNC_DELETE:
+   case LDB_DELETE:
return lsql_delete_async(module,
req-op.del.dn,
req-async.context,
req-async.callback,
req-async.handle);
 
-   case LDB_ASYNC_RENAME:
+   case LDB_RENAME:
return lsql_rename_async(module,
req-op.rename.olddn,
req-op.rename.newdn,

Modified: branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c
===
--- branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c 2006-06-08 03:35:39 UTC 
(rev 16089)
+++ branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c 2006-06-08 03:57:57 UTC 
(rev 16090)
@@ -812,7 +812,7 @@
new_base = map_local_dn(module, module, base);
 
memset((char *)(new_req), 0, sizeof(new_req));
-   new_req.operation = LDB_REQ_SEARCH;
+   new_req.operation = LDB_SEARCH;
new_req.op.search.base = new_base;
new_req.op.search.scope = scope;
new_req.op.search.tree = new_tree;
@@ -857,7 +857,7 @@

/* Merge with additional data from fallback database */
memset((char *)(mergereq), 0, sizeof(mergereq)); /* zero off 
the request structure */
-   mergereq.operation = LDB_REQ_SEARCH;
+   mergereq.operation = LDB_SEARCH;
mergereq.op.search.base = merged-dn;
mergereq.op.search.scope = LDB_SCOPE_BASE;
mergereq.op.search.tree = ldb_parse_tree(module, );
@@ -1266,10 +1266,10 @@
fb_ret = ldb_next_request(module, req);
if (fb_ret == -1) {
ldb_msg_add_string(fb, isMapped, TRUE);
-   req-operation = LDB_REQ_ADD

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

2006-05-02 Thread tpot
Author: tpot
Date: 2006-05-02 10:46:03 + (Tue, 02 May 2006)
New Revision: 15390

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

Log:
Make test output a bit prettier.

Modified:
   branches/SAMBA_4_0/source/script/tests/test_swig.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_swig.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-05-02 05:14:00 UTC 
(rev 15389)
+++ branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-05-02 10:46:03 UTC 
(rev 15390)
@@ -15,7 +15,10 @@
 export PYTHONPATH=lib/tdb/swig:lib/ldb/swig:scripting/swig:$PYTHONPATH
 export LD_LIBRARY_PATH=bin:$LD_LIBRARY_PATH
 
+echo Testing tdb wrappers
 scripting/swig/torture/torture_tdb.py || failed=`expr $failed + 1`
+
+echo Testing ldb wrappers
 scripting/swig/torture/torture_ldb.py || failed=`expr $failed + 1`
 
 testok $0 $failed



svn commit: samba r15391 - in branches/SAMBA_4_0/source: libcli libcli/swig scripting/swig

2006-05-02 Thread tpot
Author: tpot
Date: 2006-05-02 10:59:31 + (Tue, 02 May 2006)
New Revision: 15391

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

Log:
Wrap up the nbt_name_query() function as a bit of an experiment.  It 
seemed to work quite well and this technique might be good for 
generating an interface to use for automated testing.

Tested by doing a nbt lookup against smbd.

Added:
   branches/SAMBA_4_0/source/libcli/swig/
   branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i
Modified:
   branches/SAMBA_4_0/source/libcli/config.mk
   branches/SAMBA_4_0/source/scripting/swig/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/config.mk
===
--- branches/SAMBA_4_0/source/libcli/config.mk  2006-05-02 10:46:03 UTC (rev 
15390)
+++ branches/SAMBA_4_0/source/libcli/config.mk  2006-05-02 10:59:31 UTC (rev 
15391)
@@ -56,6 +56,11 @@
 PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT LIBCLI_COMPOSITE LIBEVENTS \
NDR_SECURITY samba-socket
 
+[LIBRARY::swig_libcli_nbt]
+LIBRARY_REALNAME = swig/_libcli_nbt.$(SHLIBEXT)
+OBJ_FILES = swig/libcli_nbt_wrap.o
+PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-CONFIG
+
 [SUBSYSTEM::LIBCLI_DGRAM]
 OBJ_FILES = \
dgram/dgramsocket.o \


Property changes on: branches/SAMBA_4_0/source/libcli/swig
___
Name: svn:ignore
   + _*.so
*.pyc
libcli_nbt.py
libcli_nbt_wrap.c


Added: branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i
===
--- branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i  2006-05-02 10:46:03 UTC 
(rev 15390)
+++ branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i  2006-05-02 10:59:31 UTC 
(rev 15391)
@@ -0,0 +1,136 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   Swig interface to libcli_nbt library.
+
+   Copyright (C) 2006 Tim Potter [EMAIL PROTECTED]
+
+ ** NOTE! The following LGPL license applies to the tdb
+ ** library. This does NOT imply that all of Samba is released
+ ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+%module libcli_nbt
+
+%{
+
+#include includes.h
+#include lib/talloc/talloc.h
+#include lib/events/events.h
+#include libcli/nbt/libnbt.h
+
+/* Undo strcpy safety macro as it's used by swig )-: */
+
+#undef strcpy
+
+%}
+
+%apply bool { BOOL };
+%apply int { uint8_t };
+%apply int { int8_t };
+%apply unsigned int { uint16_t };
+%apply int { int16_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);
+}
+
+%apply unsigned long long { uint64_t };
+%apply long long { int64_t };
+
+%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));
+}
+
+TALLOC_CTX *talloc_init(char *name);
+int talloc_free(TALLOC_CTX *ptr);
+
+/* Function prototypes */
+
+struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
+
+struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx, 
+struct event_context *event_ctx);
+
+enum nbt_name_type {
+   NBT_NAME_CLIENT=0x00,
+   NBT_NAME_MS=0x01,
+   NBT_NAME_USER=0x03,
+   NBT_NAME_SERVER=0x20,
+   NBT_NAME_PDC=0x1B,
+   NBT_NAME_LOGON=0x1C,
+   NBT_NAME_MASTER=0x1D,
+   NBT_NAME_BROWSER=0x1E
+};
+
+struct nbt_name {
+   const char *name;
+   const char *scope;
+   enum nbt_name_type type;
+};
+
+%rename(data_in) in;
+%rename(data_out) out;
+
+struct nbt_name_query {
+   struct {
+   struct nbt_name name;
+   const char

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

2006-05-02 Thread tpot
Author: tpot
Date: 2006-05-02 19:00:19 + (Tue, 02 May 2006)
New Revision: 15395

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

Log:
Fix build by adding another copy of the Python detection m4 fragment.  
This stuff should be common somewhere.

Added:
   branches/SAMBA_4_0/source/libcli/config.m4
Modified:
   branches/SAMBA_4_0/source/configure.in


Changeset:
Modified: branches/SAMBA_4_0/source/configure.in
===
--- branches/SAMBA_4_0/source/configure.in  2006-05-02 13:08:38 UTC (rev 
15394)
+++ branches/SAMBA_4_0/source/configure.in  2006-05-02 19:00:19 UTC (rev 
15395)
@@ -47,6 +47,7 @@
 sinclude(ntvfs/sysdep/config.m4)
 sinclude(lib/appweb/config.m4)
 sinclude(nsswitch/config.m4)
+sinclude(libcli/config.m4)
 
 AC_ARG_ENABLE(dso,
 [  --enable-dsoEnable building internal libraries as DSO's 
(experimental)],

Added: branches/SAMBA_4_0/source/libcli/config.m4
===
--- branches/SAMBA_4_0/source/libcli/config.m4  2006-05-02 13:08:38 UTC (rev 
15394)
+++ branches/SAMBA_4_0/source/libcli/config.m4  2006-05-02 19:00:19 UTC (rev 
15395)
@@ -0,0 +1,31 @@
+AC_MSG_CHECKING([for Python (libcli_nbt)])
+
+PYTHON=
+ 
+AC_ARG_WITH(python,
+[  --with-python=PYTHONNAME  build Python libraries],
+[ case ${withval-python} in
+  yes)
+PYTHON=python
+;;
+  no)
+PYTHON=
+;;
+  *)
+PYTHON=${withval-python}
+;;
+  esac ])
+
+if test x$PYTHON != x; then
+   incdir=`python -c 'import sys; print %s/include/python%d.%d % 
(sys.prefix, sys.version_info[[0]], sys.version_info[[1]])'`
+   CPPFLAGS=$CPPFLAGS -I $incdir
+fi
+
+if test x$PYTHON != x; then
+   AC_MSG_RESULT([${withval-python}])
+else
+   AC_MSG_RESULT(no)
+   SMB_ENABLE(swig_libli_nbt, NO)
+fi
+
+AC_SUBST(PYTHON)



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

2006-05-02 Thread tpot
Author: tpot
Date: 2006-05-02 19:20:49 + (Tue, 02 May 2006)
New Revision: 15397

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

Log:
Fix typo.

Modified:
   branches/SAMBA_4_0/source/libcli/config.m4


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/config.m4
===
--- branches/SAMBA_4_0/source/libcli/config.m4  2006-05-02 19:15:14 UTC (rev 
15396)
+++ branches/SAMBA_4_0/source/libcli/config.m4  2006-05-02 19:20:49 UTC (rev 
15397)
@@ -25,7 +25,7 @@
AC_MSG_RESULT([${withval-python}])
 else
AC_MSG_RESULT(no)
-   SMB_ENABLE(swig_libli_nbt, NO)
+   SMB_ENABLE(swig_libcli_nbt, NO)
 fi
 
 AC_SUBST(PYTHON)



svn commit: samba r15388 - in branches/SAMBA_4_0/source/lib/ldb/common: .

2006-05-01 Thread tpot
Author: tpot
Date: 2006-05-02 02:36:11 + (Tue, 02 May 2006)
New Revision: 15388

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

Log:
Fix cutpaste typo.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c  2006-05-01 23:03:32 UTC 
(rev 15387)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c  2006-05-02 02:36:11 UTC 
(rev 15388)
@@ -533,7 +533,7 @@
return Alias problem;
case LDB_ERR_INVALID_DN_SYNTAX:
return Invalid DN syntax;
-/* 53 RESERVED */
+/* 35 RESERVED */
case LDB_ERR_ALIAS_DEREFERENCING_PROBLEM:
return Alias dereferencing problem;
 /* 37-47 unused */



svn commit: samba r15389 - in branches/SAMBA_4_0/source: lib/ldb/swig scripting/swig/torture

2006-05-01 Thread tpot
Author: tpot
Date: 2006-05-02 05:14:00 + (Tue, 02 May 2006)
New Revision: 15389

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

Log:
Add some better torture tests for LdbMessage.

Fix up behaviour of Ldb.__setitem__() function.  It should overwrite the 
element data.

Add wrapper for ldb_msg_sanity_check().

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-05-02 02:36:11 UTC 
(rev 15388)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-05-02 05:14:00 UTC 
(rev 15389)
@@ -20,6 +20,15 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 
+#
+# Interface notes:
+#
+#   - should an empty dn be represented as None, or an empty string?
+#
+#   - should single-valued attributes be a string, or a list with one
+# element?
+#
+
 from ldb import *
 
 # Global initialisation
@@ -62,6 +71,9 @@
 def __setattr__(self, attr, value):
 if attr == 'dn':
 self.msg.dn = ldb_dn_explode(self.msg, value)
+if self.msg.dn == None:
+err = LDB_ERR_INVALID_DN_SYNTAX
+raise LdbError(err, ldb_strerror(err))
 return
 self.__dict__[attr] = value
 
@@ -78,6 +90,7 @@
 for i in range(elt.num_values)]
 
 def __setitem__(self, key, value):
+ldb_msg_remove_attr(self.msg, key)
 if type(value) in (list, tuple):
 [ldb_msg_add_value(self.msg, key, v) for v in value]
 else:
@@ -99,6 +112,11 @@
 def items(self):
 return [(k, self[k]) for k in self.keys()]
 
+# Misc stuff
+
+def sanity_check(self):
+return ldb_msg_sanity_check(self.msg)
+
 class Ldb:
 A class representing a binding to a ldb file.
 

Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-05-02 02:36:11 UTC 
(rev 15388)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-05-02 05:14:00 UTC 
(rev 15389)
@@ -199,13 +199,18 @@
  * Wrap ldb functions 
  */
 
+/* Initialisation */
+
 int ldb_global_init(void);
-
 struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
 
+/* Error handling */
+
 const char *ldb_errstring(struct ldb_context *ldb);
 const char *ldb_strerror(int ldb_err);
 
+/* Top-level ldb operations */
+
 int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, 
const char *options[]);
 
 int ldb_search(struct ldb_context *ldb, const struct ldb_dn *base, enum 
ldb_scope scope, const char *expression, const char * const *attrs, struct 
ldb_result **OUT);
@@ -216,9 +221,20 @@
 
 int ldb_add(struct ldb_context *ldb, const struct ldb_message *message);
 
+/* Ldb message operations */
+
 struct ldb_message *ldb_msg_new(void *mem_ctx);
+
 struct ldb_message_element *ldb_msg_find_element(const struct ldb_message 
*msg, const char *attr_name);
+
 int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *INPUT);
 
+void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr);
+
+int ldb_msg_sanity_check(struct ldb_message *msg);
+
+/* DN operations */
+
 struct ldb_dn *ldb_dn_explode(void *mem_ctx, const char *dn);
+
 char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *dn);

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py 
2006-05-02 02:36:11 UTC (rev 15388)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py 
2006-05-02 05:14:00 UTC (rev 15389)
@@ -1,18 +1,83 @@
 #!/usr/bin/python
+#
+# A torture test for the Python Ldb bindings.  Also a short guide on
+# how the API works.
+#
 
-import Ldb, sys
+from Ldb import *
 
-def test(cond, msg):
+# Helpers
+
+def t(cond, msg):
+Test a condition.
 if not cond:
-print 'FAILED:', msg
-sys.exit(1)
+raise RuntimeError('FAILED: %s' % msg)
 
+#
 # Torture LdbMessage
+#
 
-m = Ldb.LdbMessage()
+m = LdbMessage()
+
+# Empty message
+
+t(m.keys() == [], 'empty msg')
+t(m.dn == None, 'empty dn')
+
+t(m.sanity_check() == LDB_ERR_INVALID_DN_SYNTAX, 'sanity check')
+
+# Test invalid dn
+
+try:
+m.dn = 'invalid dn'
+except LdbError, arg:
+if arg[0] != LDB_ERR_INVALID_DN_SYNTAX:
+raise
+else:
+t(False, 'LdbError not raised')
+
+# Test valid dn
+
+m.dn = 'name=spotty'
+t(m.dn == 'name=spotty', 'specified dn')
+
+t(m.sanity_check() == LDB_SUCCESS, 'sanity check')
+
+# Test some single-valued attributes
+
 m['animal'] = 'dog'
 m['name'] = 'spotty'
 
-test

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

2006-04-29 Thread tpot
Author: tpot
Date: 2006-04-30 00:22:05 + (Sun, 30 Apr 2006)
New Revision: 15339

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

Log:
Signature for tdb_reopen_all() has changed.

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2006-04-30 00:00:28 UTC 
(rev 15338)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2006-04-30 00:22:05 UTC 
(rev 15339)
@@ -125,7 +125,7 @@
 
 int tdb_reopen(TDB_CONTEXT *tdb);
 
-int tdb_reopen_all(void);
+int tdb_reopen_all(int parent_longlived);
 
 void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func);
 



svn commit: samba r15340 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-29 Thread tpot
Author: tpot
Date: 2006-04-30 00:30:35 + (Sun, 30 Apr 2006)
New Revision: 15340

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

Log:
Ignore *.pyc and autogenerated swig files.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/


Changeset:

Property changes on: branches/SAMBA_4_0/source/lib/ldb/swig
___
Name: svn:ignore
   - *.d
ldb.py
_ldb.so

   + *.d
ldb.py
_ldb.so
ldb_wrap.c
*.pyc




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

2006-04-29 Thread tpot
Author: tpot
Date: 2006-04-30 01:00:57 + (Sun, 30 Apr 2006)
New Revision: 15345

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

Log:
Add a read-only test to tdb torture tester.

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


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py 
2006-04-30 00:40:04 UTC (rev 15344)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py 
2006-04-30 01:00:57 UTC (rev 15345)
@@ -77,6 +77,14 @@
 if set(items) != set([('a', '1'), ('ab', '12'), ('abc', '123')]):
 fail('values method produced wrong values')
 
+t.close()
+
+# Re-open read-only
+
+t = Tdb.Tdb(tdb_file, open_flags = os.O_RDONLY)
+t.keys()
+t.close()
+
 # Clean up
 
 os.unlink(tdb_file)



svn commit: samba r15346 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-29 Thread tpot
Author: tpot
Date: 2006-04-30 01:07:16 + (Sun, 30 Apr 2006)
New Revision: 15346

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

Log:
Doc.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-30 01:00:57 UTC 
(rev 15345)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-30 01:07:16 UTC 
(rev 15346)
@@ -115,7 +115,7 @@
 }
 
 /* 
- * Wrap TALLOC_CTX
+ * Wrap a small bit of talloc
  */
 
 /* Use talloc_init() to create a parameter to pass to ldb_init().  Don't



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

2006-04-29 Thread tpot
Author: tpot
Date: 2006-04-30 01:08:02 + (Sun, 30 Apr 2006)
New Revision: 15347

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

Log:
Ignore autogenerated stuff.

Modified:
   branches/SAMBA_4_0/source/lib/tdb/swig/


Changeset:

Property changes on: branches/SAMBA_4_0/source/lib/tdb/swig
___
Name: svn:ignore
   - *.d
tdb.py
_tdb.so

   + *.d
tdb.py
_tdb.so
*.pyc
tdb_wrap.c




svn commit: samba r15343 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-29 Thread tpot
Author: tpot
Date: 2006-04-30 00:38:19 + (Sun, 30 Apr 2006)
New Revision: 15343

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

Log:
Some small cleanups.

Remove LdbMessage.close() method as it's not necessary.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-30 00:36:29 UTC 
(rev 15342)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-30 00:38:19 UTC 
(rev 15343)
@@ -29,10 +29,16 @@
 if result != 0:
 raise LdbError, (result, 'ldb_global_init failed')
 
+# Ldb exceptions
+
 class LdbError(Exception):
-An exception raised when a ldb error occurs.
+An exception raised when a ldb error occurs.
+The exception data is a tuple consisting of the ldb number and a
+string description of the error.
 pass
 
+# Ldb classes
+
 class LdbMessage:
 A class representing a ldb message as a Python dictionary.
 
@@ -41,9 +47,6 @@
 self.msg = ldb_msg_new(self.mem_ctx)
 
 def __del__(self):
-self.close()
-
-def close(self):
 if self.mem_ctx is not None:
 talloc_free(self.mem_ctx)
 self.mem_ctx = None
@@ -88,7 +91,7 @@
 self.mem_ctx = talloc_init('mem_ctx for ldb 0x%x' % id(self))
 self.ldb_ctx = ldb_init(self.mem_ctx)
 
-result =  ldb_connect(self.ldb_ctx, url, flags, None)
+result = ldb_connect(self.ldb_ctx, url, flags, None)
 
 if result != LDB_SUCCESS:
 raise LdbError, (result, ldb_strerror(result))



svn commit: samba r15348 - in branches/SAMBA_4_0/source: lib/ldb/swig scripting/swig/torture

2006-04-29 Thread tpot
Author: tpot
Date: 2006-04-30 01:08:52 + (Sun, 30 Apr 2006)
New Revision: 15348

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

Log:
Start adding a dict interface and tests to LdbMessage class.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-30 01:08:02 UTC 
(rev 15347)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-30 01:08:52 UTC 
(rev 15348)
@@ -52,6 +52,8 @@
 self.mem_ctx = None
 self.msg = None
 
+# Make the dn attribute of the object dynamic
+
 def __getattr__(self, attr):
 if attr == 'dn':
 return ldb_dn_linearize(None, self.msg.dn)
@@ -63,8 +65,7 @@
 return
 self.__dict__[attr] = value
 
-def len(self):
-return self.msg.num_elements
+# Get and set individual elements
 
 def __getitem__(self, key):
 
@@ -81,7 +82,23 @@
 [ldb_msg_add_value(self.msg, key, v) for v in value]
 else:
 ldb_msg_add_value(self.msg, key, value)
-
+
+# Dictionary interface
+# TODO: move to iterator based interface
+
+def len(self):
+return self.msg.num_elements
+
+def keys(self):
+return [ldb_message_element_array_getitem(self.msg.elements, i).name
+for i in range(self.msg.num_elements)]
+
+def values(self):
+return [self[k] for k in self.keys()]
+
+def items(self):
+return [(k, self[k]) for k in self.keys()]
+
 class Ldb:
 A class representing a binding to a ldb file.
 

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py 
2006-04-30 01:08:02 UTC (rev 15347)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py 
2006-04-30 01:08:52 UTC (rev 15348)
@@ -1,14 +1,18 @@
 #!/usr/bin/python
 
-import Ldb
+import Ldb, sys
 
-def fail(msg):
-print 'FAILED:', msg
-sys.exit(1)
+def test(cond, msg):
+if not cond:
+print 'FAILED:', msg
+sys.exit(1)
 
-l = Ldb.Ldb()
+# Torture LdbMessage
 
-l.connect('tdb:///tmp/foo.ldb')
-result = l.search('(dn=*)')
+m = Ldb.LdbMessage()
+m['animal'] = 'dog'
+m['name'] = 'spotty'
 
-print result
+test(m.keys() == ['animal', 'name'], 'keys() test failed')
+test(m.values() == [['dog'], ['spotty']], 'values() test failed')
+test(m.items() == [('animal', ['dog']), ('name', ['spotty'])], 'items() test 
failed')



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

2006-04-26 Thread tpot
Author: tpot
Date: 2006-04-26 19:15:11 + (Wed, 26 Apr 2006)
New Revision: 15289

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

Log:
Put references to $PICFLAGS in quotes.  Fixes #3725.

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  2006-04-26 16:52:45 UTC (rev 
15288)
+++ branches/SAMBA_3_0/source/configure.in  2006-04-26 19:15:11 UTC (rev 
15289)
@@ -2913,7 +2913,7 @@
 
 # Conditions under which smbwrapper should not be built.
 
-   if test x$PICFLAGS = x; then
+   if test x$PICFLAGS = x; then
   echo No support for PIC code - disabling smbwrapper and smbsh
   WRAPPROG=
   WRAP=
@@ -3862,7 +3862,7 @@
 
# Conditions under which pam_smbpass should not be built.
 
-   if test x$PICFLAGS = x; then
+   if test x$PICFLAGS = x; then
   AC_MSG_ERROR([No support for PIC code])
elif test x$ac_cv_header_security_pam_appl_h = xno; then
  AC_MSG_ERROR([No security/pam_appl.h found])

Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2006-04-26 16:52:45 UTC (rev 15288)
+++ trunk/source/configure.in   2006-04-26 19:15:11 UTC (rev 15289)
@@ -2913,7 +2913,7 @@
 
 # Conditions under which smbwrapper should not be built.
 
-   if test x$PICFLAGS = x; then
+   if test x$PICFLAGS = x; then
   echo No support for PIC code - disabling smbwrapper and smbsh
   WRAPPROG=
   WRAP=
@@ -3862,7 +3862,7 @@
 
# Conditions under which pam_smbpass should not be built.
 
-   if test x$PICFLAGS = x; then
+   if test x$PICFLAGS = x; then
   AC_MSG_ERROR([No support for PIC code])
elif test x$ac_cv_header_security_pam_appl_h = xno; then
  AC_MSG_ERROR([No security/pam_appl.h found])



svn commit: samba r15255 - branches/SAMBA_3_0/source/locking trunk/source/locking

2006-04-25 Thread tpot
Author: tpot
Date: 2006-04-25 21:36:35 + (Tue, 25 Apr 2006)
New Revision: 15255

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

Log:
Add return statement after abort to placate fussy compilers.  Closes #3721.

Modified:
   branches/SAMBA_3_0/source/locking/brlock.c
   trunk/source/locking/brlock.c


Changeset:
Modified: branches/SAMBA_3_0/source/locking/brlock.c
===
--- branches/SAMBA_3_0/source/locking/brlock.c  2006-04-25 21:15:00 UTC (rev 
15254)
+++ branches/SAMBA_3_0/source/locking/brlock.c  2006-04-25 21:36:35 UTC (rev 
15255)
@@ -563,6 +563,8 @@
smb_panic(brlock_posix_split_merge\n);
/* Notreached. */
abort();
+   /* Keep some compilers happy. */
+   return 0;
 }
 
 /

Modified: trunk/source/locking/brlock.c
===
--- trunk/source/locking/brlock.c   2006-04-25 21:15:00 UTC (rev 15254)
+++ trunk/source/locking/brlock.c   2006-04-25 21:36:35 UTC (rev 15255)
@@ -563,6 +563,8 @@
smb_panic(brlock_posix_split_merge\n);
/* Notreached. */
abort();
+   /* Keep some compilers happy. */
+   return 0;
 }
 
 /



svn commit: samba r15177 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-23 Thread tpot
Author: tpot
Date: 2006-04-23 15:29:25 + (Sun, 23 Apr 2006)
New Revision: 15177

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

Log:
Wrap ldb_strerror() function.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-23 11:25:02 UTC 
(rev 15176)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-23 15:29:25 UTC 
(rev 15177)
@@ -204,6 +204,7 @@
 struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
 
 const char *ldb_errstring(struct ldb_context *ldb);
+const char *ldb_strerror(int ldb_err);
 
 int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, 
const char *options[]);
 



svn commit: samba r15178 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-23 Thread tpot
Author: tpot
Date: 2006-04-23 15:30:40 + (Sun, 23 Apr 2006)
New Revision: 15178

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

Log:
Fix ldb function calls after big swig rename.

Add close() methods to Ldb and LdbMessage classes.

Start adding dict interface to LdbMessage.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-23 15:29:25 UTC 
(rev 15177)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-23 15:30:40 UTC 
(rev 15178)
@@ -22,8 +22,13 @@
 
 from ldb import *
 
-ldb_global_init()
+# Global initialisation
 
+result = ldb_global_init()
+
+if result != 0:
+raise LdbError, (result, 'ldb_global_init failed')
+
 class LdbError(Exception):
 An exception raised when a ldb error occurs.
 pass
@@ -31,29 +36,48 @@
 class LdbMessage:
 A class representing a ldb message as a Python dictionary.
 
-def __init__(self, msg = None):
+def __init__(self):
+self.mem_ctx = talloc_init(None)
+self.msg = ldb_msg_new(self.mem_ctx)
 
-self._msg = msg
-if self._msg is None:
-self._msg = ldb_msg_new(None)
-
 def __del__(self):
-talloc_free(self._msg)
+self.close()
 
+def close(self):
+if self.mem_ctx is not None:
+talloc_free(self.mem_ctx)
+self.mem_ctx = None
+self.msg = None
+
+def __getattr__(self, attr):
+if attr == 'dn':
+return ldb_dn_linearize(None, self.msg.dn)
+return self.__dict__[attr]
+
+def __setattr__(self, attr, value):
+if attr == 'dn':
+self.msg.dn = ldb_dn_explode(self.msg, value)
+return
+self.__dict__[attr] = value
+
 def len(self):
-return self._msg.num_elements
+return self.msg.num_elements
 
 def __getitem__(self, key):
-elt = ldb_msg_find_element(self._msg, key)
+
+elt = ldb_msg_find_element(self.msg, key)
+
 if elt is None:
 raise KeyError, No such attribute '%s' % key
+
 return [ldb_val_array_getitem(elt.values, i)
 for i in range(elt.num_values)]
 
 def __setitem__(self, key, value):
-result = ldb_msg_add_value(self._msg, key, str(value))
-if result != LDB_SUCCESS:
-raise LdbError, (result, ldb.strerror(result))
+if type(value) in (list, tuple):
+[ldb_msg_add_value(self.msg, key, v) for v in value]
+else:
+ldb_msg_add_value(self.msg, key, value)
 
 class Ldb:
 A class representing a binding to a ldb file.
@@ -67,29 +91,35 @@
 result =  ldb_connect(self.ldb_ctx, url, flags, None)
 
 if result != LDB_SUCCESS:
-raise ldbError, (result, ldb.strerror(result))
+raise LdbError, (result, ldb_strerror(result))
 
 def __del__(self):
-ldb.talloc_free(self.mem_ctx)
-self.mem_ctx = None
-self.ldb_ctx = None
+Called when the object is to be garbage collected.
+self.close()
 
+def close(self):
+Close down a ldb.
+if self.mem_ctx is not None:
+talloc_free(self.mem_ctx)
+self.mem_ctx = None
+self.ldb_ctx = None
+
 def _ldb_call(self, fn, *args):
 Call a ldb function with args.  Raise a LdbError exception
 if the function returns a non-zero return value.
 
 result = fn(*args)
 
-if result != ldb.LDB_SUCCESS:
-raise LdbError, (result, ldb.strerror(result))
+if result != LDB_SUCCESS:
+raise LdbError, (result, ldb_strerror(result))
 
 def search(self, expression):
 Search a ldb for a given expression.
 
-self._ldb_call(ldb.search, self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
+self._ldb_call(ldb_search, self.ldb_ctx, None, LDB_SCOPE_DEFAULT,
expression, None);
 
-return [LdbMessage(ldb.ldb_message_ptr_array_getitem(result.msgs, ndx))
+return [LdbMessage(ldb_message_ptr_array_getitem(result.msgs, ndx))
 for ndx in range(result.count)]
 
 def delete(self, dn):
@@ -97,7 +127,7 @@
 
 _dn = ldb_dn_explode(self.ldb_ctx, dn)
 
-self._ldb_call(ldb.delete, self.ldb_ctx, _dn)
+self._ldb_call(ldb_delete, self.ldb_ctx, _dn)
 
 def rename(self, olddn, newdn):
 Rename a dn.
@@ -105,7 +135,7 @@
 _olddn = ldb_dn_explode(self.ldb_ctx, olddn)
 _newdn = ldb_dn_explode(self.ldb_ctx, newdn)
 
-self._ldb_call(ldb.rename, self.ldb_ctx, _olddn, _newdn)
+self._ldb_call(ldb_rename, self.ldb_ctx, _olddn, _newdn)
 
-def add(self, msg):
-self._ldb_call(ldb.add, self.ldb_ctx, msg)
+def add(self, m):
+self

svn commit: samba r15109 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-17 Thread tpot
Author: tpot
Date: 2006-04-17 21:59:44 + (Mon, 17 Apr 2006)
New Revision: 15109

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

Log:
Wrap ldb_global_init()

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-17 17:56:57 UTC 
(rev 15108)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-17 21:59:44 UTC 
(rev 15109)
@@ -199,6 +199,8 @@
  * Wrap ldb functions 
  */
 
+int ldb_global_init(void);
+
 struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
 
 const char *ldb_errstring(struct ldb_context *ldb);



svn commit: samba r15110 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-17 Thread tpot
Author: tpot
Date: 2006-04-17 22:00:30 + (Mon, 17 Apr 2006)
New Revision: 15110

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

Log:
Start rewriting higher level ldb wrapper.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-17 21:59:44 UTC 
(rev 15109)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-17 22:00:30 UTC 
(rev 15110)
@@ -20,73 +20,71 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 
-import ldb
+from ldb import *
 
+ldb_global_init()
+
 class LdbError(Exception):
 An exception raised when a ldb error occurs.
 pass
 
-class LdbElement:
-A class representing a ldb element as an array of values.
-
-def __init__(self, elt):
-self.name = elt.name
-self.flags = elt.flags
-self.values = [ldb.ldb_val_array_getitem(elt.values, x)
-   for x in range(elt.num_values)]
-
-def __repr__(self):
-return '%s(name=%s) instance at 0x%x' % (self.__class__.__name__,
-  `self.name`, id(self))
-
-def __len__(self):
-return self.values.len()
-
-def __getitem__(self, key):
-return self.values[key]
-
 class LdbMessage:
-A class representing a ldb message as a dict of ldb elements.
+A class representing a ldb message as a Python dictionary.
 
 def __init__(self, msg = None):
 
-self.dn = None
-self.private_data = None
-self.elements = []
+self._msg = msg
+if self._msg is None:
+self._msg = ldb_msg_new(None)
 
-if msg is not None:
-self.dn = msg.dn
-self.private_data = msg.private_data
-eltlist = \
-[LdbElement(ldb.ldb_message_element_array_getitem(
-msg.elements, x))
- for x in range(msg.num_elements)]
-self.elements = dict([(x.name, x) for x in eltlist])
+def __del__(self):
+talloc_free(self._msg)
 
-def __repr__(self):
-return '%s(dn=%s) instance at 0x%x' % (self.__class__.__name__,
-   `self.dn`, id(self))
+def len(self):
+return self._msg.num_elements
 
 def __getitem__(self, key):
-return self.elements[key]
+elt = ldb_msg_find_element(self._msg, key)
+if elt is None:
+raise KeyError, No such attribute '%s' % key
+return [ldb_val_array_getitem(elt.values, i)
+for i in range(elt.num_values)]
 
-def keys(self):
-return self.elements.keys()
-
+def __setitem__(self, key, value):
+result = ldb_msg_add_value(self._msg, key, str(value))
+if result != LDB_SUCCESS:
+raise LdbError, (result, ldb.strerror(result))
+
 class Ldb:
 A class representing a binding to a ldb file.
 
-def __init__(self):
-self.mem_ctx = ldb.talloc_init('python ldb')
-self.ldb_ctx = ldb.init(self.mem_ctx)
+def __init__(self, url, flags = 0):
+Initialise underlying ldb.
+
+self.mem_ctx = talloc_init('mem_ctx for ldb 0x%x' % id(self))
+self.ldb_ctx = ldb_init(self.mem_ctx)
+
+result =  ldb_connect(self.ldb_ctx, url, flags, None)
+
+if result != LDB_SUCCESS:
+raise ldbError, (result, ldb.strerror(result))
 
 def __del__(self):
 ldb.talloc_free(self.mem_ctx)
+self.mem_ctx = None
+self.ldb_ctx = None
 
-def connect(self, url, flags = 0):
-ldb.connect(self.ldb_ctx, url, flags, None)
+def _ldb_call(self, fn, *args):
+Call a ldb function with args.  Raise a LdbError exception
+if the function returns a non-zero return value.
+
+result = fn(*args)
 
+if result != ldb.LDB_SUCCESS:
+raise LdbError, (result, ldb.strerror(result))
+
 def search(self, expression):
+Search a ldb for a given expression.
 
 self._ldb_call(ldb.search, self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
expression, None);
@@ -94,16 +92,20 @@
 return [LdbMessage(ldb.ldb_message_ptr_array_getitem(result.msgs, ndx))
 for ndx in range(result.count)]
 
-def _ldb_call(self, fn, *args):
-result = fn(*args)
-if result != ldb.LDB_SUCCESS:
-raise LdbError, (result, ldb.strerror(result))
-
 def delete(self, dn):
-self._ldb_call(ldb.delete, self.ldb_ctx, dn)
+Delete a dn.
 
+_dn = ldb_dn_explode(self.ldb_ctx, dn)
+
+self._ldb_call(ldb.delete, self.ldb_ctx, _dn)
+
 def rename(self, olddn, newdn):
-self._ldb_call(ldb.rename, self.ldb_ctx, olddn, newdn)
+Rename a dn

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

2006-04-17 Thread tpot
Author: tpot
Date: 2006-04-17 23:25:25 + (Mon, 17 Apr 2006)
New Revision: 15113

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

Log:
Add a ldb_strerror() function.

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c  2006-04-17 22:32:38 UTC 
(rev 15112)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c  2006-04-17 23:25:25 UTC 
(rev 15113)
@@ -474,7 +474,102 @@
return NULL;
 }
 
+/*
+  return a string explaining what a ldb error constant meancs
+*/
+const char *ldb_strerror(int ldb_err)
+{
+   switch (ldb_err) {
+   case LDB_SUCCESS:
+   return Success;
+   case LDB_ERR_OPERATIONS_ERROR:
+   return Operations error;
+   case LDB_ERR_PROTOCOL_ERROR:
+   return Protocol error;
+   case LDB_ERR_TIME_LIMIT_EXCEEDED:
+   return Time limit exceeded;
+   case LDB_ERR_SIZE_LIMIT_EXCEEDED:
+   return Size limit exceeded;
+   case LDB_ERR_COMPARE_FALSE:
+   return Compare false;
+   case LDB_ERR_COMPARE_TRUE:
+   return Compare true;
+   case LDB_ERR_AUTH_METHOD_NOT_SUPPORTED:
+   return Auth method not supported;
+   case LDB_ERR_STRONG_AUTH_REQUIRED:
+   return Strong auth required;
+/* 9 RESERVED */
+   case LDB_ERR_REFERRAL:
+   return Referral error;
+   case LDB_ERR_ADMIN_LIMIT_EXCEEDED:
+   return Admin limit exceeded;
+   case LDB_ERR_UNSUPPORTED_CRITICAL_EXTENSION:
+   return Unsupported critical extension;
+   case LDB_ERR_CONFIDENTIALITY_REQUIRED:
+   return Confidentiality required;
+   case LDB_ERR_SASL_BIND_IN_PROGRESS:
+   return SASL bind in progress;
+   case LDB_ERR_NO_SUCH_ATTRIBUTE:
+   return No such attribute;
+   case LDB_ERR_UNDEFINED_ATTRIBUTE_TYPE:
+   return Undefined attribute type;
+   case LDB_ERR_INAPPROPRIATE_MATCHING:
+   return Inappropriate matching;
+   case LDB_ERR_CONSTRAINT_VIOLATION:
+   return Constraint violation;
+   case LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS:
+   return Attribute or value exists;
+   case LDB_ERR_INVALID_ATTRIBUTE_SYNTAX:
+   return Invalid attribute syntax;
+/* 22-31 unused */
+   case LDB_ERR_NO_SUCH_OBJECT:
+   return No such object;
+   case LDB_ERR_ALIAS_PROBLEM:
+   return Alias problem;
+   case LDB_ERR_INVALID_DN_SYNTAX:
+   return Invalid DN syntax;
+/* 53 RESERVED */
+   case LDB_ERR_ALIAS_DEREFERENCING_PROBLEM:
+   return Alias dereferencing problem;
+/* 37-47 unused */
+   case LDB_ERR_INAPPROPRIATE_AUTHENTICATION:
+   return Inappropriate authentication;
+   case LDB_ERR_INVALID_CREDENTIALS:
+   return Invalid credentials;
+   case LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS:
+   return insufficient access rights;
+   case LDB_ERR_BUSY:
+   return Busy;
+   case LDB_ERR_UNAVAILABLE:
+   return Unavailable;
+   case LDB_ERR_UNWILLING_TO_PERFORM:
+   return Unwilling to perform;
+   case LDB_ERR_LOOP_DETECT:
+   return Loop detect;
+/* 55-63 unused */
+   case LDB_ERR_NAMING_VIOLATION:
+   return Naming violation;
+   case LDB_ERR_OBJECT_CLASS_VIOLATION:
+   return Object class violation;
+   case LDB_ERR_NOT_ALLOWED_ON_NON_LEAF:
+   return Not allowed on non-leaf;
+   case LDB_ERR_NOT_ALLOWED_ON_RDN:
+   return Not allowed on RDN;
+   case LDB_ERR_ENTRY_ALREADY_EXISTS:
+   return Entry already exists;
+   case LDB_ERR_OBJECT_CLASS_MODS_PROHIBITED:
+   return Object class mods prohibited;
+/* 70 RESERVED FOR CLDAP */
+   case LDB_ERR_AFFECTS_MULTIPLE_DSAS:
+   return Affects multiple DSAs;
+/* 72-79 unused */
+   case LDB_ERR_OTHER:
+   return Other;
+   }
 
+   return Unknown error;
+}
+
 /*
   set backend specific opaque parameters
 */

Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-04-17 22:32:38 UTC 
(rev 15112)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-04-17 23:25:25 UTC 
(rev 15113)
@@ -827,6 +827,11 @@
 const char *ldb_errstring(struct ldb_context *ldb);
 
 /**
+  return a string explaining what a ldb error constant meancs
+*/
+const char *ldb_strerror(int ldb_err);
+
+/**
   setup the default utf8 functions
   FIXME: these functions do not yet handle utf8
 */



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

2006-04-16 Thread tpot
Author: tpot
Date: 2006-04-16 06:02:13 + (Sun, 16 Apr 2006)
New Revision: 15096

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

Log:
Fix typo.

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb_errors.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb_errors.h  2006-04-16 
03:46:05 UTC (rev 15095)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb_errors.h  2006-04-16 
06:02:13 UTC (rev 15096)
@@ -206,7 +206,7 @@
 */
 #define LDB_ERR_INVALID_DN_SYNTAX  34
 
-/* 53 RESERVED */
+/* 35 RESERVED */
 
 /**
The function required dereferencing of an alias, and something went



svn commit: samba r15097 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-16 Thread tpot
Author: tpot
Date: 2006-04-16 06:05:33 + (Sun, 16 Apr 2006)
New Revision: 15097

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

Log:
Add constants for ldb errors.

Add wrappers for ldb_dn_explode() and ldb_dn_linearize().

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-16 06:02:13 UTC 
(rev 15096)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-16 06:05:33 UTC 
(rev 15097)
@@ -49,6 +49,53 @@
  * Constants
  */
 
+#define LDB_SUCCESS0
+#define LDB_ERR_OPERATIONS_ERROR   1
+#define LDB_ERR_PROTOCOL_ERROR 2
+#define LDB_ERR_TIME_LIMIT_EXCEEDED3
+#define LDB_ERR_SIZE_LIMIT_EXCEEDED4
+#define LDB_ERR_COMPARE_FALSE  5
+#define LDB_ERR_COMPARE_TRUE   6
+#define LDB_ERR_AUTH_METHOD_NOT_SUPPORTED  7
+#define LDB_ERR_STRONG_AUTH_REQUIRED   8
+/* 9 RESERVED */
+#define LDB_ERR_REFERRAL   10
+#define LDB_ERR_ADMIN_LIMIT_EXCEEDED   11
+#define LDB_ERR_UNSUPPORTED_CRITICAL_EXTENSION 12
+#define LDB_ERR_CONFIDENTIALITY_REQUIRED   13
+#define LDB_ERR_SASL_BIND_IN_PROGRESS  14
+#define LDB_ERR_NO_SUCH_ATTRIBUTE  16
+#define LDB_ERR_UNDEFINED_ATTRIBUTE_TYPE   17
+#define LDB_ERR_INAPPROPRIATE_MATCHING 18
+#define LDB_ERR_CONSTRAINT_VIOLATION   19
+#define LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS  20
+#define LDB_ERR_INVALID_ATTRIBUTE_SYNTAX   21
+/* 22-31 unused */
+#define LDB_ERR_NO_SUCH_OBJECT 32
+#define LDB_ERR_ALIAS_PROBLEM  33
+#define LDB_ERR_INVALID_DN_SYNTAX  34
+/* 35 RESERVED */
+#define LDB_ERR_ALIAS_DEREFERENCING_PROBLEM36
+/* 37-47 unused */
+#define LDB_ERR_INAPPROPRIATE_AUTHENTICATION   48
+#define LDB_ERR_INVALID_CREDENTIALS49
+#define LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS 50
+#define LDB_ERR_BUSY   51
+#define LDB_ERR_UNAVAILABLE52
+#define LDB_ERR_UNWILLING_TO_PERFORM   53
+#define LDB_ERR_LOOP_DETECT54
+/* 55-63 unused */
+#define LDB_ERR_NAMING_VIOLATION   64
+#define LDB_ERR_OBJECT_CLASS_VIOLATION 65
+#define LDB_ERR_NOT_ALLOWED_ON_NON_LEAF66
+#define LDB_ERR_NOT_ALLOWED_ON_RDN 67
+#define LDB_ERR_ENTRY_ALREADY_EXISTS   68
+#define LDB_ERR_OBJECT_CLASS_MODS_PROHIBITED   69
+/* 70 RESERVED FOR CLDAP */
+#define LDB_ERR_AFFECTS_MULTIPLE_DSAS  71
+/* 72-79 unused */
+#define LDB_ERR_OTHER  80
+
 enum ldb_scope {LDB_SCOPE_DEFAULT=-1, 
LDB_SCOPE_BASE=0, 
LDB_SCOPE_ONELEVEL=1,
@@ -169,3 +216,6 @@
 struct ldb_message *ldb_msg_new(void *mem_ctx);
 struct ldb_message_element *ldb_msg_find_element(const struct ldb_message 
*msg, const char *attr_name);
 int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *INPUT);
+
+struct ldb_dn *ldb_dn_explode(void *mem_ctx, const char *dn);
+char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *dn);



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

2006-04-15 Thread tpot
Author: tpot
Date: 2006-04-15 07:44:06 + (Sat, 15 Apr 2006)
New Revision: 15090

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

Log:
Since we wrap the swig wrapper in another layer of Python, there isn't 
much point in doing lots of %rename calls in tdb.i so get rid of them.

Modified:
   branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py
   branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py   2006-04-15 04:07:14 UTC 
(rev 15089)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py   2006-04-15 07:44:06 UTC 
(rev 15090)
@@ -20,15 +20,16 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 
-import tdb, os
+import os
+from tdb import *
 
 # Open flags
 
-DEFAULT= tdb.TDB_DEFAULT
-CLEAR_IF_FIRST = tdb.TDB_CLEAR_IF_FIRST
-INTERNAL   = tdb.TDB_INTERNAL
-NOLOCK = tdb.TDB_NOLOCK
-NOMMAP = tdb.TDB_NOMMAP
+DEFAULT= TDB_DEFAULT
+CLEAR_IF_FIRST = TDB_CLEAR_IF_FIRST
+INTERNAL   = TDB_INTERNAL
+NOLOCK = TDB_NOLOCK
+NOMMAP = TDB_NOMMAP
 
 # Class representing a TDB file
 
@@ -36,40 +37,40 @@
 
 # Create and destroy Tdb objects
 
-def __init__(self, name, hash_size = 0, flags = tdb.TDB_DEFAULT,
+def __init__(self, name, hash_size = 0, flags = TDB_DEFAULT,
  open_flags = os.O_RDWR | os.O_CREAT, mode = 0600):
-self.tdb = tdb.open(name, hash_size, flags, open_flags, mode)
+self.tdb = tdb_open(name, hash_size, flags, open_flags, mode)
 if self.tdb is None:
-raise IOError, tdb.errorstr(self.tdb)
+raise IOError, tdb_errorstr(self.tdb)
 
 def __del__(self):
 self.close()
 
 def close(self):
 if hasattr(self, 'tdb') and self.tdb is not None:
-if tdb.close(self.tdb) == -1:
-raise IOError, tdb.errorstr(self.tdb)
+if tdb_close(self.tdb) == -1:
+raise IOError, tdb_errorstr(self.tdb)
 self.tdb = None
 
 # Random access to keys, values
 
 def __getitem__(self, key):
-result = tdb.fetch(self.tdb, key)
+result = tdb_fetch(self.tdb, key)
 if result is None:
-raise KeyError, '%s: %s' % (key, tdb.errorstr(self.tdb))
+raise KeyError, '%s: %s' % (key, tdb_errorstr(self.tdb))
 return result
 
 def __setitem__(self, key, item):
-if tdb.store(self.tdb, key, item) == -1:
-raise IOError, tdb.errorstr(self.tdb)
+if tdb_store(self.tdb, key, item) == -1:
+raise IOError, tdb_errorstr(self.tdb)
 
 def __delitem__(self, key):
-if not tdb.exists(self.tdb, key):
-raise KeyError, '%s: %s' % (key, tdb.errorstr(self.tdb))
-tdb.delete(self.tdb, key)
+if not tdb_exists(self.tdb, key):
+raise KeyError, '%s: %s' % (key, tdb_errorstr(self.tdb))
+tdb_delete(self.tdb, key)
 
 def has_key(self, key):
-return tdb.exists(self.tdb, key)
+return tdb_exists(self.tdb, key)
 
 # Tdb iterator
 
@@ -83,12 +84,12 @@
 
 def next(self):
 if self.key is None:
-self.key = tdb.firstkey(self.tdb)
+self.key = tdb_firstkey(self.tdb)
 if self.key is None:
 raise StopIteration
 return self.key
 else:
-self.key = tdb.nextkey(self.tdb, self.key)
+self.key = tdb_nextkey(self.tdb, self.key)
 if self.key is None:
 raise StopIteration
 return self.key

Modified: branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2006-04-15 04:07:14 UTC 
(rev 15089)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2006-04-15 07:44:06 UTC 
(rev 15090)
@@ -113,11 +113,9 @@
}
 }
 
-%rename tdb_open open;
 TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
  int open_flags, mode_t mode);
 
-%rename tdb_open_ex open_ex;
 TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
 int open_flags, mode_t mode,
 tdb_log_func log_fn,
@@ -125,66 +123,46 @@
 
 %exception;
 
-%rename tdb_reopen reopen;
 int tdb_reopen(TDB_CONTEXT *tdb);
 
-%rename tdb_reopen_all reopen_all;
 int tdb_reopen_all(void);
 
-%rename tdb_logging_function logging_function;
 void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func);
 
-%rename tdb_error error;
 enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
 
-%rename tdb_errorstr errorstr;
 const char *tdb_errorstr(TDB_CONTEXT *tdb);
 
-%rename tdb_fetch fetch;
 TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key

svn commit: samba r15091 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-15 Thread tpot
Author: tpot
Date: 2006-04-15 10:10:23 + (Sat, 15 Apr 2006)
New Revision: 15091

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

Log:
Raise LdbError instead of IOError when ldb function calls return an 
error.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-15 07:44:06 UTC 
(rev 15090)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-15 10:10:23 UTC 
(rev 15091)
@@ -22,6 +22,10 @@
 
 import ldb
 
+class LdbError(Exception):
+An exception raised when a ldb error occurs.
+pass
+
 class LdbElement:
 A class representing a ldb element as an array of values.
 
@@ -84,19 +88,22 @@
 
 def search(self, expression):
 
-result = ldb.search(self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
-expression, None);
+self._ldb_call(ldb.search, self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
+   expression, None);
 
 return [LdbMessage(ldb.ldb_message_ptr_array_getitem(result.msgs, ndx))
 for ndx in range(result.count)]
 
+def _ldb_call(self, fn, *args):
+result = fn(*args)
+if result != ldb.LDB_SUCCESS:
+raise LdbError, (result, ldb.strerror(result))
+
 def delete(self, dn):
-if ldb.delete(self.ldb_ctx, dn) != 0:
-raise IOError, ldb.errstring(self.ldb_ctx)
+self._ldb_call(ldb.delete, self.ldb_ctx, dn)
 
 def rename(self, olddn, newdn):
-if ldb.rename(self.ldb_ctx, olddn, newdn) != 0:
-raise IOError, ldb.errstring(self.ldb_ctx)
+self._ldb_call(ldb.rename, self.ldb_ctx, olddn, newdn)
 
 def add(self, msg):
-ldb.add(self.ldb_ctx, msg)
+self._ldb_call(ldb.add, self.ldb_ctx, msg)



svn commit: samba r15092 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-15 Thread tpot
Author: tpot
Date: 2006-04-15 10:13:09 + (Sat, 15 Apr 2006)
New Revision: 15092

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

Log:
Remove some swig stuff that didn't work out and the %rename call.

Add wrappers for some of the ldb_msg_* functions.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-15 10:10:23 UTC 
(rev 15091)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-15 10:13:09 UTC 
(rev 15092)
@@ -72,20 +72,22 @@
  * Wrap struct ldb_val
  */
 
-%typemap(in) struct ldb_val {
+%typemap(in) struct ldb_val * (struct ldb_val temp) {
+   $1 = temp;
if (!PyString_Check($input)) {
PyErr_SetString(PyExc_TypeError, string arg expected);
return NULL;
}
-   $1.length = PyString_Size($input);
-   $1.data = PyString_AsString($input);
+   $1-length = PyString_Size($input);
+   $1-data = PyString_AsString($input);
 }
 
-%typemap(out) struct ldb_val {
-   if ($1.data == NULL  $1.length == 0) {
+%typemap(out) struct ldb_val * {
+   if ($1-data == NULL  $1-length == 0) {
+   Py_INCREF(Py_None);
$result = Py_None;
} else {
-   $result = PyString_FromStringAndSize($1.data, $1.length);
+   $result = PyString_FromStringAndSize($1-data, $1-length);
}
 }
 
@@ -103,34 +105,12 @@
 }
 
 %typemap(argout) struct ldb_result ** {
-
-   /* XXX: Check result for error and throw exception if necessary */
-
resultobj = SWIG_NewPointerObj(*$1, SWIGTYPE_p_ldb_result, 0);
 }  
 
 %types(struct ldb_result *);
 
 /*
- * Wrap struct ldb_dn
- */
-
-%typemap(in) struct ldb_dn * {
-   if ($input == Py_None) {
-   $1 = NULL;
-   } else if (!PyString_Check($input)) {
-   PyErr_SetString(PyExc_TypeError, string arg expected);
-   return NULL;
-   } else {
-   $1 = ldb_dn_explode(NULL, PyString_AsString($input));
-   }
-}
-
-%typemap(out) struct ldb_dn * {
-   $result = PyString_FromString(ldb_dn_linearize($1, $1));
-}
-
-/*
  * Wrap struct ldb_message_element
  */
 
@@ -153,33 +133,9 @@
struct ldb_dn *dn;
unsigned int num_elements;
struct ldb_message_element *elements;
-   void *private_data; /* private to the backend */
+   void *private_data;
 };
 
-%typemap(in) struct ldb_message * {
-   PyObject *obj, *key, *value;
-   int pos;
-
-   $1 = ldb_msg_new(NULL);
-
-   obj = PyObject_GetAttrString($input, dn);
-   $1-dn = ldb_dn_explode(NULL, PyString_AsString(obj));
-
-   obj = PyObject_GetAttrString($input, private_data);
-   $1-private_data = PyString_AsString(obj);
-
-   obj = PyObject_GetAttrString($input, elements);
-
-   pos = 0;
-   while (PyDict_Next(obj, pos, key, value)) {
-   struct ldb_val v;
-
-   v.data = PyString_AsString(value);
-   v.length = PyString_Size(value);
-   ldb_msg_add_value($1, PyString_AsString(key), v);
-   }
-}
-
 /*
  * Wrap struct ldb_result
  */
@@ -197,23 +153,20 @@
  * Wrap ldb functions 
  */
 
-%rename ldb_init init;
 struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
 
-%rename ldb_errstring errstring;
 const char *ldb_errstring(struct ldb_context *ldb);
 
-%rename ldb_connect connect;
 int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, 
const char *options[]);
 
-%rename ldb_search search;
 int ldb_search(struct ldb_context *ldb, const struct ldb_dn *base, enum 
ldb_scope scope, const char *expression, const char * const *attrs, struct 
ldb_result **OUT);
 
-%rename ldb_delete delete;
 int ldb_delete(struct ldb_context *ldb, const struct ldb_dn *dn);
 
-%rename ldb_rename rename;
 int ldb_rename(struct ldb_context *ldb, const struct ldb_dn *olddn, const 
struct ldb_dn *newdn);
 
-%rename ldb_add add;
 int ldb_add(struct ldb_context *ldb, const struct ldb_message *message);
+
+struct ldb_message *ldb_msg_new(void *mem_ctx);
+struct ldb_message_element *ldb_msg_find_element(const struct ldb_message 
*msg, const char *attr_name);
+int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *val);



svn commit: samba r15095 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-15 Thread tpot
Author: tpot
Date: 2006-04-16 03:46:05 + (Sun, 16 Apr 2006)
New Revision: 15095

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

Log:
Fix up typemap for struct ldb_val so that ldb_msg_add_value() wrapper 
works properly.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-15 21:24:32 UTC 
(rev 15094)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-16 03:46:05 UTC 
(rev 15095)
@@ -45,6 +45,15 @@
 %include carrays.i
 %include exception.i
 
+/*
+ * Constants
+ */
+
+enum ldb_scope {LDB_SCOPE_DEFAULT=-1, 
+   LDB_SCOPE_BASE=0, 
+   LDB_SCOPE_ONELEVEL=1,
+   LDB_SCOPE_SUBTREE=2};
+
 /* 
  * Wrap struct ldb_context
  */
@@ -72,7 +81,7 @@
  * Wrap struct ldb_val
  */
 
-%typemap(in) struct ldb_val * (struct ldb_val temp) {
+%typemap(in) struct ldb_val *INPUT (struct ldb_val temp) {
$1 = temp;
if (!PyString_Check($input)) {
PyErr_SetString(PyExc_TypeError, string arg expected);
@@ -82,20 +91,10 @@
$1-data = PyString_AsString($input);
 }
 
-%typemap(out) struct ldb_val * {
-   if ($1-data == NULL  $1-length == 0) {
-   Py_INCREF(Py_None);
-   $result = Py_None;
-   } else {
-   $result = PyString_FromStringAndSize($1-data, $1-length);
-   }
+%typemap(out) struct ldb_val {
+   $result = PyString_FromStringAndSize($1.data, $1.length);
 }
 
-enum ldb_scope {LDB_SCOPE_DEFAULT=-1, 
-   LDB_SCOPE_BASE=0, 
-   LDB_SCOPE_ONELEVEL=1,
-   LDB_SCOPE_SUBTREE=2};
-
 /*
  * Wrap struct ldb_result
  */
@@ -169,4 +168,4 @@
 
 struct ldb_message *ldb_msg_new(void *mem_ctx);
 struct ldb_message_element *ldb_msg_find_element(const struct ldb_message 
*msg, const char *attr_name);
-int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *val);
+int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *INPUT);



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

2006-04-12 Thread tpot
Author: tpot
Date: 2006-04-13 04:19:27 + (Thu, 13 Apr 2006)
New Revision: 15065

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

Log:
Remove duplicate prototype.

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-04-13 04:14:18 UTC 
(rev 15064)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-04-13 04:19:27 UTC 
(rev 15065)
@@ -1055,7 +1055,6 @@
 int ldb_attr_cmp(const char *attr1, const char *attr2);
 char *ldb_attr_casefold(void *mem_ctx, const char *s);
 int ldb_attr_dn(const char *attr);
-char *ldb_dn_escape_value(void *mem_ctx, struct ldb_val value);
 
 /**
Create an empty message



svn commit: samba r15017 - in branches/SAMBA_4_0/source/ntvfs/sysdep: .

2006-04-10 Thread tpot
Author: tpot
Date: 2006-04-10 12:15:40 + (Mon, 10 Apr 2006)
New Revision: 15017

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

Log:
When making up our own inotify functions, make sure glibc exports the 
__NR_inotify_* syscall numbers before trying.

Modified:
   branches/SAMBA_4_0/source/ntvfs/sysdep/config.m4


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/config.m4
===
--- branches/SAMBA_4_0/source/ntvfs/sysdep/config.m42006-04-10 06:06:26 UTC 
(rev 15016)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/config.m42006-04-10 12:15:40 UTC 
(rev 15017)
@@ -1,7 +1,13 @@
 AC_CHECK_HEADERS(linux/inotify.h asm/unistd.h)
 AC_CHECK_FUNC(inotify_init)
+AC_CHECK_DECL(__NR_inotify_init)
 
 SMB_ENABLE(sys_notify_inotify, NO)
-if test x$ac_cv_header_linux_inotify_h = xyes; then
+
+if test x$ac_cv_func_inotify_init = xyes -a 
x$ac_cv_header_linux_inotify_h = xyes; then
 SMB_ENABLE(sys_notify_inotify, YES)
 fi
+
+if test x$ac_cv_header_linux_inotify_h = xyes -a 
x$ac_cv_have_decl___NR_inotify_init; then
+SMB_ENABLE(sys_notify_inotify, YES)
+fi



svn commit: samba r14968 - in branches/SAMBA_4_0/source: lib/ldb lib/ldb/swig lib/tdb lib/tdb/swig scripting/swig

2006-04-07 Thread tpot
Author: tpot
Date: 2006-04-08 00:40:52 + (Sat, 08 Apr 2006)
New Revision: 14968

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

Log:
Move tdb and ldb swig wrappers in to lib/tdb and lib/ldb directories.

Added:
   branches/SAMBA_4_0/source/lib/ldb/swig/
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
   branches/SAMBA_4_0/source/lib/tdb/swig/
   branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py
   branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i
Removed:
   branches/SAMBA_4_0/source/scripting/swig/Ldb.py
   branches/SAMBA_4_0/source/scripting/swig/Tdb.py
   branches/SAMBA_4_0/source/scripting/swig/ldb.i
   branches/SAMBA_4_0/source/scripting/swig/tdb.i
Modified:
   branches/SAMBA_4_0/source/lib/ldb/config.mk
   branches/SAMBA_4_0/source/lib/tdb/config.mk
   branches/SAMBA_4_0/source/scripting/swig/
   branches/SAMBA_4_0/source/scripting/swig/config.mk


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


svn commit: samba r14970 - in branches/SAMBA_4_0/source/lib: ldb tdb

2006-04-07 Thread tpot
Author: tpot
Date: 2006-04-08 01:52:09 + (Sat, 08 Apr 2006)
New Revision: 14970

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

Log:
Add configure stuff for Python to tdb and ldb standalone builds.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/config.m4
   branches/SAMBA_4_0/source/lib/tdb/config.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/config.m4
===
--- branches/SAMBA_4_0/source/lib/ldb/config.m4 2006-04-08 00:47:15 UTC (rev 
14969)
+++ branches/SAMBA_4_0/source/lib/ldb/config.m4 2006-04-08 01:52:09 UTC (rev 
14970)
@@ -1 +1,32 @@
 SMB_ENABLE(ldb_sqlite3,$with_sqlite3_support)
+
+AC_MSG_CHECKING([for Python])
+
+PYTHON=
+ 
+AC_ARG_WITH(python,
+[  --with-python=PYTHONNAME  build Python libraries],
+[ case ${withval-python} in
+  yes)
+PYTHON=python
+;;
+  no)
+PYTHON=
+;;
+  *)
+PYTHON=${withval-python}
+;;
+  esac ])
+
+if test x$PYTHON != x; then
+   incdir=`python -c 'import sys; print %s/include/python%d.%d % 
(sys.prefix, sys.version_info[[0]], sys.version_info[[1]])'`
+   CPPFLAGS=$CPPFLAGS -I $incdir
+fi
+
+if test x$PYTHON != x; then
+   AC_MSG_RESULT([${withval-python}])
+else
+   AC_MSG_RESULT(no)
+fi
+
+AC_SUBST(PYTHON)

Modified: branches/SAMBA_4_0/source/lib/tdb/config.m4
===
--- branches/SAMBA_4_0/source/lib/tdb/config.m4 2006-04-08 00:47:15 UTC (rev 
14969)
+++ branches/SAMBA_4_0/source/lib/tdb/config.m4 2006-04-08 01:52:09 UTC (rev 
14970)
@@ -5,3 +5,34 @@
 
 AC_HAVE_DECL(pread, [#include unistd.h])
 AC_HAVE_DECL(pwrite, [#include unistd.h])
+
+AC_MSG_CHECKING([for Python])
+
+PYTHON=
+ 
+AC_ARG_WITH(python,
+[  --with-python=PYTHONNAME  build Python libraries],
+[ case ${withval-python} in
+  yes)
+PYTHON=python
+;;
+  no)
+PYTHON=
+;;
+  *)
+PYTHON=${withval-python}
+;;
+  esac ])
+
+if test x$PYTHON != x; then
+   incdir=`python -c 'import sys; print %s/include/python%d.%d % 
(sys.prefix, sys.version_info[[0]], sys.version_info[[1]])'`
+   CPPFLAGS=$CPPFLAGS -I $incdir
+fi
+
+if test x$PYTHON != x; then
+   AC_MSG_RESULT([${withval-python}])
+else
+   AC_MSG_RESULT(no)
+fi
+
+AC_SUBST(PYTHON)



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

2006-04-07 Thread tpot
Author: tpot
Date: 2006-04-08 02:04:19 + (Sat, 08 Apr 2006)
New Revision: 14971

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

Log:
Update test script with new location of tdb and ldb wrappers.

Modified:
   branches/SAMBA_4_0/source/script/tests/test_swig.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_swig.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-04-08 01:52:09 UTC 
(rev 14970)
+++ branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-04-08 02:04:19 UTC 
(rev 14971)
@@ -12,7 +12,7 @@
 
 failed=0
 
-export PYTHONPATH=scripting/swig:$PYTHONPATH
+export PYTHONPATH=lib/tdb/swig:lib/ldb/swig:scripting/swig:$PYTHONPATH
 export LD_LIBRARY_PATH=bin:$LD_LIBRARY_PATH
 
 scripting/swig/torture/torture_tdb.py || failed=`expr $failed + 1`



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

2006-04-04 Thread tpot
Author: tpot
Date: 2006-04-04 22:15:27 + (Tue, 04 Apr 2006)
New Revision: 14915

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

Log:
Work in progress - getting ldb_add() working.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/Ldb.py
   branches/SAMBA_4_0/source/scripting/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/Ldb.py 2006-04-04 17:48:53 UTC 
(rev 14914)
+++ branches/SAMBA_4_0/source/scripting/swig/Ldb.py 2006-04-04 22:15:27 UTC 
(rev 14915)
@@ -44,15 +44,21 @@
 class LdbMessage:
 A class representing a ldb message as a dict of ldb elements.
 
-def __init__(self, msg):
-self.dn = msg.dn
-self.private_data = msg.private_data
-eltlist = \
-[LdbElement(ldb.ldb_message_element_array_getitem(msg.elements, x))
- for x in range(msg.num_elements)]
-self.elements = \
-dict([(x.name, x) for x in eltlist])
+def __init__(self, msg = None):
 
+self.dn = None
+self.private_data = None
+self.elements = []
+
+if msg is not None:
+self.dn = msg.dn
+self.private_data = msg.private_data
+eltlist = \
+[LdbElement(ldb.ldb_message_element_array_getitem(
+msg.elements, x))
+ for x in range(msg.num_elements)]
+self.elements = dict([(x.name, x) for x in eltlist])
+
 def __repr__(self):
 return '%s(dn=%s) instance at 0x%x' % (self.__class__.__name__,
`self.dn`, id(self))

Modified: branches/SAMBA_4_0/source/scripting/swig/ldb.i
===
--- branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-04 17:48:53 UTC 
(rev 14914)
+++ branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-04 22:15:27 UTC 
(rev 14915)
@@ -156,6 +156,30 @@
void *private_data; /* private to the backend */
 };
 
+%typemap(in) struct ldb_message * {
+   PyObject *obj, *key, *value;
+   int pos;
+
+   $1 = ldb_msg_new(NULL);
+
+   obj = PyObject_GetAttrString($input, dn);
+   $1-dn = ldb_dn_explode(NULL, PyString_AsString(obj));
+
+   obj = PyObject_GetAttrString($input, private_data);
+   $1-private_data = PyString_AsString(obj);
+
+   obj = PyObject_GetAttrString($input, elements);
+
+   pos = 0;
+   while (PyDict_Next(obj, pos, key, value)) {
+   struct ldb_val v;
+
+   v.data = PyString_AsString(value);
+   v.length = PyString_Size(value);
+   ldb_msg_add_value($1, PyString_AsString(key), v);
+   }
+}
+
 /*
  * Wrap struct ldb_result
  */



svn commit: samba r14878 - in branches/SAMBA_4_0/source: script/tests scripting/swig scripting/swig/torture

2006-04-03 Thread tpot
Author: tpot
Date: 2006-04-03 08:03:44 + (Mon, 03 Apr 2006)
New Revision: 14878

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

Log:
Write swig wrappers for ldb_init() and ldb_connect().

Start wrapper for ldb_search().  Currently it returns a list of swig 
ldb_message objects.  More unpacking of results required.

Modified:
   branches/SAMBA_4_0/source/script/tests/test_swig.sh
   branches/SAMBA_4_0/source/scripting/swig/Ldb.py
   branches/SAMBA_4_0/source/scripting/swig/ldb.i
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_swig.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-04-03 06:46:55 UTC 
(rev 14877)
+++ branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-04-03 08:03:44 UTC 
(rev 14878)
@@ -13,6 +13,7 @@
 failed=0
 
 export PYTHONPATH=scripting/swig:$PYTHONPATH
+export LD_LIBRARY_PATH=bin:$LD_LIBRARY_PATH
 
 scripting/swig/torture/torture_tdb.py || failed=`expr $failed + 1`
 scripting/swig/torture/torture_ldb.py || failed=`expr $failed + 1`

Modified: branches/SAMBA_4_0/source/scripting/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/Ldb.py 2006-04-03 06:46:55 UTC 
(rev 14877)
+++ branches/SAMBA_4_0/source/scripting/swig/Ldb.py 2006-04-03 08:03:44 UTC 
(rev 14878)
@@ -23,4 +23,17 @@
 import ldb
 
 class Ldb:
-pass
+
+def __init__(self):
+self.mem_ctx = ldb.talloc_init('python ldb')
+self.ldb_ctx = ldb.init(self.mem_ctx)
+
+def __del__(self):
+ldb.talloc_free(self.mem_ctx)
+
+def connect(self, url, flags = 0):
+ldb.connect(self.ldb_ctx, url, flags, None)
+
+def search(self, expression):
+return ldb.search(self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
+  expression, None);

Modified: branches/SAMBA_4_0/source/scripting/swig/ldb.i
===
--- branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-03 06:46:55 UTC 
(rev 14877)
+++ branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-03 08:03:44 UTC 
(rev 14878)
@@ -54,10 +54,11 @@
 typedef long long int64_t;
 
 #include lib/ldb/include/ldb.h
+#include lib/talloc/talloc.h
 
 %}
 
-/* The ldb functions will crash if a NULL tdb is passed */
+/* The ldb functions will crash if a NULL ldb is passed */
 
 %include exception.i
 
@@ -67,22 +68,71 @@
ldb context must be non-NULL);
 }
 
-/* Throw an IOError exception if tdb_open() or tdb_open_ex() returns NULL */
+/* Use talloc_init() to create a parameter to pass to ldb_init().  Don't
+   forget to free it using talloc_free() afterwards. */
 
-%exception {
-   $action
-   if (result == NULL) {
-   PyErr_SetFromErrno(PyExc_IOError);
-   SWIG_fail;
+TALLOC_CTX *talloc_init(char *name);
+int talloc_free(TALLOC_CTX *ptr);
+
+/* In and out typemaps for struct ldb_val.  This is converted to and from
+   the Python string datatype. */
+
+%typemap(in) struct ldb_val {
+   if (!PyString_Check($input)) {
+   PyErr_SetString(PyExc_TypeError, string arg expected);
+   return NULL;
}
+   $1.length = PyString_Size($input);
+   $1.data = PyString_AsString($input);
 }
 
+%typemap(out) struct ldb_val {
+   if ($1.data == NULL  $1.length == 0) {
+   $result = Py_None;
+   } else {
+   $result = PyString_FromStringAndSize($1.data, $1.length);
+   }
+}
 
+enum ldb_scope {LDB_SCOPE_DEFAULT=-1, 
+   LDB_SCOPE_BASE=0, 
+   LDB_SCOPE_ONELEVEL=1,
+   LDB_SCOPE_SUBTREE=2};
+
+/* Typemap for passing a struct ldb_result by reference */
+
+%typemap(in, numinputs=0) struct ldb_result **OUT (struct ldb_result 
*temp_ldb_result) {
+   $1 = temp_ldb_result;
+}
+
+%typemap(argout) struct ldb_result ** {
+   unsigned int i;
+
+   /* XXX: Handle resultobj by throwing an exception if required */
+
+   resultobj = PyList_New((*$1)-count);
+
+   for (i = 0; i  (*$1)-count; i++) {
+   PyList_SetItem(resultobj, i, SWIG_NewPointerObj(*$1, 
SWIGTYPE_p_ldb_message, 0));
+   }
+}  
+
+%types(struct ldb_result *);
+
+struct ldb_message {
+   struct ldb_dn *dn;
+   unsigned int num_elements;
+   struct ldb_message_element *elements;
+   void *private_data; /* private to the backend */
+};
+
+/* Wrap ldb functions */
+
 %rename ldb_init init;
-struct ldb_context *ldb_init(void *mem_ctx);
+struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
 
 %rename ldb_connect connect;
 int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, 
const char *options[]);
 
-%rename ldb_request request;
-int ldb_request(struct ldb_context *ldb, struct ldb_request *request);
+%rename

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

2006-04-03 Thread tpot
Author: tpot
Date: 2006-04-03 08:25:03 + (Mon, 03 Apr 2006)
New Revision: 14879

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

Log:
Fix bug unpacking ldb_messages.

Start decoding more of ldb_message and ldb_message_result.

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


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/ldb.i
===
--- branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-03 08:03:44 UTC 
(rev 14878)
+++ branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-03 08:25:03 UTC 
(rev 14879)
@@ -113,12 +113,23 @@
resultobj = PyList_New((*$1)-count);
 
for (i = 0; i  (*$1)-count; i++) {
-   PyList_SetItem(resultobj, i, SWIG_NewPointerObj(*$1, 
SWIGTYPE_p_ldb_message, 0));
+   PyList_SetItem(resultobj, i, SWIG_NewPointerObj((*$1)-msgs[i], 
SWIGTYPE_p_ldb_message, 0));
}
 }  
 
 %types(struct ldb_result *);
 
+%typemap(out) struct ldb_dn * {
+   $result = PyString_FromString(ldb_dn_linearize($1, $1));
+}
+
+struct ldb_message_element {
+   unsigned int flags;
+   const char *name;
+   unsigned int num_values;
+   struct ldb_val *values;
+};
+
 struct ldb_message {
struct ldb_dn *dn;
unsigned int num_elements;



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

2006-04-03 Thread tpot
Author: tpot
Date: 2006-04-03 09:18:34 + (Mon, 03 Apr 2006)
New Revision: 14880

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

Log:
Doc.

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  2006-04-03 08:25:03 UTC 
(rev 14879)
+++ branches/SAMBA_4_0/source/scripting/swig/tdb.i  2006-04-03 09:18:34 UTC 
(rev 14880)
@@ -51,7 +51,7 @@
 
 %}
 
-/* The tdb functions will crash if a NULL tdb is passed */
+/* The tdb functions will crash if a NULL tdb context is passed */
 
 %include exception.i
 



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

2006-04-03 Thread tpot
Author: tpot
Date: 2006-04-03 09:26:38 + (Mon, 03 Apr 2006)
New Revision: 14881

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

Log:
Unpack ldb_message_element and ldb_val arrays.  Python can now access 
all parts of a ldb_result:

@BASEINFO has 2 elements
elt[0]: val[0]: sequenceNumber = 2
elt[1]: val[0]: distinguishedName = @BASEINFO
name=foo has 2 elements
elt[0]: val[0]: foo = bar
elt[1]: val[0]: distinguishedName = name=foo

Cleanup some swig junk that was only necessary when including config.h 
and function prototypes that used the PRINTF_ATTRIBUTE() macro.

Add some more comments.

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


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/ldb.i
===
--- branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-03 09:18:34 UTC 
(rev 14880)
+++ branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-03 09:26:38 UTC 
(rev 14881)
@@ -3,7 +3,7 @@
 
Swig interface to ldb.
 
-   Copyright (C) 2005 Tim Potter [EMAIL PROTECTED]
+   Copyright (C) 2005,2006 Tim Potter [EMAIL PROTECTED]
Copyright (C) 2006 Simo Sorce [EMAIL PROTECTED]
 
  ** NOTE! The following LGPL license applies to the ldb
@@ -29,53 +29,48 @@
 
 %{
 
-/* This symbol is used in both includes.h and Python.h which causes an
-   annoying compiler warning. */
+/* Some typedefs to help swig along */
 
-#ifdef HAVE_FSTAT
-#undef HAVE_FSTAT
-#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
- * argument. Note that some gcc 2.x versions don't handle this
- * properly **/
-#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
-#else
-#define PRINTF_ATTRIBUTE(a1, a2)
-#endif
-
-/* Include ldb headers */
-
-/* Treat a uint8_t as an unsigned character */
 typedef unsigned char uint8_t;
 typedef unsigned long long uint64_t;
 typedef long long int64_t;
 
+/* Include headers */
+
 #include lib/ldb/include/ldb.h
 #include lib/talloc/talloc.h
 
 %}
 
-/* The ldb functions will crash if a NULL ldb is passed */
+%include carrays.i
+%include exception.i
 
-%include exception.i
+/* 
+ * Wrap struct ldb_context
+ */
 
+/* The ldb functions will crash if a NULL ldb context is passed so
+   catch this before it happens. */
+
 %typemap(check) struct ldb_context* {
if ($1 == NULL)
SWIG_exception(SWIG_ValueError, 
ldb context must be non-NULL);
 }
 
+/* 
+ * Wrap TALLOC_CTX
+ */
+
 /* Use talloc_init() to create a parameter to pass to ldb_init().  Don't
forget to free it using talloc_free() afterwards. */
 
 TALLOC_CTX *talloc_init(char *name);
 int talloc_free(TALLOC_CTX *ptr);
 
-/* In and out typemaps for struct ldb_val.  This is converted to and from
-   the Python string datatype. */
+/*
+ * Wrap struct ldb_val
+ */
 
 %typemap(in) struct ldb_val {
if (!PyString_Check($input)) {
@@ -99,7 +94,9 @@
LDB_SCOPE_ONELEVEL=1,
LDB_SCOPE_SUBTREE=2};
 
-/* Typemap for passing a struct ldb_result by reference */
+/*
+ * Wrap struct ldb_result
+ */
 
 %typemap(in, numinputs=0) struct ldb_result **OUT (struct ldb_result 
*temp_ldb_result) {
$1 = temp_ldb_result;
@@ -119,10 +116,20 @@
 
 %types(struct ldb_result *);
 
+/*
+ * Wrap struct ldb_dn
+ */
+
 %typemap(out) struct ldb_dn * {
$result = PyString_FromString(ldb_dn_linearize($1, $1));
 }
 
+/*
+ * Wrap struct ldb_message_element
+ */
+
+%array_functions(struct ldb_val, ldb_val_array);
+
 struct ldb_message_element {
unsigned int flags;
const char *name;
@@ -130,6 +137,12 @@
struct ldb_val *values;
 };
 
+/*
+ * Wrap struct ldb_message
+ */
+
+%array_functions(struct ldb_message_element, ldb_message_element_array);
+
 struct ldb_message {
struct ldb_dn *dn;
unsigned int num_elements;
@@ -137,7 +150,9 @@
void *private_data; /* private to the backend */
 };
 
-/* Wrap ldb functions */
+/*
+ * Wrap ldb functions 
+ */
 
 %rename ldb_init init;
 struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);



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

2006-04-03 Thread tpot
Author: tpot
Date: 2006-04-03 22:04:33 + (Mon, 03 Apr 2006)
New Revision: 14897

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

Log:
Do more error checking of tdb function returns and raise IOError or 
KeyError exceptions as appropriate.

Add a close() function to the wrapper as we can't rely on the 
Python garbage collector destroying the object and closing the tdb file 
at any particular time.

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


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/Tdb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/Tdb.py 2006-04-03 19:14:12 UTC 
(rev 14896)
+++ branches/SAMBA_4_0/source/scripting/swig/Tdb.py 2006-04-03 22:04:33 UTC 
(rev 14897)
@@ -39,25 +39,33 @@
 def __init__(self, name, hash_size = 0, flags = tdb.TDB_DEFAULT,
  open_flags = os.O_RDWR | os.O_CREAT, mode = 0600):
 self.tdb = tdb.open(name, hash_size, flags, open_flags, mode)
-
+if self.tdb is None:
+raise IOError, tdb.errorstr(self.tdb)
+
 def __del__(self):
-if hasattr(self, 'tdb'):
-tdb.close(self.tdb)
+self.close()
 
+def close(self):
+if hasattr(self, 'tdb') and self.tdb is not None:
+if tdb.close(self.tdb) == -1:
+raise IOError, tdb.errorstr(self.tdb)
+self.tdb = None
+
 # Random access to keys, values
 
 def __getitem__(self, key):
 result = tdb.fetch(self.tdb, key)
 if result is None:
-raise KeyError, key
+raise KeyError, '%s: %s' % (key, tdb.errorstr(self.tdb))
 return result
 
 def __setitem__(self, key, item):
-tdb.store(self.tdb, key, item)
+if tdb.store(self.tdb, key, item) == -1:
+raise IOError, tdb.errorstr(self.tdb)
 
 def __delitem__(self, key):
 if not tdb.exists(self.tdb, key):
-raise KeyError, key
+raise KeyError, '%s: %s' % (key, tdb.errorstr(self.tdb))
 tdb.delete(self.tdb, key)
 
 def has_key(self, key):



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

2006-04-03 Thread tpot
Author: tpot
Date: 2006-04-04 01:22:38 + (Tue, 04 Apr 2006)
New Revision: 14901

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

Log:
More work on ldb swig interface.  Wrap some more functions.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/Ldb.py
   branches/SAMBA_4_0/source/scripting/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/Ldb.py 2006-04-04 01:07:28 UTC 
(rev 14900)
+++ branches/SAMBA_4_0/source/scripting/swig/Ldb.py 2006-04-04 01:22:38 UTC 
(rev 14901)
@@ -22,7 +22,49 @@
 
 import ldb
 
+class LdbElement:
+A class representing a ldb element as an array of values.
+
+def __init__(self, elt):
+self.name = elt.name
+self.flags = elt.flags
+self.values = [ldb.ldb_val_array_getitem(elt.values, x)
+   for x in range(elt.num_values)]
+
+def __repr__(self):
+return '%s(name=%s) instance at 0x%x' % (self.__class__.__name__,
+  `self.name`, id(self))
+
+def __len__(self):
+return self.values.len()
+
+def __getitem__(self, key):
+return self.values[key]
+
+class LdbMessage:
+A class representing a ldb message as a dict of ldb elements.
+
+def __init__(self, msg):
+self.dn = msg.dn
+self.private_data = msg.private_data
+eltlist = \
+[LdbElement(ldb.ldb_message_element_array_getitem(msg.elements, x))
+ for x in range(msg.num_elements)]
+self.elements = \
+dict([(x.name, x) for x in eltlist])
+
+def __repr__(self):
+return '%s(dn=%s) instance at 0x%x' % (self.__class__.__name__,
+   `self.dn`, id(self))
+
+def __getitem__(self, key):
+return self.elements[key]
+
+def keys(self):
+return self.elements.keys()
+
 class Ldb:
+A class representing a binding to a ldb file.
 
 def __init__(self):
 self.mem_ctx = ldb.talloc_init('python ldb')
@@ -35,5 +77,20 @@
 ldb.connect(self.ldb_ctx, url, flags, None)
 
 def search(self, expression):
-return ldb.search(self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
-  expression, None);
+
+result = ldb.search(self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
+expression, None);
+
+return [LdbMessage(ldb.ldb_message_ptr_array_getitem(result.msgs, ndx))
+for ndx in range(result.count)]
+
+def delete(self, dn):
+if ldb.delete(self.ldb_ctx, dn) != 0:
+raise IOError, ldb.errstring(self.ldb_ctx)
+
+def rename(self, olddn, newdn):
+if ldb.rename(self.ldb_ctx, olddn, newdn) != 0:
+raise IOError, ldb.errstring(self.ldb_ctx)
+
+def add(self, msg):
+ldb.add(self.ldb_ctx, msg)

Modified: branches/SAMBA_4_0/source/scripting/swig/ldb.i
===
--- branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-04 01:07:28 UTC 
(rev 14900)
+++ branches/SAMBA_4_0/source/scripting/swig/ldb.i  2006-04-04 01:22:38 UTC 
(rev 14901)
@@ -103,15 +103,10 @@
 }
 
 %typemap(argout) struct ldb_result ** {
-   unsigned int i;
 
-   /* XXX: Handle resultobj by throwing an exception if required */
+   /* XXX: Check result for error and throw exception if necessary */
 
-   resultobj = PyList_New((*$1)-count);
-
-   for (i = 0; i  (*$1)-count; i++) {
-   PyList_SetItem(resultobj, i, SWIG_NewPointerObj((*$1)-msgs[i], 
SWIGTYPE_p_ldb_message, 0));
-   }
+   resultobj = SWIG_NewPointerObj(*$1, SWIGTYPE_p_ldb_result, 0);
 }  
 
 %types(struct ldb_result *);
@@ -120,6 +115,17 @@
  * Wrap struct ldb_dn
  */
 
+%typemap(in) struct ldb_dn * {
+   if ($input == Py_None) {
+   $1 = NULL;
+   } else if (!PyString_Check($input)) {
+   PyErr_SetString(PyExc_TypeError, string arg expected);
+   return NULL;
+   } else {
+   $1 = ldb_dn_explode(NULL, PyString_AsString($input));
+   }
+}
+
 %typemap(out) struct ldb_dn * {
$result = PyString_FromString(ldb_dn_linearize($1, $1));
 }
@@ -151,14 +157,39 @@
 };
 
 /*
+ * Wrap struct ldb_result
+ */
+
+%array_functions(struct ldb_message *, ldb_message_ptr_array);
+
+struct ldb_result {
+   unsigned int count;
+   struct ldb_message **msgs;
+   char **refs;
+   struct ldb_control **controls;
+};
+
+/*
  * Wrap ldb functions 
  */
 
 %rename ldb_init init;
 struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
 
+%rename ldb_errstring errstring;
+const char *ldb_errstring(struct ldb_context *ldb);
+
 %rename ldb_connect connect;
 int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, 
const char *options

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

2006-04-02 Thread tpot
Author: tpot
Date: 2006-04-03 00:13:47 + (Mon, 03 Apr 2006)
New Revision: 14870

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

Log:
Update to link with dynamic instead of static objects.

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


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/config.mk
===
--- branches/SAMBA_4_0/source/scripting/config.mk   2006-04-02 21:12:23 UTC 
(rev 14869)
+++ branches/SAMBA_4_0/source/scripting/config.mk   2006-04-03 00:13:47 UTC 
(rev 14870)
@@ -27,17 +27,20 @@
 scripting/swig/tdb_wrap.c: scripting/swig/tdb.i
swig -python scripting/swig/tdb.i
 
-scripting/swig/_tdb.so: scripting/swig/tdb_wrap.o 
bin/subsystems/LIBRARY_LIBTDB.o
-   $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_tdb.so \
-   scripting/swig/tdb_wrap.o \
-   bin/subsystems/LIBRARY_LIBTDB.o
+scripting/swig/_tdb.so: scripting/swig/tdb_wrap.o
+   $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_tdb.so $(LOCAL_LINK_FLAGS) \
+   bin/libtdb.$(SHLIBEXT).0.0.1 \
+   scripting/swig/tdb_wrap.o
 
 scripting/swig/ldb_wrap.c: scripting/swig/ldb.i
swig -python scripting/swig/ldb.i
 
-scripting/swig/_ldb.so: scripting/swig/ldb_wrap.o 
$(LIBRARY_swig_ldb_DEPEND_LIST)
-   $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_ldb.so 
scripting/swig/ldb_wrap.o \
-   $(LIBRARY_swig_ldb_LINK_LIST) $(LIBRARY_swig_ldb_LINK_FLAGS)
+scripting/swig/_ldb.so: scripting/swig/ldb_wrap.o $(LIBRARY_DYNCONFIG_OBJ_LIST)
+   $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_ldb.so $(LOCAL_LINK_FLAGS) \
+   $(LIBRARY_DYNCONFIG_LINK_LIST) \
+   bin/libtdb.$(SHLIBEXT).0.0.1 \
+   bin/libldb.$(SHLIBEXT).0.0.1 \
+   scripting/swig/ldb_wrap.o
 
 SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i 
librpc/gen_ndr/spoolss.i
 



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

2006-04-02 Thread tpot
Author: tpot
Date: 2006-04-03 00:20:04 + (Mon, 03 Apr 2006)
New Revision: 14871

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

Log:
We don't need to import UserDict anymore.

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


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/Tdb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/Tdb.py 2006-04-03 00:13:47 UTC 
(rev 14870)
+++ branches/SAMBA_4_0/source/scripting/swig/Tdb.py 2006-04-03 00:20:04 UTC 
(rev 14871)
@@ -20,7 +20,7 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 
-import tdb, os, UserDict
+import tdb, os
 
 # Open flags
 



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

2006-04-02 Thread tpot
Author: tpot
Date: 2006-04-03 00:23:22 + (Mon, 03 Apr 2006)
New Revision: 14872

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

Log:
Add tdbdump to svn:ignore.

Modified:
   branches/SAMBA_4_0/source/lib/tdb/bin/


Changeset:

Property changes on: branches/SAMBA_4_0/source/lib/tdb/bin
___
Name: svn:ignore
   - .sconsign
tdbtool
tdbtest
tdbtorture

   + .sconsign
tdbtool
tdbtest
tdbtorture
tdbdump




svn commit: samba r14873 - in branches/SAMBA_4_0/source: script/tests scripting/swig scripting/swig/torture

2006-04-02 Thread tpot
Author: tpot
Date: 2006-04-03 00:24:59 + (Mon, 03 Apr 2006)
New Revision: 14873

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

Log:
Add skeleton swig ldb interface.

Added:
   branches/SAMBA_4_0/source/scripting/swig/Ldb.py
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py
Modified:
   branches/SAMBA_4_0/source/script/tests/test_swig.sh
   branches/SAMBA_4_0/source/scripting/swig/


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_swig.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-04-03 00:23:22 UTC 
(rev 14872)
+++ branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-04-03 00:24:59 UTC 
(rev 14873)
@@ -15,5 +15,6 @@
 export PYTHONPATH=scripting/swig:$PYTHONPATH
 
 scripting/swig/torture/torture_tdb.py || failed=`expr $failed + 1`
+scripting/swig/torture/torture_ldb.py || failed=`expr $failed + 1`
 
 testok $0 $failed


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

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


Added: branches/SAMBA_4_0/source/scripting/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/Ldb.py 2006-04-03 00:23:22 UTC 
(rev 14872)
+++ branches/SAMBA_4_0/source/scripting/swig/Ldb.py 2006-04-03 00:24:59 UTC 
(rev 14873)
@@ -0,0 +1,26 @@
+Provide a more Pythonic and object-oriented interface to ldb.
+
+#
+# Swig interface to Samba
+#
+# Copyright (C) Tim Potter 2006
+#
+# 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.
+#
+
+import ldb
+
+class Ldb:
+pass

Added: branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py 
2006-04-03 00:23:22 UTC (rev 14872)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py 
2006-04-03 00:24:59 UTC (rev 14873)
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+
+import Ldb
+
+def fail(msg):
+print 'FAILED:', msg
+sys.exit(1)
+


Property changes on: 
branches/SAMBA_4_0/source/scripting/swig/torture/torture_ldb.py
___
Name: svn:executable
   + *



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

2006-04-01 Thread tpot
Author: tpot
Date: 2006-04-02 01:56:22 + (Sun, 02 Apr 2006)
New Revision: 14854

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

Log:
Finish off swig wrapper and torture tests for tdb.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/Tdb.py
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/Tdb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/Tdb.py 2006-04-01 19:17:07 UTC 
(rev 14853)
+++ branches/SAMBA_4_0/source/scripting/swig/Tdb.py 2006-04-02 01:56:22 UTC 
(rev 14854)
@@ -22,24 +22,86 @@
 
 import tdb, os, UserDict
 
+# Open flags
+
+DEFAULT= tdb.TDB_DEFAULT
+CLEAR_IF_FIRST = tdb.TDB_CLEAR_IF_FIRST
+INTERNAL   = tdb.TDB_INTERNAL
+NOLOCK = tdb.TDB_NOLOCK
+NOMMAP = tdb.TDB_NOMMAP
+
+# Class representing a TDB file
+
 class Tdb:
 
-def __init__(self, name, hash_size = 0, tdb_flags = tdb.TDB_DEFAULT,
+# Create and destroy Tdb objects
+
+def __init__(self, name, hash_size = 0, flags = tdb.TDB_DEFAULT,
  open_flags = os.O_RDWR | os.O_CREAT, mode = 0600):
+self.tdb = tdb.open(name, hash_size, flags, open_flags, mode)
 
-self.tdb = tdb.open(name, hash_size, tdb_flags, open_flags, mode)
-
 def __del__(self):
-tdb.close(self.tdb)
+if hasattr(self, 'tdb'):
+tdb.close(self.tdb)
 
+# Random access to keys, values
+
 def __getitem__(self, key):
-pass
+result = tdb.fetch(self.tdb, key)
+if result is None:
+raise KeyError, key
+return result
 
 def __setitem__(self, key, item):
-pass
+tdb.store(self.tdb, key, item)
 
 def __delitem__(self, key):
-pass
+if not tdb.exists(self.tdb, key):
+raise KeyError, key
+tdb.delete(self.tdb, key)
 
+def has_key(self, key):
+return tdb.exists(self.tdb, key)
+
+# Tdb iterator
+
+class TdbIterator:
+def __init__(self, tdb):
+self.tdb = tdb
+self.key = None
+
+def __iter__(self):
+return self
+
+def next(self):
+if self.key is None:
+self.key = tdb.firstkey(self.tdb)
+if self.key is None:
+raise StopIteration
+return self.key
+else:
+self.key = tdb.nextkey(self.tdb, self.key)
+if self.key is None:
+raise StopIteration
+return self.key
+
+def __iter__(self):
+return Tdb.TdbIterator(self.tdb)
+
+# Implement other dict functions using TdbIterator
+
 def keys(self):
-pass
+return [k for k in iter(self)]
+
+def values(self):
+return [self[k] for k in iter(self)]
+
+def items(self):
+return [(k, self[k]) for k in iter(self)]
+
+def __len__(self):
+return len(self.keys())
+
+def clear(self):
+for k in iter(self):
+del(self[k])

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py 
2006-04-01 19:17:07 UTC (rev 14853)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py 
2006-04-02 01:56:22 UTC (rev 14854)
@@ -1,6 +1,82 @@
 #!/usr/bin/python
 
-import Tdb, os
+import sys, os
+import Tdb
 
-t = Tdb.Tdb('foo.tdb')
-os.unlink('foo.tdb')
+def fail(msg):
+print 'FAILED:', msg
+sys.exit(1)
+
+tdb_file = '/tmp/torture_tdb.tdb'
+
+# Create temporary tdb file
+
+t = Tdb.Tdb(tdb_file, flags = Tdb.CLEAR_IF_FIRST)
+
+# Check non-existent key throws KeyError exception
+
+try:
+t['__none__']
+except KeyError:
+pass
+else:
+fail('non-existent key did not throw KeyError')
+
+# Check storing key
+
+t['bar'] = '1234'
+if t['bar'] != '1234':
+fail('store key failed')
+
+# Check key exists
+
+if not t.has_key('bar'):
+fail('has_key() failed for existing key')
+
+if t.has_key('__none__'):
+fail('has_key() succeeded for non-existent key')
+
+# Delete key
+
+try:
+del(t['__none__'])
+except KeyError:
+pass
+else:
+fail('delete of non-existent key did not throw KeyError')
+
+del t['bar']
+if t.has_key('bar'):
+fail('delete of existing key did not delete key')
+
+# Clear all keys
+
+t.clear()
+if len(t) != 0:
+fail('clear failed to remove all keys')
+
+# Other dict functions
+
+t['a'] = '1'
+t['ab'] = '12'
+t['abc'] = '123'
+
+if len(t) != 3:
+fail('len method produced wrong value')
+
+keys = t.keys()
+values = t.values()
+items = t.items()
+
+if set(keys) != set(['a', 'ab', 'abc']):
+fail('keys method produced wrong values')
+
+if set(values) != set(['1', '12', '123']):
+fail('values method produced wrong values')
+
+if set

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

2006-03-30 Thread tpot
Author: tpot
Date: 2006-03-31 03:05:39 + (Fri, 31 Mar 2006)
New Revision: 14836

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

Log:
Keep constants in the right order, and line things up nicely.

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


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/dcerpc.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/dcerpc.idl 2006-03-31 03:02:39 UTC 
(rev 14835)
+++ branches/SAMBA_4_0/source/librpc/idl/dcerpc.idl 2006-03-31 03:05:39 UTC 
(rev 14836)
@@ -57,10 +57,10 @@
[flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier;
} dcerpc_request;
 
-   const int DCERPC_BIND_PROVIDER_REJECT = 2;
-   const int DCERPC_BIND_REASON_ASYNTAX  = 1;
+   const int DCERPC_BIND_REASON_ASYNTAX = 1;
+   const int DCERPC_BIND_PROVIDER_REJECT= 2;
const int DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED = 4;
-   const int DCERPC_BIND_REASON_INVALID_AUTH_TYPE = 8;
+   const int DCERPC_BIND_REASON_INVALID_AUTH_TYPE   = 8;
 
typedef struct {
uint16 result;



svn commit: samba r14798 - in branches/SAMBA_4_0/source: . script/tests scripting scripting/swig/torture

2006-03-29 Thread tpot
Author: tpot
Date: 2006-03-30 04:39:37 + (Thu, 30 Mar 2006)
New Revision: 14798

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

Log:
Get swig building again (by commenting out dcerpc stuff for now).

Add the start of a test framework for swigged functionality.

Added:
   branches/SAMBA_4_0/source/script/tests/test_swig.sh
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py
Modified:
   branches/SAMBA_4_0/source/main.mk
   branches/SAMBA_4_0/source/scripting/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/main.mk
===
--- branches/SAMBA_4_0/source/main.mk   2006-03-30 03:51:49 UTC (rev 14797)
+++ branches/SAMBA_4_0/source/main.mk   2006-03-30 04:39:37 UTC (rev 14798)
@@ -304,6 +304,9 @@
 unused_macros:
./script/find_unused_macros.pl `find . -name *.[ch]` | sort
 
+swigtest: swig
+   ./script/tests/test_swig.sh
+
 ###
 # File types
 ###

Added: branches/SAMBA_4_0/source/script/tests/test_swig.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-03-30 03:51:49 UTC 
(rev 14797)
+++ branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-03-30 04:39:37 UTC 
(rev 14798)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+if [ $# -ne 0 ]; then
+cat EOF
+Usage: test_swig.sh
+EOF
+exit 1;
+fi
+
+incdir=`dirname $0`
+. $incdir/test_functions.sh
+
+failed=0
+
+export PYTHONPATH=scripting/swig:$PYTHONPATh
+
+scripting/swig/torture/torture_tdb.py || failed=`expr $failed + 1`
+
+testok $0 $failed


Property changes on: branches/SAMBA_4_0/source/script/tests/test_swig.sh
___
Name: svn:executable
   + *

Modified: branches/SAMBA_4_0/source/scripting/config.mk
===
--- branches/SAMBA_4_0/source/scripting/config.mk   2006-03-30 03:51:49 UTC 
(rev 14797)
+++ branches/SAMBA_4_0/source/scripting/config.mk   2006-03-30 04:39:37 UTC 
(rev 14798)
@@ -22,14 +22,15 @@
 ###
 
 # Swig extensions
-swig: scripting/swig/_tdb.so scripting/swig/_ldb.so scripting/swig/_dcerpc.so
+swig: scripting/swig/_tdb.so scripting/swig/_ldb.so
 
 scripting/swig/tdb_wrap.c: scripting/swig/tdb.i
swig -python scripting/swig/tdb.i
 
-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_LINK_LIST) $(LIBRARY_swig_tdb_LINK_FLAGS)
+scripting/swig/_tdb.so: scripting/swig/tdb_wrap.o 
bin/subsystems/LIBRARY_LIBTDB.o
+   $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_tdb.so \
+   scripting/swig/tdb_wrap.o \
+   bin/subsystems/LIBRARY_LIBTDB.o
 
 scripting/swig/ldb_wrap.c: scripting/swig/ldb.i
swig -python scripting/swig/ldb.i

Added: branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py 
2006-03-30 03:51:49 UTC (rev 14797)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py 
2006-03-30 04:39:37 UTC (rev 14798)
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+
+import sys, tdb
+from os import *
+
+t = tdb.open('foo.tdb', 0, 0, O_RDWR | O_CREAT, 0600)
+tdb.close(t)
+
+unlink('foo.tdb')
+


Property changes on: 
branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py
___
Name: svn:executable
   + *



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

2006-03-29 Thread tpot
Author: tpot
Date: 2006-03-30 05:24:37 + (Thu, 30 Mar 2006)
New Revision: 14801

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

Log:
Move swig testing makefile fragment into swig's config.mk and out of 
main.mk

Modified:
   branches/SAMBA_4_0/source/main.mk
   branches/SAMBA_4_0/source/scripting/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/main.mk
===
--- branches/SAMBA_4_0/source/main.mk   2006-03-30 04:55:03 UTC (rev 14800)
+++ branches/SAMBA_4_0/source/main.mk   2006-03-30 05:24:37 UTC (rev 14801)
@@ -304,9 +304,6 @@
 unused_macros:
./script/find_unused_macros.pl `find . -name *.[ch]` | sort
 
-swigtest: swig
-   ./script/tests/test_swig.sh
-
 ###
 # File types
 ###

Modified: branches/SAMBA_4_0/source/scripting/config.mk
===
--- branches/SAMBA_4_0/source/scripting/config.mk   2006-03-30 04:55:03 UTC 
(rev 14800)
+++ branches/SAMBA_4_0/source/scripting/config.mk   2006-03-30 05:24:37 UTC 
(rev 14801)
@@ -49,3 +49,8 @@
 
 swig_clean:
-rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc 
scripting/swig/tdb.py scripting/swig/tdb_wrap.c scripting/swig/tdb_wrap.o
+
+# Swig testing
+
+swigtest: swig
+   ./script/tests/test_swig.sh



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

2006-03-29 Thread tpot
Author: tpot
Date: 2006-03-30 05:36:09 + (Thu, 30 Mar 2006)
New Revision: 14802

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

Log:
Fix typo.

Modified:
   branches/SAMBA_4_0/source/script/tests/test_swig.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_swig.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-03-30 05:24:37 UTC 
(rev 14801)
+++ branches/SAMBA_4_0/source/script/tests/test_swig.sh 2006-03-30 05:36:09 UTC 
(rev 14802)
@@ -12,7 +12,7 @@
 
 failed=0
 
-export PYTHONPATH=scripting/swig:$PYTHONPATh
+export PYTHONPATH=scripting/swig:$PYTHONPATH
 
 scripting/swig/torture/torture_tdb.py || failed=`expr $failed + 1`
 



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

2006-03-29 Thread tpot
Author: tpot
Date: 2006-03-30 05:50:09 + (Thu, 30 Mar 2006)
New Revision: 14804

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

Log:
Start writing a more Pythonic tdb module.

Added:
   branches/SAMBA_4_0/source/scripting/swig/Tdb.py
Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py


Changeset:
Added: branches/SAMBA_4_0/source/scripting/swig/Tdb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/Tdb.py 2006-03-30 05:45:43 UTC 
(rev 14803)
+++ branches/SAMBA_4_0/source/scripting/swig/Tdb.py 2006-03-30 05:50:09 UTC 
(rev 14804)
@@ -0,0 +1,45 @@
+Provide a more Pythonic and object-oriented interface to tdb.
+
+#
+# Swig interface to Samba
+#
+# Copyright (C) Tim Potter 2006
+#
+# 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.
+#
+
+import tdb, os, UserDict
+
+class Tdb:
+
+def __init__(self, name, hash_size = 0, tdb_flags = tdb.TDB_DEFAULT,
+ open_flags = os.O_RDWR | os.O_CREAT, mode = 0600):
+
+self.tdb = tdb.open(name, hash_size, tdb_flags, open_flags, mode)
+
+def __del__(self):
+tdb.close(self.tdb)
+
+def __getitem__(self, key):
+pass
+
+def __setitem__(self, key, item):
+pass
+
+def __delitem__(self, key):
+pass
+
+def keys(self):
+pass

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py
===
--- branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py 
2006-03-30 05:45:43 UTC (rev 14803)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/torture_tdb.py 
2006-03-30 05:50:09 UTC (rev 14804)
@@ -1,10 +1,6 @@
 #!/usr/bin/python
 
-import sys, tdb
-from os import *
+import Tdb, os
 
-t = tdb.open('foo.tdb', 0, 0, O_RDWR | O_CREAT, 0600)
-tdb.close(t)
-
-unlink('foo.tdb')
-
+t = Tdb.Tdb('foo.tdb')
+os.unlink('foo.tdb')



svn commit: samba r13702 - in trunk/source/passdb: .

2006-02-26 Thread tpot
Author: tpot
Date: 2006-02-27 01:57:35 + (Mon, 27 Feb 2006)
New Revision: 13702

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

Log:
Slightly smaller version of pdb_get_methods() patch.  Turns out that
callers to initialize_password_db() use the reload parameter so this
has turned in to a smaller cleanup than I thought.

Modified:
   trunk/source/passdb/pdb_interface.c


Changeset:
Modified: trunk/source/passdb/pdb_interface.c
===
--- trunk/source/passdb/pdb_interface.c 2006-02-27 01:03:21 UTC (rev 13701)
+++ trunk/source/passdb/pdb_interface.c 2006-02-27 01:57:35 UTC (rev 13702)
@@ -193,7 +193,7 @@
  Return an already initialised pdn_methods structure
 ***/
 
-static struct pdb_methods *pdb_get_methods( BOOL reload ) 
+static struct pdb_methods *pdb_get_methods_reload( BOOL reload ) 
 {
static struct pdb_methods *pdb = NULL;
 
@@ -213,13 +213,18 @@
return pdb;
 }
 
+static struct pdb_methods *pdb_get_methods()
+{
+   return pdb_get_methods_reload(False);
+}
+
 /**
  Backward compatibility functions for the original passdb interface
 ***/
 
 BOOL pdb_setsampwent(BOOL update, uint16 acb_mask) 
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return False;
@@ -230,7 +235,7 @@
 
 void pdb_endsampwent(void) 
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return;
@@ -241,7 +246,7 @@
 
 BOOL pdb_getsampwent(struct samu *user) 
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return False;
@@ -258,7 +263,7 @@
 
 BOOL pdb_getsampwnam(struct samu *sam_acct, const char *username) 
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return False;
@@ -311,7 +316,7 @@
struct pdb_methods *pdb;
uint32 rid;
 
-   if ( !(pdb = pdb_get_methods(False)) ) {
+   if ( !(pdb = pdb_get_methods()) ) {
return False;
}
 
@@ -399,7 +404,7 @@
 NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32 flags,
 uint32 *rid)
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return NT_STATUS_UNSUCCESSFUL;
@@ -452,7 +457,7 @@
 
 NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct)
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return NT_STATUS_UNSUCCESSFUL;
@@ -463,7 +468,7 @@
 
 NTSTATUS pdb_add_sam_account(struct samu *sam_acct) 
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return NT_STATUS_UNSUCCESSFUL;
@@ -474,7 +479,7 @@
 
 NTSTATUS pdb_update_sam_account(struct samu *sam_acct) 
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return NT_STATUS_UNSUCCESSFUL;
@@ -490,7 +495,7 @@
 
 NTSTATUS pdb_delete_sam_account(struct samu *sam_acct) 
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return NT_STATUS_UNSUCCESSFUL;
@@ -506,7 +511,7 @@
 
 NTSTATUS pdb_rename_sam_account(struct samu *oldname, const char *newname)
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return NT_STATUS_NOT_IMPLEMENTED;
@@ -522,7 +527,7 @@
 
 NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, BOOL success)
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return NT_STATUS_NOT_IMPLEMENTED;
@@ -533,7 +538,7 @@
 
 BOOL pdb_getgrsid(GROUP_MAP *map, DOM_SID sid)
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return False;
@@ -544,7 +549,7 @@
 
 BOOL pdb_getgrgid(GROUP_MAP *map, gid_t gid)
 {
-   struct pdb_methods *pdb = pdb_get_methods(False);
+   struct pdb_methods *pdb = pdb_get_methods();
 
if ( !pdb ) {
return False;
@@ -555,7 +560,7 @@
 
 BOOL pdb_getgrnam(GROUP_MAP *map

svn commit: samba r13706 - branches/SAMBA_3_0/source/auth trunk/source/auth

2006-02-26 Thread tpot
Author: tpot
Date: 2006-02-27 02:44:41 + (Mon, 27 Feb 2006)
New Revision: 13706

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

Log:
Fix typo in typo fix.  (-:

Modified:
   branches/SAMBA_3_0/source/auth/auth_util.c
   trunk/source/auth/auth_util.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===
--- branches/SAMBA_3_0/source/auth/auth_util.c  2006-02-27 02:14:26 UTC (rev 
13705)
+++ branches/SAMBA_3_0/source/auth/auth_util.c  2006-02-27 02:44:41 UTC (rev 
13706)
@@ -1527,7 +1527,7 @@
}

/* if we still don't have a valid unix account check for 
- 'map to guest = bad user' */
+ 'map to guest = bad uid' */
  
if (!NT_STATUS_IS_OK(nt_status)) {
TALLOC_FREE( sam_account );

Modified: trunk/source/auth/auth_util.c
===
--- trunk/source/auth/auth_util.c   2006-02-27 02:14:26 UTC (rev 13705)
+++ trunk/source/auth/auth_util.c   2006-02-27 02:44:41 UTC (rev 13706)
@@ -1527,7 +1527,7 @@
}

/* if we still don't have a valid unix account check for 
- 'map to guest = bad user' */
+ 'map to guest = bad uid' */
  
if (!NT_STATUS_IS_OK(nt_status)) {
TALLOC_FREE( sam_account );



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

2006-02-22 Thread tpot
Author: tpot
Date: 2006-02-23 01:58:27 + (Thu, 23 Feb 2006)
New Revision: 13648

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

Log:
Duh.

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


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_groupmap.c
===
--- branches/SAMBA_3_0/source/utils/net_groupmap.c  2006-02-23 01:53:26 UTC 
(rev 13647)
+++ branches/SAMBA_3_0/source/utils/net_groupmap.c  2006-02-23 01:58:27 UTC 
(rev 13648)
@@ -818,7 +818,7 @@
 
/* we shouldn't have silly checks like this */
if (getuid() != 0) {
-   d_fprintf(stderr, You must be root to edit group 
mappings.\nExiting...\n);
+   d_fprintf(stderr, You must be root to edit group mappings.\n);
return -1;
}


Modified: trunk/source/utils/net_groupmap.c
===
--- trunk/source/utils/net_groupmap.c   2006-02-23 01:53:26 UTC (rev 13647)
+++ trunk/source/utils/net_groupmap.c   2006-02-23 01:58:27 UTC (rev 13648)
@@ -818,7 +818,7 @@
 
/* we shouldn't have silly checks like this */
if (getuid() != 0) {
-   d_fprintf(stderr, You must be root to edit group 
mappings.\nExiting...\n);
+   d_fprintf(stderr, You must be root to edit group mappings.\n);
return -1;
}




svn commit: samba r13612 - branches/SAMBA_3_0/source/client trunk/source/client

2006-02-21 Thread tpot
Author: tpot
Date: 2006-02-22 03:12:00 + (Wed, 22 Feb 2006)
New Revision: 13612

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

Log:
#define NO_SYSLOG is dead as a doornail.

Modified:
   branches/SAMBA_3_0/source/client/smbctool.c
   trunk/source/client/smbctool.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/smbctool.c
===
--- branches/SAMBA_3_0/source/client/smbctool.c 2006-02-22 01:31:49 UTC (rev 
13611)
+++ branches/SAMBA_3_0/source/client/smbctool.c 2006-02-22 03:12:00 UTC (rev 
13612)
@@ -22,8 +22,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#define NO_SYSLOG
-
 #include includes.h
 #include libsmbclient.h
 #include client/client_proto.h

Modified: trunk/source/client/smbctool.c
===
--- trunk/source/client/smbctool.c  2006-02-22 01:31:49 UTC (rev 13611)
+++ trunk/source/client/smbctool.c  2006-02-22 03:12:00 UTC (rev 13612)
@@ -22,8 +22,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#define NO_SYSLOG
-
 #include includes.h
 #include libsmbclient.h
 #include client/client_proto.h



svn commit: samba-docs r925 - in trunk/smbdotconf/printing: .

2006-02-20 Thread tpot
Author: tpot
Date: 2006-02-20 22:49:51 + (Mon, 20 Feb 2006)
New Revision: 925

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

Log:
Although uneffected is probably a word, it's a bit awkward.

Modified:
   trunk/smbdotconf/printing/disablespoolss.xml


Changeset:
Modified: trunk/smbdotconf/printing/disablespoolss.xml
===
--- trunk/smbdotconf/printing/disablespoolss.xml2006-02-20 03:09:02 UTC 
(rev 924)
+++ trunk/smbdotconf/printing/disablespoolss.xml2006-02-20 22:49:51 UTC 
(rev 925)
@@ -7,7 +7,7 @@
 paraEnabling this parameter will disable Samba's support
 for the SPOOLSS set of MS-RPC's and will yield identical behavior
 as Samba 2.0.x.  Windows NT/2000 clients will downgrade to using
-Lanman style printing commands. Windows 9x/ME will be uneffected by
+Lanman style printing commands. Windows 9x/ME will be unaffected by
 the parameter. However, this will also disable the ability to upload
 printer drivers to a Samba server via the Windows NT Add Printer
 Wizard or by using the NT printer properties dialog window.  It will



svn commit: samba-docs r924 - in trunk/smbdotconf/protocol: .

2006-02-19 Thread tpot
Author: tpot
Date: 2006-02-20 03:09:02 + (Mon, 20 Feb 2006)
New Revision: 924

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

Log:
Add a note that the 'nt acl support' parameter also maps POSIX ACLs as
well as Unix {user,group,other}/rwx permissions.

Modified:
   trunk/smbdotconf/protocol/ntaclsupport.xml


Changeset:
Modified: trunk/smbdotconf/protocol/ntaclsupport.xml
===
--- trunk/smbdotconf/protocol/ntaclsupport.xml  2006-02-17 03:06:24 UTC (rev 
923)
+++ trunk/smbdotconf/protocol/ntaclsupport.xml  2006-02-20 03:09:02 UTC (rev 
924)
@@ -6,9 +6,11 @@
 description
 paraThis boolean parameter controls whether 
citerefentryrefentrytitlesmbd/refentrytitle   

 manvolnum8/manvolnum/citerefentry will attempt to map 
-UNIX permissions into Windows NT access control lists.
-This parameter was formally a global parameter in releases
-prior to 2.2.2./para
+UNIX permissions into Windows NT access control lists.  The UNIX
+permissions considered are the the traditional UNIX owner and
+group permissions, as well as POSIX ACLs set on any files or
+directories.  This parameter was formally a global parameter in
+releases prior to 2.2.2./para
 /description
 
 value type=defaultyes/value



svn commit: samba r13463 - in branches/tmp/deryck-samba4-swat/source/torture: .

2006-02-11 Thread tpot
Author: tpot
Date: 2006-02-11 23:26:56 + (Sat, 11 Feb 2006)
New Revision: 13463

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

Log:
This directory disappeared in the merge somehow.

Added:
   branches/tmp/deryck-samba4-swat/source/torture/rap/


Changeset:
Copied: branches/tmp/deryck-samba4-swat/source/torture/rap (from rev 13462, 
branches/SAMBA_4_0/source/torture/rap)



svn commit: samba r13453 - in branches/tmp/deryck-samba4-swat/source: . auth auth/credentials auth/gensec auth/ntlmssp build/m4 build/smb_build dsdb/samdb dsdb/samdb/ldb_modules gtk/man heimdal/lib/gs

2006-02-10 Thread tpot
Author: tpot
Date: 2006-02-11 01:00:39 + (Sat, 11 Feb 2006)
New Revision: 13453

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

Log:
Merge up to r13451 from branches/SAMBA_4_0/source.

Added:
   branches/tmp/deryck-samba4-swat/source/gtk/man/gepdump.1.xml
   branches/tmp/deryck-samba4-swat/source/gtk/man/gwcrontab.1.xml
   branches/tmp/deryck-samba4-swat/source/ldap_server/devdocs/Index
   
branches/tmp/deryck-samba4-swat/source/ldap_server/devdocs/ldapext-ldapv3-vlv-04.txt
   branches/tmp/deryck-samba4-swat/source/ldap_server/devdocs/rfc3296.txt
   branches/tmp/deryck-samba4-swat/source/lib/ldb/Doxyfile
   branches/tmp/deryck-samba4-swat/source/lib/ldb/examples.dox
   branches/tmp/deryck-samba4-swat/source/lib/ldb/mainpage.dox
   branches/tmp/deryck-samba4-swat/source/lib/ldb/man/oLschema2ldif.1.xml
   branches/tmp/deryck-samba4-swat/source/lib/ldb/modules/asq.c
   branches/tmp/deryck-samba4-swat/source/libcli/finddcs.c
   branches/tmp/deryck-samba4-swat/source/libnet/libnet_site.c
   branches/tmp/deryck-samba4-swat/source/libnet/libnet_site.h
   branches/tmp/deryck-samba4-swat/source/ntvfs/ipc/ipc.h
   branches/tmp/deryck-samba4-swat/source/ntvfs/ipc/np_echo.c
   branches/tmp/deryck-samba4-swat/source/script/tests/test_cifsdd.sh
   branches/tmp/deryck-samba4-swat/source/script/tests/test_smbclient.sh
   branches/tmp/deryck-samba4-swat/source/script/tests/tests_client.sh
   branches/tmp/deryck-samba4-swat/source/smbd/smbd.8.xml
   branches/tmp/deryck-samba4-swat/source/torture/nbt/browse.c
   branches/tmp/deryck-samba4-swat/source/utils/man/getntacl.1.xml
Removed:
   branches/tmp/deryck-samba4-swat/source/auth/credentials/credentials_gensec.c
   branches/tmp/deryck-samba4-swat/source/gtk/man/gepdump.1.xml
   branches/tmp/deryck-samba4-swat/source/gtk/man/gwcrontab.1.xml
   branches/tmp/deryck-samba4-swat/source/lib/ldb/Doxyfile
   branches/tmp/deryck-samba4-swat/source/lib/ldb/examples.dox
   branches/tmp/deryck-samba4-swat/source/lib/ldb/mainpage.dox
   branches/tmp/deryck-samba4-swat/source/lib/ldb/man/oLschema2ldif.1.xml
   branches/tmp/deryck-samba4-swat/source/lib/ldb/modules/asq.c
   branches/tmp/deryck-samba4-swat/source/libcli/finddcs.c
   branches/tmp/deryck-samba4-swat/source/libnet/libnet_site.c
   branches/tmp/deryck-samba4-swat/source/libnet/libnet_site.h
   branches/tmp/deryck-samba4-swat/source/smbd/smbd.8.xml
   branches/tmp/deryck-samba4-swat/source/torture/rap/
   branches/tmp/deryck-samba4-swat/source/utils/man/getntacl.1.xml
Modified:
   branches/tmp/deryck-samba4-swat/source/auth/auth_sam.c
   branches/tmp/deryck-samba4-swat/source/auth/credentials/config.mk
   branches/tmp/deryck-samba4-swat/source/auth/credentials/credentials.c
   branches/tmp/deryck-samba4-swat/source/auth/credentials/credentials.h
   branches/tmp/deryck-samba4-swat/source/auth/credentials/credentials_ntlm.c
   branches/tmp/deryck-samba4-swat/source/auth/gensec/gensec.c
   branches/tmp/deryck-samba4-swat/source/auth/gensec/gensec.h
   branches/tmp/deryck-samba4-swat/source/auth/gensec/gensec_gssapi.c
   branches/tmp/deryck-samba4-swat/source/auth/gensec/gensec_krb5.c
   branches/tmp/deryck-samba4-swat/source/auth/gensec/schannel.c
   branches/tmp/deryck-samba4-swat/source/auth/gensec/schannel_sign.c
   branches/tmp/deryck-samba4-swat/source/auth/gensec/schannel_state.c
   branches/tmp/deryck-samba4-swat/source/auth/gensec/spnego.c
   branches/tmp/deryck-samba4-swat/source/auth/ntlmssp/ntlmssp.h
   branches/tmp/deryck-samba4-swat/source/auth/ntlmssp/ntlmssp_parse.c
   branches/tmp/deryck-samba4-swat/source/auth/ntlmssp/ntlmssp_server.c
   branches/tmp/deryck-samba4-swat/source/build/m4/check_cc.m4
   branches/tmp/deryck-samba4-swat/source/build/m4/check_path.m4
   branches/tmp/deryck-samba4-swat/source/build/m4/env.m4
   branches/tmp/deryck-samba4-swat/source/build/m4/rewrite.m4
   branches/tmp/deryck-samba4-swat/source/build/smb_build/makefile.pm
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/cracknames.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/kludge_acl.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/password_hash.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/rootdse.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/samldb.c
   branches/tmp/deryck-samba4-swat/source/dynconfig.c
   branches/tmp/deryck-samba4-swat/source/heimdal/lib/gssapi/init_sec_context.c
   branches/tmp/deryck-samba4-swat/source/include/debug.h
   branches/tmp/deryck-samba4-swat/source/include/dynconfig.h
   branches/tmp/deryck-samba4-swat/source/include/system/filesys.h
   branches/tmp/deryck-samba4-swat/source/kdc/hdb-ldb.c
   branches/tmp/deryck-samba4-swat/source/kdc/kdc.c
   branches/tmp/deryck-samba4-swat/source/ldap_server/ldap_bind.c
   branches/tmp/deryck-samba4-swat/source/lib/charset/charcnv.c
   branches/tmp/deryck-samba4-swat/source/lib/cmdline/popt_common.c
   branches/tmp/deryck-samba4-swat/source/lib

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

2006-02-05 Thread tpot
Author: tpot
Date: 2006-02-06 06:16:35 + (Mon, 06 Feb 2006)
New Revision: 13363

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

Log:
Honour the $(DESTDIR) Makefile variable when installing Python 
extensions.  Fix from Vladimir Lettiev.

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


Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===
--- branches/SAMBA_3_0/source/Makefile.in   2006-02-06 04:06:55 UTC (rev 
13362)
+++ branches/SAMBA_3_0/source/Makefile.in   2006-02-06 06:16:35 UTC (rev 
13363)
@@ -1470,7 +1470,7 @@
PYTHON_OBJS=$(PYTHON_PICOBJS) \
PYTHON_CFLAGS=$(CFLAGS) $(CPPFLAGS) \
LIBS=$(LDFLAGS) $(LIBS) \
-   $(PYTHON) python/setup.py install
+   $(PYTHON) python/setup.py install --root=$(DESTDIR)
 
 python_clean:
@-if test -n $(PYTHON); then $(PYTHON) python/setup.py clean; fi

Modified: trunk/source/Makefile.in
===
--- trunk/source/Makefile.in2006-02-06 04:06:55 UTC (rev 13362)
+++ trunk/source/Makefile.in2006-02-06 06:16:35 UTC (rev 13363)
@@ -1488,7 +1488,7 @@
PYTHON_OBJS=$(PYTHON_PICOBJS) \
PYTHON_CFLAGS=$(CFLAGS) $(CPPFLAGS) \
LIBS=$(LDFLAGS) $(LIBS) \
-   $(PYTHON) python/setup.py install
+   $(PYTHON) python/setup.py install --root=$(DESTDIR)
 
 python_clean:
@-if test -n $(PYTHON); then $(PYTHON) python/setup.py clean; fi



svn commit: samba r13254 - in branches/tmp/deryck-samba4-swat: .

2006-01-30 Thread tpot
Author: tpot
Date: 2006-01-31 04:44:13 + (Tue, 31 Jan 2006)
New Revision: 13254

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

Log:
Remove dummy file (heh) to generate test commit message.

Removed:
   branches/tmp/deryck-samba4-swat/10kcommit.txt


Changeset:
Deleted: branches/tmp/deryck-samba4-swat/10kcommit.txt
===
--- branches/tmp/deryck-samba4-swat/10kcommit.txt   2006-01-31 03:20:18 UTC 
(rev 13253)
+++ branches/tmp/deryck-samba4-swat/10kcommit.txt   2006-01-31 04:44:13 UTC 
(rev 13254)
@@ -1 +0,0 @@
-Firstage postage.



svn commit: samba r13171 - in branches/tmp/deryck-samba4-swat: . source source/auth/credentials source/auth/gensec source/auth/kerberos source/auth/ntlmssp source/build/m4 source/build/smb_build sourc

2006-01-26 Thread tpot
Author: tpot
Date: 2006-01-26 23:13:04 + (Thu, 26 Jan 2006)
New Revision: 13171

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

Log:
Merge to r13143.

Added:
   branches/tmp/deryck-samba4-swat/WHATSNEW.txt
   branches/tmp/deryck-samba4-swat/source/gtk/man/gepdump.1.xml
   branches/tmp/deryck-samba4-swat/source/gtk/man/gwcrontab.1.xml
   branches/tmp/deryck-samba4-swat/source/heimdal/lib/hdb/keytab.c
   branches/tmp/deryck-samba4-swat/source/lib/ldb/Doxyfile
   branches/tmp/deryck-samba4-swat/source/lib/ldb/examples.dox
   branches/tmp/deryck-samba4-swat/source/lib/ldb/examples/
   branches/tmp/deryck-samba4-swat/source/lib/ldb/mainpage.dox
   branches/tmp/deryck-samba4-swat/source/lib/ldb/man/oLschema2ldif.1.xml
   branches/tmp/deryck-samba4-swat/source/lib/ldb/modules/asq.c
   branches/tmp/deryck-samba4-swat/source/libcli/finddcs.c
   branches/tmp/deryck-samba4-swat/source/libnet/libnet_site.c
   branches/tmp/deryck-samba4-swat/source/libnet/libnet_site.h
   branches/tmp/deryck-samba4-swat/source/nbt_server/wins/wins_hook.c
   branches/tmp/deryck-samba4-swat/source/nbt_server/wins/wins_ldb.c
   branches/tmp/deryck-samba4-swat/source/smbd/smbd.8.xml
   branches/tmp/deryck-samba4-swat/source/utils/man/getntacl.1.xml
Removed:
   branches/tmp/deryck-samba4-swat/source/ldap_server/ldap_simple_ldb.c
   branches/tmp/deryck-samba4-swat/source/torture/msgtest.c
   branches/tmp/deryck-samba4-swat/source/winbind/wb_samba3_protocol.h
Modified:
   branches/tmp/deryck-samba4-swat/NEWS
   branches/tmp/deryck-samba4-swat/TODO
   branches/tmp/deryck-samba4-swat/howto.txt
   branches/tmp/deryck-samba4-swat/source/VERSION
   branches/tmp/deryck-samba4-swat/source/auth/credentials/credentials_files.c
   branches/tmp/deryck-samba4-swat/source/auth/credentials/credentials_krb5.c
   branches/tmp/deryck-samba4-swat/source/auth/gensec/gensec_gssapi.c
   branches/tmp/deryck-samba4-swat/source/auth/kerberos/kerberos-notes.txt
   branches/tmp/deryck-samba4-swat/source/auth/kerberos/kerberos_util.c
   branches/tmp/deryck-samba4-swat/source/auth/kerberos/krb5_init_context.c
   branches/tmp/deryck-samba4-swat/source/auth/ntlmssp/ntlmssp.c
   branches/tmp/deryck-samba4-swat/source/build/m4/check_cc.m4
   branches/tmp/deryck-samba4-swat/source/build/m4/rewrite.m4
   branches/tmp/deryck-samba4-swat/source/build/smb_build/makefile.pm
   branches/tmp/deryck-samba4-swat/source/client/client.c
   branches/tmp/deryck-samba4-swat/source/configure.in
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/cracknames.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/kludge_acl.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/password_hash.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/rootdse.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/samba3sam.c
   branches/tmp/deryck-samba4-swat/source/dsdb/samdb/ldb_modules/samldb.c
   branches/tmp/deryck-samba4-swat/source/gtk/config.mk
   branches/tmp/deryck-samba4-swat/source/heimdal/lib/gssapi/gssapi.h
   branches/tmp/deryck-samba4-swat/source/heimdal/lib/gssapi/gssapi_locl.h
   branches/tmp/deryck-samba4-swat/source/heimdal/lib/gssapi/wrap.c
   branches/tmp/deryck-samba4-swat/source/heimdal/lib/hdb/hdb-protos.h
   branches/tmp/deryck-samba4-swat/source/heimdal/lib/hdb/hdb.c
   branches/tmp/deryck-samba4-swat/source/heimdal/lib/krb5/krb5.h
   branches/tmp/deryck-samba4-swat/source/heimdal_build/config.h
   branches/tmp/deryck-samba4-swat/source/heimdal_build/config.mk
   branches/tmp/deryck-samba4-swat/source/include/includes.h
   branches/tmp/deryck-samba4-swat/source/include/system/filesys.h
   branches/tmp/deryck-samba4-swat/source/include/system/select.h
   branches/tmp/deryck-samba4-swat/source/kdc/config.mk
   branches/tmp/deryck-samba4-swat/source/kdc/hdb-ldb.c
   branches/tmp/deryck-samba4-swat/source/kdc/kdc.c
   branches/tmp/deryck-samba4-swat/source/kdc/kdc.h
   branches/tmp/deryck-samba4-swat/source/kdc/kpasswdd.c
   branches/tmp/deryck-samba4-swat/source/ldap_server/config.mk
   branches/tmp/deryck-samba4-swat/source/ldap_server/ldap_backend.c
   branches/tmp/deryck-samba4-swat/source/ldap_server/ldap_bind.c
   branches/tmp/deryck-samba4-swat/source/ldap_server/ldap_server.c
   branches/tmp/deryck-samba4-swat/source/ldap_server/ldap_server.h
   branches/tmp/deryck-samba4-swat/source/lib/events/events_standard.c
   branches/tmp/deryck-samba4-swat/source/lib/ldb/
   branches/tmp/deryck-samba4-swat/source/lib/ldb/Makefile.in
   branches/tmp/deryck-samba4-swat/source/lib/ldb/common/ldb_modules.c
   branches/tmp/deryck-samba4-swat/source/lib/ldb/config.mk
   branches/tmp/deryck-samba4-swat/source/lib/ldb/configure.in
   branches/tmp/deryck-samba4-swat/source/lib/ldb/include/ldb.h
   branches/tmp/deryck-samba4-swat/source/lib/ldb/include/ldb_errors.h
   branches/tmp/deryck-samba4-swat/source/lib/ldb/include/ldb_private.h
   branches/tmp/deryck-samba4-swat/source/lib/ldb/man/ldbsearch.1

svn commit: samba r12971 - in branches: SAMBA_4_0/source/auth tmp/deryck-samba4-swat/source/auth

2006-01-16 Thread tpot
Author: tpot
Date: 2006-01-16 23:42:07 + (Mon, 16 Jan 2006)
New Revision: 12971

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

Log:
Fix spelling.

Modified:
   branches/SAMBA_4_0/source/auth/auth_unix.c
   branches/tmp/deryck-samba4-swat/source/auth/auth_unix.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/auth_unix.c
===
--- branches/SAMBA_4_0/source/auth/auth_unix.c  2006-01-16 23:20:38 UTC (rev 
12970)
+++ branches/SAMBA_4_0/source/auth/auth_unix.c  2006-01-16 23:42:07 UTC (rev 
12971)
@@ -316,7 +316,7 @@
pam_error = pam_authenticate(pamh, PAM_SILENT | lp_null_passwords() ? 0 
: PAM_DISALLOW_NULL_AUTHTOK);
switch( pam_error ){
case PAM_AUTH_ERR:
-   DEBUG(2, (smb_pam_auth: PAM: Athentication Error for 
user %s\n, user));
+   DEBUG(2, (smb_pam_auth: PAM: Authentication Error for 
user %s\n, user));
break;
case PAM_CRED_INSUFFICIENT:
DEBUG(2, (smb_pam_auth: PAM: Insufficient Credentials 
for user %s\n, user));

Modified: branches/tmp/deryck-samba4-swat/source/auth/auth_unix.c
===
--- branches/tmp/deryck-samba4-swat/source/auth/auth_unix.c 2006-01-16 
23:20:38 UTC (rev 12970)
+++ branches/tmp/deryck-samba4-swat/source/auth/auth_unix.c 2006-01-16 
23:42:07 UTC (rev 12971)
@@ -316,7 +316,7 @@
pam_error = pam_authenticate(pamh, PAM_SILENT | lp_null_passwords() ? 0 
: PAM_DISALLOW_NULL_AUTHTOK);
switch( pam_error ){
case PAM_AUTH_ERR:
-   DEBUG(2, (smb_pam_auth: PAM: Athentication Error for 
user %s\n, user));
+   DEBUG(2, (smb_pam_auth: PAM: Authentication Error for 
user %s\n, user));
break;
case PAM_CRED_INSUFFICIENT:
DEBUG(2, (smb_pam_auth: PAM: Insufficient Credentials 
for user %s\n, user));



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

2006-01-09 Thread tpot
Author: tpot
Date: 2006-01-09 21:58:40 + (Mon, 09 Jan 2006)
New Revision: 12802

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

Log:
Fix for bugzilla #3389 from William Jojo.  This fixes failures on AIX in  
linking smbd when the symbol table for ld exceeds 65536 bytes.

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  2006-01-09 21:44:30 UTC (rev 
12801)
+++ branches/SAMBA_3_0/source/configure.in  2006-01-09 21:58:40 UTC (rev 
12802)
@@ -1460,7 +1460,7 @@
*aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
BLDSHARED=true
LDSHFLAGS=-Wl,-bexpall,-bM:SRE,-bnoentry,-berok
-   DYNEXP=-Wl,-brtl,-bexpall
+   DYNEXP=-Wl,-brtl,-bexpall,-bbigtoc
PICFLAGS=-O2
if test ${GCC} != yes; then
## for funky AIX compiler using strncpy()

Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2006-01-09 21:44:30 UTC (rev 12801)
+++ trunk/source/configure.in   2006-01-09 21:58:40 UTC (rev 12802)
@@ -1460,7 +1460,7 @@
*aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
BLDSHARED=true
LDSHFLAGS=-Wl,-bexpall,-bM:SRE,-bnoentry,-berok
-   DYNEXP=-Wl,-brtl,-bexpall
+   DYNEXP=-Wl,-brtl,-bexpall,-bbigtoc
PICFLAGS=-O2
if test ${GCC} != yes; then
## for funky AIX compiler using strncpy()



svn commit: samba-docs r884 - in trunk/smbdotconf/misc: .

2005-12-07 Thread tpot
Author: tpot
Date: 2005-12-07 18:56:26 + (Wed, 07 Dec 2005)
New Revision: 884

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

Log:
Fix some misuse of the smbconfoption element.

Modified:
   trunk/smbdotconf/misc/dfreecachetime.xml
   trunk/smbdotconf/misc/dfreecommand.xml


Changeset:
Modified: trunk/smbdotconf/misc/dfreecachetime.xml
===
--- trunk/smbdotconf/misc/dfreecachetime.xml2005-12-05 18:56:56 UTC (rev 
883)
+++ trunk/smbdotconf/misc/dfreecachetime.xml2005-12-07 18:56:26 UTC (rev 
884)
@@ -16,8 +16,7 @@
It specifies in seconds the time that smbd will cache the output
of a disk free query. If set to zero (the default) no caching is
done. This allows a heavily loaded server to prevent rapid spawning
-   of smbconfoption name=dfree command/dfree command scripts
-   increasing the load.
+   of smbconfoption name=dfree command/ scripts increasing the load.
/para
 
 /description

Modified: trunk/smbdotconf/misc/dfreecommand.xml
===
--- trunk/smbdotconf/misc/dfreecommand.xml  2005-12-05 18:56:56 UTC (rev 
883)
+++ trunk/smbdotconf/misc/dfreecommand.xml  2005-12-07 18:56:26 UTC (rev 
884)
@@ -24,7 +24,7 @@
para
In Samba version 3.0.21 this parameter has been changed to be
a per-share parameter, and in addition the parameter
-   smbconfoption name=dfree cache time/dfree cache time was added
+   smbconfoption name=dfree cache time/ was added
to allow the output of this script to be cached for systems under
heavy load.
/para



svn commit: samba-docs r885 - in trunk/smbdotconf/printing: .

2005-12-07 Thread tpot
Author: tpot
Date: 2005-12-07 19:46:41 + (Wed, 07 Dec 2005)
New Revision: 885

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

Log:
Add some documentation for the 'iprint server' parameter.

Added:
   trunk/smbdotconf/printing/iprintserver.xml


Changeset:
Added: trunk/smbdotconf/printing/iprintserver.xml
===
--- trunk/smbdotconf/printing/iprintserver.xml  2005-12-07 18:56:26 UTC (rev 
884)
+++ trunk/smbdotconf/printing/iprintserver.xml  2005-12-07 19:46:41 UTC (rev 
885)
@@ -0,0 +1,19 @@
+samba:parameter name=iprint server
+ context=G
+type=string
+print=1
+ xmlns:samba=http://www.samba.org/samba/DTD/samba-doc;
+description
+para
+This parameter is only applicable if smbconfoption name=printing/ is 
set to constantiprint/constant.
+/para
+
+   para
+   If set, this option overrides the ServerName option in the CUPS 
filenameclient.conf/filename. This is 
+   necessary if you have virtual samba servers that connect to different CUPS 
daemons.
+   /para
+/description
+
+value type=default/value
+value type=exampleMYCUPSSERVER/value
+/samba:parameter



svn commit: samba r11965 - in branches/SAMBA_4_0/source/torture/smb2: .

2005-11-29 Thread tpot
Author: tpot
Date: 2005-11-30 00:00:53 + (Wed, 30 Nov 2005)
New Revision: 11965

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

Log:
Try to fix some 64-bit warnings.

Modified:
   branches/SAMBA_4_0/source/torture/smb2/find.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/smb2/find.c
===
--- branches/SAMBA_4_0/source/torture/smb2/find.c   2005-11-29 23:40:01 UTC 
(rev 11964)
+++ branches/SAMBA_4_0/source/torture/smb2/find.c   2005-11-30 00:00:53 UTC 
(rev 11965)
@@ -47,7 +47,7 @@
if (io.all_info2.out.field != d-stype.field) { \
printf((%s) %s/%s should be 0x%llx - 0x%llx\n, __location__, \
   #call_name, #field, \
-  (uint64_t)io.all_info2.out.field, 
(uint64_t)d-stype.field); \
+  (long long)io.all_info2.out.field, (long 
long)d-stype.field); \
ret = False; \
}} while (0)
 



svn commit: samba r11967 - in branches/SAMBA_4_0/source: auth/gensec dsdb/samdb lib/com/dcom lib/stream libcli/smb2 nbt_server/wins smb_server torture torture/basic torture/nbt torture/rpc torture/smb

2005-11-29 Thread tpot
Author: tpot
Date: 2005-11-30 02:08:15 + (Wed, 30 Nov 2005)
New Revision: 11967

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

Log:
Fix more 64-bit warnings.

Modified:
   branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c
   branches/SAMBA_4_0/source/dsdb/samdb/samdb.c
   branches/SAMBA_4_0/source/lib/com/dcom/main.c
   branches/SAMBA_4_0/source/lib/stream/packet.c
   branches/SAMBA_4_0/source/libcli/smb2/transport.c
   branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c
   branches/SAMBA_4_0/source/smb_server/smb_server.c
   branches/SAMBA_4_0/source/torture/basic/denytest.c
   branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
   branches/SAMBA_4_0/source/torture/rpc/dssync.c
   branches/SAMBA_4_0/source/torture/rpc/samsync.c
   branches/SAMBA_4_0/source/torture/smb2/connect.c
   branches/SAMBA_4_0/source/torture/smb2/scan.c
   branches/SAMBA_4_0/source/torture/smb2/util.c
   branches/SAMBA_4_0/source/torture/torture_util.c
   branches/SAMBA_4_0/source/wrepl_server/wrepl_apply_records.c
   branches/SAMBA_4_0/source/wrepl_server/wrepl_in_call.c
   branches/SAMBA_4_0/source/wrepl_server/wrepl_in_connection.c


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


svn commit: samba r11968 - in branches/SAMBA_4_0/source: kdc smb_server/smb smb_server/smb2 torture/auth torture/rpc winbind

2005-11-29 Thread tpot
Author: tpot
Date: 2005-11-30 03:20:25 + (Wed, 30 Nov 2005)
New Revision: 11968

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

Log:
More warning fixes.  We're on track to getting to double digits for
the number of warnings generated now.

Modified:
   branches/SAMBA_4_0/source/kdc/kdc.c
   branches/SAMBA_4_0/source/smb_server/smb/receive.c
   branches/SAMBA_4_0/source/smb_server/smb2/receive.c
   branches/SAMBA_4_0/source/torture/auth/pac.c
   branches/SAMBA_4_0/source/torture/rpc/dssync.c
   branches/SAMBA_4_0/source/torture/rpc/samsync.c
   branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c


Changeset:
Modified: branches/SAMBA_4_0/source/kdc/kdc.c
===
--- branches/SAMBA_4_0/source/kdc/kdc.c 2005-11-30 02:08:15 UTC (rev 11967)
+++ branches/SAMBA_4_0/source/kdc/kdc.c 2005-11-30 03:20:25 UTC (rev 11968)
@@ -143,8 +143,8 @@
talloc_steal(tmp_ctx, src_addr);
blob.length = nread;

-   DEBUG(2,(Received krb5 UDP packet of length %u from %s:%u\n, 
-blob.length, src_addr, (uint16_t)src_port));
+   DEBUG(2,(Received krb5 UDP packet of length %lu from %s:%u\n, 
+(long)blob.length, src_addr, (uint16_t)src_port));

/* Call krb5 */
ret = kdc_socket-process(kdc_socket-kdc, 
@@ -219,8 +219,8 @@
if (!src_addr) goto nomem;
src_port = socket_get_peer_port(kdcconn-conn-socket);
 
-   DEBUG(2,(Received krb5 TCP packet of length %u from %s:%u\n, 
-blob.length - 4, src_addr, src_port));
+   DEBUG(2,(Received krb5 TCP packet of length %lu from %s:%u\n, 
+(long)blob.length - 4, src_addr, src_port));
 
/* Call krb5 */
input = data_blob_const(blob.data + 4, blob.length - 4); 

Modified: branches/SAMBA_4_0/source/smb_server/smb/receive.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/receive.c  2005-11-30 02:08:15 UTC 
(rev 11967)
+++ branches/SAMBA_4_0/source/smb_server/smb/receive.c  2005-11-30 03:20:25 UTC 
(rev 11968)
@@ -87,15 +87,15 @@
}
 
if ((NBT_HDR_SIZE + MIN_SMB_SIZE)  blob.length) {
-   DEBUG(2,(Invalid SMB packet: length %d\n, blob.length));
+   DEBUG(2,(Invalid SMB packet: length %ld\n, 
(long)blob.length));
smbsrv_terminate_connection(smb_conn, Invalid SMB packet);
return NT_STATUS_OK;
}
 
/* Make sure this is an SMB packet */
if (IVAL(blob.data, NBT_HDR_SIZE) != SMB_MAGIC) {
-   DEBUG(2,(Non-SMB packet of length %d. Terminating 
connection\n,
-blob.length));
+   DEBUG(2,(Non-SMB packet of length %ld. Terminating 
connection\n,
+(long)blob.length));
smbsrv_terminate_connection(smb_conn, Non-SMB packet);
return NT_STATUS_OK;
}

Modified: branches/SAMBA_4_0/source/smb_server/smb2/receive.c
===
--- branches/SAMBA_4_0/source/smb_server/smb2/receive.c 2005-11-30 02:08:15 UTC 
(rev 11967)
+++ branches/SAMBA_4_0/source/smb_server/smb2/receive.c 2005-11-30 03:20:25 UTC 
(rev 11968)
@@ -192,7 +192,7 @@
}
 
if (blob.length  (NBT_HDR_SIZE + SMB2_MIN_SIZE)) {
-   DEBUG(2,(Invalid SMB2 packet length count %d\n, blob.length));
+   DEBUG(2,(Invalid SMB2 packet length count %ld\n, 
(long)blob.length));
smbsrv_terminate_connection(smb_conn, Invalid SMB2 packet);
return NT_STATUS_OK;
}

Modified: branches/SAMBA_4_0/source/torture/auth/pac.c
===
--- branches/SAMBA_4_0/source/torture/auth/pac.c2005-11-30 02:08:15 UTC 
(rev 11967)
+++ branches/SAMBA_4_0/source/torture/auth/pac.c2005-11-30 03:20:25 UTC 
(rev 11968)
@@ -359,7 +359,7 @@
pac_file = lp_parm_string(-1,torture,pac_file);
if (pac_file) {
tmp_blob.data = (uint8_t *)file_load(pac_file, 
tmp_blob.length, mem_ctx);
-   printf((saved test) Loaded pac of size %d from %s\n, 
tmp_blob.length, pac_file);
+   printf((saved test) Loaded pac of size %ld from %s\n, 
(long)tmp_blob.length, pac_file);
} else {
tmp_blob = data_blob_talloc(mem_ctx, saved_pac, 
sizeof(saved_pac));
}

Modified: branches/SAMBA_4_0/source/torture/rpc/dssync.c
===
--- branches/SAMBA_4_0/source/torture/rpc/dssync.c  2005-11-30 02:08:15 UTC 
(rev 11967)
+++ branches/SAMBA_4_0/source/torture/rpc/dssync.c  2005-11-30 03:20:25 UTC 
(rev 11968)
@@ -351,8 +351,8 @@
DEBUG(0,(DN: %s\n, dn));
dn_printed = True

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

2005-11-14 Thread tpot
Author: tpot
Date: 2005-11-14 23:09:46 + (Mon, 14 Nov 2005)
New Revision: 11729

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

Log:
Remove space from DYNEXP flags declaration for HPUX.  Fixes bugzilla 
#3260.

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-11-14 21:18:09 UTC (rev 
11728)
+++ branches/SAMBA_3_0/source/configure.in  2005-11-14 23:09:46 UTC (rev 
11729)
@@ -1480,10 +1480,10 @@
fi
if test $host_cpu = ia64; then
SHLIBEXT=so
-   DYNEXP=-Wl,-E,+b 
/usr/local/lib/hpux32:/usr/lib/hpux32
+   
DYNEXP=-Wl,-E,+b/usr/local/lib/hpux32:/usr/lib/hpux32
else
SHLIBEXT=sl
-   DYNEXP=-Wl,-E,+b /usr/local/lib:/usr/lib
+   DYNEXP=-Wl,-E,+b/usr/local/lib:/usr/lib
fi
AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block])
AC_DEFINE(POSIX_ACL_NEEDS_MASK,1,[Does a POSIX ACL need 
a mask element])

Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2005-11-14 21:18:09 UTC (rev 11728)
+++ trunk/source/configure.in   2005-11-14 23:09:46 UTC (rev 11729)
@@ -1480,10 +1480,10 @@
fi
if test $host_cpu = ia64; then
SHLIBEXT=so
-   DYNEXP=-Wl,-E,+b 
/usr/local/lib/hpux32:/usr/lib/hpux32
+   
DYNEXP=-Wl,-E,+b/usr/local/lib/hpux32:/usr/lib/hpux32
else
SHLIBEXT=sl
-   DYNEXP=-Wl,-E,+b /usr/local/lib:/usr/lib
+   DYNEXP=-Wl,-E,+b/usr/local/lib:/usr/lib
fi
AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block])
AC_DEFINE(POSIX_ACL_NEEDS_MASK,1,[Does a POSIX ACL need 
a mask element])



svn commit: samba r11709 - in branches/SAMBA_4_0/source/lib/registry: .

2005-11-13 Thread tpot
Author: tpot
Date: 2005-11-14 00:57:19 + (Mon, 14 Nov 2005)
New Revision: 11709

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

Log:
Comment out unused function.

Modified:
   branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c
===
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c2005-11-13 
18:35:12 UTC (rev 11708)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c2005-11-14 
00:57:19 UTC (rev 11709)
@@ -652,6 +652,8 @@
return WERR_NOT_SUPPORTED;
 }
 
+#if 0 /* Unused */
+
 static WERROR regf_save_hbin(struct registry_hive *hive, struct hbin_block 
*hbin)
 {
struct regf_data *regf = hive-backend_data;
@@ -670,6 +672,8 @@
return WERR_OK;
 }
 
+#endif
+
 static WERROR nt_open_hive (struct registry_hive *h, struct registry_key **key)
 {
struct regf_data *regf;



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

2005-11-09 Thread tpot
Author: tpot
Date: 2005-11-10 03:01:21 + (Thu, 10 Nov 2005)
New Revision: 11624

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

Log:
Use enum names instead of magic numbers.

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/samr.c
===
--- branches/SAMBA_4_0/source/torture/rpc/samr.c2005-11-10 02:23:59 UTC 
(rev 11623)
+++ branches/SAMBA_4_0/source/torture/rpc/samr.c2005-11-10 03:01:21 UTC 
(rev 11624)
@@ -650,8 +650,8 @@
r.in.level = levels[i];
r.in.info  = talloc(mem_ctx, union samr_AliasInfo);
switch (r.in.level) {
-   case 2 : init_lsa_String(r.in.info-name,TEST_ALIASNAME); 
break;
-   case 3 : init_lsa_String(r.in.info-description,
+   case ALIASINFONAME: 
init_lsa_String(r.in.info-name,TEST_ALIASNAME); break;
+   case ALIASINFODESCRIPTION: 
init_lsa_String(r.in.info-description,
Test Description, should test I18N as well); 
break;
}
 



svn commit: samba r11625 - in branches/SAMBA_4_0/source/torture/local: .

2005-11-09 Thread tpot
Author: tpot
Date: 2005-11-10 03:37:49 + (Thu, 10 Nov 2005)
New Revision: 11625

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

Log:
NULL terminate list of strings.  For some reason this wasn't causing a
crash on i386 but was on ia64.

Modified:
   branches/SAMBA_4_0/source/torture/local/util_strlist.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/local/util_strlist.c
===
--- branches/SAMBA_4_0/source/torture/local/util_strlist.c  2005-11-10 
03:01:21 UTC (rev 11624)
+++ branches/SAMBA_4_0/source/torture/local/util_strlist.c  2005-11-10 
03:37:49 UTC (rev 11625)
@@ -29,6 +29,7 @@
foo bar \bla \,
foo \\ bla,
bla  blie,
+   NULL
 };
 
 static BOOL test_lists_shell(TALLOC_CTX *mem_ctx)



svn commit: samba r11626 - in branches/SAMBA_4_0/source: client libcli/raw torture torture/rpc winbind

2005-11-09 Thread tpot
Author: tpot
Date: 2005-11-10 03:48:56 + (Thu, 10 Nov 2005)
New Revision: 11626

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

Log:
Fix unhandled enum in case statement warnings by noting appropriately 
that some values aren't handled.  The remaining warnings I think are 
actual bugs or required functionality that is missing (mostly lack of 
server side Unix extensions).

Modified:
   branches/SAMBA_4_0/source/client/client.c
   branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c
   branches/SAMBA_4_0/source/torture/gentest.c
   branches/SAMBA_4_0/source/torture/rpc/samsync.c
   branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c


Changeset:
Modified: branches/SAMBA_4_0/source/client/client.c
===
--- branches/SAMBA_4_0/source/client/client.c   2005-11-10 03:37:49 UTC (rev 
11625)
+++ branches/SAMBA_4_0/source/client/client.c   2005-11-10 03:48:56 UTC (rev 
11626)
@@ -1817,6 +1817,9 @@
 (unsigned long long) 
fsinfo.objectid_information.out.unknown[5],
 (unsigned long long) 
fsinfo.objectid_information.out.unknown[6] );
break;
+   case RAW_QFS_GENERIC:
+   d_printf(\twrong level returned\n);
+   break;
}
   
  done:

Modified: branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c
===
--- branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c   2005-11-10 
03:37:49 UTC (rev 11625)
+++ branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c   2005-11-10 
03:48:56 UTC (rev 11626)
@@ -124,6 +124,18 @@
NEED_BLOB(4);
SIVAL(blob-data, 0, parms-mode_information.in.mode);
return True;
+   
+   /* Unhandled levels */
+
+   case RAW_SFILEINFO_UNIX_LINK:
+   case RAW_SFILEINFO_UNIX_HLINK:
+   case RAW_SFILEINFO_1023:
+   case RAW_SFILEINFO_1025:
+   case RAW_SFILEINFO_1029:
+   case RAW_SFILEINFO_1032:
+   case RAW_SFILEINFO_1039:
+   case RAW_SFILEINFO_1040:
+   break;
}
 
return False;

Modified: branches/SAMBA_4_0/source/torture/gentest.c
===
--- branches/SAMBA_4_0/source/torture/gentest.c 2005-11-10 03:37:49 UTC (rev 
11625)
+++ branches/SAMBA_4_0/source/torture/gentest.c 2005-11-10 03:48:56 UTC (rev 
11626)
@@ -1600,6 +1600,14 @@
CHECK_EQUAL(attribute_tag_information.out.attrib);
CHECK_EQUAL(attribute_tag_information.out.reparse_tag);
break;
+
+   /* Unhandled levels */
+
+   case RAW_FILEINFO_SEC_DESC:
+   case RAW_FILEINFO_EA_LIST:
+   case RAW_FILEINFO_UNIX_BASIC:
+   case RAW_FILEINFO_UNIX_LINK:
+   break;
}
 
return True;

Modified: branches/SAMBA_4_0/source/torture/rpc/samsync.c
===
--- branches/SAMBA_4_0/source/torture/rpc/samsync.c 2005-11-10 03:37:49 UTC 
(rev 11625)
+++ branches/SAMBA_4_0/source/torture/rpc/samsync.c 2005-11-10 03:48:56 UTC 
(rev 11626)
@@ -1174,6 +1174,23 @@
ret = False;
}
break;
+   case NETR_DELTA_DELETE_GROUP:
+   case NETR_DELTA_RENAME_GROUP:
+   case NETR_DELTA_DELETE_USER:
+   case NETR_DELTA_RENAME_USER:
+   case NETR_DELTA_GROUP_MEMBER:
+   case NETR_DELTA_DELETE_ALIAS:
+   case NETR_DELTA_RENAME_ALIAS:
+   case NETR_DELTA_ALIAS_MEMBER:
+   case NETR_DELTA_DELETE_TRUST:
+   case NETR_DELTA_DELETE_ACCOUNT:
+   case NETR_DELTA_DELETE_SECRET:
+   case NETR_DELTA_DELETE_GROUP2:
+   case NETR_DELTA_DELETE_USER2:
+   case NETR_DELTA_MODIFY_COUNT:
+   printf(Unhandled delta type %d\n, 
r.out.delta_enum_array-delta_enum[d].delta_type);
+   ret = False;
+   break;
}
talloc_free(delta_ctx);
}

Modified: branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c
===
--- branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c  2005-11-10 
03:37:49 UTC (rev 11625)
+++ branches/SAMBA_4_0/source/winbind/wb_samba3_protocol.c  2005-11-10 
03:48:56 UTC (rev 11626)
@@ -118,6 +118,49

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

2005-11-09 Thread tpot
Author: tpot
Date: 2005-11-10 05:42:07 + (Thu, 10 Nov 2005)
New Revision: 11633

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

Log:
Fix some more warnings.

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/gentest.c
===
--- branches/SAMBA_4_0/source/torture/gentest.c 2005-11-10 05:26:53 UTC (rev 
11632)
+++ branches/SAMBA_4_0/source/torture/gentest.c 2005-11-10 05:42:07 UTC (rev 
11633)
@@ -1733,6 +1733,19 @@
case RAW_SFILEINFO_MODE_INFORMATION:
info-mode_information.in.mode = gen_bits_mask(0x);
break;
+   case RAW_SFILEINFO_GENERIC:
+   case RAW_SFILEINFO_SEC_DESC:
+   case RAW_SFILEINFO_UNIX_BASIC:
+   case RAW_SFILEINFO_UNIX_LINK:
+   case RAW_SFILEINFO_UNIX_HLINK:
+   case RAW_SFILEINFO_1023:
+   case RAW_SFILEINFO_1025:
+   case RAW_SFILEINFO_1029:
+   case RAW_SFILEINFO_1032:
+   case RAW_SFILEINFO_1039:
+   case RAW_SFILEINFO_1040:
+   /* Untested */
+   break;
}
 }
 



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

2005-10-28 Thread tpot
Author: tpot
Date: 2005-10-28 06:51:44 + (Fri, 28 Oct 2005)
New Revision: 11362

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

Log:
Remove attempt to decode uint8 array as a security descriptor.  Pidl thinks
that because it is an array, the import should also be an array, i.e of
security descriptors.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/winreg.cnf


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.cnf
===
--- branches/SAMBA_4_0/source/librpc/idl/winreg.cnf 2005-10-28 06:44:24 UTC 
(rev 11361)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.cnf 2005-10-28 06:51:44 UTC 
(rev 11362)
@@ -50,5 +50,3 @@
 HF_RENAME hf_winreg_winreg_OpenHKDD_handle hf_winreg_handle
 HF_RENAME hf_winreg_winreg_OpenHKPT_handle hf_winreg_handle
 HF_RENAME hf_winreg_winreg_OpenHKPN_handle hf_winreg_handle
-
-IMPORT KeySecurityData.data if (((dcerpc_info 
*)pinfo-private_data)-conformant_run) return offset; offset = 
dissect_nt_sec_desc(tvb, offset, pinfo, tree, drep, FALSE, -1, NULL);



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

2005-10-27 Thread tpot
Author: tpot
Date: 2005-10-27 07:32:04 + (Thu, 27 Oct 2005)
New Revision: 11318

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

Log:
Tweak import statement for decoding KeySecurityData as a NT security
descriptor in ethereal.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/winreg.cnf


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.cnf
===
--- branches/SAMBA_4_0/source/librpc/idl/winreg.cnf 2005-10-27 05:33:49 UTC 
(rev 11317)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.cnf 2005-10-27 07:32:04 UTC 
(rev 11318)
@@ -51,4 +51,4 @@
 HF_RENAME hf_winreg_winreg_OpenHKPT_handle hf_winreg_handle
 HF_RENAME hf_winreg_winreg_OpenHKPN_handle hf_winreg_handle
 
-IMPORT KeySecurityData.data offset = dissect_nt_sec_desc(tvb, offset, pinfo, 
tree, drep, FALSE, -1, NULL);
+IMPORT KeySecurityData.data if (((dcerpc_info 
*)pinfo-private_data)-conformant_run) return offset; offset = 
dissect_nt_sec_desc(tvb, offset, pinfo, tree, drep, FALSE, -1, NULL);



svn commit: samba r11261 - in branches/SAMBA_4_0/source: lib/registry librpc/idl rpc_server/winreg torture/rpc

2005-10-22 Thread tpot
Author: tpot
Date: 2005-10-22 08:00:09 + (Sat, 22 Oct 2005)
New Revision: 11261

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

Log:
Rename access_required field in winreg idl to access_mask so it matches 
the other interfaces.

Modified:
   branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc.c
   branches/SAMBA_4_0/source/librpc/idl/winreg.idl
   branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
   branches/SAMBA_4_0/source/torture/rpc/winreg.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc.c
===
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc.c2005-10-22 
07:10:13 UTC (rev 11260)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc.c2005-10-22 
08:00:09 UTC (rev 11261)
@@ -39,7 +39,7 @@
NTSTATUS status; \
\
r.in.system_name = 0; \
-   r.in.access_required = SEC_FLAG_MAXIMUM_ALLOWED; \
+   r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; \
r.out.handle = hnd;\
\
status = dcerpc_winreg_Open ## u(p, mem_ctx, r); \
@@ -253,7 +253,7 @@
r.in.handle = parent-backend_data;
r.out.new_handle = talloc(mem_ctx, struct policy_handle);   
r.in.options = 0;
-   r.in.access_required = access_mask;
+   r.in.access_mask = access_mask;
r.in.secdesc = NULL;
 
status = dcerpc_winreg_CreateKey((struct dcerpc_pipe 
*)(parent-hive-backend_data), mem_ctx, r);

Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/winreg.idl 2005-10-22 07:10:13 UTC 
(rev 11260)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.idl 2005-10-22 08:00:09 UTC 
(rev 11261)
@@ -41,7 +41,7 @@
/* Function: 0x00 */
WERROR winreg_OpenHKCR(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 
@@ -49,7 +49,7 @@
/* Function: 0x01 */
WERROR winreg_OpenHKCU(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 
@@ -57,7 +57,7 @@
/* Function: 0x02 */
WERROR winreg_OpenHKLM(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 
@@ -65,7 +65,7 @@
/* Function: 0x03 */
WERROR winreg_OpenHKPD(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 
@@ -73,7 +73,7 @@
/* Function: 0x04 */
WERROR winreg_OpenHKU(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 
@@ -109,7 +109,7 @@
[in] winreg_String name,
[in] winreg_String class,
[in] uint32 options,
-   [in] uint32 access_required,
+   [in] uint32 access_mask,
[in,unique] winreg_SecBuf *secdesc,
[out,ref] policy_handle *new_handle,
[in,out,unique] winreg_CreateAction *action_taken
@@ -292,7 +292,7 @@
/* Function: 0x1b */
WERROR winreg_OpenHKCC(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 
@@ -300,7 +300,7 @@
/* Function: 0x1c */
WERROR winreg_OpenHKDD(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 
@@ -341,7 +341,7 @@
/* Function: 0x20 */
WERROR winreg_OpenHKPT(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 
@@ -349,7 +349,7 @@
/* Function: 0x21 */
WERROR winreg_OpenHKPN(
[in]  uint16 *system_name,
-   [in]  uint32 access_required,
+   [in]  uint32 access_mask,
[out,ref] policy_handle *handle
);
 

Modified: branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
===
--- branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c2005

svn commit: samba r11262 - in branches/SAMBA_4_0/source: librpc/idl pidl/lib/Parse/Pidl/Ethereal

2005-10-22 Thread tpot
Author: tpot
Date: 2005-10-23 01:19:38 + (Sun, 23 Oct 2005)
New Revision: 11262

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

Log:
Try to get the equivalent of a subcontext in pidl ethereal conformance 
files working.  It doesn't quite work though.  (-:

This patch also allows a struct.field format to be used in an IMPORT 
statement instead of a type name.

Jelmer, what do you think?

Modified:
   branches/SAMBA_4_0/source/librpc/idl/winreg.cnf
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.cnf
===
--- branches/SAMBA_4_0/source/librpc/idl/winreg.cnf 2005-10-22 08:00:09 UTC 
(rev 11261)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.cnf 2005-10-23 01:19:38 UTC 
(rev 11262)
@@ -50,3 +50,5 @@
 HF_RENAME hf_winreg_winreg_OpenHKDD_handle hf_winreg_handle
 HF_RENAME hf_winreg_winreg_OpenHKPT_handle hf_winreg_handle
 HF_RENAME hf_winreg_winreg_OpenHKPN_handle hf_winreg_handle
+
+IMPORT KeySecurityData.data offset = dissect_nt_sec_desc(tvb, offset, pinfo, 
tree, drep, FALSE, -1, NULL);

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm   
2005-10-22 08:00:09 UTC (rev 11261)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm   
2005-10-23 01:19:38 UTC (rev 11262)
@@ -292,6 +292,10 @@
if ($conformance-{imports}-{$l-{DATA_TYPE}}) {
$call = 
$conformance-{imports}-{$l-{DATA_TYPE}}-{DATA}; 

$conformance-{imports}-{$l-{DATA_TYPE}}-{USED} = 1;
+   } elsif 
(defined($conformance-{imports}-{$pn.$e-{NAME}})) {
+   $call = 
$conformance-{imports}-{$pn.$e-{NAME}}-{DATA};
+   
$conformance-{imports}-{$pn.$e-{NAME}}-{USED} = 1;
+   
} elsif 
(defined($conformance-{types}-{$l-{DATA_TYPE}})) {
$call= 
$conformance-{types}-{$l-{DATA_TYPE}}-{DISSECTOR_NAME};

$conformance-{types}-{$l-{DATA_TYPE}}-{USED} = 1;



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

2005-10-21 Thread tpot
Author: tpot
Date: 2005-10-22 01:12:46 + (Sat, 22 Oct 2005)
New Revision: 11258

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

Log:
Dissect all access_required fields as hex using the same hf.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/winreg.cnf


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.cnf
===
--- branches/SAMBA_4_0/source/librpc/idl/winreg.cnf 2005-10-21 22:49:23 UTC 
(rev 11257)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.cnf 2005-10-22 01:12:46 UTC 
(rev 11258)
@@ -1,3 +1,12 @@
 IMPORT security_secinfooffset = dissect_ndr_uint32(tvb, offset, pinfo, 
tree, drep, hf_winreg_winreg_GetKeySecurity_sec_info, NULL);
 
-INFO_KEY OpenKey.Ke
\ No newline at end of file
+HF_FIELD hf_winreg_access_required Access Required winreg.access_required 
FT_UINT32 BASE_HEX NULL 0   
+
+HF_RENAME hf_winreg_winreg_OpenHKCR_access_required hf_winreg_access_required
+HF_RENAME hf_winreg_winreg_OpenHKLM_access_required hf_winreg_access_required
+HF_RENAME hf_winreg_winreg_OpenHKU_access_required hf_winreg_access_required
+HF_RENAME hf_winreg_winreg_CreateKey_access_required hf_winreg_access_required
+HF_RENAME hf_winreg_winreg_OpenHKCC_access_required hf_winreg_access_required
+HF_RENAME hf_winreg_winreg_OpenHKDD_access_required hf_winreg_access_required
+HF_RENAME hf_winreg_winreg_OpenHKPT_access_required hf_winreg_access_required
+HF_RENAME hf_winreg_winreg_OpenHKPN_access_required hf_winreg_access_required



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

2005-10-20 Thread tpot
Author: tpot
Date: 2005-10-20 06:31:51 + (Thu, 20 Oct 2005)
New Revision: 11210

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

Log:
Log registry open function name when starting hive tests.

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c
===
--- branches/SAMBA_4_0/source/torture/rpc/winreg.c  2005-10-20 05:09:58 UTC 
(rev 11209)
+++ branches/SAMBA_4_0/source/torture/rpc/winreg.c  2005-10-20 06:31:51 UTC 
(rev 11210)
@@ -686,13 +686,16 @@
 
 typedef NTSTATUS (*winreg_open_fn)(struct dcerpc_pipe *, TALLOC_CTX *, void *);
 
-static BOOL test_Open(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
winreg_open_fn open_fn)
+static BOOL test_Open(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
+ const char *name, winreg_open_fn open_fn)
 {
struct policy_handle handle, newhandle;
BOOL ret = True, created = False, deleted = False;
struct winreg_OpenHKLM r;
NTSTATUS status;
 
+   printf(Testing %s\n, name);
+
r.in.system_name = 0;
r.in.access_required = SEC_FLAG_MAXIMUM_ALLOWED;
r.out.handle = handle;
@@ -791,10 +794,13 @@
struct dcerpc_pipe *p;
TALLOC_CTX *mem_ctx;
BOOL ret = True;
-   winreg_open_fn open_fns[] = { (winreg_open_fn)dcerpc_winreg_OpenHKLM, 
-  (winreg_open_fn)dcerpc_winreg_OpenHKU,
-  (winreg_open_fn)dcerpc_winreg_OpenHKCR,
-  (winreg_open_fn)dcerpc_winreg_OpenHKCU };
+   struct {
+   const char *name;
+   winreg_open_fn fn;
+   } open_fns[] = {{OpenHKLM, (winreg_open_fn)dcerpc_winreg_OpenHKLM },
+   {OpenHKU,  (winreg_open_fn)dcerpc_winreg_OpenHKU },
+   {OpenHKCR, (winreg_open_fn)dcerpc_winreg_OpenHKCR },
+   {OpenHKCU, (winreg_open_fn)dcerpc_winreg_OpenHKCU }};
int i;
mem_ctx = talloc_init(torture_rpc_winreg);
 
@@ -819,7 +825,7 @@
}
 
for (i = 0; i  ARRAY_SIZE(open_fns); i++) {
-   if (!test_Open(p, mem_ctx, open_fns[i]))
+   if (!test_Open(p, mem_ctx, open_fns[i].name, open_fns[i].fn))
ret = False;
}
 



svn commit: samba r11211 - in branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal: .

2005-10-20 Thread tpot
Author: tpot
Date: 2005-10-20 07:06:49 + (Thu, 20 Oct 2005)
New Revision: 11211

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

Log:
Append an error message to COL_INFO if the RPC call returned an error.

Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm   
2005-10-20 06:31:51 UTC (rev 11210)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm   
2005-10-20 07:06:49 UTC (rev 11211)
@@ -401,6 +401,7 @@
pidl_code $ifname\_dissect\_${fn_name}_response(tvbuff_t *tvb _U_, int 
offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
pidl_code {;
indent;
+   pidl_code guint32 status;\n;
foreach (@{$fn-{ELEMENTS}}) {
if (grep(/out/,@{$_-{DIRECTION}})) {
pidl_code $dissectornames{$_-{NAME}};
@@ -411,10 +412,15 @@
 
if (not defined($fn-{RETURN_TYPE})) {
} elsif ($fn-{RETURN_TYPE} eq NTSTATUS) {
-   pidl_code offset = dissect_ntstatus(tvb, offset, pinfo, tree, 
drep, hf\_$ifname\_status, NULL);;
+   pidl_code offset = dissect_ntstatus(tvb, offset, pinfo, tree, 
drep, hf\_$ifname\_status, status);\n;
+   pidl_code if (status != 0  check_col(pinfo-cinfo, 
COL_INFO));
+   pidl_code \tcol_append_fstr(pinfo-cinfo, COL_INFO, \, Error: 
%s\, val_to_str(status, NT_errors, \Unknown NT status 0x%08x\));\n;
$hf_used{hf\_$ifname\_status} = 1;
} elsif ($fn-{RETURN_TYPE} eq WERROR) {
-   pidl_code offset = dissect_ndr_uint32(tvb, offset, pinfo, 
tree, drep, hf\_$ifname\_werror, NULL);;
+   pidl_code offset = dissect_ndr_uint32(tvb, offset, pinfo, 
tree, drep, hf\_$ifname\_werror, status);\n;
+   pidl_code if (status != 0  check_col(pinfo-cinfo, 
COL_INFO));
+   pidl_code \tcol_append_fstr(pinfo-cinfo, COL_INFO, \, Error: 
%s\, val_to_str(status, DOS_errors, \Unknown DOS error 0x%08x\));\n;
+   
$hf_used{hf\_$ifname\_werror} = 1;
} else {
print $fn-{FILE}:$fn-{LINE}: error: return type 
`$fn-{RETURN_TYPE}' not yet supported\n;



svn commit: samba-docs r818 - in trunk: .

2005-10-12 Thread tpot
Author: tpot
Date: 2005-10-13 01:19:46 + (Thu, 13 Oct 2005)
New Revision: 818

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

Log:
Handle dia not being present more gracefully.

Modified:
   trunk/configure.in


Changeset:
Modified: trunk/configure.in
===
--- trunk/configure.in  2005-10-12 17:17:19 UTC (rev 817)
+++ trunk/configure.in  2005-10-13 01:19:46 UTC (rev 818)
@@ -19,16 +19,19 @@
 DOCS_TARGET_REQUIRE_PROGRAM(DIA, dia, ALL)
 
 # Check dia version number
-[ DIA_VERSION=`$DIA -v | egrep -o '([0-9]+)\.([0-9]+)'`]
-DIA_MAJ_VERSION=`echo $DIA_VERSION | cut -d . -f 1`
-DIA_MIN_VERSION=`echo $DIA_VERSION | cut -d . -f 2`
 
-if test $DIA_MAJ_VERSION -le 0
-then
+if test -n $DIA; then
+   [ DIA_VERSION=`$DIA -v | egrep -o '([0-9]+)\.([0-9]+)'`]
+   DIA_MAJ_VERSION=`echo $DIA_VERSION | cut -d . -f 1`
+   DIA_MIN_VERSION=`echo $DIA_VERSION | cut -d . -f 2`
+
+   if test $DIA_MAJ_VERSION -le 0
+   then
if test $DIA_MIN_VERSION -le 92  test -z $DISPLAY 
then
AC_MSG_ERROR([Dia below 0.93 requires an X environment. Set 
\$DISPLAY or install Dia 0.93 or higher])
fi
+   fi   
 fi
 
 DOCS_TARGET_REQUIRE_PROGRAM(MAKEINDEX, makeindex, LATEX)



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

2005-10-06 Thread tpot
Author: tpot
Date: 2005-10-07 02:08:38 + (Fri, 07 Oct 2005)
New Revision: 10797

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

Log:
Fix warning if not compiling with kerberos.

Modified:
   trunk/source/rpc_client/cli_pipe.c


Changeset:
Modified: trunk/source/rpc_client/cli_pipe.c
===
--- trunk/source/rpc_client/cli_pipe.c  2005-10-07 02:07:25 UTC (rev 10796)
+++ trunk/source/rpc_client/cli_pipe.c  2005-10-07 02:08:38 UTC (rev 10797)
@@ -2636,6 +2636,8 @@
return result;
 }
 
+#ifdef HAVE_KRB5
+
 /
  Free function for the kerberos spcific data.
  /
@@ -2645,6 +2647,8 @@
data_blob_free(a-a_u.kerberos_auth-session_key);
 }
 
+#endif
+
 /
  Open a named pipe to an SMB server and bind using krb5 (bind type 16).
  The idea is this can be called with service_princ, username and password all



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

2005-10-06 Thread tpot
Author: tpot
Date: 2005-10-07 03:48:43 + (Fri, 07 Oct 2005)
New Revision: 10798

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

Log:
Cleanup of yucky code in setup.py with patch from Christian Andreetta.
Bugzilla #3141.

Modified:
   trunk/source/python/setup.py


Changeset:
Modified: trunk/source/python/setup.py
===
--- trunk/source/python/setup.py2005-10-07 02:08:38 UTC (rev 10797)
+++ trunk/source/python/setup.py2005-10-07 03:48:43 UTC (rev 10798)
@@ -52,21 +52,28 @@
 libraries = []
 library_dirs = []
 
+next_is_path = 0
+next_is_flag = 0
+
 for lib in string.split(samba_libs):
-if lib[0:2] == -l:
+if next_is_path != 0:
+library_dirs.append(lib);
+next_is_path = 0;
+elif next_is_flag != 0:
+next_is_flag = 0;
+elif lib == -Wl,-rpath:
+next_is_path = 1;
+elif lib[0:2] in (-l,-pthread):
 libraries.append(lib[2:])
-continue
-if lib[0:8] == -pthread:
-libraries.append(lib[2:])
-continue
-if lib[0:2] == -L:
+elif lib[0:2] == -L:
 library_dirs.append(lib[2:])
-continue
-if lib[0:2] == -W:
-# Skip linker flags
-continue
-print Unknown entry '%s' in $LIBS variable passed to setup.py % lib
-sys.exit(1)
+elif lib[0:2] in (-W,-s):
+pass # Skip linker flags
+elif lib[0:2] == -z:
+next_is_flag = 1 # Skip linker flags
+else:
+print Unknown entry '%s' in $LIBS variable passed to setup.py % lib
+sys.exit(1)
 
 flags_list = string.split(samba_cflags)
 



  1   2   3   4   5   6   7   8   9   10   >