GNU bug report logs -
#28156
Emacs quietly munges symlink contents
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Sun, 20 Aug 2017 10:29:01 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #26 received at 28156 <at> debbugs.gnu.org (full text, mbox):
Michael Albinus wrote:
>>> We have quoting for these cases.
>> Quoting does not work for these cases. If I try to rename a symlink to
>> the literal string '~eggert' on my machine, Emacs will misbehave as
>> described and there is no way to quote the string naming the symlink
>> to fix this.
> (make-symbolic-link "~/.emacs" "/:/tmp/~eggert") ...
That's not the problem I was referring to. Sorry, I should have given more
detail. By "misbehave as described" I was referring to an earlier-mentioned
scenario where rename-file copies because the source and destination are on
different filesystems. For example, suppose the current directory is on a
different filesystem from /tmp, and I execute the following in my *scratch* buffer:
(shell-command "ln -s '~' symlink")
0
(file-symlink-p "symlink")
"~"
(rename-file "symlink" "/tmp/symlink")
nil
(file-symlink-p "/tmp/symlink")
"/home/eggert"
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.
This bug report was last modified 7 years and 269 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.