summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-08-26 18:10:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:24 -0500
commitf5b2238bb3812dceb4262a4b26021350a68d7af3 (patch)
tree0b6b93a037ca614e47a6e6ea37d11d05d2054f63 /source3
parentd602d8c442a7cbcbf96f9f5673d92073d4361def (diff)
downloadsamba-f5b2238bb3812dceb4262a4b26021350a68d7af3.tar.gz
samba-f5b2238bb3812dceb4262a4b26021350a68d7af3.tar.bz2
samba-f5b2238bb3812dceb4262a4b26021350a68d7af3.zip
r9657: fix final issue with regf sk_records; profiles now successfully rewrites
Win2k and WinXP user profile security descriptors. (This used to be commit 3a3bf4ddb702647b48baf9073c4fca0e1e16a194)
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/regfio.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c
index c453130713..e6e9455eb2 100644
--- a/source3/registry/regfio.c
+++ b/source3/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;
}
}