The Samba-Bugzilla – Attachment 3111 Details for
Bug 5178
Registry backend: Problems when editing with regedit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Allow creating, deleting, and renaming keys.
patch-4 (text/plain), 1.98 KB, created by
Andrew Kroeger
on 2008-01-17 14:56:43 UTC
(
hide
)
Description:
Allow creating, deleting, and renaming keys.
Filename:
MIME Type:
Creator:
Andrew Kroeger
Created:
2008-01-17 14:56:43 UTC
Size:
1.98 KB
patch
obsolete
>diff --git a/source/lib/registry/ldb.c b/source/lib/registry/ldb.c >index 275d25f..28cfe66 100644 >--- a/source/lib/registry/ldb.c >+++ b/source/lib/registry/ldb.c >@@ -169,7 +169,13 @@ static struct ldb_dn *reg_path_to_ldb(TALLOC_CTX *mem_ctx, > else keyname = mypath; > > if(strlen(keyname)) { >- ldb_dn_add_base_fmt(ret, "key=%s", keyname); >+ if (!ldb_dn_add_base_fmt(ret, "key=%s", >+ reg_ldb_escape(local_ctx, >+ keyname))) >+ { >+ talloc_free(local_ctx); >+ return NULL; >+ } > } > > if(begin) { >@@ -427,18 +433,18 @@ static WERROR ldb_add_key(TALLOC_CTX *mem_ctx, const struct hive_key *parent, > return WERR_OK; > } > >-static WERROR ldb_del_key(const struct hive_key *key, const char *child) >+static WERROR ldb_del_key(const struct hive_key *key, const char *name) > { > int ret; > struct ldb_key_data *parentkd = talloc_get_type(key, struct ldb_key_data); >- struct ldb_dn *childdn; >+ struct ldb_dn *ldap_path; >+ TALLOC_CTX *mem_ctx = talloc_init("ldb_del_key"); > >- childdn = ldb_dn_copy(parentkd->ldb, parentkd->dn); >- ldb_dn_add_child_fmt(childdn, "key=%s", child); >+ ldap_path = reg_path_to_ldb(mem_ctx, key, name, NULL); > >- ret = ldb_delete(parentkd->ldb, childdn); >+ ret = ldb_delete(parentkd->ldb, ldap_path); > >- talloc_free(childdn); >+ talloc_free(mem_ctx); > > if (ret == LDB_ERR_NO_SUCH_OBJECT) { > return WERR_NOT_FOUND; >diff --git a/source/rpc_server/winreg/rpc_winreg.c b/source/rpc_server/winreg/rpc_winreg.c >index 7eba428..7686bbb 100644 >--- a/source/rpc_server/winreg/rpc_winreg.c >+++ b/source/rpc_server/winreg/rpc_winreg.c >@@ -356,6 +356,13 @@ static WERROR dcesrv_winreg_OpenKey(struct dcesrv_call_state *dce_call, > r->out.handle = &newh->wire_handle; > } else { > talloc_free(newh); >+ /* >+ * Windows expects WERR_BADFILE when a particular key >+ * is not found. If we receive WERR_NOT_FOUND from the lower >+ * layer calls, translate it here to return what is expected. >+ */ >+ if (W_ERROR_EQUAL(result, WERR_NOT_FOUND)) >+ return WERR_BADFILE; > } > > return result;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5178
:
3090
|
3108
|
3109
|
3110
|
3111
|
3112
|
3113
|
3152
|
3400
|
3464
|
3466
|
3472
|
3473
|
3474
|
3480
|
3481
|
3497
|
3572