From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28156: Emacs quietly munges symlink contents Date: Mon, 21 Aug 2017 17:25:37 +0300 Message-ID: <83y3qdatge.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1503325645 13737 195.159.176.226 (21 Aug 2017 14:27:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 21 Aug 2017 14:27:25 +0000 (UTC) Cc: p.stephani2@gmail.com, michael.albinus@gmx.de, 28156@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 21 16:27:18 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 1djnfb-0002vM-GW for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Aug 2017 16:27:11 +0200 Original-Received: from localhost ([::1]:49668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djnfi-0003qq-8l for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Aug 2017 10:27:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djnfY-0003qC-Gi for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 10:27:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djnfS-0003f1-Of for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 10:27:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39238) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djnfS-0003eZ-KC for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 10:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1djnfS-0008Am-F3 for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 10:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Aug 2017 14:27: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.150332558031369 (code B ref 28156); Mon, 21 Aug 2017 14:27:02 +0000 Original-Received: (at 28156) by debbugs.gnu.org; 21 Aug 2017 14:26:20 +0000 Original-Received: from localhost ([127.0.0.1]:47919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djnel-00089s-QV for submit@debbugs.gnu.org; Mon, 21 Aug 2017 10:26:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djneh-00089d-TW for 28156@debbugs.gnu.org; Mon, 21 Aug 2017 10:26:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djneZ-0002fu-KU for 28156@debbugs.gnu.org; Mon, 21 Aug 2017 10:26:10 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djneZ-0002fk-Gs; Mon, 21 Aug 2017 10:26:07 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1488 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1djneW-0004kT-T6; Mon, 21 Aug 2017 10:26:07 -0400 In-reply-to: <6d4110f8-5c70-6c0f-bbad-dd8cd1d193e3@cs.ucla.edu> (message from Paul Eggert on Mon, 21 Aug 2017 01:34:20 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:135992 Archived-At: > Cc: michael.albinus@gmx.de, p.stephani2@gmail.com, 28156@debbugs.gnu.org > From: Paul Eggert > Date: Mon, 21 Aug 2017 01:34:20 -0700 > > The proposed change to file-symlink-p doesn't affect support for file name > quoting in its argument string. All it affects is the returned string. There is > no need for it to quote the returned string 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? So quoting it sounds like a good way to avoid triggering a slow and erroneous connection to some possibly non-existent host. If we don't quote, the caller might be in for a surprise. > just as there is no need for read-file-name to quote the string that > it returns. read-file-name gets the string from the user, so it's an entirely different context. In that context, it's user's responsibility to quote the file name if needed. > Neither function is documented to quote its return value, and > neither should do so. Documentation in Emacs was never 110% accurate, so reading it as a kind of formal requirements is not a good idea, IME. This behavior is in file-symlink-p since more than 17 years ago, so it's a de-facto standard by now; if we decide it is what we want, we could document it and move on.