oss-sec mailing list archives
Re: Re: Fw: Security risk of vim swap files
From: Florent Rougon <f.rougon () free fr>
Date: Wed, 01 Nov 2017 22:35:59 +0100
Michael Orlitzky <michael () orlitzky 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
Current thread:
- Re: Security risk of vim swap files, (continued)
- Re: Security risk of vim swap files Ian Zimmerman (Nov 06)
- Re: Security risk of vim swap files Solar Designer (Nov 06)
- Re: Security risk of vim swap files Jakub Wilk (Nov 06)
- Re: Fw: Security risk of vim swap files Jakub Wilk (Nov 01)
- Re: Fw: Security risk of vim swap files Leonid Isaev (Nov 01)
- Re: Fw: Security risk of vim swap files Jan Pokorný (Nov 01)
- Re: Re: Fw: Security risk of vim swap files Michael Orlitzky (Nov 01)
- Re: Re: Fw: Security risk of vim swap files Florent Rougon (Nov 01)
- Re: Re: Fw: Security risk of vim swap files Kurt Seifried (Nov 02)
- Re: Re: Fw: Security risk of vim swap files Jakub Wilk (Nov 03)
- Re: Re: Fw: Security risk of vim swap files Scott Court (Nov 03)
- Re: Re: Fw: Security risk of vim swap files Nick Bowler (Nov 03)
- Re: Fw: Security risk of vim swap files Christian Brabandt (Nov 03)
- Re: Fw: Security risk of vim swap files Christian Brabandt (Nov 03)
- Re: Fw: Security risk of vim swap files Christian Brabandt (Nov 05)
- Re: Fw: Security risk of vim swap files Solar Designer (Nov 05)
- Re: Fw: Security risk of vim swap files Scott Court (Nov 05)
