Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Authorization of application
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="tohihaho" data-source="post: 657854" data-attributes="member: 56265"><p>Hi all.</p><p>I am really junior mac-developer. I have verry little experience in building applications and using the unix-based operating systems. </p><p>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.</p><p>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. </p><p>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. </p><p>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. </p><p>Help please. <img src="/mac_images/images/smilies/Straight-Faced.png" class="smilie" loading="lazy" alt=":|" title="Straight Faced :|" data-shortname=":|" /></p></blockquote><p></p>
[QUOTE="tohihaho, post: 657854, member: 56265"] 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]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Authorization of application
Top