Determine if a file requires elevated privileges
Posted: Wed Jan 16, 2008 11:11 pm
I have a small program that receives information from a shell extension activated when the user right-clicks folders or files that then takes action on those selected items.
Under Vista I can have folders/files that require elevated privileges to be accessed and others that don't.
I've compared a few files that require and do not require elevation and came up with the following comparison to see if it requires elevation or not:
1) If it has "Authenticated Users" with Modify and Write permissions, OK
2) If it has "Everyone" with Modify and Write permissions, OK
3) If it has "Steven Martins" (the user name I'm currently log on in Vista) with Modify and Write permissions, OK
4) If it has "Users" without Modify and Write permissions, Elevation Needed! (but not if 1) is present)
Any idea on how I can do these validations using FileSecurity from madSecurity?
Thanks!
Under Vista I can have folders/files that require elevated privileges to be accessed and others that don't.
I've compared a few files that require and do not require elevation and came up with the following comparison to see if it requires elevation or not:
1) If it has "Authenticated Users" with Modify and Write permissions, OK
2) If it has "Everyone" with Modify and Write permissions, OK
3) If it has "Steven Martins" (the user name I'm currently log on in Vista) with Modify and Write permissions, OK
4) If it has "Users" without Modify and Write permissions, Elevation Needed! (but not if 1) is present)
Any idea on how I can do these validations using FileSecurity from madSecurity?
Thanks!