aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert1993-10-14 18:28:24 +0000
committerPaul Eggert1993-10-14 18:28:24 +0000
commit219a7d3fd6d41dac73717fd887429c6cd29c308d (patch)
tree26ba03f60df9ecbadb2813dc7dcaece4efece80f
parent2ba0ccff3ad4502b2a1d36d0e7ff2e0c8dd09438 (diff)
downloademacs-219a7d3fd6d41dac73717fd887429c6cd29c308d.tar.gz
emacs-219a7d3fd6d41dac73717fd887429c6cd29c308d.zip
(vc-backend-checkout): Do not set umask to value that does not allow
user-write permission while `co' is running; some versions of `co' won't work, because they can't write their temporaries.
-rw-r--r--lisp/vc.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index de99a97c828..5adf1ca8147 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1461,22 +1461,21 @@ Return nil if there is no such person."
1461 (if workfile ;; RCS 1461 (if workfile ;; RCS
1462 ;; RCS doesn't let us check out into arbitrary file names directly. 1462 ;; RCS doesn't let us check out into arbitrary file names directly.
1463 ;; Use `co -p' and make stdout point to the correct file. 1463 ;; Use `co -p' and make stdout point to the correct file.
1464 (let ((default-modes (default-file-modes)) 1464 (let ((vc-modes (logior (file-modes (vc-name file))
1465 (vc-modes (logior (file-modes (vc-name file))
1466 (if writable 128 0))) 1465 (if writable 128 0)))
1467 (failed t)) 1466 (failed t))
1468 (unwind-protect 1467 (unwind-protect
1469 (progn 1468 (progn
1470 (set-default-file-modes vc-modes)
1471 (vc-do-command 1469 (vc-do-command
1472 0 "/bin/sh" file "-c" 1470 0 "/bin/sh" file "-c"
1473 "filename=$1; shift; exec co \"$@\" >$filename" 1471 (format "umask %o; exec >\"$1\" || exit; shift; umask %o; exec co \"$@\""
1472 (logand 511 (lognot vc-modes))
1473 (logand 511 (lognot (default-file-modes))))
1474 "" ; dummy argument for shell's $0 1474 "" ; dummy argument for shell's $0
1475 filename 1475 filename
1476 (if writable "-l") 1476 (if writable "-l")
1477 (concat "-p" rev)) 1477 (concat "-p" rev))
1478 (setq failed nil)) 1478 (setq failed nil))
1479 (set-default-file-modes default-modes)
1480 (and failed (file-exists-p filename) (delete-file filename)))) 1479 (and failed (file-exists-p filename) (delete-file filename))))
1481 (vc-do-command 0 "co" file 1480 (vc-do-command 0 "co" file
1482 (if writable "-l") 1481 (if writable "-l")