emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#8850: closed (mkdir inside symlink creates wrong


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#8850: closed (mkdir inside symlink creates wrong directory with relative parent)
Date: Mon, 13 Jun 2011 14:56:02 +0000

Your message dated Mon, 13 Jun 2011 16:55:32 +0200
with message-id <address@hidden>
and subject line Re: bug#8850: mkdir inside symlink creates wrong directory 
with relative parent
has caused the GNU bug report #8850,
regarding mkdir inside symlink creates wrong directory with relative parent
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
8850: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8850
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: mkdir inside symlink creates wrong directory with relative parent Date: Mon, 13 Jun 2011 12:50:19 +0200
Hi all,

I was trying to search for any description helping me understand in
what I see, but actually I didn't find any, so I'm here. I discovered
it by using automake-1.11, because it uses relative paths a lot. So my
simplified testcase is as follows:

Have a directory structure x/y and x/z/a. Have a symbolic link from
x/y/z that points to x/z.

 mkdir -p x/y
 mkdir -p x/z/a
 ln -s ../z x/y/z

Now go into x/y/z/a and try to create directory like that:

 cd x/y/z/a
 mkdir ../dir_xyz
 mkdir ../../dir_xy
 mkdir ../../../dir_x

I would expet that there would be a directory like this:

 x/dir_x
 x/y/dir_xy
 x/y/z/dir_xyz (x/z/dir_xyz)

But the result is completely different:

 dir_x
 x/dir_xy
 x/y/z/dir_xyz (x/z/dir_xyz)

So when you want to create a directory in the parent structure from
within the symbolic link, you will fail in doing so, because the
symbolic link would be resolved during walking through parents, so you
can get to completely different tree while creating your directory. It
looks like a bug, because it is nowhere documented to behave like that
(and the behaviour is strange by itself).

Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo
with coreutils 8.12.

Regards,
Oldrich.



--- End Message ---
--- Begin Message --- Subject: Re: bug#8850: mkdir inside symlink creates wrong directory with relative parent Date: Mon, 13 Jun 2011 16:55:32 +0200
Oldřich Jedlička wrote:
> I was trying to search for any description helping me understand in
> what I see, but actually I didn't find any, so I'm here. I discovered
> it by using automake-1.11, because it uses relative paths a lot. So my
> simplified testcase is as follows:
>
> Have a directory structure x/y and x/z/a. Have a symbolic link from
> x/y/z that points to x/z.
>
>  mkdir -p x/y
>  mkdir -p x/z/a
>  ln -s ../z x/y/z
>
> Now go into x/y/z/a and try to create directory like that:
>
>  cd x/y/z/a
>  mkdir ../dir_xyz
>  mkdir ../../dir_xy
>  mkdir ../../../dir_x
>
> I would expet that there would be a directory like this:
>
>  x/dir_x
>  x/y/dir_xy
>  x/y/z/dir_xyz (x/z/dir_xyz)
>
> But the result is completely different:
>
>  dir_x
>  x/dir_xy
>  x/y/z/dir_xyz (x/z/dir_xyz)
>
> So when you want to create a directory in the parent structure from
> within the symbolic link, you will fail in doing so, because the
> symbolic link would be resolved during walking through parents, so you
> can get to completely different tree while creating your directory. It
> looks like a bug, because it is nowhere documented to behave like that
> (and the behaviour is strange by itself).
>
> Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo
> with coreutils 8.12.

Loic explained that this is not a bug. (Thanks, Loic.)
I'm marking this issue as closed.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]