From: Michael Albinus <michael.albinus@gmx.de>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: p.stephani2@gmail.com, 28156@debbugs.gnu.org
Subject: bug#28156: Emacs quietly munges symlink contents
Date: Fri, 25 Aug 2017 14:45:49 +0200 [thread overview]
Message-ID: <87h8wvlssi.fsf@detlef> (raw)
In-Reply-To: <732853c9-87db-e108-edb9-cf581fc62e67@cs.ucla.edu> (Paul Eggert's message of "Thu, 24 Aug 2017 22:12:28 -0700")
Paul Eggert <eggert@cs.ucla.edu> 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.
next prev parent reply other threads:[~2017-08-25 12:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-20 10:28 bug#28156: Emacs quietly munges symlink contents Paul Eggert
2017-08-20 13:48 ` Michael Albinus
2017-08-20 14:37 ` Eli Zaretskii
2017-08-20 15:09 ` Philipp Stephani
2017-08-20 15:38 ` Eli Zaretskii
2017-08-20 17:54 ` Paul Eggert
2017-08-20 18:28 ` Michael Albinus
2017-08-20 18:53 ` Paul Eggert
2017-08-20 19:15 ` Michael Albinus
2017-08-20 21:47 ` Paul Eggert
2017-08-21 7:36 ` Michael Albinus
2017-08-20 19:21 ` Eli Zaretskii
2017-08-20 21:31 ` Paul Eggert
2017-08-21 2:34 ` Eli Zaretskii
2017-08-21 8:34 ` Paul Eggert
2017-08-21 14:25 ` Eli Zaretskii
2017-08-21 15:58 ` Paul Eggert
2017-08-20 19:16 ` Eli Zaretskii
2017-08-21 17:34 ` Paul Eggert
2017-08-21 17:59 ` Eli Zaretskii
2017-08-21 20:30 ` Paul Eggert
2017-08-22 7:28 ` Michael Albinus
2017-08-22 16:03 ` Paul Eggert
2017-08-24 11:38 ` Michael Albinus
2017-08-25 5:12 ` Paul Eggert
2017-08-25 12:45 ` Michael Albinus [this message]
2017-08-26 13:16 ` Michael Albinus
2017-08-27 1:53 ` Paul Eggert
2017-08-20 22:19 ` npostavs
2017-08-20 23:00 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h8wvlssi.fsf@detlef \
--to=michael.albinus@gmx.de \
--cc=28156@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=p.stephani2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.