how broken other systems are.
ok guenther gilles
-/* $OpenBSD: makemap.c,v 1.53 2015/10/06 06:04:46 gilles Exp $ */
+/* $OpenBSD: makemap.c,v 1.54 2015/10/12 07:58:19 deraadt Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
int ch;
DBTYPE dbtype = DB_HASH;
char *p;
- mode_t omode;
log_init(1);
if (! bsnprintf(dbname, sizeof(dbname), "%s.XXXXXXXXXXX", oflag))
errx(1, "path too long");
- omode = umask(07077);
if (mkstemp(dbname) == -1)
err(1, "mkstemp");
- umask(omode);
db = dbopen(dbname, O_EXLOCK|O_RDWR|O_SYNC, 0644, dbtype, NULL);
if (db == NULL) {
-/* $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>
offline_file(void)
{
char path[PATH_MAX];
- mode_t omode;
int fd;
FILE *fp;
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);
-/* $OpenBSD: smtpd.c,v 1.243 2015/10/09 17:44:25 gilles Exp $ */
+/* $OpenBSD: smtpd.c,v 1.244 2015/10/12 07:58:19 deraadt Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
struct child *child;
pid_t pid;
int allout, pipefd[2];
- mode_t omode;
log_debug("debug: smtpd: forking mda for session %016"PRIx64
": \"%s\" as %s", id, deliver->to, deliver->user);
/* prepare file which captures stdout and stderr */
(void)strlcpy(sfn, "/tmp/smtpd.out.XXXXXXXXXXX", sizeof(sfn));
- omode = umask(07077);
allout = mkstemp(sfn);
- umask(omode);
if (allout < 0) {
(void)snprintf(ebuf, sizeof ebuf, "mkstemp: %s", strerror(errno));
m_create(p_pony, IMSG_MDA_DONE, 0, 0, -1);
-/* $OpenBSD: util.c,v 1.119 2015/10/10 11:42:49 jung Exp $ */
+/* $OpenBSD: util.c,v 1.120 2015/10/12 07:58:19 deraadt Exp $ */
/*
* Copyright (c) 2000,2001 Markus Friedl. All rights reserved.
{
char path[PATH_MAX];
int fd;
- mode_t omode;
if (! bsnprintf(path, sizeof(path), "%s/smtpd.XXXXXXXXXX",
PATH_TEMPORARY)) {
fatal("exiting");
}
- omode = umask(07077);
if ((fd = mkstemp(path)) == -1) {
log_warn("cannot create temporary file %s", path);
fatal("exiting");
}
- umask(omode);
unlink(path);
return (fd);
}