svn commit: samba r4141 - in
branches/SAMBA_4_0/source/lib/registry: . common
jelmer at samba.org
jelmer at samba.org
Fri Dec 10 23:13:17 GMT 2004
Author: jelmer
Date: 2004-12-10 23:13:17 +0000 (Fri, 10 Dec 2004)
New Revision: 4141
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4141
Log:
Fix crash bug in ldb backend
Modified:
branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c
branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c 2004-12-10 22:57:43 UTC (rev 4140)
+++ branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c 2004-12-10 23:13:17 UTC (rev 4141)
@@ -150,7 +150,7 @@
WERROR reg_open_hive(struct registry_context *parent_ctx, const char *backend, const char *location, const char *credentials, struct registry_key **root)
{
struct registry_hive *rethive;
- struct registry_key *retkey;
+ struct registry_key *retkey = NULL;
struct reg_init_function_entry *entry;
WERROR werr;
@@ -173,17 +173,17 @@
werr = entry->hive_functions->open_hive(rethive, &retkey);
- rethive->root = retkey;
-
if(!W_ERROR_IS_OK(werr)) {
return werr;
}
-
+
if(!retkey) {
DEBUG(0, ("Backend %s didn't provide root key!\n", backend));
return WERR_GENERAL_FAILURE;
}
+ rethive->root = retkey;
+
retkey->hive = rethive;
retkey->name = NULL;
retkey->path = talloc_strdup(retkey, "");
Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb.c 2004-12-10 22:57:43 UTC (rev 4140)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb.c 2004-12-10 23:13:17 UTC (rev 4141)
@@ -196,12 +196,12 @@
ldb_set_debug_stderr(c);
hive->backend_data = c;
- hive->root = talloc_zero_p(hive, struct registry_key);
- talloc_set_destructor (hive->root, reg_close_ldb_key);
+ *k = talloc_zero_p(hive, struct registry_key);
+ talloc_set_destructor (*k, reg_close_ldb_key);
talloc_set_destructor (hive, ldb_close_hive);
- hive->root->name = talloc_strdup(hive->root, "");
- hive->root->backend_data = kd = talloc_zero_p(hive->root, struct ldb_key_data);
- kd->dn = talloc_strdup(hive->root, "key=root");
+ (*k)->name = talloc_strdup(*k, "");
+ (*k)->backend_data = kd = talloc_zero_p(*k, struct ldb_key_data);
+ kd->dn = talloc_strdup(*k, "key=root");
return WERR_OK;
More information about the samba-cvs
mailing list