I’m attempting to check the rights on a particular file for a specific trustee and am using the win32 API GetEffectiveRightsFromAcl(). When the file is accessible by a domain group, the function returns 5 (Access Denied) when a local account (admin or other) is used to execute the function.
These three statements summarize the behavior I am seeing with GetEffectiveRightsFromAcl():
- When domain group has rights to the file and the program runs under a local account: Access Denied.
- When domain group has rights to the file and the program runs under a domain account or Local System: Success
- When domain group doesn't have rights to the file and the program runs under any account: Success
Does anyone know the reason behind this? It looks to me like this is related to Active Directory security. What settings could affect this and what would be a good way to debug this?
Also, I've heard that GetEffectiveRightsFromAcl() may be generally problematic and to use AccessCheck() instead. However I need to be able to take an arbitrary SID and check it's access against a file and since AccessCheck() requires an impersonation token I don't know how I could greate a token out of an arbitrary SID... Any ideas? Thanks
Bob