security framework and access()
security framework and access()
- Subject: security framework and access()
- From: Matsumoto Shigeyuki <email@hidden>
- Date: Fri, 13 Jul 2001 17:20:19 +0900
I'm making a GUI for '/usr/bin/hdiutil' which manipulates disk images.
Because 'hdiutil' requires the privilege to open/read raw disk devices,
I used AuthorizationExecuteWithPrivileges in security framework. But
launched instance of 'hdiutil' fails to open raw disk devices.
The reasons may be,
(1) AuthorizationExecuteWithPrivileges sets the effective user ID
to 0 (=root), but does not change the real user ID.
(2) The 'hdiutil' calls access() to check permissions, but access()
uses real user ID in place of the effective one.
Should I give up to use security framework?
Do you think 'sudo' is safe for my purpose?
Thank you for your suggestion.
- Shigeyuki Matsumoto