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: Sat, 26 Aug 2017 18:53:25 -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> <83bmnacaob.fsf@gnu.org> <1fafa4ea-424e-53c5-3c91-6dd18fe47f1e@cs.ucla.edu> <83bmn8by40.fsf@gnu.org> <5963ac31-06cc-7784-bf21-46b76bd77c51@cs.ucla.edu> <87tw10qcwz.fsf@detlef> <787f2dca-7135-3da5-4516-99d12ecf8edd@cs.ucla.edu> <87a82p8abu.fsf@detlef> <732853c9-87db-e108-edb9-cf581fc62e67@cs.ucla.edu> <87h8wvlssi.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 1503798892 31780 195.159.176.226 (27 Aug 2017 01:54:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 Aug 2017 01:54:52 +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, 28156-done@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 27 03:54:47 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 1dlmmh-0007nP-Vr for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Aug 2017 03:54:44 +0200 Original-Received: from localhost ([::1]:59214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlmmo-0001QH-QX for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Aug 2017 21:54:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlmm6-00015i-C5 for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 21:54:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlmm3-0007lF-Ax for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 21:54:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48250) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dlmm3-0007l4-5T for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 21:54:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dlmm2-0004qD-Pz for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 21:54:02 -0400 Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Aug 2017 01:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 28156 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 28156@debbugs.gnu.org, eggert@cs.ucla.edu, eggert@cs.ucla.edu Original-Received: via spool by 28156-done@debbugs.gnu.org id=D28156.150379882518584 (code D ref 28156); Sun, 27 Aug 2017 01:54:02 +0000 Original-Received: (at 28156-done) by debbugs.gnu.org; 27 Aug 2017 01:53:45 +0000 Original-Received: from localhost ([127.0.0.1]:56931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlmll-0004pf-49 for submit@debbugs.gnu.org; Sat, 26 Aug 2017 21:53:45 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlmlh-0004pR-Sg for 28156-done@debbugs.gnu.org; Sat, 26 Aug 2017 21:53:43 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1A37C160872; Sat, 26 Aug 2017 18:53:35 -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 K2oOxmH-HXWa; Sat, 26 Aug 2017 18:53:34 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5848D160891; Sat, 26 Aug 2017 18:53:34 -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 W42V9H1Iep2D; Sat, 26 Aug 2017 18:53:34 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 30425160865; Sat, 26 Aug 2017 18:53:34 -0700 (PDT) In-Reply-To: <87h8wvlssi.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:136241 Archived-At: Michael Albinus wrote: > What about file-truename? I believe it still must quote the result, > otherwise we run into problems. See >=20 > (make-symbolic-link "/x:y:" "/tmp/foo") > (file-truename "/tmp/foo") >=20 > The latter shall return "/:/x:y:" (as of today) instead of > "/x:y:". Thanks for catching that. While looking into it, I noticed that file-true= name=20 has long mishandled symlink contents starting with ~ as in the following = example: $ ln -s '~nosuchuser' /tmp/foo $ ls -l /tmp/foo lrwxrwxrwx. 1 eggert eggert 11 Aug 26 18:51 /tmp/foo -> ~nosuchuser $ src/emacs -Q -batch -eval '(message "%S" (file-truename "/tmp/foo"))' "/home/eggert/src/gnu/emacs/master-tmp/~nosuchuser" I fixed both problems. > Maybe we shall document it as well. Neither the docstring of > `file-truename', nor the Lisp reference say something about. Yes, the documentation could stand some improving here. I fixed it up a b= it,=20 though not in the file-truename area as I'm thinking we may need some mor= e=20 changes here and would like to cogitate about it first. I'll CC: you on a= ny=20 further bug reports in this area. I rebased the patch to master which simplified it since I no longer had t= o worry=20 about Tramp tests, and installed the result. Closing this bug report.