]> git.ipfire.org Git - thirdparty/git.git/commitdiff
banned.h: ban mktemp(3)
authorRené Scharfe <l.s.r@web.de>
Sat, 6 Dec 2025 13:29:43 +0000 (14:29 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 6 Dec 2025 22:28:13 +0000 (07:28 +0900)
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>
banned.h

index 44e76bd90af76938f04f7e7b0df8818d4bb81e61..2b934c8c4381b5d17eea952cc9fe3fbcfa73e523 100644 (file)
--- 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 */