unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: 68976-done@debbugs.gnu.org
Subject: bug#68976: 30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo")
Date: Thu, 08 Feb 2024 11:25:51 +0100	[thread overview]
Message-ID: <87a5obb6c0.fsf@gmx.de> (raw)
In-Reply-To: <877cjgqejt.fsf@localhost> (Ihor Radchenko's message of "Wed, 07 Feb 2024 19:07:02 +0000")

Version: 30.1

Ihor Radchenko <yantar92@posteo.net> writes:

Hi Ihor,

>> If you want to know, whether a file name has remote file name syntax,
>> you should call
>>
>> (string-match-p tramp-file-name-regexp "/dav:localhost#8000:/foo")
>>
>> This variable is documented in the Tramp manual, node "(tramp) Change
>> file name syntax".
>
> Are you saying that I shouldn't use `file-remote-p'?

No.

> For me, the goal is to determine whether file is coming from trusted
> place or not. By default, anything non-local (Urls, TRAMP paths, etc)
> should not be trusted.

I stand corrected. Other Tramp backends do not check whether there is a
valid method. So we even have

--8<---------------cut here---------------start------------->8---
(file-remote-p "/foo:localhost#8000:/foo") => "/foo:localhost#8000:"
--8<---------------cut here---------------end--------------->8---

I've fixed tramp-gvfs.el to behave similar, and to return non-nil for
your example even if tramp-gvfs-enabled is nil. Pushed to master,
closing the bug.

Best regards, Michael.





      reply	other threads:[~2024-02-08 10:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 16:08 bug#68976: 30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo") Ihor Radchenko
2024-02-07 16:29 ` Eli Zaretskii
2024-02-07 16:40   ` Ihor Radchenko
2024-02-07 16:42     ` Eli Zaretskii
2024-02-07 17:59 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-07 19:07   ` Ihor Radchenko
2024-02-08 10:25     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5obb6c0.fsf@gmx.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68976-done@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=yantar92@posteo.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).