diff options
author | Michael Adam <obnox@samba.org> | 2011-07-04 13:06:20 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-07-04 20:02:08 +0200 |
commit | 15a50ef8f856d83508ece3a8294dfaffbadc3b41 (patch) | |
tree | 5a9c3581b531458770123c92aeeb196e10257310 /source3/registry | |
parent | fc4d79d41a18ed3c2a2f8a831e5dcc3002423ab1 (diff) | |
download | samba-15a50ef8f856d83508ece3a8294dfaffbadc3b41.tar.gz samba-15a50ef8f856d83508ece3a8294dfaffbadc3b41.tar.bz2 samba-15a50ef8f856d83508ece3a8294dfaffbadc3b41.zip |
s3:registry: add new mode to regdb_store_subkey_list() for handing in NULL parent key
Standard behaviour is to concatenate parent and key path (parent\key).
This new mode allows for storing subkey lists for base keys using a NULL
parent argument.
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_backend_db.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 34c25d8357..efb2b46b88 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -858,6 +858,8 @@ done: * Utility function to store a new empty list of * subkeys of given key specified as parent and subkey name * (thereby creating the key). + * If the parent keyname is NULL, then the "subkey" is + * interpreted as a base key. * If the subkey list does already exist, it is not modified. * * Must be called from within a transaction. @@ -870,7 +872,11 @@ static WERROR regdb_store_subkey_list(struct db_context *db, const char *parent, struct regsubkey_ctr *subkeys = NULL; TALLOC_CTX *frame = talloc_stackframe(); - path = talloc_asprintf(frame, "%s\\%s", parent, key); + if (parent == NULL) { + path = talloc_strdup(frame, key); + } else { + path = talloc_asprintf(frame, "%s\\%s", parent, key); + } if (!path) { werr = WERR_NOMEM; goto done; |