changeset 4854:a964061ab350

(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.
author Paul Eggert <eggert@twinsun.com>
date Thu, 14 Oct 1993 18:28:24 +0000
parents 3ec2205d12b5
children e12addbc2c52
files lisp/vc.el
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc.el	Thu Oct 14 04:30:19 1993 +0000
+++ b/lisp/vc.el	Thu Oct 14 18:28:24 1993 +0000
@@ -1461,22 +1461,21 @@
      (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")