GetNamedSecurityInfo VS GetFileSecurity
From: Frederic P. (P._at_discussions.microsoft.com)
Date: 06/26/05
- Previous message: Joe Richards [MVP]: "Re: PasswordFilter and ASP.NET"
- Next in thread: Pavel Lebedinsky [MSFT]: "Re: GetNamedSecurityInfo VS GetFileSecurity"
- Reply: Pavel Lebedinsky [MSFT]: "Re: GetNamedSecurityInfo VS GetFileSecurity"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 25 Jun 2005 18:29:03 -0700
Hi,
I am trying to read the security on different files and folders but I am
getting different results depending on the method I use to get the security
descriptor:
"GetFileSecurity", "GetKernelObjectSecurity", and "GetUserObjectSecurity"
all return the same security descriptor which doesn't have any inherited aces
in it (INHERITED_ACE is never set on any aces).
On the other hand, if I use "GetNamedSecurityInfo", I get the expected
results which is a security descriptor containing aces with the INHERITED_ACE
flag set. Sometimes, even the number of aces are different.
I can get the problem with newly created files/folders with default ACL or
older files/folders (even c:\CONFIG.sys). Some files work, others don't???
The freeware "SetAcl" also returns explicit aces when listing the security
descriptor of the files so I don't think the problem is in my code (SetAcl
uses "GetKernelObjectSecurity" to access the security descriptors).
If I call "ConvertToAutoInheritPrivateObjectSecurity" on the files/folders
with the problem, everythings goes back to normal; all 4 methods return the
same security descriptor.
Questions:
What is the difference behind "GetNamedSecurityInfo" and "GetFileSecurity"?
Why am I getting only explicit aces on certain files/folders when using
"GetFileSecurity"?
This behaviour occured on Windows XP.
Thanks.
- Previous message: Joe Richards [MVP]: "Re: PasswordFilter and ASP.NET"
- Next in thread: Pavel Lebedinsky [MSFT]: "Re: GetNamedSecurityInfo VS GetFileSecurity"
- Reply: Pavel Lebedinsky [MSFT]: "Re: GetNamedSecurityInfo VS GetFileSecurity"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|