aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2025-12-06 14:29:43 +0100
committerJunio C Hamano <gitster@pobox.com>2025-12-07 07:28:13 +0900
commit7bef658135944d26acf3e1ec9316ca11f4369cf8 (patch)
tree2c68f8dc25f49bcf972b9501838847eed8572da8
parent47bf14750eee7e43e12d20414d3698f203245a35 (diff)
downloadgit-7bef658135944d26acf3e1ec9316ca11f4369cf8.tar.gz
banned.h: ban mktemp(3)
Older versions of mktemp(3) generate easily guessable file names. The function checks if the generated name is used, which is unreliable, as a file with that name might then be created by some other process before we can do it ourselves. The function was dropped from POSIX due to its security problems. Forbid its use. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--banned.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/banned.h b/banned.h
index 44e76bd90a..2b934c8c43 100644
--- a/banned.h
+++ b/banned.h
@@ -41,4 +41,7 @@
#undef asctime_r
#define asctime_r(t, buf) BANNED(asctime_r)
+#undef mktemp
+#define mktemp(x) BANNED(mktemp)
+
#endif /* BANNED_H */