SoftwareTipsandTricks Forum

Go Back   SoftwareTipsandTricks Forum > Operating Systems > Windows XP
User Name
Password


Incorrect SDDL string returned while trying to read the Registry User Permissions....

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes

  #1  
Old 11-26-2004, 05:44 AM
vikram_seri Offline
Junior Member
 
Join Date: Nov 2004
Posts: 1
Question Incorrect SDDL string returned while trying to read the Registry User Permissions....

Hi All!

I am trying to Read the User Permissions of a Registry Base Key (HKLM\.DEFAULT) by using the GetSecurityInfo method of Win32 API dll(Advapi32.dll).

// Assign the pointer zero value
IntPtr ptrOwnerSid = IntPtr.Zero;
IntPtr ptrGroupSid = IntPtr.Zero;
IntPtr ptrDacl = IntPtr.Zero;
IntPtr ptrSacl = IntPtr.Zero;
IntPtr ptrSecDesc = IntPtr.Zero;

// Retrieving the security information
DWORD rc = GetSecurityInfo(hKey, SE_OBJECT_TYPE.SE_REGISTRY_KEY, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION|SEC URITY_INFORMATION.PROTECTED_DACL_SECURITY_INFORMAT ION|SECURITY_INFORMATION.UNPROTECTED_DACL_SECURITY _INFORMATION,ref ptrOwnerSid, ref ptrGroupSid, ref ptrDacl, ref ptrSacl, ref ptrSecDesc);

string strSDDL=ConvertSDToStringSD(ptrSecDesc,4);

This method returns a string value(SDDL String) describing the Permissions that apply to the Registry Base Key, but

the SDDL String value that is being returned is:

D:PAI(A;;KR;;;BU)(A;CIIO;GR;;;BU)(A;;KR;;;PU)(A;CI IO;GR;;;PU)(A;;KA;;;BA)(A;CIIO;GA;;;BA)(A;;KA;;;SY )(A;CIIO;GA;;;SY)(A;;KA;;;BA)(A;CIIO;GA;;;CO)

But on checking the actual permissions for this particular base key in Registry Editor on the system this is what I found:

Allow - Administrators - Full Control - <not inherited> - This key and subkeys
Allow - CREATOR OWNER - Full Control - <not inherited> - Subkeys only
Allow - Power Users - Read - <not inherited> - This key and subkeys
Allow - SYSTEM - Full Control - <not inherited> - This key and subkeys
Allow - Users - Read - <not inherited> - This key and subkeys


According to this I should get only 5 ACE's in the SDDL string listed above but instead I am getting 10 ACE's.

Could any one tell me how this could be set right???

Thanks in advance..
Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A new idea for the windows registry and Longhorn Blitz Windows XP 7 12-20-2005 08:08 AM
Test Epimetreus Testing 0 05-30-2003 04:13 PM



All times are GMT -5. The time now is 10:19 AM.


Designed by eXtremepixels. Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.3.2 © 2005, Crawlability, Inc.