Subject: Re: bug#77402: 31.0.50; Tramp: file-writable-p broken

From: Gerd Möllmann <[email-masked]>
Date: Mon, 31 Mar 2025 16:13:10 +0200

Michael Albinus <[email-masked]> writes:

> Gerd Möllmann <[email-masked]> writes:
>
> Hi Gerd,
>
>>> Thanks. I went through the debug buffer, and perhaps I found the guilty
>>> place. Could you, please try the attached patch?
>>
>> I'm afraid that didn't fix it yet. 
>
> Hmm. I have the impression the problem is due to the sticky bit set in
> /private/tmp. Could you, please, check the modified patch?
>
> If it still doesn't work, I need the full traces again, from the
> beginning.
>
> Best regards, Michael.

--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1831,7 +1831,8 @@ tramp-sh-handle-file-writable-p
 	  ;; Examine `file-attributes' cache to see if request can be
 	  ;; satisfied without remote operation.
 	  (if (tramp-use-file-attributes v)
-	      (tramp-check-cached-permissions v ?w)
+	      (or (tramp-check-cached-permissions v ?w)
+                  (tramp-check-cached-permissions v ?t)))
                                                        ^^^
 	    (tramp-run-test v "-w" localname))
 	;; If file doesn't exist, check if directory is writable.
 	(and

That had a ')' too much which I deleted. Hope that's TRT.

With that, the error is still there. Same procedure with tramp-verbose
== 10 gives this log