summaryrefslogtreecommitdiffstats
path: root/usr.sbin/smtpd/util.c
diff options
context:
space:
mode:
authoreric <eric@openbsd.org>2013-01-31 18:34:43 +0000
committereric <eric@openbsd.org>2013-01-31 18:34:43 +0000
commit1c6ac25114bf06f7d43719e74b098aea17cee49c (patch)
treec6a9197bc346c4c8a38fb7caf01b634152987a65 /usr.sbin/smtpd/util.c
parentdo not need to tweak the socket sndbuf, now that the envelopes are passed (diff)
downloadwireguard-openbsd-1c6ac25114bf06f7d43719e74b098aea17cee49c.tar.xz
wireguard-openbsd-1c6ac25114bf06f7d43719e74b098aea17cee49c.zip
assorted fixes spotted by Coverity.
some log message updates. ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/util.c')
-rw-r--r--usr.sbin/smtpd/util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/util.c b/usr.sbin/smtpd/util.c
index 1586513e79c..d6a30802644 100644
--- a/usr.sbin/smtpd/util.c
+++ b/usr.sbin/smtpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.90 2013/01/26 09:37:24 gilles Exp $ */
+/* $OpenBSD: util.c,v 1.91 2013/01/31 18:34:43 eric Exp $ */
/*
* Copyright (c) 2000,2001 Markus Friedl. All rights reserved.
@@ -365,14 +365,16 @@ mktmpfile(void)
{
char path[MAXPATHLEN];
int fd;
+ mode_t omode;
if (! bsnprintf(path, sizeof(path), "%s/smtpd.XXXXXXXXXX",
PATH_TEMPORARY))
err(1, "snprintf");
+ omode = umask(7077);
if ((fd = mkstemp(path)) == -1)
err(1, "cannot create temporary file %s", path);
-
+ umask(omode);
unlink(path);
return (fd);
}