[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Sun Aug 7 13:08:02 MDT 2011


The branch, master has been updated
       via  24f6eaa sd_utils: Fix some formatting, add module docstring.
       via  3bcb871 pyldb: Generate ABI file.
       via  fdff105 pyldb: Consistently use pyldb_ prefix.
      from  a6be082 s3:web/swat: use strtoll() instead of atoi/atol/atoll

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 24f6eaa8f4aebf1e3aad59d52bdbfa88532be881
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Aug 7 18:55:14 2011 +0200

    sd_utils: Fix some formatting, add module docstring.
    
    Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date: Sun Aug  7 21:07:04 CEST 2011 on sn-devel-104

commit 3bcb8710fdb502028e61ab12ae847cb9a7364ae9
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Aug 7 17:17:18 2011 +0200

    pyldb: Generate ABI file.

commit fdff105854c52c334af2845a55f0473dcad5c55f
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Aug 7 17:08:56 2011 +0200

    pyldb: Consistently use pyldb_ prefix.

-----------------------------------------------------------------------

Summary of changes:
 lib/ldb-samba/pyldb.c                      |   12 +-
 lib/ldb/ABI/pyldb-util-1.1.2.sigs          |    2 +
 lib/ldb/pyldb.c                            |  228 ++++++++++++++-------------
 lib/ldb/pyldb.h                            |   20 +--
 lib/ldb/pyldb_util.c                       |    6 +-
 lib/ldb/wscript                            |    6 +-
 source4/auth/pyauth.c                      |    6 +-
 source4/dsdb/pydsdb.c                      |   21 ++--
 source4/libnet/py_net.c                    |    2 +-
 source4/param/provision.c                  |    4 +-
 source4/scripting/python/samba/sd_utils.py |    8 +-
 11 files changed, 162 insertions(+), 153 deletions(-)
 create mode 100644 lib/ldb/ABI/pyldb-util-1.1.2.sigs


Changeset truncated at 500 lines:

diff --git a/lib/ldb-samba/pyldb.c b/lib/ldb-samba/pyldb.c
index ff48a3b..aae25a0 100644
--- a/lib/ldb-samba/pyldb.c
+++ b/lib/ldb-samba/pyldb.c
@@ -54,7 +54,7 @@ static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "O", &py_lp_ctx))
 		return NULL;
 
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 
 	lp_ctx = lpcfg_from_py_object(ldb, py_lp_ctx);
 	if (lp_ctx == NULL) {
@@ -82,7 +82,7 @@ static PyObject *py_ldb_set_credentials(PyObject *self, PyObject *args)
 		return NULL;
 	}
 
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 
 	ldb_set_opaque(ldb, "credentials", creds);
 
@@ -102,7 +102,7 @@ static PyObject *py_ldb_set_opaque_integer(PyObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "si", &py_opaque_name, &value))
 		return NULL;
 
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 
 	/* see if we have a cached copy */
 	old_val = (int *)ldb_get_opaque(ldb, py_opaque_name);
@@ -158,7 +158,7 @@ static PyObject *py_ldb_set_utf8_casefold(PyObject *self)
 {
 	struct ldb_context *ldb;
 
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 
 	ldb_set_utf8_fns(ldb, NULL, wrap_casefold);
 
@@ -190,7 +190,7 @@ static PyObject *py_ldb_set_session_info(PyObject *self, PyObject *args)
 	if (!ret)
 		return NULL;
 
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 
 	info = PyAuthSession_AsSession(py_session_info);
 
@@ -206,7 +206,7 @@ static PyObject *py_ldb_register_samba_handlers(PyObject *self)
 
 	/* XXX: Perhaps call this from PySambaLdb's init function ? */
 
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 	ret = ldb_register_samba_handlers(ldb);
 
 	PyErr_LDB_ERROR_IS_ERR_RAISE(py_ldb_error, ret, ldb);
diff --git a/lib/ldb/ABI/pyldb-util-1.1.2.sigs b/lib/ldb/ABI/pyldb-util-1.1.2.sigs
new file mode 100644
index 0000000..74d6719
--- /dev/null
+++ b/lib/ldb/ABI/pyldb-util-1.1.2.sigs
@@ -0,0 +1,2 @@
+pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
+pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index e9af227..87b2307 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -40,10 +40,15 @@ static PyObject *PyExc_LdbError;
 staticforward PyTypeObject PyLdbControl;
 staticforward PyTypeObject PyLdbResult;
 staticforward PyTypeObject PyLdbMessage;
+#define PyLdbMessage_Check(ob) PyObject_TypeCheck(ob, &PyLdbMessage)
 staticforward PyTypeObject PyLdbModule;
 staticforward PyTypeObject PyLdbDn;
+#define pyldb_Dn_Check(ob) PyObject_TypeCheck(ob, &PyLdbDn)
 staticforward PyTypeObject PyLdb;
+#define PyLdb_Check(ob) PyObject_TypeCheck(ob, &PyLdb)
 staticforward PyTypeObject PyLdbMessageElement;
+#define pyldb_MessageElement_Check(ob) PyObject_TypeCheck(ob, &PyLdbMessageElement)
+
 staticforward PyTypeObject PyLdbTree;
 static PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx);
 static PyObject *PyLdbModule_FromModule(struct ldb_module *mod);
