diff options
Diffstat (limited to 'source4/lib/registry/reg_samba.c')
-rw-r--r-- | source4/lib/registry/reg_samba.c | 12 |
1 files changed, 7 insertions, 5 deletions
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 |