Mercurial > emacs
changeset 5327:526f3bb9b653
(vc-mode-line): Make buffer read-only for root if file is locked.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 24 Dec 1993 03:12:14 +0000 |
parents | 65b2fa217aa0 |
children | a1450ffc50b7 |
files | lisp/vc-hooks.el |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/vc-hooks.el Fri Dec 24 03:07:30 1993 +0000 +++ b/lisp/vc-hooks.el Fri Dec 24 03:12:14 1993 +0000 @@ -147,6 +147,13 @@ (concat " " (or label (symbol-name vc-type)) (if (and vc-rcs-status (eq vc-type 'RCS)) (vc-rcs-status file))))) + ;; Even root shouldn't modify a registered file without locking it first. + (and vc-type + (not buffer-read-only) + (zerop (user-uid)) + (require 'vc) + (not (string-equal (user-login-name) (vc-locking-user file))) + (setq buffer-read-only t)) ;; force update of mode line (set-buffer-modified-p (buffer-modified-p)) vc-type))