From: Andrew Tridgell Date: Tue, 16 Dec 2008 00:41:20 +0000 (+1100) Subject: Merge branch 'master' of ssh://git.samba.org/data/git/samba X-Git-Tag: samba-4.0.0alpha6~479 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=f448fde4e35e56508ad93be8de9f60d88e8b8dcd;hp=530758dc2a6dd6dce083789b328e16e51ba6573d Merge branch 'master' of ssh://git.samba.org/data/git/samba --- diff --git a/pidl/config.mk b/pidl/config.mk index 45582f5d568..d7a84e3fcc2 100644 --- a/pidl/config.mk +++ b/pidl/config.mk @@ -28,4 +28,7 @@ $(pidldir)/lib/Parse/Pidl/Expr.pm: $(pidldir)/idl.yp testcov-html:: pidl-testcov +pidl-clean: + /bin/rm -f $(pidldir)/Makefile +clean:: pidl-clean diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 2b453bb0c37..ab0f4c51cc2 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -40,6 +40,9 @@ #define LDB_MODULE_PREFIX "modules:" #define LDB_MODULE_PREFIX_LEN 8 +static void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name, + const char *symbol); + void ldb_set_modules_dir(struct ldb_context *ldb, const char *path) { talloc_free(ldb->modules_dir); @@ -291,8 +294,8 @@ int ldb_register_module(const struct ldb_module_ops *ops) return 0; } -void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name, - const char *symbol) +static void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name, + const char *symbol) { char *path; void *handle; @@ -334,6 +337,10 @@ int ldb_load_modules_list(struct ldb_context *ldb, const char **module_list, str for (i = 0; module_list[i] != NULL; i++) { struct ldb_module *current; const struct ldb_module_ops *ops; + + if (strcmp(module_list[i], "") == 0) { + continue; + } ops = ldb_find_module_ops(module_list[i]); if (ops == NULL) { diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h index 8f7e010bee7..90c49800173 100644 --- a/source4/lib/ldb/include/ldb_private.h +++ b/source4/lib/ldb/include/ldb_private.h @@ -259,9 +259,6 @@ const char *ldb_default_modules_dir(void); int ldb_register_backend(const char *url_prefix, ldb_connect_fn); -void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name, - const char *symbol); - struct ldb_handle *ldb_handle_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb); int ldb_module_send_entry(struct ldb_request *req, diff --git a/source4/lib/ldb/ldb.i b/source4/lib/ldb/ldb.i index 6ecbfbfa08a..0f05c1fbab6 100644 --- a/source4/lib/ldb/ldb.i +++ b/source4/lib/ldb/ldb.i @@ -190,6 +190,7 @@ PyObject *ldb_val_to_py_object(struct ldb_context *ldb_ctx, } %apply const char * const *NULL_STR_LIST { const char * const *attrs } +%apply const char * const *NULL_STR_LIST { const char * const *options } %apply const char * const *NULL_STR_LIST { const char * const *control_strings } #endif @@ -711,9 +712,10 @@ typedef struct ldb_context { %feature("docstring") connect "S.connect(url,flags=0,options=None) -> None\n" \ "Connect to a LDB URL."; ldb_error connect(const char *url, unsigned int flags = 0, - const char *options[] = NULL); + const char *const *options = NULL); ~ldb() { talloc_free($self); } + ldb_error search_ex(TALLOC_CTX *mem_ctx, ldb_dn *base = NULL, enum ldb_scope scope = LDB_SCOPE_DEFAULT, diff --git a/source4/lib/ldb/ldb_wrap.c b/source4/lib/ldb/ldb_wrap.c index 3cf5ec613a7..4a34c1c998d 100644 --- a/source4/lib/ldb/ldb_wrap.c +++ b/source4/lib/ldb/ldb_wrap.c @@ -4822,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 ; @@ -4830,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 ; @@ -4860,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; }