GNU bug report logs - #14116
[PATCH] ln: allow to overwrite relative symlink

Previous Next

Package: coreutils;

Reported by: Rémy Lefevre <lefevreremy <at> gmail.com>

Date: Mon, 1 Apr 2013 15:18:02 UTC

Severity: normal

Tags: patch

Merged with 17126, 23564

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

Bug is archived. No further changes may be made.

Full log


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

From: Eric Blake <eblake <at> redhat.com>
To: Linda Walsh <coreutils <at> tlinx.org>
Cc: Rémy Lefevre <lefevreremy <at> gmail.com>,
	14116 <at> debbugs.gnu.org
Subject: Re: bug#14116: [PATCH] ln: allow to overwrite relative symlink
Date: Mon, 08 Apr 2013 08:16:24 -0600
[Message part 1 (text/plain, inline)]
On 04/07/2013 01:20 AM, Linda Walsh wrote:
> 
> 
> Rémy Lefevre wrote:
> [>> Pádraig Brady wrote:
>>> Doing that though breaks `ln -sr target1 target2 dir` where dir is a symlink.
> ]
>> But could you provide me an example where the final component of the link
>> should be resolved ?
> ---
> 	What happens if 'dir' is a symlink, "-n" is used, and
> '/' (or '/.') is appended to "dir" in the above example?

According to POSIX, appending a trailing '/' requires that a name be
resolved as a directory (either an actual directory, or a symlink to a
directory).

> 
> 	Would that force 'dir' to be resolved, on the basis that
> '/' would be the final component.

'/' is never a final component (except for the root directory '/' where
it is the only component).  In POSIX parlance, a final component is
determined by stripping trailing slashes (except for the special case of
the root directory), then using the non-slash portion after the last
remaining slash.  However, the mere presence of a trailing slash does
affect resolution rules, in that the component being resolved has to be
a directory or a symlink to a directory.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

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.