r9209: - fixed the ldb registry backend to work with the new provision ldif
authorAndrew Tridgell <tridge@samba.org>
Mon, 8 Aug 2005 03:19:28 +0000 (03:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:31:31 +0000 (13:31 -0500)
- default to ldb backend if none specified
(This used to be commit 8c3f57f7917efceb11b3b6a2ac76ec44968fbfb6)

source4/lib/registry/reg_backend_ldb.c
source4/lib/registry/reg_samba.c

index 5f4e296edfc56e4910307142cb46e63ffbac3d7b..8a5eac59c52647b28e722d87ed7435ebb9cce98f 100644 (file)
@@ -250,7 +250,7 @@ static WERROR ldb_open_hive(struct registry_hive *hive, struct registry_key **k)
        talloc_set_destructor (hive, ldb_free_hive);
        (*k)->name = talloc_strdup(*k, "");
        (*k)->backend_data = kd = talloc_zero(*k, struct ldb_key_data);
-       kd->dn = talloc_strdup(*k, "hive=");
+       kd->dn = talloc_strdup(*k, "hive=NONE");
        
 
        return WERR_OK;
index 7188109daa83bca8a49701094fe654b1afe86ec2..3c9ae3f4153a46193619595bbb7d227aea9babdf 100644 (file)
@@ -27,7 +27,8 @@ static WERROR reg_samba_get_predef (struct registry_context *ctx, uint32_t hkey,
 {
        WERROR error;
        const char *conf;
-       char *backend, *location;
+       char *backend;
+       const char *location;
        const char *hivename = reg_get_predef_name(hkey);
 
        *k = NULL;
@@ -38,12 +39,13 @@ static WERROR reg_samba_get_predef (struct registry_context *ctx, uint32_t hkey,
                return WERR_NOT_SUPPORTED;
        }
 
-       backend = talloc_strdup(NULL, conf);
-       location = strchr(backend, ':');
-
+       location = strchr(conf, ':');
        if (location) {
-               *location = '\0';
+               backend = talloc_strndup(ctx, conf, (int)(location - conf));
                location++;
+       } else {
+               backend = talloc_strdup(ctx, "ldb");
+               location = conf;
        }
 
        /* FIXME: Different hive backend for HKEY_CLASSES_ROOT: merged view of HKEY_LOCAL_MACHINE\Software\Classes