GNU bug report logs - #68976
30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo")

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Wed, 7 Feb 2024 16:06:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 30.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#68976: closed (30.0.50; Tramp: unexpected error when calling
 (file-remote-p "/dav:localhost#8000:/foo"))
Date: Thu, 08 Feb 2024 10:27:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 08 Feb 2024 11:25:51 +0100
with message-id <87a5obb6c0.fsf <at> gmx.de>
and subject line Re: bug#68976: 30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo")
has caused the debbugs.gnu.org bug report #68976,
regarding 30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo")
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
68976: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68976
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ihor Radchenko <yantar92 <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Tramp: unexpected error when calling (file-remote-p
 "/dav:localhost#8000:/foo")
Date: Wed, 07 Feb 2024 16:08:20 +0000
Hello,

Today, I tried to execute an innocent test checking if a file is remote
or not:

(file-remote-p "/dav:localhost#8000:/foo")

Unexpectedly, I encountered user error
tramp-error: Package `tramp-gvfs' not supported

I did not expect that `file-remote-p' should ever throw an error other
than when passed non-string argument.

Looking at the code, (setq tramp-gvfs-enabled t) would make the error
disappear. (The default value is nil)

I believe that it is inappropriate that throw an error in such
situation. If "gvfs" is not supported, but still claimed to be remote by
TRAMP, I expect non-nil return value when calling `file-remote-p'; not
an error.

In GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version
 3.24.41, cairo version 1.18.0) of 2024-02-04 built on localhost
Repository revision: ac3b44daf09cf723687664f21ff557d9d5ebc19b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


[Message part 3 (message/rfc822, inline)]
From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 68976-done <at> debbugs.gnu.org
Subject: Re: 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
Version: 30.1

Ihor Radchenko <yantar92 <at> 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.


This bug report was last modified 1 year and 185 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.