mirror of
https://github.com/samba-team/samba.git
synced 2025-11-25 00:23:52 +03:00
r9387: regedit uses "New Key #nn" for newly created keys, which conflicts with the stricter
DN rules in ldb. Escape the DN components to cope. Simo, sorry for making a change in ldb_dn.c while you have changes pending. Please feel free to revert these and switch reg_backend_ldb.c to use the new dn construction code.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
ae42976590
commit
136ecf5cb2
@@ -126,12 +126,24 @@ static char *reg_path_to_ldb(TALLOC_CTX *mem_ctx, struct registry_key *from, con
|
||||
while(mypath) {
|
||||
char *keyname;
|
||||
begin = strrchr(mypath, '\\');
|
||||
struct ldb_val val;
|
||||
char *key;
|
||||
|
||||
if(begin) keyname = begin + 1;
|
||||
if (begin) keyname = begin + 1;
|
||||
else keyname = mypath;
|
||||
|
||||
if(strlen(keyname))
|
||||
ret = talloc_asprintf_append(ret, "key=%s,", keyname);
|
||||
val.data = keyname;
|
||||
val.length = strlen(keyname);
|
||||
|
||||
key = ldb_dn_escape_value(mem_ctx, val);
|
||||
if (key == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strlen(key))
|
||||
ret = talloc_asprintf_append(ret, "key=%s,", key);
|
||||
|
||||
talloc_free(key);
|
||||
|
||||
if(begin) {
|
||||
*begin = '\0';
|
||||
|
||||
Reference in New Issue
Block a user