What API should I use to elevate user privileges as root in Mac OS X?

I want to increase the privilege of my application to superuser. Installer supports this by displaying this dialog . How to show this dialog to increase privilege?

PS. I am building my batch sniffer application on Mac OS X. I am using pcap lib. (which is part of tcpdump)

+3
source share
1 answer

AuthorizationExecuteWithPrivileges with kAuthorizationRightExecute

See BetterAuthorizationSample

Generally, you should not run GUI applications with root privileges. You have to make a command line tool that you can run as root and manage it from your user space GUI application.

+4
source

All Articles