dsdb: Make secrets_tdb_sync cope with -H secrets.ldb
authorAndrew Bartlett <abartlet@samba.org>
Wed, 12 Sep 2012 13:34:29 +0000 (15:34 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 16 Nov 2012 09:45:25 +0000 (10:45 +0100)
The issue was, without a / in the path, we did not cope.

Andrew Bartlett
Reviewed-by: Michael Adam <obnox@samba.org>
source4/dsdb/samdb/ldb_modules/secrets_tdb_sync.c

index c742d868487e4ecefccdb3d84902b039fba418fd..e90fc77068f0424e4882d1478fb2f2a0b251b22d 100644 (file)
@@ -498,11 +498,12 @@ static int secrets_tdb_sync_init(struct ldb_module *module)
        p = strrchr(private_dir, '/');
        if (p) {
                *p = '\0';
+               secrets_init_path(private_dir);
        } else {
-               return ldb_operr(ldb);
+               secrets_init_path(".");
        }
 
-       secrets_init_path(private_dir);
+       TALLOC_FREE(private_dir);
 
        data->secrets_tdb = secrets_db_ctx();