GNU bug report logs - #77402
31.0.50; Tramp: file-writable-p broken

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Mon, 31 Mar 2025 08:22:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 30.2

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

Bug is archived. No further changes may be made.

Full log


Message #53 received at 77402 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 77402 <at> debbugs.gnu.org
Subject: Re: bug#77402: 31.0.50; Tramp: file-writable-p broken
Date: Mon, 31 Mar 2025 19:08:22 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
> Hi Gerd,
>
>>>> I'm afraid that's also not it. I can now boil it down to the following
>>>> test with emacs -Q (I'm always building without window system FWIW):
>>>>
>>>>   (file-writable-p "/ssh:mini:/tmp")
>>>>    => nil
>>>>   (file-writable-p (file-truename "/ssh:mini:/tmp"))
>>>>    => t
>>>>
>>>> where
>>>>
>>>>   (file-truename "/ssh:mini:/tmp")
>>>>    => "/ssh:mini:/private/tmp"
>>>
>>> Yes, this is the area I'm looking at. "/ssh:mini:/tmp" has file
>>> permissions lrwxr-xr-x, and "/ssh:mini:/private/tmp" has file
>>> permissions drwxrwxrwt. (file-writable-p "/ssh:mini:/tmp") should look
>>> at the permissions of the target, but it doesn't. It looks at the
>>> permissions of the symlink itself.
>>
>> That's what I suspected..
>>
>>> And everything is mixed happily with cached values, for performance
>>> speedup ...
>>
>> ...and there I got stuck :-)
>
> Finally., I could reproduce the problem. There was the weirdness, that on
> GNU/Linux I couldn't give a symlink the permissions 555 (your "/tmp"
> symlink has it), and so I couldn't test. Fortunately, I remembered my
> FreeBSD 14 VM, and there I could reproduce the problem.

Ah, interesting! Didn't know about that difference.

>
> The appended patch ought to fix it. Could you, pls, test?

Thanks, that works!

  (file-writable-p "/ssh:mini:/tmp")
   => t

and the Magit status buffer for the remote repository is shown without
the error. I'll test further with Magit in the next days. If I find
something, I'll submit new bugs for that.

I think this one can be considered fixed. Thanks!





This bug report was last modified 52 days ago.

Previous Next


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