diff options
author | Richard Sharpe <sharpe@samba.org> | 2003-04-20 02:30:24 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2003-04-20 02:30:24 +0000 |
commit | fdd5d9739a25209b091153a171352a9addcffc0f (patch) | |
tree | e25b47916ff4d80966ff68c7d631cb91d7aa7e03 /source3/utils | |
parent | 95b2ff81b5dcf7f090a36f8044b908b34f7579f1 (diff) | |
download | samba-fdd5d9739a25209b091153a171352a9addcffc0f.tar.gz samba-fdd5d9739a25209b091153a171352a9addcffc0f.tar.bz2 samba-fdd5d9739a25209b091153a171352a9addcffc0f.zip |
MOre functionality ... got to test it.
(This used to be commit e3c4f8c91394eecc8c77bbf0f9685cdb18c617b1)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/editreg.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/source3/utils/editreg.c b/source3/utils/editreg.c index 43cd14d57d..2c8f543690 100644 --- a/source3/utils/editreg.c +++ b/source3/utils/editreg.c @@ -993,7 +993,7 @@ REG_KEY *nt_add_reg_key(REG_KEY *key, char *name, int create); REG_KEY *nt_add_reg_key_list(REG_KEY *key, char * name, int create) { int i; - REG_KEY *ret; + REG_KEY *ret = NULL, *tmp = NULL; KEY_LIST *list; char *lname, *c1, *c2; @@ -1003,7 +1003,8 @@ REG_KEY *nt_add_reg_key_list(REG_KEY *key, char * name, int create) if (!list) { /* Create an empty list */ list = (KEY_LIST *)malloc(sizeof(KEY_LIST) + (REG_KEY_LIST_SIZE - 1) * sizeof(REG_KEY *)); - list->key_count = list->max_keys = 0; + list->key_count = 0; + list->max_keys = REG_KEY_LIST_SIZE; } @@ -1040,7 +1041,26 @@ REG_KEY *nt_add_reg_key_list(REG_KEY *key, char * name, int create) list->key_count++; } - return NULL; + /* + * add the new key at the new slot + * FIXME: Sort the list someday + */ + + /* + * We want to create the key, and then do the rest + */ + + tmp = (REG_KEY *)malloc(sizeof(REG_KEY)); + + bzero(tmp, sizeof(REG_KEY)); + + list->keys[list->key_count - 1] = tmp; + + if (c2) { + ret = nt_add_reg_key(key, name, True); + } + + return ret; error: if (lname) free(lname); return NULL; |