tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ownership and permissions of backup files


From: Glenn Morris
Subject: Ownership and permissions of backup files
Date: Thu, 27 Mar 2003 14:48:48 +0000
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/directory/emacs.html)

Hi,


I'm not sure if this is my problem, or a Tramp problem, or an Emacs
problem, but here you go anyway!

tramp-2.0.30, Emacs-21.3, backup-by-copying t

I'm running emacs as user gmorris, and I use the su method to edit a
mode 600 file owned by root on the local machine. If
backup-directory-alist is nil, then the backup file is created in the
same directory, with the same ownership and permissions. Good. But I
usually have this:

(setq backup-directory-alist '(("." . "/home/gmorris/.emacs.d/backups")))

With this setting, the backup file is created in the backups
directory, but with owner gmorris, and mode 644 (as per user gmorris's
umask). So if my backup directory was world-readable (it isn't), the
backup of the 600 root-owned file would be world-readable as well. Not
good.

Perhaps this is my fault. Maybe I should be using something like this:

(setq backup-directory-alist '(("^/su:root.*" . "/root/.emacs.d/backups")
                               ("." . "/home/gmorris/.emacs.d/backups")))

However, this gives an error trying to write the backup file because
it tries to write to /root as user gmorris. 

So as I see it, there is a Tramp/Emacs problem in that whenever a
backup-directory-alist transformation is applied in making the
backup filename, the resulting backup file ends up being owned by the
user running Emacs, rather than the user that has been su'd to.


Not at all related, but while I remember, a small request: any chance
the location of the "~/.tramp_history" file could be customizable?

TIA,


Glenn





reply via email to

[Prev in Thread] Current Thread [Next in Thread]