@@ -132,7 +137,7 @@ static PyObject *py_ldb_control_new(PyTypeObject *type, PyObject *args, PyObject
 		return NULL;
 	}
 
-	ldb_ctx = PyLdb_AsLdbContext(py_ldb);
+	ldb_ctx = pyldb_Ldb_AsLdbContext(py_ldb);
 	parsed_controls = ldb_parse_control_from_string(ldb_ctx, mem_ctx, data);
 
 	if (!parsed_controls) {
@@ -341,7 +346,7 @@ static struct ldb_result *PyLdbResult_AsResult(TALLOC_CTX *mem_ctx,
 	res->msgs = talloc_array(res, struct ldb_message *, res->count);
 	for (i = 0; i < res->count; i++) {
 		PyObject *item = PyList_GetItem(obj, i);
-		res->msgs[i] = PyLdbMessage_AsMessage(item);
+		res->msgs[i] = pyldb_Message_AsMessage(item);
 	}
 	return res;
 }
@@ -468,7 +473,7 @@ static int py_ldb_dn_compare(PyLdbDnObject *dn1, PyLdbDnObject *dn2)
 
 static PyObject *py_ldb_dn_get_parent(PyLdbDnObject *self)
 {
-	struct ldb_dn *dn = PyLdbDn_AsDn((PyObject *)self);
+	struct ldb_dn *dn = pyldb_Dn_AsDn((PyObject *)self);
 	struct ldb_dn *parent;
 	PyLdbDnObject *py_ret;
 	TALLOC_CTX *mem_ctx = talloc_new(NULL);
@@ -499,9 +504,9 @@ static PyObject *py_ldb_dn_add_child(PyLdbDnObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "O", &py_other))
 		return NULL;
 
-	dn = PyLdbDn_AsDn((PyObject *)self);
+	dn = pyldb_Dn_AsDn((PyObject *)self);
 
-	if (!PyObject_AsDn(NULL, py_other, dn_ldb_ctx(dn), &other))
+	if (!pyldb_Object_AsDn(NULL, py_other, dn_ldb_ctx(dn), &other))
 		return NULL;
 
 	return ldb_dn_add_child(dn, other)?Py_True:Py_False;
@@ -514,9 +519,9 @@ static PyObject *py_ldb_dn_add_base(PyLdbDnObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "O", &py_other))
 		return NULL;
 
-	dn = PyLdbDn_AsDn((PyObject *)self);
+	dn = pyldb_Dn_AsDn((PyObject *)self);
 
-	if (!PyObject_AsDn(NULL, py_other, dn_ldb_ctx(dn), &other))
+	if (!pyldb_Object_AsDn(NULL, py_other, dn_ldb_ctx(dn), &other))
 		return NULL;
 
 	return ldb_dn_add_base(dn, other)?Py_True:Py_False;
@@ -529,9 +534,9 @@ static PyObject *py_ldb_dn_is_child_of(PyLdbDnObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "O", &py_base))
 		return NULL;
 
-	dn = PyLdbDn_AsDn((PyObject *)self);
+	dn = pyldb_Dn_AsDn((PyObject *)self);
 
-	if (!PyObject_AsDn(NULL, py_base, dn_ldb_ctx(dn), &base))
+	if (!pyldb_Object_AsDn(NULL, py_base, dn_ldb_ctx(dn), &base))
 		return NULL;
 
 	return PyBool_FromLong(ldb_dn_compare_base(base, dn) == 0);
@@ -586,7 +591,7 @@ static PyMethodDef py_ldb_dn_methods[] = {
 
 static Py_ssize_t py_ldb_dn_len(PyLdbDnObject *self)
 {
-	return ldb_dn_get_comp_num(PyLdbDn_AsDn((PyObject *)self));
+	return ldb_dn_get_comp_num(pyldb_Dn_AsDn((PyObject *)self));
 }
 
 /*
@@ -608,11 +613,11 @@ static PyObject *py_ldb_dn_copy(struct ldb_dn *dn)
 
 static PyObject *py_ldb_dn_concat(PyLdbDnObject *self, PyObject *py_other)
 {
-	struct ldb_dn *dn = PyLdbDn_AsDn((PyObject *)self), 
+	struct ldb_dn *dn = pyldb_Dn_AsDn((PyObject *)self), 
 				  *other;
 	PyLdbDnObject *py_ret;
-	
-	if (!PyObject_AsDn(NULL, py_other, NULL, &other))
+
+	if (!pyldb_Object_AsDn(NULL, py_other, NULL, &other))
 		return NULL;
 
 	py_ret = (PyLdbDnObject *)PyLdbDn.tp_alloc(&PyLdbDn, 0);
@@ -646,7 +651,7 @@ static PyObject *py_ldb_dn_new(PyTypeObject *type, PyObject *args, PyObject *kwa
 					 &py_ldb, &str))
 		return NULL;
 
-	ldb_ctx = PyLdb_AsLdbContext(py_ldb);
+	ldb_ctx = pyldb_Ldb_AsLdbContext(py_ldb);
 
 	mem_ctx = talloc_new(NULL);
 	if (mem_ctx == NULL) {
@@ -709,7 +714,7 @@ static PyObject *py_ldb_set_debug(PyLdbObject *self, PyObject *args)
 
 	Py_INCREF(cb);
 	/* FIXME: Where do we DECREF cb ? */
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_set_debug(self->ldb_ctx, py_ldb_debug, cb), PyLdb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_set_debug(self->ldb_ctx, py_ldb_debug, cb), pyldb_Ldb_AsLdbContext(self));
 
 	Py_RETURN_NONE;
 }
@@ -720,7 +725,7 @@ static PyObject *py_ldb_set_create_perms(PyTypeObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "I", &perms))
 		return NULL;
 
-	ldb_set_create_perms(PyLdb_AsLdbContext(self), perms);
+	ldb_set_create_perms(pyldb_Ldb_AsLdbContext(self), perms);
 
 	Py_RETURN_NONE;
 }
@@ -731,38 +736,38 @@ static PyObject *py_ldb_set_modules_dir(PyTypeObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "s", &modules_dir))
 		return NULL;
 
