delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/14/17:48:03

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: [1.7] bug in chdir
Date: Tue, 14 Jul 2009 21:47:34 +0000 (UTC)
Lines: 23
Message-ID: <loom.20090714T213944-461@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

$ ls //home
ls: reading directory //home: No such file or directory
$ # makes sense; I don't have a remote machine named home
$ cd //home
$ # huh? no error reported?
$ /bin/pwd # avoid shortcuts in bash builtin; /bin/pwd uses getcwd
//home
$ # huh? getcwd is happy with it?
$ ls
ls: reading directory .: No such file or directory
$ # then how'd we get here?

We should fix chdir() to fail on attempts to go to an impossible virtual 
directory.  I discovered this because of a bug in dash:

$ dash -c 'CDPATH=/; cd home'
//home

which took me to a non-existent directory, instead of the intended /home.

-- 
Eric Blake



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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