diff options
author | Gerald Carter <jerry@samba.org> | 2005-08-26 18:10:21 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2005-08-26 18:10:21 +0000 |
commit | 03ab9f18a893acc85e43e69225d2c0a02c9c7832 (patch) | |
tree | a024e9ea093f1a4bad462250c4812a5c27a5a921 /source | |
parent | d1e2cb249d98ecd58eacaa511f3f80688a10077b (diff) | |
download | samba-03ab9f18a893acc85e43e69225d2c0a02c9c7832.tar.gz samba-03ab9f18a893acc85e43e69225d2c0a02c9c7832.tar.xz samba-03ab9f18a893acc85e43e69225d2c0a02c9c7832.zip |
r9657: fix final issue with regf sk_records; profiles now successfully rewrites
Win2k and WinXP user profile security descriptors.
Diffstat (limited to 'source')
-rw-r--r-- | source/registry/regfio.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/registry/regfio.c b/source/registry/regfio.c index c453130713c..e6e9455eb2c 100644 --- a/source/registry/regfio.c +++ b/source/registry/regfio.c @@ -1768,18 +1768,24 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) DLIST_ADD_END( file->sec_desc_list, nk->sec_desc, tmp ); - /* initialize offsets */ - - nk->sec_desc->prev_sk_off = nk->sec_desc->sk_off; - nk->sec_desc->next_sk_off = nk->sec_desc->sk_off; - - /* now update the offsets for us and the previous sd in the list */ + /* update the offsets for us and the previous sd in the list. + if this is the first record, then just set the next and prev + offsets to ourself. */ if ( nk->sec_desc->prev ) { REGF_SK_REC *prev = nk->sec_desc->prev; nk->sec_desc->prev_sk_off = prev->hbin_off + prev->hbin->first_hbin_off - HBIN_HDR_SIZE; prev->next_sk_off = nk->sec_desc->sk_off; + + /* the end must loop around to the front */ + nk->sec_desc->next_sk_off = file->sec_desc_list->sk_off; + + /* and first must loop around to the tail */ + file->sec_desc_list->prev_sk_off = nk->sec_desc->sk_off; + } else { + nk->sec_desc->prev_sk_off = nk->sec_desc->sk_off; + nk->sec_desc->next_sk_off = nk->sec_desc->sk_off; } } |