Re: FindFolder/sudo puzzle
Re: FindFolder/sudo puzzle
- Subject: Re: FindFolder/sudo puzzle
- From: henri <email@hidden>
- Date: Mon, 26 May 2008 14:30:16 +1200
I have previously read that there were no problems using su rather
than sudo.
However, in my experience using 'su' in a login hook would
intermittently crash the login process. Using 'sudo' rather than 'su'
resolved the intermittent crashing. Therefore, I would recommend
avoiding 'su' within a login hook.
The intermittent issues I have seen certainly make me wary of using
'su -c' at all.
On May 24, 2008, at 3:42 PM, Andy O'Meara wrote:
> Thanks for the suggestions, Kevin. Unfortunately, I now realize
> that our little app runs under sudo root, it doesn't even matter if
> it know the right dir since any files or dir it creates will get
> tainted with root permission/ownership. Basically, this seems to
> rule out being able to write any files once the installer is in
> preflight (since its sudoed at that point).
>
> The only idea I have remaining is launching my app using sudo -u,
> which would solve the FindFolder() issue as well as the file owner/
> permissions issue. The only thing left, however, is to choose the
> most reliable method to to get the username (or uid). The most
> obvious method would be the following in preflight:
>
> MY_RESULT=`sudo -u "${USER}" "$1/Contents/Resources/MyApp.app/
> Contents/MacOS/MyApp"`
>
> Does anyone see any issues with this for use in 10.3 and later? Is
> it safe for me to be using USER?
Apple frequently uses su -c ${USER}, which is very close to the same
thing.
We use su instead of sudo because (if I recall correctly) sudo can be
configured to require keyboard confirmation to work, and that would
screw up a postflight script in at least some cases.
But yes, for all the kinds of scripts you write, su -c ${USER} is
reliable and should keep working for quite some time.
_______________________________________________
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
_______________________________________________
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