Make sure we tzset() before chroot(); after passing that point

it may no longer be accessible for syslog() to format messages.
This commit is contained in:
kleink 2004-05-05 20:15:45 +00:00
parent 02bbaa62b0
commit a87145f3fc

View File

@ -1,4 +1,4 @@
/* $NetBSD: tftpd.c,v 1.27 2004/01/06 14:30:10 briggs Exp $ */ /* $NetBSD: tftpd.c,v 1.28 2004/05/05 20:15:45 kleink Exp $ */
/* /*
* Copyright (c) 1983, 1993 * Copyright (c) 1983, 1993
@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0 #if 0
static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93";
#else #else
__RCSID("$NetBSD: tftpd.c,v 1.27 2004/01/06 14:30:10 briggs Exp $"); __RCSID("$NetBSD: tftpd.c,v 1.28 2004/05/05 20:15:45 kleink Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -68,6 +68,7 @@ __RCSID("$NetBSD: tftpd.c,v 1.27 2004/01/06 14:30:10 briggs Exp $");
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <syslog.h> #include <syslog.h>
#include <time.h>
#include <unistd.h> #include <unistd.h>
#include "tftpsubs.h" #include "tftpsubs.h"
@ -161,6 +162,7 @@ main(int argc, char *argv[])
n = 0; n = 0;
fd = 0; fd = 0;
tzset();
openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_DAEMON); openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_DAEMON);
tgtuser = DEFAULTUSER; tgtuser = DEFAULTUSER;
tgtgroup = NULL; tgtgroup = NULL;