Merge branch 'master' of ssh://git.samba.org/data/git/samba
[nivanova/samba-autobuild/.git] / source4 / lib / ldb / ldb.i
index 60134622251815e9ab57208034650ef0e59c7037..0f05c1fbab6bfaf66938bb5c0e734ea9d2da96cf 100644 (file)
@@ -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
@@ -216,7 +217,7 @@ typedef struct ldb_dn {
                we do it this way... */
             talloc_steal(NULL, ret);
 
-            if (ret == NULL)
+            if (ret == NULL || !ldb_dn_validate(ret))
                 SWIG_exception(SWIG_ValueError, 
                                 "unable to parse dn string");
 fail:
@@ -262,7 +263,6 @@ fail:
         {
             char *dn = ldb_dn_get_linearized($self), *ret;
             asprintf(&ret, "Dn('%s')", dn);
-            talloc_free(dn);
             return ret;
         }
 
@@ -712,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,