Author: jerry Date: 2005-08-26 18:10:21 +0000 (Fri, 26 Aug 2005) New Revision: 9657
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9657 Log: fix final issue with regf sk_records; profiles now successfully rewrites Win2k and WinXP user profile security descriptors. Modified: branches/SAMBA_3_0/source/registry/regfio.c trunk/source/registry/regfio.c Changeset: Modified: branches/SAMBA_3_0/source/registry/regfio.c =================================================================== --- branches/SAMBA_3_0/source/registry/regfio.c 2005-08-26 17:40:42 UTC (rev 9656) +++ branches/SAMBA_3_0/source/registry/regfio.c 2005-08-26 18:10:21 UTC (rev 9657) @@ -1768,18 +1768,24 @@ DLIST_ADD_END( file->sec_desc_list, nk->sec_desc, tmp ); - /* initialize offsets */ + /* 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. */ - 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 */ - 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; } } Modified: trunk/source/registry/regfio.c =================================================================== --- trunk/source/registry/regfio.c 2005-08-26 17:40:42 UTC (rev 9656) +++ trunk/source/registry/regfio.c 2005-08-26 18:10:21 UTC (rev 9657) @@ -1768,18 +1768,24 @@ DLIST_ADD_END( file->sec_desc_list, nk->sec_desc, tmp ); - /* initialize offsets */ + /* 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. */ - 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 */ - 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; } }
