Mercurial > emacs
diff lisp/vc-hooks.el @ 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 | 04d6b9e7782a |
children | 9ad79a0fb0aa |
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))