Re: postflight script on Leopard
Re: postflight script on Leopard
- Subject: Re: postflight script on Leopard
- From: James Kelly <email@hidden>
- Date: Wed, 30 Jan 2008 11:31:47 -0500
- Thread-topic: postflight script on Leopard
On 1/30/08 11:10 AM, "Geoffrey Hutchison" <email@hidden> wrote:
> I have a postflight install script for my Spotlight plugin. Since
> stand-alone Spotlight plugins need to be installed into /Library/
> Spotlight, I have set the install package to run with administrator
> privileges.
>
> On the other hand, the postflight script calls /usr/bin/mdimport which
> refuses to run as root.
>
> Is there an easy way to "drop" admin rights for a postflight script?
Using su with the -c flag for the /usr/bin/mdimport command could work.
You'd have to programmatically determine what user you really are, so you
could feed that to su. I seem to remember perl still knowing who you really
were, even with elevated privs. There may be other ways to determine it as
well.
Jim
_______________________________________________
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