.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $OpenBSD: crontab.1,v 1.32 2014/02/12 10:07:33 schwarze Exp $
+.\" $OpenBSD: crontab.1,v 1.33 2015/10/26 15:50:06 millert Exp $
.\"
-.Dd $Mdocdate: February 12 2014 $
+.Dd $Mdocdate: October 26 2015 $
.Dt CRONTAB 1
.Os
.Sh NAME
option for safety's sake.
.El
.Sh ENVIRONMENT
-.Bl -tag -width "TMPDIR"
+.Bl -tag -width "EDITOR"
.It Ev EDITOR , VISUAL
Specifies an editor to use.
If both
.Ev VISUAL
are set, the default is
.Xr vi 1 .
-.It Ev TMPDIR
-Directory in which to place temporary files used by
-.Nm Fl e .
-If unset,
-.Pa /tmp
-is used.
.El
.Sh FILES
.Bl -tag -width "/var/cron/cron.allow" -compact
-/* $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")
edit_cmd(void)
{
char n[MAX_FNAME], q[MAX_TEMPSTR];
- const char *tmpdir;
FILE *f;
int t;
struct stat statbuf, xstatbuf;
(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;
}