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;
{
WERROR error;
const char *conf;
- char *backend, *location;
+ char *backend;
+ const char *location;
const char *hivename = reg_get_predef_name(hkey);
*k = NULL;
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