From dda6c354f6f2c1da95cf42cea90f76ce033de38e Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 19 Sep 2010 22:36:12 +0200 Subject: s4:dsdb python stuff - introduce also here the "show_recycled" control But also here beside "show_deleted" to not loose compatibility with older provisions. Signed-off-by: Andrew Bartlett --- source4/scripting/bin/upgradeprovision | 9 ++++++--- source4/scripting/python/samba/__init__.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'source4') diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index c7dd4f8ec3..37c66b61a5 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -633,15 +633,18 @@ def add_deletedobj_containers(ref_samdb, samdb, names): ref_delObjCnt = ref_samdb.search(expression="(cn=Deleted Objects)", base=part, scope=SCOPE_SUBTREE, attrs=["dn"], - controls=["show_deleted:0"]) + controls=["show_deleted:0", + "show_recycled:0"]) delObjCnt = samdb.search(expression="(cn=Deleted Objects)", base=part, scope=SCOPE_SUBTREE, attrs=["dn"], - controls=["show_deleted:0"]) + controls=["show_deleted:0", + "show_recycled:0"]) if len(ref_delObjCnt) > len(delObjCnt): reference = ref_samdb.search(expression="cn=Deleted Objects", base=part, scope=SCOPE_SUBTREE, - controls=["show_deleted:0"]) + controls=["show_deleted:0", + "show_recycled:0"]) empty = Message() delta = samdb.msg_diff(empty, reference[0]) diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py index f249708ea2..5299e07466 100644 --- a/source4/scripting/python/samba/__init__.py +++ b/source4/scripting/python/samba/__init__.py @@ -166,7 +166,7 @@ class Ldb(_Ldb): # Delete the 'visible' records, and the invisble 'deleted' records (if this DB supports it) for msg in self.search(basedn, ldb.SCOPE_SUBTREE, "(&(|(objectclass=*)(distinguishedName=*))(!(distinguishedName=@BASEINFO)))", - [], controls=["show_deleted:0"]): + [], controls=["show_deleted:0", "show_recycled:0"]): try: self.delete(msg.dn, ["relax:0"]) except ldb.LdbError, (errno, _): @@ -175,7 +175,7 @@ class Ldb(_Ldb): raise res = self.search(basedn, ldb.SCOPE_SUBTREE, - "(&(|(objectclass=*)(distinguishedName=*))(!(distinguishedName=@BASEINFO)))", [], controls=["show_deleted:0"]) + "(&(|(objectclass=*)(distinguishedName=*))(!(distinguishedName=@BASEINFO)))", [], controls=["show_deleted:0", "show_recycled:0"]) assert len(res) == 0 # delete the specials -- cgit