From: René Scharfe Date: Sat, 6 Dec 2025 13:29:43 +0000 (+0100) Subject: banned.h: ban mktemp(3) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bef658135944d26acf3e1ec9316ca11f4369cf8;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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 */