[X-Unix] sudo -s behavior changed in 10.5?

Robar Philip philip.robar at gmail.com
Sat Feb 23 01:50:58 PST 2008


On Feb 22, 2008, at 11:26 PM, John Baltutis wrote:
> On 02/22/08, Phillip Burk <philburk at mac.com> wrote:
>> On Feb 21, 2008, at 9:47 AM, Eric F Crist wrote:
>>
>>> It may be something in your setup - it works fine for me.
>>
>> OK, then, which files should I be checking?  The only ones associated
>> with the shell (bash) environment that I know of are /etc/profile, /
>> etc/bashrc, /etc/sudoers and /etc/environment.  /etc/environment
>> doesn't exist and editing the others seems to have no effect  
>> whatsoever.
>>
>> It's definitely a puzzle and it affects both the imaged 10.5.2
>> machines at my office as well as my personal 10.5.2 Mac Book Pro that
>> was not imaged but rather manually installed.


> I set up everything in ~.bash_profile (creating it, if it doesn't  
> exist).

This is too simplistic of an answer as it ignores the distinction  
between login/non-login, interactive/non-interactive, and restricted  
shell invocations. See bash(1) for details or a good bash reference  
and/or tutorial. In particular see the "INVOCATION" section of the  
bash man page.

/etc/environment is an X Window System environment variable and is not  
relevant to this discussion.

/etc/bashrc is there for example only and I would argue that Apple  
reading it by default is bad form as it's documented in neither the  
man page nor the bash manual. (http://www.faqs.org/docs/bashman/bashref.html#SEC_Top 
) Plus its being included by /etc/profile violates the separation  
between interactive and non-interactive shells. Looks like I need to  
file a bug.

Phil



More information about the X-Unix mailing list