GNU bug report logs - #78853
[Bug]: Unexpected Behaviour with the `-r` (relative) `ln` - Parameter

Previous Next

Package: coreutils;

Reported by: "NA0341-Services (dev-account)" <na0341-dev <at> posteo.org>

Date: Sat, 21 Jun 2025 07:27:06 UTC

Severity: normal

To reply to this bug, email your comments to 78853 AT debbugs.gnu.org.

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#78853; Package coreutils. (Sat, 21 Jun 2025 07:27:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to "NA0341-Services (dev-account)" <na0341-dev <at> posteo.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 21 Jun 2025 07:27:06 GMT) Full text and rfc822 format available.

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

From: "NA0341-Services (dev-account)" <na0341-dev <at> posteo.org>
To: bug-coreutils <at> gnu.org
Subject: [Bug]: Unexpected Behaviour with the `-r` (relative) `ln` - Parameter
Date: Fri, 20 Jun 2025 20:58:42 +0000
[Message part 1 (text/plain, inline)]
Dear GNU Coreutils Maintainers




Today I was trying to create a Relative Symbolic  Link to ~/.face (which 
itself is a Symlink)  named ~/.icon with the following Command:


	$ ln -sir ~/.face ~/.icon

But ln linked ~/.icon to the TARGET ~/.face was linking to, instead (it 
followed or dereferenced ~/.face).


As if I had used the -L, --logical (dereference TARGETs that are symbolic 
links).


I confirmed this behaviour with ZSH (zsh 5.9 (x86_64-pc-linux-gnu)), bash 
(5.2.37(1)-release (x86_64-pc-linux-gnu)) and sh (sh-5.2) on Manjaro Linux 
with the Linux 6.1.138-1-MANJARO Kernel and GNOME on Wayland version 48.


In a conversation with the Claude 3 Haiku AI I confirmed that this is very 
likely to be a bug ~ since `ln` should only dereference the TARGET when the 
-L Option is given.



Thank You for Your Time ~ and I'll wait for your Response




Greetings from Erfurt in Thuringia/Germany




Bela. Kroll (NA0341)

-- 
Sent with Vivaldi Mail. Download Vivaldi for free at vivaldi.com
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#78853; Package coreutils. (Sat, 21 Jun 2025 07:56:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "NA0341-Services (dev-account)" <na0341-dev <at> posteo.org>,
 78853 <at> debbugs.gnu.org
Subject: Re: bug#78853: [Bug]: Unexpected Behaviour with the `-r` (relative)
 `ln` - Parameter
Date: Sat, 21 Jun 2025 00:55:08 -0700
On 2025-06-20 13:58, NA0341-Services (dev-account) wrote:
> 
> 
> In a conversation with the Claude 3 Haiku AI I confirmed that this is 
> very likely to be a bug ~ since `ln` should only dereference the TARGET 
> when the -L Option is given.

The documentation for 'ln -r' says:

     Relative symbolic links are generated based on their canonicalized
     containing directory, and canonicalized targets.  I.e., all
     symbolic links in these file names will be resolved.

So it appears ln is behaving as documented. The documentation goes on to 
say how you can get finer-grained control.




This bug report was last modified today.

Previous Next


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