[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils bug with "ln x d/"
From: |
Jim Meyering |
Subject: |
Re: coreutils bug with "ln x d/" |
Date: |
Sat, 26 Jun 2004 13:48:56 +0200 |
Paul Eggert <address@hidden> wrote:
> While looking at cp, ln, and mv and thinking about how to implement
> the -D/--no-destdir option I proposed in
> <http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00142.html>,
> I noticed that "ln" has a bug. If d/x is a directory and x a file,
> "ln x d/" creates a link d/x/x; it should report an error. Here's
> a shell transcript of the bug:
>
> $ mkdir d d/x
> $ touch x
> $ ln x d/ # <-- This command should fail.
Yes, it certainly should fail.
Thanks!
> $ ls -li x d/x/x
> 17783 -rw-r--r-- 2 eggert eggert 0 2004-06-25 00:12 d/x/x
> 17783 -rw-r--r-- 2 eggert eggert 0 2004-06-25 00:12 x
>
> A similar bug exists with "ln -s".
>
> Here's a patch. It adds a test case for this bug, and fixes it.
>
> It's pretty long; sorry.
...
> If you like, I think I can split
> up the patch into two parts: a code- and diagnostic-cleanup only, and
> a bug fix. (I would do this by modifying my version to have the
> bug.... :-)
I would indeed appreciate that.