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>
This commit is contained in:
René Scharfe
2025-12-06 14:29:43 +01:00
committed by Junio C Hamano
parent 47bf14750e
commit 7bef658135

View File

@@ -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 */