From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#28156: Emacs quietly munges symlink contents Date: Fri, 25 Aug 2017 14:45:49 +0200 Message-ID: <87h8wvlssi.fsf@detlef> 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1503665237 7731 195.159.176.226 (25 Aug 2017 12:47:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2017 12:47:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: p.stephani2@gmail.com, 28156@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 25 14:47:11 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 1dlE0y-0001TG-L9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Aug 2017 14:47:08 +0200 Original-Received: from localhost ([::1]:53103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlE13-0007Ne-LO for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Aug 2017 08:47:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlE0x-0007NW-4P for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 08:47:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlE0s-00059f-76 for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 08:47:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dlE0s-00059Y-3D for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 08:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dlE0r-0008UU-PC for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 08:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2017 12:47:01 +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.150366517532584 (code B ref 28156); Fri, 25 Aug 2017 12:47:01 +0000 Original-Received: (at 28156) by debbugs.gnu.org; 25 Aug 2017 12:46:15 +0000 Original-Received: from localhost ([127.0.0.1]:53799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlE07-0008TT-3f for submit@debbugs.gnu.org; Fri, 25 Aug 2017 08:46:15 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:51174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlE04-0008TG-SA for 28156@debbugs.gnu.org; Fri, 25 Aug 2017 08:46:13 -0400 Original-Received: from detlef.gmx.de ([213.220.151.125]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M1Fe4-1dW1Yw1sb2-00tDxo; Fri, 25 Aug 2017 14:45:54 +0200 In-Reply-To: <732853c9-87db-e108-edb9-cf581fc62e67@cs.ucla.edu> (Paul Eggert's message of "Thu, 24 Aug 2017 22:12:28 -0700") X-Provags-ID: V03:K0:LInoPc0rUAOogTdO0kbb/5v7dODCzPSfZweNS17if0l7hGOkYLO W2CJBf5y6cZIOxcmR36Ypvql4nkBzbWjkZ2ZA+1rSE6zTjnEA+T+OtzZk0Apa1sMx8W5S0Q jJTAhNLVh84qvh3Ra7rgsfw1Yo40tykSMuZwkRPUiePxfD0SvVlanvUDzGWoPTtgFRdy/YH 2nRiPOxdTjICmDMKKzEiA== X-UI-Out-Filterresults: notjunk:1;V01:K0:gO9BSm7BdXo=:YRU2j00g2Y6Hk9KNUzBmjc qoQfwetVt4uN2dinyg+d2PjiQ+GJ19avdMxAWf4naRzraPF1N57Yhvka09adcAFlG2jll8Ccf cU6kdYNFVCVRc04fQd0bcjmQLMWjLmwncPJWATXT9bht1+8/i+7V1ci3ciV4fcEVSbo/9fO7t KI9dqIuctLHhsHqRPZ3Cziub0u7t87RLyVbXkoo37/uDHqdsUH/SzWNd6Uvz5ZU82YKkh6/xt GHcD0iVwWmR8XCOYNsQQPC6CAWSkwlAE/aKGehzvKNb0Ytyt+AbIJ92NTMLa37N1UCsqwFduB WrVF8VtCpLRw7EhXsunvcQTjyuuMCue1Rsub3SLlw0+JGg8B3lo0TpuBZDJEBTEj4LUKbqXzA CMrpImogTWBMg7vQdPYlsKQ/FMhL/s+zsNi/AfP/2m7ZzorMVtx+zzsI4mqgIu/iq1LFoy0g3 0BflEB1rJnxbcsd3niUK9h0sZu0QcRgwVllPJkUrBBFOdlyJ24UzCZCwWDsHFXKEuzMnKnt/S prrzhdtj+Ak4At06pF9AQmwbpNLCrX6cukPnvj9nxqiBoVBhxVnERL0tzXvf9p5I9JeVbNo7t AVWYyIk3C/vJE+3ixcp1cb1c5qLi8VlElOAHj1QPRycP2hpk7uKLrq/j37Y46SHxUMv9ce8EA FDUS/TvaBgXEpLNXw7qX6q5N8nbMRJwR9M06cw0+AZSaNWafcfh+f4jKzDYar5fQdy53nTK5h lNDNCXJjKsWw/c4qA1CYKoOHRqWoChY1NC/H0xFMoIsYcHmcmaj2JU3G3Ae6h0UrXLLakzKe 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:136192 Archived-At: Paul Eggert writes: Hi Paul, >> For a TARGET which looks like a remote file name, I propose to keep the >> current behaviour (stripping the remote part). > > That's fine if LINKNAME is also remote, since symlinks act > locally. That is, if TARGET and LINKNAME are both remote to the same > filesystem, Tramp can continue to munge TARGET so that it works on > that filesystem. However, Tramp should not be in the business of > specifying symlink behavior for local symbolic links. It should let > the OS do that. If LINKNAME is local, TARGET should just act as itself > without Tramp getting in the way. Tramp checks already in this case, that LINKNAME and TARGET belong to the same remote filesystem. I just need to add the case, that TARGET is used literally otherwise. > diff --git a/etc/NEWS b/etc/NEWS > index bf59749..60ddf54 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1228,6 +1228,30 @@ instead of to utf-8. Before this change, Emacs would sometimes > mishandle file names containing these control characters. > > +++ > +** 'file-attributes', 'file-symlink-p' and 'make-symbolic-link' no > +longer quietly mutate the target of a local symbolic link, so that > +Emacs can access and copy them reliably regardless of their contents. > +The following changes are involved. > + > +*** 'file-attributes' and 'file-symlink-p' no longer prepend "/:" to > +symbolic links whose targets begin with "/" and contain ":". For > +example, if a symbolic link "x" has a target "/y:z", (file-symlink-p > +"x") now returns "/y:z" rather than "/:/y:z". What about file-truename? I believe it still must quote the result, otherwise we run into problems. See (make-symbolic-link "/x:y:" "/tmp/foo") (file-truename "/tmp/foo") The latter shall return "/:/x:y:" (as of today) instead of "/x:y:". Otherwise, we would allow symbolic links over filesystem borders inside Emacs, which would be a security problem. Maybe we shall document it as well. Neither the docstring of `file-truename', nor the Lisp reference say something about. > diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el > index 55f4b52..99a21f3 100644 > --- a/test/lisp/net/tramp-tests.el > +++ b/test/lisp/net/tramp-tests.el You don't need to do this, I'll care for Tramp. Likely, I will add further tests here. Best regards, Michael.