Subject: Re: bug#78638: 30.1; When editing a remote file owned by another user, Tramp signals an error because it cannot change the file mode

From: Eli Zaretskii <[email-masked]>
Date: Thu, 12 Jun 2025 19:22:38 +0300

> From: Michael Albinus <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Thu, 12 Jun 2025 14:42:44 +0200
> 
> > Yes, but why does chmod fail?  Can we see the error message from chmod
> > in that case, instead of redirecting its stderr to /dev/null?
> 
> On a remote machine, I have mimicked the situation. There is a file
> 
> --8<---------------cut here---------------start------------->8---
> # ls -al /tmp/xxx
> -rw-rw-r-- 1 sigrid everyone 0 2025-06-12 14:15 /tmp/xxx
> --8<---------------cut here---------------end--------------->8---
> 
> "sigrid" and "albinus" (me) are users on that machine:
> 
> --8<---------------cut here---------------start------------->8---
> # id
> uid=500(albinus) gid=100(everyone) groups=0(administrators),100(everyone)
> # id sigrid
> uid=506(sigrid) gid=100(everyone) groups=100(everyone)
> --8<---------------cut here---------------end--------------->8---
> 
> But I ("albinus") cannot change the permissions of /tmp/xxx
> 
> --8<---------------cut here---------------start------------->8---
> # chmod 775 /tmp/xxx
> chmod: /tmp/xxx: Operation not permitted
> --8<---------------cut here---------------end--------------->8---
> 
> Likely, this is due to missing permissions in the upper directory.

If the permission of the parent directory are the problem, then the
same problem could happen with local files, right?