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 14:31:40 -0700 Organization: UCLA Computer Science Department Message-ID: References: <68b2e6ef-bf0b-ebcf-c577-d296952d593f@cs.ucla.edu> <83pobqcnlf.fsf@gnu.org> <83h8x2ckqn.fsf@gnu.org> <87y3qexfeo.fsf@detlef> <8a526a4a-fd11-06c7-8ad4-bc00a667bcd1@cs.ucla.edu> <83a82ucaew.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1503264745 25473 195.159.176.226 (20 Aug 2017 21:32:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 20 Aug 2017 21:32:25 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Cc: p.stephani2@gmail.com, michael.albinus@gmx.de, 28156@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 20 23:32:20 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 1djXpP-00063Q-Ex for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Aug 2017 23:32:15 +0200 Original-Received: from localhost ([::1]:34044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djXpW-0002TD-8Z for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Aug 2017 17:32:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djXpJ-0002SM-Go for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2017 17:32:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djXpC-0006Cc-FA for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2017 17:32:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38343) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djXpC-0006CN-By for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2017 17:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1djXpC-0002vB-2c for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2017 17:32: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 21:32: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.150326470911211 (code B ref 28156); Sun, 20 Aug 2017 21:32:02 +0000 Original-Received: (at 28156) by debbugs.gnu.org; 20 Aug 2017 21:31:49 +0000 Original-Received: from localhost ([127.0.0.1]:47024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djXoz-0002uk-Eb for submit@debbugs.gnu.org; Sun, 20 Aug 2017 17:31:49 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djXox-0002uV-MF for 28156@debbugs.gnu.org; Sun, 20 Aug 2017 17:31:48 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 971C716088D; Sun, 20 Aug 2017 14:31:41 -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 ywmpUZ2gYYoY; Sun, 20 Aug 2017 14:31:40 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id DF3B416088A; Sun, 20 Aug 2017 14:31:40 -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 wbx4K0TC0uGU; Sun, 20 Aug 2017 14:31:40 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B96DC160882; Sun, 20 Aug 2017 14:31:40 -0700 (PDT) In-Reply-To: <83a82ucaew.fsf@gnu.org> 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:135966 Archived-At: 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.