Andrew DeFaria wrote:
> 
> Corinna Vinschen wrote:
> 
> >You're mixing stuff which doesn't belong to each other.  Cygwin is not at all 
> >interested in $HOME or your /etc/passwd home entry.  The evaluation of this values 
> >is done by tools in a UNIXy way.  Shells (bash, tcsh,
> >whatever) are traditionally only paying attention to $HOME.  Remember how a logon 
> >to a UNIX machine works.  First, there's a terminal on which runs a getty, then 
> >login(1) is called for the authentication,  login's only available information is 
> >/etc/passwd.  After authentication, login sets $HOME to the correct value and 
> >starts a shell.  The shell relies on the fact, that $HOME has been set correctly by 
> >the logon procedure.
> >
> >So, there are authenticating/logon tools which use /etc/passwd and there are user 
> >tools, which rely on $HOME already been set correctly by the former.  That's just 
> >the way it works.
> >
> >Especially /etc/profile should *not* take the /etc/passwd value for evaluating the 
> >home directory.  /etc/profile is used by the shell, in a state when $HOME should 
> >already have a value.  If /etc/profile sets $HOME, this would overwrite custom 
> >settings from login tools.
> >

Amen.

> Hmmm... My /etc/profile.orig (I believe that's where I put the original
> /etc/profile before I modified it) has
> 
> # Set up USER's home directory
> if [ -z "$HOME" ]; then
>   HOME="/home/$USER"
> fi

Fortunately this has been fixed a while ago.
HOME is always set by the time /etc/profile runs
and the new /etc/profile explains how it was set.
 
Pierre

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to