]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-mode-line): Make buffer read-only for root if file is locked.
authorRichard M. Stallman <rms@gnu.org>
Fri, 24 Dec 1993 03:12:14 +0000 (03:12 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 24 Dec 1993 03:12:14 +0000 (03:12 +0000)
lisp/vc-hooks.el

index 283d2bf56ebcc79dcdada417a63a8519be649629..8f407d5b9d875051927d78d36a50c64075f91a34 100644 (file)
@@ -147,6 +147,13 @@ visiting FILE."
               (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))