Martin Costabel wrote:
> Good catch. To me this looks like a bug in Leopard's /bin/ps: When the 
> "-a" flag is present, it ignores the "-p pid" flag. I have immediately 
> filed a bug with Apple's bugreporter.
>   
> The environment variables (in particular $HOME and $USER) with which the 
> installer runs the postflight script keep changing between OS releases, 
> sometimes between minor releases. There was a time when the current 
> version of postflight did the right thing, but on Leopard your 
> suggestion is looks correct, and it looks correct for Tiger, too.
>
> However, I think this needs some more testing: When I try to execute 
> this by hand from a root command line prompt, I get weird error messages 
> (perhaps due to my using tcsh as login shell):
>
> root# sudo -i -u costabel /sw/bin/pathsetup.sh
> Badly placed ()'s.
>
> With another command it gets weirder:
>
> root# sudo -i -u costabel /usr/bin/printenv HOME
> \312\376\272\276^B^G^C^PEp^L^R: Command not found.
> ^QU\211\345WVS\203\354,\213u^H\213]^L\353^E\350\261\377\377\377\307D: 
> Event not found.
>
> There is definitely something fishy about this "-i" flag when used with 
> a command. On the other hand, "-H" seems to work correctly:
>
> root# sudo -H -u costabel /usr/bin/printenv HOME
> /Users/costabel
>
> root# sudo -H -u costabel /sw/bin/pathsetup.sh
> --------------------------------
> Setting up your Fink environment
> --------------------------------
>
> Your environment seems to be correctly
> set up for Fink already.
>   
Yeah, -H is probably what you want more than -i. In terms of behavior
changing across versions, this isn't something we should run into again
- by using -H you explicitly specify the behavior you want; this is a
flag that is standardized across every sudo I've run into.

- Evan


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel

Reply via email to