• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Error message: NOT super-user
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error message: NOT super-user


  • Subject: Re: Error message: NOT super-user
  • From: Alastair Houghton <email@hidden>
  • Date: Sat, 8 Sep 2007 22:08:24 +0100

On 8 Sep 2007, at 21:28, Ricardo Diaz wrote:

Yeah I don't care, how can I run it with root privileges?

You could use a helper tool. Look at the docs for the Authorization framework. If you *do* do that, then make sure that your tool checks for a right; otherwise it might allow an unprivileged user to shut down the system abruptly, which would be a *huge* security hole.


But why not save yourself the trouble and send the relevant Apple Events instead? This is particularly important if there might be GUI programs running, since they rarely contain code to handle the abrupt Unix-y type of shut down that you'll get from using the command you mentioned.

It's quite easy; you just send a kAEShowShutdownDialog event (with event class kCoreEventClass) to the process with ProcessSerialNumber { 0, kSystemProcess }.

Kind regards,

Alastair.

--
http://alastairs-place.net




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Error message: NOT super-user (From: Ricardo Diaz <email@hidden>)

  • Prev by Date: Re: Error message: NOT super-user
  • Next by Date: Re: iPhoto-like scroll view
  • Previous by thread: Re: Error message: NOT super-user
  • Next by thread: RE: Error message: NOT super-user
  • Index(es):
    • Date
    • Thread