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
Full log
View this message in rfc822 format
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: Paul Eggert <eggert <at> cs.ucla.edu>, mmcclenn <at> geology.wisc.edu,
> 78638 <at> debbugs.gnu.org
> Date: Sun, 15 Jun 2025 15:50:54 +0200
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> Hi Eli,
>
> >> Line 6309 in files.el:
> >>
> >> --8<---------------cut here---------------start------------->8---
> >> (write-region nil nil
> >> buffer-file-name nil t buffer-file-truename)
> >> --8<---------------cut here---------------end--------------->8---
> >>
> >> And the error is raised in line 5536 of fileio.c:
> >>
> >> --8<---------------cut here---------------start------------->8---
> >> (gdb) n
> >> 5536 report_file_errno ("Opening output file", filename, open_errno);
> >
> > Thanks. Is this with backup-by-copying = t or nil? Also, does the
> > file /tmp/xxx exist at this point with the original owner and modes
> > before you edited and saved it?
>
> I've started 'emacs -Q', so it is the default: nil
>
> And yes, it is still the file owned by another user:
>
> --8<---------------cut here---------------start------------->8---
> # ll /tmp/xxx
> -rw-rw----. 1 testuser1 albinus 0 Jun 15 09:17 /tmp/xxx
> --8<---------------cut here---------------end--------------->8---
Thanks.
So the problem is not with saving the edited buffer, the problem is
that backup-file doesn't work for some reason in this case. Does
setting backup-by-copying non-nil solve the problem?
If not, then (as I don't have access to a system where I can do "sudo
useradd"), would it be possible for you to step through the code in
backup-buffer, and tell which part there fails and why, both with
backup-by-copying set to nil and non-nil?
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.