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

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

bug#28156: Emacs quietly munges symlink contents


From: Paul Eggert
Subject: bug#28156: Emacs quietly munges symlink contents
Date: Sun, 20 Aug 2017 14:31:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Eli Zaretskii wrote:

(shell-command "ln -s '~' symlink")
0
(file-symlink-p "symlink")
"~"
(rename-file "symlink" "/tmp/symlink")
nil
(file-symlink-p "/tmp/symlink")
"/home/eggert"

If this is the problem,

It's just one instance of the problem.

then let's solve it without affecting
make-symbolic-link.

This instance of the problem occurs because rename-file calls make-symbolic-link, and make-symbolic-link silently alters the link target. The real problem here is with make-symbolic-link: the rename-file bug is just a symptom.

Here, rename-file quietly expands the symlink contents, which is a bug. As far
as I can see, one cannot work around the bug by using Tramp quoting; for
example, (rename-file "/:symlink" "/:/tmp/symlink") does the same thing that
(rename-file "symlink" "/tmp/symlink") does.

But AFAIU, file-symlink-p can return a quoted name if its argument is
quoted.

I don't know what you mean by "quoted". file-symlink-returns a string, and the string is supposed to be the contents of the symlink. file-symlink-p is working correctly here. It's make-symbolic-link (called from rename-file) that is screwing up.





reply via email to

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