delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/26/03:38:30

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <FB7B5F146C8CD5118E0D00306E005CDA02EA23@AP-CAN-MAIL01>
From: Mathew Boorman <mathew DOT boorman AT au DOT cmg DOT com>
To: cygwin AT cygwin DOT com
Subject: /etc/profile /etc/passwd and HOME
Date: Fri, 26 Oct 2001 17:13:04 +1000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019