This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: x86_64 Cygwin 1.7.29: possible bug to trace symlink (Win7)


-----Original Message-----
From: Robert Bu
Sent: 2014/4/21 9:59 +0800
On Apr 16 17:47, Corinna Vinschen wrote:
   > > Below is what I get:
   > > RS-I9E3U8R4:[~/tmp/test_symlink]>uname -a
   > > CYGWIN_NT-6.1 RS-I9E3U8R4 1.7.29(0.272/5/3) 2014-04-07 13:46 x86_64
Cygwin
   > > RS-I9E3U8R4:[~/tmp/test_symlink]>echo $CYGWIN
   > > winsymlinks:nativestrict
   > > RS-I9E3U8R4:[~/tmp/test_symlink]>echo test > test.txt
   > > RS-I9E3U8R4:[~/tmp/test_symlink]>mkdir dest
   > > RS-I9E3U8R4:[~/tmp/test_symlink]>cd dest
   > > RS-I9E3U8R4:[~/tmp/test_symlink/dest]>ln -s ../test.txt test.txt
   > > RS-I9E3U8R4:[~/tmp/test_symlink/dest]>cd ../
   > > RS-I9E3U8R4:[~/tmp/test_symlink]>mkdir src
   > > RS-I9E3U8R4:[~/tmp/test_symlink]>cd src
   > > RS-I9E3U8R4:[~/tmp/test_symlink/src]>ln -s ../dest dest
   > > RS-I9E3U8R4:[~/tmp/test_symlink/src]>cd ../
   > > RS-I9E3U8R4:[~/tmp/test_symlink]>cat src/dest/test.txt
   > > cat: src/dest/test.txt: No such file or directory
   >
   > I can reproduce it now.  I made a mistake when creating the symlinks
   > the first time, which is, I created them with tcsh.  Tcsh tends to
   > change relative paths using ".." components to absolute paths on the
   > command line.  Using plain relative paths, I now see what's going on.
   >
   > But it'sa tricky problem.  I don't know how to fix it yet.  I'll
   > have to think about it, so please be patient.

This is a very interesting problem which (again) shows the downsides of
the Cygwin path handling, namely the evaluation of the path from right
to left, contrary to what POSIX demands.  We really have to rewrite this
code, but that's a lot of work for long and dark winter nights and days,
not something we can do out of the blue.

Therefore, I created a workaround within the constraints of the current
code.  Please try the today's snapshot from http://cygwin.com/snapshots/,
it contains my workaround.

This snapshots works as expected.

Note that in the current configuration we're having a recursion problem.
If your path consists of more than 15 native symlinks, all of which have
a ".." path component in the symlink target path, the result will be a
"no such file or directory" again.  This is pretty unlikely in normal
life, but can be easily constructed, of course.


There are about 10 native symlinks in the repo created git directory. So
this workaround works for me for now.

Thank you very much.

Regards
Robert

.

Hi,

I get this problem again in 1.7.30 (x86_64) on Win7.
I think the snapshot "cygwin1-20140418-x64.dll" already fixed this problem.

Best regards.
Robert Bu



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]