delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/04/28/11:02:21

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: user-fstab.sh is cruel
Date: Mon, 28 Apr 2008 15:01:38 +0000 (UTC)
Lines: 27
Message-ID: <loom.20080428T145610-862@post.gmane.org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

In testing cygwin 1.7.0, I noticed that /etc/profile.d/user-fstab.sh blindly 
slams /bin at the front of PATH.  This is cruel to users, since it breaks the 
1.5.x behavior of defaulting to /usr/local/bin at the front of PATH.  It also 
pollutes the user's environment with SYSCONFDIR, FSTABDIR, and FSTAB.  Since 
this file is sourced by /etc/profile, it seems like the fastest fix would be 
making the entire body of the file behave as a subshell, so as not to pollute 
the parent shell.

--- /etc/profile.d/user-fstab.sh.orig	2008-04-28 08:59:55.695117400 -0600
+++ /etc/profile.d/user-fstab.sh	2008-04-28 09:00:03.117039900 -0600
@@ -7,6 +7,7 @@
 #
 # The registry mount points are stored in a file /etc/fstab.d/<username>
 #
+(
 export PATH="/bin:$PATH"
 
 SYSCONFDIR=/etc
@@ -95,3 +96,4 @@
     echo " 0 0"
   fi >> ${FSTAB}
 fi
+)

-- 
Eric Blake



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

- Raw text -


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