提交 105b5d3f 编写于 作者: D David Aguilar 提交者: Paul Mackerras

gitk: Use mktemp -d to avoid predictable temporary directories

gitk uses a predictable ".gitk-tmp.$PID" pattern when generating
a temporary directory.

Use "mktemp -d .gitk-tmp.XXXXXX" to harden gitk against someone
seeding /tmp with files matching the pid pattern.
Signed-off-by: NDavid Aguilar <davvid@gmail.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 c7664f1a
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册