summaryrefslogtreecommitdiff
path: root/lib/ldb/pyldb.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-07-06 19:57:10 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-07-06 22:55:49 +1000
commit979215ad59e3a1dcb2dddeb1749d8f2eb1a920c3 (patch)
treebca2ea85ced512f58ca55279c4564b4850cdf115 /lib/ldb/pyldb.c
parente4077a8ca57c044bdd177dba1cbb81c3b802fe4c (diff)
downloadsamba-979215ad59e3a1dcb2dddeb1749d8f2eb1a920c3.tar.gz
samba-979215ad59e3a1dcb2dddeb1749d8f2eb1a920c3.tar.bz2
samba-979215ad59e3a1dcb2dddeb1749d8f2eb1a920c3.zip
pyldb: Add bindings for ldb_dn_remove_base_components
Diffstat (limited to 'lib/ldb/pyldb.c')
-rw-r--r--lib/ldb/pyldb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 9c8a70b529..8c9d6b9599 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -529,6 +529,18 @@ static PyObject *py_ldb_dn_add_base(PyLdbDnObject *self, PyObject *args)
return ldb_dn_add_base(dn, other)?Py_True:Py_False;
}
+static PyObject *py_ldb_dn_remove_base_components(PyLdbDnObject *self, PyObject *args)
+{
+ struct ldb_dn *dn;
+ int i;
+ if (!PyArg_ParseTuple(args, "i", &i))
+ return NULL;
+
+ dn = pyldb_Dn_AsDn((PyObject *)self);
+
+ return ldb_dn_remove_base_components(dn, i)?Py_True:Py_False;
+}
+
static PyObject *py_ldb_dn_is_child_of(PyLdbDnObject *self, PyObject *args)
{
PyObject *py_base;
@@ -579,6 +591,9 @@ static PyMethodDef py_ldb_dn_methods[] = {
{ "add_base", (PyCFunction)py_ldb_dn_add_base, METH_VARARGS,
"S.add_base(dn) -> None\n"
"Add a base DN to this DN." },
+ { "remove_base_components", (PyCFunction)py_ldb_dn_remove_base_components, METH_VARARGS,
+ "S.remove_base_components(int) -> bool\n"
+ "Remove a number of DN components from the base of this DN." },
{ "check_special", (PyCFunction)py_ldb_dn_check_special, METH_VARARGS,
"S.check_special(name) -> bool\n\n"
"Check if name is a special DN name"},