diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-12 07:58:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-12 07:58:20 +0000 |
commit | 9f188205b3761ba90ca2a027f71220c5349c4dfb (patch) | |
tree | 32ea152db6b0f33d52b606fde70fbd121ad5dbbb /usr.sbin/smtpd/smtpctl.c | |
parent | e8dba3772776bc9ece8a6d6c4ad9eca596cafdfa (diff) |
do not umask() [with the wrong umask] around mkstemp() calls, no matter
how broken other systems are.
ok guenther gilles
Diffstat (limited to 'usr.sbin/smtpd/smtpctl.c')
-rw-r--r-- | usr.sbin/smtpd/smtpctl.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index b53d2c20326..27e454eca39 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpctl.c,v 1.128 2015/10/09 14:37:38 gilles Exp $ */ +/* $OpenBSD: smtpctl.c,v 1.129 2015/10/12 07:58:19 deraadt Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -139,7 +139,6 @@ FILE * offline_file(void) { char path[PATH_MAX]; - mode_t omode; int fd; FILE *fp; @@ -147,13 +146,11 @@ offline_file(void) PATH_OFFLINE, (long long int) time(NULL))) err(EX_UNAVAILABLE, "snprintf"); - omode = umask(07077); if ((fd = mkstemp(path)) == -1 || (fp = fdopen(fd, "w+")) == NULL) { if (fd != -1) unlink(path); err(EX_UNAVAILABLE, "cannot create temporary file %s", path); } - umask(omode); if (fchmod(fd, 0600) == -1) { unlink(path); |