gitk: Use mktemp -d to avoid predictable temporary directories
[gitweb.git] / gitk
diff --git a/gitk b/gitk
index c66643520413dea6b90a3a0231c2772a856fade4..41e5071c4bdce3767f7f2782dd97b448fb153022 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -3503,7 +3503,8 @@ proc gitknewtmpdir {} {
        } else {
            set tmpdir $gitdir
        }
-       set gitktmpdir [file join $tmpdir [format ".gitk-tmp.%s" [pid]]]
+       set gitktmpformat [file join $tmpdir ".gitk-tmp.XXXXXX"]
+       set gitktmpdir [exec mktemp -d $gitktmpformat]
        if {[catch {file mkdir $gitktmpdir} err]} {
            error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err"
            unset gitktmpdir