unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Preserve permissions after backup?
@ 2003-01-26 20:45 Kai Großjohann
  2003-01-27  6:22 ` Eli Zaretskii
  2003-01-27 17:41 ` Richard Stallman
  0 siblings, 2 replies; 3+ messages in thread
From: Kai Großjohann @ 2003-01-26 20:45 UTC (permalink / raw)


A Tramp user is reporting that the permissions of a root-owned file
change after he edits it with Tramp (the su method).  I'm guessing
that's because Tramp does backup by renaming and creates a new file
with default permissions.

Is there some machinery in Emacs which is designed to prevent things
like this from happening?  I guess there must be a bug in Tramp which
prevents this machinery from working.

I investigated the backup-by-copying variables but these don't talk
about the permissions, only the owner and group.

Or is backup-by-copying the right approach and I (and the user) just
need to make sure that it is used for the file(s) in question?
-- 
Ambibibentists unite!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Preserve permissions after backup?
  2003-01-26 20:45 Preserve permissions after backup? Kai Großjohann
@ 2003-01-27  6:22 ` Eli Zaretskii
  2003-01-27 17:41 ` Richard Stallman
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2003-01-27  6:22 UTC (permalink / raw)
  Cc: emacs-devel


On Sun, 26 Jan 2003, Kai =?iso-8859-1?q?Gro=DFjohann?= wrote:

> A Tramp user is reporting that the permissions of a root-owned file
> change after he edits it with Tramp (the su method).  I'm guessing
> that's because Tramp does backup by renaming and creates a new file
> with default permissions.
> 
> Is there some machinery in Emacs which is designed to prevent things
> like this from happening?

I think that machinery is in this line of files.el:basic-save-buffer:

   (set-file-modes buffer-file-name setmodes)

[and similar lines elsewhere in basic-save-buffer's subroutines].

Perhaps Tramp sabotaged some of the code that tells Emacs there's a need 
to set file's permissions, or maybe set-file-modes itself fails under 
Tramp?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Preserve permissions after backup?
  2003-01-26 20:45 Preserve permissions after backup? Kai Großjohann
  2003-01-27  6:22 ` Eli Zaretskii
@ 2003-01-27 17:41 ` Richard Stallman
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2003-01-27 17:41 UTC (permalink / raw)
  Cc: emacs-devel

    A Tramp user is reporting that the permissions of a root-owned file
    change after he edits it with Tramp (the su method).  I'm guessing
    that's because Tramp does backup by renaming and creates a new file
    with default permissions.

    Is there some machinery in Emacs which is designed to prevent things
    like this from happening?

Yes.  The functions to save the file are supposed to record the permissions
of the old file and apply them to the new file.  This must
be malfunctioning with Tramp.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-27 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-26 20:45 Preserve permissions after backup? Kai Großjohann
2003-01-27  6:22 ` Eli Zaretskii
2003-01-27 17:41 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).