summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb.py
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/ldb.py')
-rw-r--r--source4/lib/ldb/ldb.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/source4/lib/ldb/ldb.py b/source4/lib/ldb/ldb.py
index 5a921b5394..ab2a68a4b3 100644
--- a/source4/lib/ldb/ldb.py
+++ b/source4/lib/ldb/ldb.py
@@ -71,6 +71,13 @@ class Dn(object):
def __init__(self, *args, **kwargs):
_ldb.Dn_swiginit(self,_ldb.new_Dn(*args, **kwargs))
__swig_destroy__ = _ldb.delete_Dn
+ def __eq__(self, other):
+ if isinstance(other, self.__class__):
+ return self.__cmp__(other) == 0
+ if isinstance(other, str):
+ return str(self) == other
+ return False
+
Dn.validate = new_instancemethod(_ldb.Dn_validate,None,Dn)
Dn.get_casefold = new_instancemethod(_ldb.Dn_get_casefold,None,Dn)
Dn.__str__ = new_instancemethod(_ldb.Dn___str__,None,Dn)
@@ -192,8 +199,16 @@ class Ldb(object):
if url is not None:
self.connect(url, flags, options)
+ def search(self, base=None, scope=SCOPE_DEFAULT, expression=None,
+ attrs=None, controls=None):
+ parsed_controls = None
+ if controls is not None:
+ parsed_controls = self.parse_control_strings(controls)
+ return self.search_ex(base, scope, expression, attrs,
+ parsed_controls)
+
Ldb.connect = new_instancemethod(_ldb.Ldb_connect,None,Ldb)
-Ldb.search = new_instancemethod(_ldb.Ldb_search,None,Ldb)
+Ldb.search_ex = new_instancemethod(_ldb.Ldb_search_ex,None,Ldb)
Ldb.delete = new_instancemethod(_ldb.Ldb_delete,None,Ldb)
Ldb.rename = new_instancemethod(_ldb.Ldb_rename,None,Ldb)
Ldb.parse_control_strings = new_instancemethod(_ldb.Ldb_parse_control_strings,None,Ldb)