# HG changeset patch # User Richard M. Stallman # Date 756702734 0 # Node ID 526f3bb9b653a65dd64e889f2160297f6cca4f66 # Parent 65b2fa217aa03e3f116cdff90c5acddae6e8add9 (vc-mode-line): Make buffer read-only for root if file is locked. diff -r 65b2fa217aa0 -r 526f3bb9b653 lisp/vc-hooks.el --- 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))