comparison lisp/vc.el @ 5209:7fdef355cdc2

(vc-locking-user): Don't assume that the umask permits group-write and other-write.
author Paul Eggert <eggert@twinsun.com>
date Thu, 02 Dec 1993 07:47:48 +0000
parents b27badfb4040
children f8ba69b02832
comparison
equal deleted inserted replaced
5208:203a78f3f2e4 5209:7fdef355cdc2
1351 (vc-true-locking-user file) 1351 (vc-true-locking-user file)
1352 ;; This implementation assumes that any file which is under version 1352 ;; This implementation assumes that any file which is under version
1353 ;; control and has -rw-r--r-- is locked by its owner. This is true 1353 ;; control and has -rw-r--r-- is locked by its owner. This is true
1354 ;; for both RCS and SCCS, which keep unlocked files at -r--r--r--. 1354 ;; for both RCS and SCCS, which keep unlocked files at -r--r--r--.
1355 ;; We have to be careful not to exclude files with execute bits on; 1355 ;; We have to be careful not to exclude files with execute bits on;
1356 ;; scripts can be under version control too. The advantage of this 1356 ;; scripts can be under version control too. Also, we must ignore
1357 ;; hack is that calls to the very expensive vc-fetch-properties 1357 ;; the group-read and other-read bits, since paranoid users turn them off.
1358 ;; This hack wins because calls to the very expensive vc-fetch-properties
1358 ;; function only have to be made if (a) the file is locked by someone 1359 ;; function only have to be made if (a) the file is locked by someone
1359 ;; other than the current user, or (b) some untoward manipulation 1360 ;; other than the current user, or (b) some untoward manipulation
1360 ;; behind vc's back has changed the owner or the `group' or `other' 1361 ;; behind vc's back has changed the owner or the `group' or `other'
1361 ;; write bits. 1362 ;; write bits.
1362 (let ((attributes (file-attributes file))) 1363 (let ((attributes (file-attributes file)))
1363 (cond ((string-match ".r-.r-.r-." (nth 8 attributes)) 1364 (cond ((string-match ".r-..-..-." (nth 8 attributes))
1364 nil) 1365 nil)
1365 ((and (= (nth 2 attributes) (user-uid)) 1366 ((and (= (nth 2 attributes) (user-uid))
1366 (string-match ".rw.r-.r-." (nth 8 attributes))) 1367 (string-match ".rw..-..-." (nth 8 attributes)))
1367 (user-login-name)) 1368 (user-login-name))
1368 (t 1369 (t
1369 (vc-true-locking-user file)))))) 1370 (vc-true-locking-user file))))))
1370 1371
1371 (defun vc-true-locking-user (file) 1372 (defun vc-true-locking-user (file)