summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-08 03:19:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:31 -0500
commita689b968b6c1b47b0425f753472f1e221d2dea67 (patch)
tree7c271f69cf11da5838497eb3ec5f376c9e9445db /source4
parentede70c80e88bab269795a6ee403050c64fbc9292 (diff)
downloadsamba-a689b968b6c1b47b0425f753472f1e221d2dea67.tar.gz
samba-a689b968b6c1b47b0425f753472f1e221d2dea67.tar.bz2
samba-a689b968b6c1b47b0425f753472f1e221d2dea67.zip
r9209: - fixed the ldb registry backend to work with the new provision ldif
- default to ldb backend if none specified (This used to be commit 8c3f57f7917efceb11b3b6a2ac76ec44968fbfb6)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/reg_backend_ldb.c2
-rw-r--r--source4/lib/registry/reg_samba.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/source4/lib/registry/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb.c
index 5f4e296edf..8a5eac59c5 100644
--- a/source4/lib/registry/reg_backend_ldb.c
+++ b/source4/lib/registry/reg_backend_ldb.c
@@ -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;
diff --git a/source4/lib/registry/reg_samba.c b/source4/lib/registry/reg_samba.c
index 7188109daa..3c9ae3f415 100644
--- a/source4/lib/registry/reg_samba.c
+++ b/source4/lib/registry/reg_samba.c
@@ -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