GNU bug report logs - #78638
30.1; When editing a remote file owned by another user, Tramp signals an error because it cannot change the file mode

Previous Next

Package: emacs;

Reported by: Michael McClennen <mmcclenn <at> geology.wisc.edu>

Date: Thu, 29 May 2025 21:10:02 UTC

Severity: normal

Found in version 30.1

Full log


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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mmcclenn <at> geology.wisc.edu, 78638 <at> debbugs.gnu.org
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
Date: Thu, 12 Jun 2025 14:42:44 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi Eli,

>> --8<---------------cut here---------------start------------->8---
>>    • How to ignore errors when changing file attributes?
>> 
>>      Sometimes, for example while saving remote files, errors appear
>>      when changing file attributes like permissions, time stamps, or
>>      ownership.  If these errors can be ignored, set user option
>>      ‘tramp-inhibit-errors-if-setting-file-attributes-fail’ to a
>>      non-‘nil’ value.  This transforms the error into a warning.
>> --8<---------------cut here---------------end--------------->8---
>
> 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.

Michael, what do the following commands return on the remote machine:

--8<---------------cut here---------------start------------->8---
# getfacl -ac /var/paleobiodb/frontend/pbdb-app/collections                                                       
# ls -ld /var/paleobiodb/frontend/pbdb-app/collections
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.




This bug report was last modified 31 days ago.

Previous Next


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