-	ldb_set_modules_dir(PyLdb_AsLdbContext(self), modules_dir);
+	ldb_set_modules_dir(pyldb_Ldb_AsLdbContext(self), modules_dir);
 
 	Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_transaction_start(PyLdbObject *self)
 {
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_start(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_start(pyldb_Ldb_AsLdbContext(self)), pyldb_Ldb_AsLdbContext(self));
 	Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_transaction_commit(PyLdbObject *self)
 {
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_commit(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_commit(pyldb_Ldb_AsLdbContext(self)), pyldb_Ldb_AsLdbContext(self));
 	Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_transaction_prepare_commit(PyLdbObject *self)
 {
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_prepare_commit(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_prepare_commit(pyldb_Ldb_AsLdbContext(self)), pyldb_Ldb_AsLdbContext(self));
 	Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_transaction_cancel(PyLdbObject *self)
 {
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_cancel(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_cancel(pyldb_Ldb_AsLdbContext(self)), pyldb_Ldb_AsLdbContext(self));
 	Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_setup_wellknown_attributes(PyLdbObject *self)
 {
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_setup_wellknown_attributes(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_setup_wellknown_attributes(pyldb_Ldb_AsLdbContext(self)), pyldb_Ldb_AsLdbContext(self));
 	Py_RETURN_NONE;
 }
 
@@ -773,7 +778,7 @@ static PyObject *py_ldb_repr(PyLdbObject *self)
 
 static PyObject *py_ldb_get_root_basedn(PyLdbObject *self)
 {
-	struct ldb_dn *dn = ldb_get_root_basedn(PyLdb_AsLdbContext(self));
+	struct ldb_dn *dn = ldb_get_root_basedn(pyldb_Ldb_AsLdbContext(self));
 	if (dn == NULL)
 		Py_RETURN_NONE;
 	return py_ldb_dn_copy(dn);
@@ -782,7 +787,7 @@ static PyObject *py_ldb_get_root_basedn(PyLdbObject *self)
 
 static PyObject *py_ldb_get_schema_basedn(PyLdbObject *self)
 {
-	struct ldb_dn *dn = ldb_get_schema_basedn(PyLdb_AsLdbContext(self));
+	struct ldb_dn *dn = ldb_get_schema_basedn(pyldb_Ldb_AsLdbContext(self));
 	if (dn == NULL)
 		Py_RETURN_NONE;
 	return py_ldb_dn_copy(dn);
@@ -790,7 +795,7 @@ static PyObject *py_ldb_get_schema_basedn(PyLdbObject *self)
 
 static PyObject *py_ldb_get_config_basedn(PyLdbObject *self)
 {
-	struct ldb_dn *dn = ldb_get_config_basedn(PyLdb_AsLdbContext(self));
+	struct ldb_dn *dn = ldb_get_config_basedn(pyldb_Ldb_AsLdbContext(self));
 	if (dn == NULL)
 		Py_RETURN_NONE;
 	return py_ldb_dn_copy(dn);
@@ -798,7 +803,7 @@ static PyObject *py_ldb_get_config_basedn(PyLdbObject *self)
 
 static PyObject *py_ldb_get_default_basedn(PyLdbObject *self)
 {
-	struct ldb_dn *dn = ldb_get_default_basedn(PyLdb_AsLdbContext(self));
+	struct ldb_dn *dn = ldb_get_default_basedn(pyldb_Ldb_AsLdbContext(self));
 	if (dn == NULL)
 		Py_RETURN_NONE;
 	return py_ldb_dn_copy(dn);
@@ -847,7 +852,7 @@ static int py_ldb_init(PyLdbObject *self, PyObject *args, PyObject *kwargs)
 					 &url, &flags, &py_options))
 		return -1;
 
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 
 	if (py_options == Py_None) {
 		options = NULL;
@@ -912,10 +917,10 @@ static PyObject *py_ldb_connect(PyLdbObject *self, PyObject *args, PyObject *kwa
 			return NULL;
 	}
 
-	ret = ldb_connect(PyLdb_AsLdbContext(self), url, flags, options);
+	ret = ldb_connect(pyldb_Ldb_AsLdbContext(self), url, flags, options);
 	talloc_free(options);
 
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, PyLdb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, pyldb_Ldb_AsLdbContext(self));
 
 	Py_RETURN_NONE;
 }
@@ -943,7 +948,7 @@ static PyObject *py_ldb_modify(PyLdbObject *self, PyObject *args, PyObject *kwar
 		PyErr_NoMemory();
 		return NULL;
 	}
-	ldb_ctx = PyLdb_AsLdbContext(self);
+	ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 
 	if (py_controls == Py_None) {
 		parsed_controls = NULL;
@@ -958,7 +963,7 @@ static PyObject *py_ldb_modify(PyLdbObject *self, PyObject *args, PyObject *kwar
 		talloc_free(mem_ctx);
 		return NULL;
 	}
-	msg = PyLdbMessage_AsMessage(py_msg);
+	msg = pyldb_Message_AsMessage(py_msg);
 
 	if (validate) {
 		ret = ldb_msg_sanity_check(ldb_ctx, msg);
@@ -1033,7 +1038,7 @@ static struct ldb_message *PyDict_AsMessage(TALLOC_CTX *mem_ctx,
 	msg->elements = talloc_zero_array(msg, struct ldb_message_element, PyDict_Size(py_obj));
 
 	if (dn_value) {
-		if (!PyObject_AsDn(msg, dn_value, ldb_ctx, &msg->dn)) {
+		if (!pyldb_Object_AsDn(msg, dn_value, ldb_ctx, &msg->dn)) {
 			PyErr_SetString(PyExc_TypeError, "unable to import dn object");
 			return NULL;
 		}
@@ -1087,7 +1092,7 @@ static PyObject *py_ldb_add(PyLdbObject *self, PyObject *args, PyObject *kwargs)
 		PyErr_NoMemory();
 		return NULL;
 	}
-	ldb_ctx = PyLdb_AsLdbContext(self);
+	ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 
 	if (py_controls == Py_None) {
 		parsed_controls = NULL;
@@ -1098,7 +1103,7 @@ static PyObject *py_ldb_add(PyLdbObject *self, PyObject *args, PyObject *kwargs)
 	}
 
 	if (PyLdbMessage_Check(py_obj)) {
-		msg = PyLdbMessage_AsMessage(py_obj);
+		msg = pyldb_Message_AsMessage(py_obj);
 	} else if (PyDict_Check(py_obj)) {
 		msg = PyDict_AsMessage(mem_ctx, py_obj, ldb_ctx, LDB_FLAG_MOD_ADD);
 	} else {
@@ -1179,7 +1184,7 @@ static PyObject *py_ldb_delete(PyLdbObject *self, PyObject *args, PyObject *kwar
 		PyErr_NoMemory();
 		return NULL;
 	}
-	ldb_ctx = PyLdb_AsLdbContext(self);
+	ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 
 	if (py_controls == Py_None) {
 		parsed_controls = NULL;
@@ -1189,7 +1194,7 @@ static PyObject *py_ldb_delete(PyLdbObject *self, PyObject *args, PyObject *kwar
 		talloc_free(controls);
 	}
 
-	if (!PyObject_AsDn(mem_ctx, py_dn, ldb_ctx, &dn)) {
+	if (!pyldb_Object_AsDn(mem_ctx, py_dn, ldb_ctx, &dn)) {
 		talloc_free(mem_ctx);
 		return NULL;
 	}
@@ -1245,7 +1250,7 @@ static PyObject *py_ldb_rename(PyLdbObject *self, PyObject *args, PyObject *kwar
 	struct ldb_request *req;
 	const char * const kwnames[] = { "dn1", "dn2", "controls", NULL };
 
-	ldb_ctx = PyLdb_AsLdbContext(self);
+	ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 
 	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|O",
 					 discard_const_p(char *, kwnames),
@@ -1258,7 +1263,7 @@ static PyObject *py_ldb_rename(PyLdbObject *self, PyObject *args, PyObject *kwar
 		PyErr_NoMemory();
 		return NULL;
 	}
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 
 	if (py_controls == Py_None) {
 		parsed_controls = NULL;
@@ -1269,12 +1274,12 @@ static PyObject *py_ldb_rename(PyLdbObject *self, PyObject *args, PyObject *kwar
 	}
 
 
-	if (!PyObject_AsDn(mem_ctx, py_dn1, ldb, &dn1)) {
+	if (!pyldb_Object_AsDn(mem_ctx, py_dn1, ldb, &dn1)) {
 		talloc_free(mem_ctx);
 		return NULL;
 	}
 
-	if (!PyObject_AsDn(mem_ctx, py_dn2, ldb, &dn2)) {
+	if (!pyldb_Object_AsDn(mem_ctx, py_dn2, ldb, &dn2)) {
 		talloc_free(mem_ctx);
 		return NULL;
 	}
@@ -1323,7 +1328,7 @@ static PyObject *py_ldb_schema_attribute_remove(PyLdbObject *self, PyObject *arg
 	if (!PyArg_ParseTuple(args, "s", &name))
 		return NULL;
 
-	ldb_schema_attribute_remove(PyLdb_AsLdbContext(self), name);
+	ldb_schema_attribute_remove(pyldb_Ldb_AsLdbContext(self), name);
 
 	Py_RETURN_NONE;
 }
@@ -1336,9 +1341,9 @@ static PyObject *py_ldb_schema_attribute_add(PyLdbObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "sIs", &attribute, &flags, &syntax))
 		return NULL;
 
-	ret = ldb_schema_attribute_add(PyLdb_AsLdbContext(self), attribute, flags, syntax);
+	ret = ldb_schema_attribute_add(pyldb_Ldb_AsLdbContext(self), attribute, flags, syntax);
 
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, PyLdb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, pyldb_Ldb_AsLdbContext(self));
 
 	Py_RETURN_NONE;
 }
@@ -1373,12 +1378,12 @@ static PyObject *py_ldb_write_ldif(PyLdbObject *self, PyObject *args)
 		return NULL;
 	}
 
-	ldif.msg = PyLdbMessage_AsMessage(py_msg);
+	ldif.msg = pyldb_Message_AsMessage(py_msg);
 	ldif.changetype = changetype;
 
 	mem_ctx = talloc_new(NULL);
 
-	string = ldb_ldif_write_string(PyLdb_AsLdbContext(self), mem_ctx, &ldif);
+	string = ldb_ldif_write_string(pyldb_Ldb_AsLdbContext(self), mem_ctx, &ldif);
 	if (!string) {
 		PyErr_SetString(PyExc_KeyError, "Failed to generate LDIF");
 		return NULL;
@@ -1445,10 +1450,10 @@ static PyObject *py_ldb_msg_diff(PyLdbObject *self, PyObject *args)
 		return NULL;
 	}
 
-	ldb = PyLdb_AsLdbContext(self);
+	ldb = pyldb_Ldb_AsLdbContext(self);
 	ldb_ret = ldb_msg_difference(ldb, ldb,
-	                             PyLdbMessage_AsMessage(py_msg_old),
-	                             PyLdbMessage_AsMessage(py_msg_new),
+	                             pyldb_Message_AsMessage(py_msg_old),
+	                             pyldb_Message_AsMessage(py_msg_new),
 	                             &diff);
 	if (ldb_ret != LDB_SUCCESS) {
 		PyErr_SetString(PyExc_RuntimeError, "Failed to generate the Ldb Message diff");
@@ -1480,13 +1485,13 @@ static PyObject *py_ldb_schema_format_value(PyLdbObject *self, PyObject *args)
 	old_val.data = (uint8_t *)PyString_AsString(val);
 	old_val.length = PyString_Size(val);
 
-	a = ldb_schema_attribute_by_name(PyLdb_AsLdbContext(self), element_name);
+	a = ldb_schema_attribute_by_name(pyldb_Ldb_AsLdbContext(self), element_name);
 
 	if (a == NULL) {
 		Py_RETURN_NONE;
 	}
 
-	if (a->syntax->ldif_write_fn(PyLdb_AsLdbContext(self), mem_ctx, &old_val, &new_val) != 0) {
+	if (a->syntax->ldif_write_fn(pyldb_Ldb_AsLdbContext(self), mem_ctx, &old_val, &new_val) != 0) {
 		talloc_free(mem_ctx);
 		Py_RETURN_NONE;
 	}
@@ -1528,7 +1533,7 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar
 		PyErr_NoMemory();
 		return NULL;
 	}
-	ldb_ctx = PyLdb_AsLdbContext(self);
+	ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 
 	if (py_attrs == Py_None) {
 		attrs = NULL;
@@ -1543,7 +1548,7 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar
 	if (py_base == Py_None) {
 		base = ldb_get_default_basedn(ldb_ctx);
 	} else {
-		if (!PyObject_AsDn(ldb_ctx, py_base, ldb_ctx, &base)) {
+		if (!pyldb_Object_AsDn(ldb_ctx, py_base, ldb_ctx, &base)) {
 			talloc_free(attrs);
 			return NULL;
 		}
@@ -1609,7 +1614,7 @@ static PyObject *py_ldb_get_opaque(PyLdbObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "s", &name))
 		return NULL;
 
-	data = ldb_get_opaque(PyLdb_AsLdbContext(self), name);
+	data = ldb_get_opaque(pyldb_Ldb_AsLdbContext(self), name);
 
 	if (data == NULL)
 		Py_RETURN_NONE;
@@ -1629,14 +1634,14 @@ static PyObject *py_ldb_set_opaque(PyLdbObject *self, PyObject *args)
 
 	/* FIXME: More interpretation */
 
-	ldb_set_opaque(PyLdb_AsLdbContext(self), name, data);
+	ldb_set_opaque(pyldb_Ldb_AsLdbContext(self), name, data);
 
 	Py_RETURN_NONE;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list