Re: How can I "un-sudo" in postflight?
Re: How can I "un-sudo" in postflight?
- Subject: Re: How can I "un-sudo" in postflight?
- From: Greg Neagle <email@hidden>
- Date: Tue, 03 Dec 2013 06:07:20 -0800
There has been great info in this thread, but I feel obligated once again to point out why this sort of thing isn't a great a idea in general, especially if the package is to be installed in a business/enterprise/educational environment (as opposed to a home user):
Automated installation methods may occur when there is no console user. If your script assumes a console user, it will fail.
The person doing the installation might be a organizational administrator, and not the person that will be using the software. If your script does special configuration for only the current console user, what does that mean when that user logs out and the "real" user logs in? What if there are multiple "real" users on the machine?
Any script that loops through existing local users and does special stuff to each account doesn't take into account users that are created/added _after_ your software is installed. If the machine is connected to a network directory service, either you miss network users, or you (probably incorrectly) modify files in perhaps thousands of network user's homes.
-Greg
On Dec 3, 2013, at 12:06 AM, Per Olofsson <email@hidden> wrote:
> 2 dec 2013 kl. 20:40 skrev Mitchell J Laurren-Ring <email@hidden>:
>
>> How do execute something from postflight as "not root", preferably the installing user?
>
> Here’s the script I use to launch commands for every currently logged in console user in the correct bootstrap context:
>
> https://github.com/MagerValp/Scripted-Mac-Package-Creation/blob/master/scripts/postinstall
>
> Details, read carefully:
>
> https://lists.macosforge.org/pipermail/launchd-dev/2011-January/000890.html
>
> --
> Per Olofsson, IT-service, University of Gothenburg
>
>
> _______________________________________________
> 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