]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-backend-checkout): Do not set umask to value that does not allow
authorPaul Eggert <eggert@twinsun.com>
Thu, 14 Oct 1993 18:28:24 +0000 (18:28 +0000)
committerPaul Eggert <eggert@twinsun.com>
Thu, 14 Oct 1993 18:28:24 +0000 (18:28 +0000)
user-write permission while `co' is running; some versions of `co'
won't work, because they can't write their temporaries.

lisp/vc.el

index de99a97c828e4efddf1f7e16bcd1c5d34f566237..5adf1ca81475846045073566780b6f8a055ad292 100644 (file)
@@ -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")