summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/crontab.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-10-26 15:50:07 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-10-26 15:50:07 +0000
commitdb0279f8ac9ff5cba34335bb38abc89dab01c9d1 (patch)
tree08457799ee53b1d1b51bdadb6cb7373b8e043621 /usr.sbin/cron/crontab.c
parentaa81826a6a6e4cec67c4aaabb2eddc03dfb570ed (diff)
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;
}