From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#28156: Emacs quietly munges symlink contents Date: Sun, 20 Aug 2017 11:53:55 -0700 Organization: UCLA Computer Science Department Message-ID: <8a526a4a-fd11-06c7-8ad4-bc00a667bcd1@cs.ucla.edu> References: <68b2e6ef-bf0b-ebcf-c577-d296952d593f@cs.ucla.edu> <83pobqcnlf.fsf@gnu.org> <83h8x2ckqn.fsf@gnu.org> <87y3qexfeo.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1503255318 1043 195.159.176.226 (20 Aug 2017 18:55:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 20 Aug 2017 18:55:18 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Cc: Philipp Stephani , 28156@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 20 20:55:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djVNP-000823-F3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Aug 2017 20:55:11 +0200 Original-Received: from localhost ([::1]:48903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djVNR-0000uJ-Fe for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Aug 2017 14:55:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djVNJ-0000sK-SS for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2017 14:55:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djVNG-0003yJ-Q6 for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2017 14:55:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38213) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djVNG-0003y7-Lr for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2017 14:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1djVNG-0003zx-BX for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2017 14:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Aug 2017 18:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28156 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28156-submit@debbugs.gnu.org id=B28156.150325524415296 (code B ref 28156); Sun, 20 Aug 2017 18:55:02 +0000 Original-Received: (at 28156) by debbugs.gnu.org; 20 Aug 2017 18:54:04 +0000 Original-Received: from localhost ([127.0.0.1]:46894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djVMJ-0003ye-Rc for submit@debbugs.gnu.org; Sun, 20 Aug 2017 14:54:04 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djVMI-0003yB-Bb for 28156@debbugs.gnu.org; Sun, 20 Aug 2017 14:54:02 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AA8EB160883; Sun, 20 Aug 2017 11:53:56 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id DLT9r2QcbqRK; Sun, 20 Aug 2017 11:53:56 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EE59C16088D; Sun, 20 Aug 2017 11:53:55 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id KsH_xH8Z1ZQ2; Sun, 20 Aug 2017 11:53:55 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C972F160883; Sun, 20 Aug 2017 11:53:55 -0700 (PDT) In-Reply-To: <87y3qexfeo.fsf@detlef> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135951 Archived-At: 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 mor= e=20 detail. By "misbehave as described" I was referring to an earlier-mention= ed=20 scenario where rename-file copies because the source and destination are = on=20 different filesystems. For example, suppose the current directory is on a= =20 different filesystem from /tmp, and I execute the following in my *scratc= h* 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. A= s far=20 as I can see, one cannot work around the bug by using Tramp quoting; for=20 example, (rename-file "/:symlink" "/:/tmp/symlink") does the same thing t= hat=20 (rename-file "symlink" "/tmp/symlink") does.