Re: When sudo is run the first time, something about the user account changes
Re: When sudo is run the first time, something about the user account changes
- Subject: Re: When sudo is run the first time, something about the user account changes
- From: Sidney San MartÃn <email@hidden>
- Date: Sat, 16 Jan 2010 09:49:14 -0500
This is the installer-dev list, probably not the best place to get helpful responses to that question.
Regardless, sudo is a tool for privilege escalation. Your privileges are being escalated through AuthorizationExecuteWithPriviliges, so just execute /bin/bash (or your shell of choice) with the path to the script as an argument.
On Jan 16, 2010, at 12:20 AM, Brant Sears wrote:
> I'm trying to execute a bash script from my application. I'm using the Security framework to call AuthorizationExecuteWithPrivileges() on the sudo command passing the path to my script in as an argument. This has the effect that my script runs as root.
>
> This works as I would expect (i.e. the user is prompted when I create the authentication object and then the script executes as root), except on user accounts where "sudo" has never been used.
>
> I notice that when I invoke sudo for the first time, I get a warning message from the OS. And obviously other things about the user account change as well. What exactly changes when you call sudo for the first time?
>
> Also, is there another way I can invoke my script to work correctly in this instance? Another means by which it can run as root?
>
> Thanks.
>
> Brant Sears
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Installer-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden