diff options
| author | Paul Eggert | 1993-12-02 07:47:48 +0000 |
|---|---|---|
| committer | Paul Eggert | 1993-12-02 07:47:48 +0000 |
| commit | 73960ffd67cfa0bac6cb0e67112e42a81f48a607 (patch) | |
| tree | b0ebac1945f841841bcfa1d60cf678033647a764 | |
| parent | ea32a440c04346f3336db097ce4021b6e6ffce39 (diff) | |
| download | emacs-73960ffd67cfa0bac6cb0e67112e42a81f48a607.tar.gz emacs-73960ffd67cfa0bac6cb0e67112e42a81f48a607.zip | |
(vc-locking-user): Don't assume that the umask permits
group-write and other-write.
| -rw-r--r-- | lisp/vc.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index 7b688ea8694..635b0298c00 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -1353,17 +1353,18 @@ Return nil if there is no such person." | |||
| 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)))))) |