emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#14116: closed ([PATCH] ln: allow to overwrite rela


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14116: closed ([PATCH] ln: allow to overwrite relative symlink)
Date: Wed, 03 Apr 2013 17:48:02 +0000

Your message dated Wed, 03 Apr 2013 18:43:53 +0100
with message-id <address@hidden>
and subject line Re: bug#14116: [PATCH] ln: allow to overwrite relative symlink
has caused the debbugs.gnu.org bug report #14116,
regarding [PATCH] ln: allow to overwrite relative symlink
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14116: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14116
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] ln: allow to overwrite relative symlink Date: Mon, 1 Apr 2013 16:40:59 +0200
Overwriting relative symlink leads to undesirable behavior. Consider the following example:

# Create some directories
mkdir test
mkdir test/folder1
mkdir test/folder2

#Create some files
touch test/folder1/file1
touch test/folder1/file2

#Create a relative symlink in folder2 to file1
ln -sr test/folder1/file1 test/folder2/link

#Check the link
ls -l test/folder2/link
# Correctly output a link to ../folder1/file1

#Overwrite the symlink to point to file2
ln -sfr test/folder1/file2 test/folder2/link

#Check the link
ls -l test/folder2/link
# Wrongly output a link to file2 instead of ../folder1/file2


This undesirable behavior is due to a dereferencing of the target when the relative path is computed. Passing CAN_NOLINKS flag to canonicalize_filename_mode solves the problem.

Attachment: patch.diff
Description: Binary data


--- End Message ---
--- Begin Message --- Subject: Re: bug#14116: [PATCH] ln: allow to overwrite relative symlink Date: Wed, 03 Apr 2013 18:43:53 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2
On 04/02/2013 11:30 AM, Rémy Lefevre wrote:
> I'm not sure to understand your first sentence. Resolving the last component 
> is already the existing behavior, but maybe not the intended one.
> 
> Anyway, I agree that the path should be resolved without its last component.
> 
> I wrote a new patch for this. I hope that this one will not break anything.

It looks good.

I've attached the full patch in your name with a test and NEWS entry.
Also attached is a related doc change, detailing the symlink
resolution done with ln --relative.

thanks!
Pádraig.

Attachment: ln--relative--symlink.patch
Description: Text Data


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]