Merge branch 'master' of ssh://git.samba.org/data/git/samba
[kai/samba-autobuild/.git] / source4 / lib / ldb / ldb_wrap.c
index cc8099f27f5391a22a992a7a15088e388a8405e2..4a34c1c998d981d48f0194341748ec1e92c11d94 100644 (file)
@@ -2732,7 +2732,6 @@ SWIGINTERN char const *ldb_dn_canonical_ex_str(ldb_dn *self){
 SWIGINTERN char *ldb_dn___repr__(ldb_dn *self){
             char *dn = ldb_dn_get_linearized(self), *ret;
             asprintf(&ret, "Dn('%s')", dn);
-            talloc_free(dn);
             return ret;
         }
 SWIGINTERN ldb_dn *ldb_dn___add__(ldb_dn *self,ldb_dn *other){
@@ -3505,25 +3504,6 @@ int py_module_del_transaction(struct ldb_module *mod)
     return LDB_SUCCESS;
 }
 
-int py_module_sequence_number(struct ldb_module *mod, struct ldb_request *req)
-{
-    PyObject *py_ldb = mod->private_data;
-    PyObject *py_result;
-    int ret;
-
-    py_result = PyObject_CallMethod(py_ldb, "sequence_number", "ili", req->op.seq_num.type, req->op.seq_num.seq_num, req->op.seq_num.flags);
-
-    if (py_result == NULL) {
-        return LDB_ERR_OPERATIONS_ERROR;
-    }
-
-    ret = PyInt_AsLong(py_result);
-
-    Py_DECREF(py_result);
-
-    return ret;
-}
-
 static int py_module_destructor(void *_mod)
 {
     struct ldb_module *mod = _mod;
@@ -4842,7 +4822,7 @@ SWIGINTERN PyObject *_wrap_Ldb_connect(PyObject *SWIGUNUSEDPARM(self), PyObject
   ldb *arg1 = (ldb *) 0 ;
   char *arg2 = (char *) 0 ;
   unsigned int arg3 = (unsigned int) 0 ;
-  char **arg4 = (char **) (char **)NULL ;
+  char **arg4 = (char **) NULL ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -4850,8 +4830,6 @@ SWIGINTERN PyObject *_wrap_Ldb_connect(PyObject *SWIGUNUSEDPARM(self), PyObject
   int alloc2 = 0 ;
   unsigned int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -4880,25 +4858,33 @@ SWIGINTERN PyObject *_wrap_Ldb_connect(PyObject *SWIGUNUSEDPARM(self), PyObject
     arg3 = (unsigned int)(val3);
   }
   if (obj3) {
-    res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_char, 0 |  0 );
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Ldb_connect" "', argument " "4"" of type '" "char const *[]""'"); 
-    } 
-    arg4 = (char **)(argp4);
+    if (obj3 == Py_None) {
+      arg4 = NULL;
+    } else if (PySequence_Check(obj3)) {
+      int i;
+      arg4 = talloc_array(NULL, char *, PySequence_Size(obj3)+1);
+      for(i = 0; i < PySequence_Size(obj3); i++)
+      arg4[i] = PyString_AsString(PySequence_GetItem(obj3, i));
+      arg4[i] = NULL;
+    } else {
+      SWIG_exception(SWIG_TypeError, "expected sequence");
+    }
   }
   if (arg1 == NULL)
   SWIG_exception(SWIG_ValueError, 
     "ldb context must be non-NULL");
-  result = ldb_connect(arg1,(char const *)arg2,arg3,(char const *(*))arg4);
+  result = ldb_connect(arg1,(char const *)arg2,arg3,(char const *const *)arg4);
   if (result != 0) {
     PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_errstring(arg1)));
     SWIG_fail;
   }
   resultobj = Py_None;
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  talloc_free(arg4);
   return resultobj;
 fail:
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  talloc_free(arg4);
   return NULL;
 }
 
@@ -6648,7 +6634,6 @@ SWIGINTERN PyObject *_wrap_register_module(PyObject *SWIGUNUSEDPARM(self), PyObj
   arg1->start_transaction = py_module_start_transaction;
   arg1->end_transaction = py_module_end_transaction;
   arg1->del_transaction = py_module_del_transaction;
-  arg1->sequence_number = py_module_sequence_number;
   result = ldb_register_module((struct ldb_module_ops const *)arg1);
   if (result != 0) {
     PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result)));