Thread: Authorization of application
05-19-2008, 11:32 AM #1
Authorization of application
- Member Since
- May 19, 2008
I am really junior mac-developer. I have verry little experience in building applications and using the unix-based operating systems.
My problem is this: I am building an application in which I have to open a device to read and write from it. I use the function open() with parameters the "path" to the device (for example /dev/rdisk2s3) and an option for opening (for example O_RDONLY). When the device is "local" (I don't know how to explain it in other way - not flash or ISCSI or image or etc...) this function returns -1 with errno 13 - EACCES - Permission denied.
My application has both command line and UI "versions". If I run the command line "version" with sudo and I write the password - it works with no problems.
I want to make the UI ask for password and run the rest of the code with root rights, as if I have run it with sudo.
I tried using the Security Framework - the functions from Authorization.h, but I couldn't make it work - I manage to create and initiate an authorization reference, but the open function still doesn't work.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By MacShane in forum Music, Audio, and PodcastingReplies: 10Last Post: 04-25-2012, 10:41 PM
By David&karen in forum Music, Audio, and PodcastingReplies: 3Last Post: 11-10-2011, 02:22 AM
By floraneg in forum Switcher HangoutReplies: 2Last Post: 03-10-2011, 09:03 PM
By krumlin in forum Music, Audio, and PodcastingReplies: 1Last Post: 11-05-2009, 04:00 PM
By steveo_hants in forum iOS and AppsReplies: 1Last Post: 07-29-2008, 11:27 AM