summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/openbsd-compat.h
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2023-03-10 13:27:29 +1100
committerDarren Tucker <dtucker@dtucker.net>2023-03-10 13:27:29 +1100
commit77adde4305542ebe3005dd456122624fe2347b01 (patch)
tree2d74b5ad01f606c34a5a9d218d0df8b41ed5c8df /openbsd-compat/openbsd-compat.h
parent633d3dc2a1e9e2a013d019a0576a0771c8423713 (diff)
Wrap mkstemp calls with umask set/restore.
glibc versions 2.06 and earlier did not set a umask on files created by mkstemp created the world-writable. Wrap mkstemp to set and restore the umask. From Coverity (CIDs 291826 291886 291891), ok djm@
Diffstat (limited to 'openbsd-compat/openbsd-compat.h')
-rw-r--r--openbsd-compat/openbsd-compat.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 895ecf9e..cc4cf205 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -141,6 +141,8 @@ int mkstemp(char *path);
char *mkdtemp(char *path);
#endif
+#define mkstemp(x) _ssh_mkstemp(x)
+
#ifndef HAVE_DAEMON
int daemon(int nochdir, int noclose);
#endif