• 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: exec() with pmset
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exec() with pmset


  • Subject: Re: exec() with pmset
  • From: Izidor Jerebic <email@hidden>
  • Date: Thu, 1 Nov 2007 15:26:22 +0100


On 1.11.2007, at 13:26, Izidor Jerebic wrote:

On 10/31/07, Andrew James <email@hidden> wrote:

For some reason i can not make pmset work in my "authtool" which has a
setuid to have root privs,


I could not find any documentation on this (not that I tried very hard), but it seems that in Leopard a child process system()'d by a root setuid process does not inherit uid/euid. I.e. you can only do superhuman evil things in your code, but any process started by your code will fall back to mere mortal privileges.


I did not try directly exec()-ing, but I guess it is the same, as system() is just a wrapper for lazy people like me :-)

At least this is the way it worked with my moresecurity-inspired tool...


I should think/test before I post. Fork/exec keeps the setuid just fine, it's system() that doesn't.

As for the status (straight from sys/wait.h) - it is 8 bit shifted exit() value from child together with signal status, so 256 means child did exit(1), and 13 means there was signal regarding pipes (SIGPIPE).

Definitely the parameters for execl() as typed in your email are wrong, so that may be a problem.
Another possibility is that maybe pmset has become hostile towards running as setuid...


izidor

_______________________________________________

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: exec() with pmset (From: Izidor Jerebic <email@hidden>)

  • Prev by Date: Re: Data Rich email like iPhoto/Aperture?
  • Next by Date: Re: [Leopard] Core Data model versioning vs. NSPersistentDocument
  • Previous by thread: Re: exec() with pmset
  • Next by thread: Re: exec() with pmset
  • Index(es):
    • Date
    • Thread