Re: Possible bug in 'ln -s target dir' check code --

[email protected] (Perry Hutchison)
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <5d3ea36b.KKQJMB0m4EFqZLj+%[email protected]>
"Townsend, Paul" <[email protected]> wrote:

> I am probably incorrectly interpreting the autoconf code that
> checks whether or not 'ln -s target dir' works.  It seems the
> check code is satisfied if
>
>   mkdir a
>
>   touch b
>
>   ln -s b a
>
> works without aborting.  On Ubuntu this does create a 'b' symlink
> in 'a' but that symlink is an infinite a/b->a/b.

AFAIK this has been the normal behavior of "ln -s" for as long
as symlinks have existed.  Indeed, because "ln -s" (unlike "ln"
without -s) does not stat the link target, it would still work
even if you left out the "touch b".

> In fact I think the only way to succeed is to use
>
>   ln -s $PWD/b a

or, better, "ln -s ../b a"

One way to help keep such things straight is to make symlinks only
in the current directory, e.g.

  ( cd a && ln -s ../b . )

> i.e., the ln app should be a heck of a lot smarter.

Arguably it should have originally been designed to issue a warning
if the target does not exist or if the result will be a loop, but to
change its behavior now would break backward compatibility.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.