[1.7] bug in chdir

Ashok Vadekar avadekar@certicom.com
Wed Jul 15 13:31:00 GMT 2009


Could it be that a mount point called /home, or //home (if possible), makes a difference? 
----- Original Message -----
From: cygwin-owner@cygwin.com <cygwin-owner@cygwin.com>
To: cygwin@cygwin.com <cygwin@cygwin.com>
Sent: Wed Jul 15 04:46:35 2009
Subject: Re: [1.7] bug in chdir
On Jul 14 21:47, Eric Blake wrote:
> $ 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

Sorry Eric, but I can't reproduce this. I tried it on XP and 2K8R2
with identical result.
That's what I get in bash:
 corinna@cathi ~
 $ ls //home
 ls: cannot access //home: No such file or directory
 corinna@cathi ~
 $ cd //home
 bash: cd: //home: No such file or directory
 corinna@cathi ~
 $
And that's what I get in dash:
 $ ls //home
 ls: cannot access //home: No such file or directory
 $ cd //home
 cd: 2: can't cd to //home
 $ 
> $ dash -c 'CDPATH=/; cd home'
> //home

On my systems this result in:
 $ dash -c 'CDPATH=/; cd home'
 cd: 1: can't cd to home
I also tried a simple test application which removes the shell
magic from the picture:
 #include <stdio.h>
 int
 main (int argc, char **argv)
 {
 int ret = 0;
 if (argc > 1)
 ret = chdir (argv[1]);
 if (ret)
 perror ("chdir");
 return 0;
 }
 $ gcc -g -o chdir chdir.c
 $ ./chdir //home
 chdir: No such file or directory
 $
If you're able to cd to //home, then there must be some crucial
difference in your environment. You should debug this, at least with
strace, so we can find out under what circumstances this occurs.
Corinna
-- 
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
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


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /