delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/22/19:32:50

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Sun, 22 May 2005 19:32:35 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: =?ISO-8859-15?Q?Sven_K=F6hler?= <skoehler AT upb DOT de>
cc: cygwin AT cygwin DOT com
Subject: Re: /etc/profile always does a "cd $HOME"
In-Reply-To: <d6qm36$var$1@sea.gmane.org>
Message-ID: <Pine.GSO.4.61.0505221920350.25809@slinky.cs.nyu.edu>
References: <d6qm36$var$1 AT sea DOT gmane DOT org>
MIME-Version: 1.0

---559023410-1804928587-1116804755=:25809
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT

On Sun, 22 May 2005, Sven Köhler wrote:

> Hi,
>
> i'd like to use cygwin from a normal windows-app. The problem is, that i
> need a login-shell, so that all environment-vars are properly set. The
> problem: bash -li always changes the current workdir!
>
> IMHO, executing "bash -li" shouldn't change the workdir.
> No other system i know does that. Script may rely on that behaviour.
>
> /etc/profile contains the like
>   cd "$HOME"
>
> That line cannot easily be removed. Starting the Cygwin-Link installed
> by the setup wouldn't cd to ~ anymore. This behaviours is liked by most
> users i guess (including my own).
>
> Any suggestions, how the situation could be improved?

Yes, you're correct in that on many Linux systems /etc/profile doesn't
change the working directory.  The directory is changed to $HOME by the
login process.

One possibility is adding a Cygwin-specific option to login(1) that would
log in as the current user without requiring the username to be specified
at the command line, to avoid local/domain username conflicts (e.g.,
"login -l") and skip printing the motd (as if .hushlogin is found).  If I
understand the security implications correctly, any user can log in as
herself without a password (using, for example, "login -f").  Then
cygwin.bat can be changed to use "login -lpf" instead of "bash -li".
This would simplify scripts like 'chere'.  It would also have the
advantage of using the users' favorite shell from /etc/passwd in console
logins.  Now, <http://cygwin.com/acronyms/#SHTDI>.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

---559023410-1804928587-1116804755=:25809
Content-Type: text/plain; charset=us-ascii

--
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/
---559023410-1804928587-1116804755=:25809--

- Raw text -


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