Privilege tree in metapackages.
Privilege tree in metapackages.
- Subject: Privilege tree in metapackages.
- From: Fritz Anderson <email@hidden>
- Date: Tue, 29 May 2007 17:25:42 -0500
I have been trying to work out the problem of installing something to
the /Applications directory (and thus needing administrator
privileges) and to the user directory of the person running the
installation (installing to a neutral place like /tmp, and
transferring the files with a script and the $HOME environment
variable). No, that doesn't easily work. That's why I'm exploring my
options.
To educate myself, I built the following simple metapackage; my hope
was that $USER or $HOME would remain the user's in an unprivileged
package that is sister to a privileged one:
TestMeta.mpkg
# postflight
Privileged.pkg
/Applications/Privileged.rtf
# postflight
# Admin authorization
Unprivileged.pkg
/Users/Shared/Unprivileged.rtf
#postflight
# No additional authorization.
If it matters, the metapackage was built with Iceberg.
The three (meta)packages copy the same postflight script, which is:
================
#!/bin/sh
LOGFILE=/Users/Shared/TestMeta.log
echo \*\*\* Package ${1} \*\*\* >>$LOGFILE
echo ' ' USER = $USER >>$LOGFILE
echo ' ' HOME = $HOME >>$LOGFILE
exit 0
================
The output, after running the metapackage is:
================
*** Package /Users/fritza/TestMeta/build/TestMeta.mpkg ***
USER = fritza
HOME = /Users/fritza
*** Package /Users/fritza/TestMeta/build/Privileged.pkg ***
USER = fritza
HOME = /Users/fritza
*** Package /Users/fritza/TestMeta/build/Unprivileged.pkg ***
USER = fritza
HOME = /Users/fritza
================
When I run Privileged.pkg standalone, as non-admin user "other,"
entering my admin name and password, I see:
================
*** Package /Users/fritza/TestMeta/build/Privileged.pkg ***
USER = other
HOME = /Users/other
================
Privileged.rtf is duly installed in /Applications/.
Per <http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html>, $USER
should be root. In fact, I've seen postflight scripts in other
packages, on the same machine, report USER = root.
I am baffled. It seems I simply don't have the fundamental
information that would allow me to make sense of all this.
Can anyone please help me dig out?
— F
_______________________________________________
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