Skip to content

Commit 7bef658

Browse files
rscharfegitster
authored andcommitted
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>
1 parent 47bf147 commit 7bef658

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

banned.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@
4141
#undef asctime_r
4242
#define asctime_r(t, buf) BANNED(asctime_r)
4343

44+
#undef mktemp
45+
#define mktemp(x) BANNED(mktemp)
46+
4447
#endif /* BANNED_H */

0 commit comments

Comments
 (0)