Commit 219a7d3f authored by Paul Eggert's avatar Paul Eggert
Browse files

(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.
parent 2ba0ccff
......@@ -1461,22 +1461,21 @@ Return nil if there is no such person."
(if workfile ;; RCS
;; RCS doesn't let us check out into arbitrary file names directly.
;; Use `co -p' and make stdout point to the correct file.
(let ((default-modes (default-file-modes))
(vc-modes (logior (file-modes (vc-name file))
(let ((vc-modes (logior (file-modes (vc-name file))
(if writable 128 0)))
(failed t))
(unwind-protect
(progn
(set-default-file-modes vc-modes)
(vc-do-command
0 "/bin/sh" file "-c"
"filename=$1; shift; exec co \"$@\" >$filename"
(format "umask %o; exec >\"$1\" || exit; shift; umask %o; exec co \"$@\""
(logand 511 (lognot vc-modes))
(logand 511 (lognot (default-file-modes))))
"" ; dummy argument for shell's $0
filename
(if writable "-l")
(concat "-p" rev))
(setq failed nil))
(set-default-file-modes default-modes)
(and failed (file-exists-p filename) (delete-file filename))))
(vc-do-command 0 "co" file
(if writable "-l")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment