From: Andrew Bartlett Date: Mon, 20 May 2019 04:29:10 +0000 (+1200) Subject: sambaundoguididx: fix for -s X-Git-Tag: ldb-2.0.5~588 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40ca8ed5a152ae7c5ec039649c09a037a20a4143;p=thirdparty%2Fsamba.git sambaundoguididx: fix for -s Quick fix running this script with -s instead of -H. samdb_url() returns a url with a protocol prefix, which causes issues further down in the script. Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/source4/scripting/bin/sambaundoguididx b/source4/scripting/bin/sambaundoguididx index f67353ff361..7474acb2cab 100755 --- a/source4/scripting/bin/sambaundoguididx +++ b/source4/scripting/bin/sambaundoguididx @@ -30,7 +30,7 @@ lp_ctx = sambaopts.get_loadparm() lp_ctx.set("dsdb:guid index", "false") if opts.H is None: - url = lp_ctx.samdb_url() + url = lp_ctx.private_path("sam.ldb") else: url = opts.H @@ -62,7 +62,9 @@ dbs = [] for part in partitions[0]['partition']: dbname = str(part).split(":")[1] dbpath = os.path.join(privatedir, dbname) - db = ldb.Ldb(url="ldb://" + dbpath, + if os.path.isfile(dbpath): + dbpath = "ldb://" + dbpath + db = ldb.Ldb(url=dbpath, options=["modules:"], flags=ldb.FLG_DONT_CREATE_DB) db.transaction_start()