summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/crontab.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-10-26 15:50:06 +0000
committermillert <millert@openbsd.org>2015-10-26 15:50:06 +0000
commit416c6c246c1a340d598a0b951a7f1405cc61626a (patch)
treed69f3472670264c53e17a13177121c0ed545e902 /usr.sbin/cron/crontab.c
parentUse rt_ifidx rather than rt_ifp. (diff)
downloadwireguard-openbsd-416c6c246c1a340d598a0b951a7f1405cc61626a.tar.xz
wireguard-openbsd-416c6c246c1a340d598a0b951a7f1405cc61626a.zip
Remove TMPDIR support, it is not really useful in crontab.
OK deraadt@
Diffstat (limited to 'usr.sbin/cron/crontab.c')
-rw-r--r--usr.sbin/cron/crontab.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c
index 05d90d07e87..17830229cdb 100644
--- a/usr.sbin/cron/crontab.c
+++ b/usr.sbin/cron/crontab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crontab.c,v 1.73 2015/10/26 14:27:41 millert Exp $ */
+/* $OpenBSD: crontab.c,v 1.74 2015/10/26 15:50:06 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -264,7 +264,6 @@ static void
edit_cmd(void)
{
char n[MAX_FNAME], q[MAX_TEMPSTR];
- const char *tmpdir;
FILE *f;
int t;
struct stat statbuf, xstatbuf;
@@ -300,13 +299,8 @@ edit_cmd(void)
(void)signal(SIGINT, SIG_IGN);
(void)signal(SIGQUIT, SIG_IGN);
- tmpdir = getenv("TMPDIR");
- if (tmpdir == NULL || tmpdir[0] == '\0')
- tmpdir = _PATH_TMP;
- for (t = strlen(tmpdir); t != 0 && tmpdir[t - 1] == '/'; t--)
- continue;
- if (snprintf(Filename, sizeof Filename, "%.*s/crontab.XXXXXXXXXX",
- t, tmpdir) >= sizeof(Filename)) {
+ if (snprintf(Filename, sizeof Filename, "%scrontab.XXXXXXXXXX",
+ _PATH_TMP) >= sizeof(Filename)) {
fprintf(stderr, "path too long\n");
goto fatal;
}