This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

/etc/profile /etc/passwd and HOME



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`
+fi
+
+# fallback if HOME was not set in /etc/passwd
if [ -z "$HOME" ]; then
  HOME="/home/$USER"
fi



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

m@




--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]