Re: Getting registry key access rights
- From: Jack <jack@xxxxxx>
- Date: Mon, 17 Apr 2006 11:36:03 -0500
"Jack" <jack@xxxxxx> wrote in message
news:2ab7421t2r261cujkr2m9c002lcjl37lsq@xxxxxxxxxx
I want to be able to determine all of the access rights to a registryOn Mon, 17 Apr 2006 11:25:11 -0400, "Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx> wrote:
key. I need to know, for example, if a key can be opened with the
KEY_QUERY_VALUE or the KEY_ENUMERATE_SUB_KEYS access right or both.
If I call RegOpenKeyEx() with both of the above flags and the key has
only has one of them, will the call succeed?
If I use RegGetKeySecurity(), can I use the returned
SECURITY_DESCRIPTOR to check for access rights? How?
Thanks,
Jack
You could use AccessCheck() to perform the check given the security
descriptor. (Or you could manually walk the ACE list in the security
descriptor and do the access check computations yourself.)
However, the best option is to just try the operation and see if it succeeds
or not. Otherwise, you are subject to a race condition where someone could
change the security descriptor on the registry key in question between the
time where you queried it via RegGetKeySecurity() and did the access check
via AccessCheck().
I'm trying to use the AccessCheck() function but it always returns
ERROR_INVALID_SECURITY_DESCR. I'm lost when it comes to Windows
security. I don't even know what "walk the ACE" means. :-( Btw, I'm
not worried about race conditions right now.
How can I use a SECURITY_DESCRIPTOR to get access rights?
Thanks,
Jack
.
- Follow-Ups:
- Re: Getting registry key access rights
- From: Scherbina Vladimir
- Re: Getting registry key access rights
- References:
- Getting registry key access rights
- From: Jack
- Re: Getting registry key access rights
- From: Skywing
- Getting registry key access rights
- Prev by Date: Re: Detours Sample Instrumentation Program
- Next by Date: Re: Mutex Help Please
- Previous by thread: Re: Getting registry key access rights
- Next by thread: Re: Getting registry key access rights
- Index(es):
Relevant Pages
|