New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Authorization of application

Post Reply New Thread Subscribe

Thread Tools

Member Since: May 19, 2008
Posts: 2
tohihaho is on a distinguished road

tohihaho is offline
Hi all.
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.
Help please.
QUOTE Thanks

Post Reply New Thread Subscribe

« dir command | Anything like windows service... »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Application Disappeared from DOC Rupin OS X - Operating System 3 10-27-2007 06:05 PM
Server Error in '/' Application. deathtolife04 OS X - Apps and Games 8 08-21-2007 02:38 PM
Application won't open Eusebius OS X - Operating System 3 02-03-2007 01:29 PM
Application has to be transferred in a .sit Aikinai Switcher Hangout 4 10-18-2005 10:19 PM
Custom Internet Application Randomly Freezing rlecjr OS X - Development and Darwin 0 08-27-2004 09:40 AM

All times are GMT -4. The time now is 02:28 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?