GNU bug report logs - #23564
Unexpected results from `ln --symbolic --interactive --relative`

Previous Next

Package: coreutils;

Reported by: Florian Schweiger <florian.schweiger <at> bbc.co.uk>

Date: Tue, 17 May 2016 15:34:02 UTC

Severity: normal

Tags: patch

Merged with 14116, 17126

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23564 in the body.
You can then email your comments to 23564 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#23564; Package coreutils. (Tue, 17 May 2016 15:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florian Schweiger <florian.schweiger <at> bbc.co.uk>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 17 May 2016 15:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Florian Schweiger <florian.schweiger <at> bbc.co.uk>
To: <bug-coreutils <at> gnu.org>
Subject: Unexpected results from `ln --symbolic --interactive --relative`
Date: Tue, 17 May 2016 10:56:06 +0100
[Message part 1 (text/plain, inline)]
Hi,

I've noticed the following unexpected behaviour in `ln` which appears to 
be a bug. I'm referring to the attached MWE Bash script 
test_ln-symbolic-interactive-relative.sh.

When run, it creates a directory "test_dir" and a file "test_file" in 
the current working directory. Then it tries to create a relative, 
symbolic link to the file in said directory. When the "--interactive" 
option is present, this operation fails every other time in that it 
overwrites the existing link with an unreachable target.

DETAILED DESCRIPTION:

* First invocation
    $ ./test_ln-symbolic-interactive-relative.sh
    ln -sirv test_file test_dir/test_link
    ‘test_dir/test_link’ -> ‘../test_file’
* Second invocation:
    $ ./test_ln-symbolic-interactive-relative.sh
    ln -sirv test_file test_dir/test_link
    ln: replace ‘test_dir/test_link’? y
    ‘test_dir/test_link’ -> ‘test_file’
* Third invocation:
    $ ./test_ln-symbolic-interactive-relative.sh
    ln -sirv test_file test_dir/test_link
    ln: replace ‘test_dir/test_link’? y
    ‘test_dir/test_link’ -> ‘../test_file’


AFFECTED SYSTEM:
    * ln (GNU coreutils) 8.21
    * GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
    * Ubuntu 14.04.4 LTS
    * Linux 3.13.0-67-generic #110-Ubuntu SMP Fri Oct 23 13:24:41 UTC 
2015 x86_64 x86_64 x86_64 GNU/Linux

On other systems, the symbolic link is set as expected every time.

WORKING SETUP:
    * ln (GNU coreutils) 8.21
    * GNU bash, version 4.2.53(1)-release (x86_64-suse-linux-gnu)
    * openSUSE 13.1 (Bottle) (x86_64)
    * Linux 3.11.10-29-desktop #1 SMP PREEMPT Thu Mar 5 16:24:00 UTC 
2015 (338c513) x86_64 x86_64 x86_64 GNU/Linux

Cheers,
Florian



-----------------------------
http://www.bbc.co.uk
This e-mail (and any attachments) is confidential and 
may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in 
error, please delete it from your system.
Do not use, copy or disclose the 
information in any way nor act in reliance on it and notify the sender 
immediately.
Please note that the BBC monitors e-mails 
sent or received.
Further communication will signify your consent to 
this.
-----------------------------
[test_ln-symbolic-interactive-relative.tar.gz (application/gzip, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#23564; Package coreutils. (Tue, 17 May 2016 16:11:02 GMT) Full text and rfc822 format available.

Message #8 received at 23564 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Florian Schweiger <florian.schweiger <at> bbc.co.uk>, 23564 <at> debbugs.gnu.org
Subject: Re: bug#23564: Unexpected results from `ln --symbolic --interactive
 --relative`
Date: Tue, 17 May 2016 17:10:34 +0100
unarchive 14116
forcemerge 14116 17126 23564
close 23564
stop

On 17/05/16 10:56, Florian Schweiger wrote:
> Hi,
>
> I've noticed the following unexpected behaviour in `ln` which appears to
> be a bug. I'm referring to the attached MWE Bash script
> test_ln-symbolic-interactive-relative.sh.
>
> When run, it creates a directory "test_dir" and a file "test_file" in
> the current working directory. Then it tries to create a relative,
> symbolic link to the file in said directory. When the "--interactive"
> option is present, this operation fails every other time in that it
> overwrites the existing link with an unreachable target.
>
> DETAILED DESCRIPTION:
>
> * First invocation
>       $ ./test_ln-symbolic-interactive-relative.sh
>       ln -sirv test_file test_dir/test_link
>       ‘test_dir/test_link’ -> ‘../test_file’
> * Second invocation:
>       $ ./test_ln-symbolic-interactive-relative.sh
>       ln -sirv test_file test_dir/test_link
>       ln: replace ‘test_dir/test_link’? y
>       ‘test_dir/test_link’ -> ‘test_file’
> * Third invocation:
>       $ ./test_ln-symbolic-interactive-relative.sh
>       ln -sirv test_file test_dir/test_link
>       ln: replace ‘test_dir/test_link’? y
>       ‘test_dir/test_link’ -> ‘../test_file’
>
>
> AFFECTED SYSTEM:
>       * ln (GNU coreutils) 8.21
>       * GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
>       * Ubuntu 14.04.4 LTS

This was fixed in V8.22 with:
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.21-27-ge52293a

thanks,
Pádraig




Forcibly Merged 14116 17126 23564. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Tue, 17 May 2016 16:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 15 Jun 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.