diff options
author | Michael Adam <obnox@samba.org> | 2009-07-15 12:50:55 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-07-15 14:01:58 +0200 |
commit | 78576117eb4292e4e2750928d5f84c2edc94192f (patch) | |
tree | afe09eff694c385493f1c157e56b469bfa7d8f38 /source3/registry | |
parent | 92df5e4a0243bde6fbc5261bf6758090c4c35eee (diff) | |
download | samba-78576117eb4292e4e2750928d5f84c2edc94192f.tar.gz samba-78576117eb4292e4e2750928d5f84c2edc94192f.tar.bz2 samba-78576117eb4292e4e2750928d5f84c2edc94192f.zip |
s3:registry: flush the provided subkey_ctr in regdb_fetch_keys_internal()
This way, we always return what has really been read from the db,
and not more. The callers assume exactly this, but one could hand
in an already pre-filled subkey container...
Michael
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_backend_db.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 7825edd5c2..9fd5c3161b 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -1474,6 +1474,9 @@ static WERROR regdb_fetch_keys_internal(struct db_context *db, const char *key, buflen = value.dsize; len = tdb_unpack( buf, buflen, "d", &num_items); + werr = regsubkey_ctr_reinit(ctr); + W_ERROR_NOT_OK_GOTO_DONE(werr); + for (i=0; i<num_items; i++) { len += tdb_unpack(buf+len, buflen-len, "f", subkeyname); werr = regsubkey_ctr_addkey(ctr, subkeyname); |