]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
on mingw64, 'mkdir -m 700' does not work
authorSteven R. Loomis <srloomis@us.ibm.com>
Thu, 17 Nov 2016 19:54:16 +0000 (11:54 -0800)
committerSean Whitton <spwhitton@spwhitton.name>
Fri, 29 Sep 2017 01:32:56 +0000 (18:32 -0700)
* workaround: skip the '-m 700' on mingw64/32 and msys

git-remote-gcrypt

index 3b35e1c86aae811c1f01f05f7ab29d854f54c84a..8b66f2fbf2a2a89d1e3f2bdcb045d015fc43dd00 100755 (executable)
@@ -831,7 +831,15 @@ setup()
        # Set up a subdirectory in /tmp
        temp_key=$(genkey 9 | tr '/' _)
        Tempdir="${TMPDIR:-/tmp}/git-remote-gcrypt-${temp_key}.$$"
-       mkdir -m 700 "${Tempdir}"
+       case "${MSYSTEM:-unknown}" in
+       MSYS*|MINGW*)
+               mkdir "${Tempdir}"
+               echo_info "Warning: Not securing tempdir ${Tempdir} because we are on mingw/msys"
+               ;;
+       unknown|*)
+               mkdir -m 700 "${Tempdir}"
+               ;;
+       esac
 
        trap cleanup_tmpfiles EXIT
        trap 'exit 1' 1 2 3 15