|
Message-ID: <87o9ol4r7k.fsf@frougon.crabdance.com> Date: Wed, 01 Nov 2017 22:35:59 +0100 From: Florent Rougon <f.rougon@...e.fr> To: oss-security@...ts.openwall.com Subject: Re: Re: Fw: Security risk of vim swap files Michael Orlitzky <michael@...itzky.com> wrote: > This is what I used to do in emacs before I disabled the backups > completely. I was wondering if there were any problems with it. If there > aren't, it seems like a better default to me, for both emacs and vim. On Emacs, this has been possible for a loooong time, and in a way that prevents collisions due to the same basename: (setq backup-directory-alist '(("." . "/some/path"))) This saves backup files in /some/path with names such as '!home!me!some-subdir!some-basename~'. It's also possible to programmatically disable the backup feature for specific files: ;; For `some', ;; cf. <http://stackoverflow.com/questions/5902847/how-do-i-apply-or-to-a-list-in-elisp>. (require 'cl) (defun my-backup-enable-predicate (fullpath) (and (not (some #'(lambda (file) (string-equal fullpath (expand-file-name file))) '("~/.zsh_history" "~/.local/share/mc/history"))) (normal-backup-enable-predicate fullpath))) (setq backup-enable-predicate 'my-backup-enable-predicate) Finally, an easier but non-programmatic solution when you can afford to write comments directly to the file: use “file variables”, e.g., with this at the beginning of the file you want to never be backed up: -*- make-backup-files: nil -*- Regards -- Florent
Powered by blists - more mailing lists
Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.