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: Mon, 21 Aug 2017 08:58:59 -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> <834lt1d4yh.fsf@gnu.org> <6d4110f8-5c70-6c0f-bbad-dd8cd1d193e3@cs.ucla.edu> <83y3qdatge.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: quoted-printable X-Trace: blaine.gmane.org 1503331229 28863 195.159.176.226 (21 Aug 2017 16:00:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 21 Aug 2017 16:00:29 +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 Mon Aug 21 18:00:22 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 1djp7h-0006zh-KO for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Aug 2017 18:00:17 +0200 Original-Received: from localhost ([::1]:57099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djp7n-0006sY-V6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Aug 2017 12:00:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djp7X-0006oX-5n for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 12:00:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djp7T-0006CP-Ac for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 12:00:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39365) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djp7T-0006CK-6R for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 12:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1djp7S-0001z3-Cy for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 12:00: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: Mon, 21 Aug 2017 16:00: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.15033311687551 (code B ref 28156); Mon, 21 Aug 2017 16:00:02 +0000 Original-Received: (at 28156) by debbugs.gnu.org; 21 Aug 2017 15:59:28 +0000 Original-Received: from localhost ([127.0.0.1]:48046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djp6u-0001xj-HS for submit@debbugs.gnu.org; Mon, 21 Aug 2017 11:59:28 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djp6s-0001xX-TM for 28156@debbugs.gnu.org; Mon, 21 Aug 2017 11:59:27 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D811B1608B2; Mon, 21 Aug 2017 08:59:20 -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 FyY99zaes6Js; Mon, 21 Aug 2017 08:59:20 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 28B6A1608AA; Mon, 21 Aug 2017 08:59:20 -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 E0cY3DSD57z5; Mon, 21 Aug 2017 08:59:20 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 04337160880; Mon, 21 Aug 2017 08:59:20 -0700 (PDT) In-Reply-To: <83y3qdatge.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:136003 Archived-At: Eli Zaretskii wrote: > What if readlink returns a name such as "/ssh:foo@bar:/quux"? A > symlink cannot have a remote file name as its target, can it? A symlink target is a string, and can have any bytes in it (other than NU= L). So=20 if FOO is a remote file name then it can have FOO as a target. Of course = the OS=20 won't interpret the remote file name on its own, just as it won't interpr= et ~ or=20 $ or whatever, but that is OK and expected. > read-file-name gets the string from the user, so it's an entirely > different context. It was just one example, though it remains a good one. Another example is= =20 (directory-files dir), which does not escape its results even when they b= egin=20 with ~. Really, there is no need or good precedent for the sort of escapi= ng that=20 you propose. It is much simpler (and agrees with the documentation and=20 intuition) for file-symlink-p to return the results as-is, like directory= -files=20 does.