[mathew.boorman@au.cmg.com: /etc/profile /etc/passwd and HOME]

Corinna Vinschen vinschen@redhat.com
Fri Oct 26 11:01:00 GMT 2001

I like that idea.

Should we add these lines to the generated profile?


----- Forwarded message from Mathew Boorman <mathew.boorman@au.cmg.com> -----

Date: Fri, 26 Oct 2001 17:13:04 +1000
From: Mathew Boorman <mathew.boorman@au.cmg.com>
Subject: /etc/profile /etc/passwd and HOME 
To: cygwin@cygwin.com

After installing on 2000 where my account has a default HOMEDRIVE setup, I
did the cygwin install.

mkpasswd automatically setup the home field in /etc/passwd correctly, but it
did not work.

I found /etc/profile does not check that but instead only checks for an
existing HOME.  It does not check for a value in /etc/passwd.

The following change worked for me, but it assumes that /etc/passwd exists.

Any comments?  

# Set up USER's home directory
+# try and get it from /etc/passwd
+if [ -z "$HOME" ]; then
+  HOME=`grep mat /etc/passwd | cut --delimiter=: --fields=6`
+# fallback if HOME was not set in /etc/passwd
if [ -z "$HOME" ]; then

If OK and so requested I will figure out how to do a real patch.


Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

----- End forwarded message -----

Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

More information about the Cygwin-developers mailing list