Re: copy some kernel extensions to /tmp directory and then load that kext when program Launches
Re: copy some kernel extensions to /tmp directory and then load that kext when program Launches
- Subject: Re: copy some kernel extensions to /tmp directory and then load that kext when program Launches
- From: mm w <email@hidden>
- Date: Thu, 28 May 2009 09:59:08 -0700
Hello,
now the priviledge access, you need to have root access to load and
unload a kext e.g adding code in your kernel space,
1- you can use launchd and start the service at boot-time with root priviledge
2- any action in the user-space from a non-root user will apply an
authentication
what is your job: handling the user-space authentication process:
A: you can use: a shell script and running it from your app using
various popen-like family functions
#!/usr/bin/env bash
exec osascript <<EOF
do shell script "kextload -t \"${1}\"" with administrator privileges
EOF
# will return a status 0 or 1 you can check this from your GUI APP
B: the same by running a applescript (cf documentation to embed this
into your app)
do shell script "kextload -t \"" & kext & "\"" with administrator privileges
C: the same by running a applescript script thru the osascript command
on run argv
set kext to (item 1 of argv)
do shell script "kextload -t \"" & kext & "\"" with administrator privileges
end run
D: using Security C API
#include <Security/Authorization.h>
any of those solutions will pop up a auth dialog
Best,
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden