s4-script: make enablerecyclebin use system_session
authorAndrew Tridgell <tridge@samba.org>
Thu, 11 Feb 2010 12:38:23 +0000 (23:38 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 11 Feb 2010 14:08:11 +0000 (01:08 +1100)
This allows it to work against our local ldb

source4/scripting/bin/enablerecyclebin

index d02e90b53346b45ede8fb3ff9fee75918f5ce79f..0d39fe7758aaea88d1fa2d4e395512e04a007e38 100755 (executable)
@@ -15,6 +15,7 @@ from samba import getopt as options, Ldb
 from ldb import SCOPE_SUBTREE, SCOPE_BASE, LdbError
 import sys
 import ldb
+from samba.auth import system_session
 
 parser = optparse.OptionParser("enablerecyclebin <URL>")
 sambaopts = options.SambaOptions(parser)
@@ -35,7 +36,7 @@ url = args[0]
 lp_ctx = sambaopts.get_loadparm()
 
 creds = credopts.get_credentials(lp_ctx)
-sam_ldb = Ldb(url, credentials=creds, lp=lp_ctx)
+sam_ldb = Ldb(url, session_info=system_session(), credentials=creds, lp=lp_ctx)
 
 # get the rootDSE
 res = sam_ldb.search(base="", expression="", scope=SCOPE_BASE, attrs=["configurationNamingContext"])