summaryrefslogtreecommitdiff
path: root/libexec/ftpd
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1998-05-18 00:07:15 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1998-05-18 00:07:15 +0000
commite425bd5ea4a650e4e5656204038d1e4e681fc8fd (patch)
treeb078902880ca96de0a5d99515fa772db9c30af81 /libexec/ftpd
parent8d59e16612b1b2380ade177af6cae397bf910737 (diff)
Notes
Diffstat (limited to 'libexec/ftpd')
-rw-r--r--libexec/ftpd/popen.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libexec/ftpd/popen.c b/libexec/ftpd/popen.c
index 89583cfc6289..56f4876125e0 100644
--- a/libexec/ftpd/popen.c
+++ b/libexec/ftpd/popen.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)popen.c 8.3 (Berkeley) 4/6/94";
#endif
static const char rcsid[] =
- "$Id: popen.c,v 1.14 1998/05/15 16:51:06 ache Exp $";
+ "$Id: popen.c,v 1.4.2.7 1998/05/15 16:53:45 ache Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -57,6 +57,7 @@ static const char rcsid[] =
#ifdef INTERNAL_LS
#include "pathnames.h"
#include <syslog.h>
+#include <time.h>
#include <varargs.h>
#endif
@@ -79,7 +80,6 @@ ftpd_popen(program, type)
FILE *iop;
int argc, gargc, pdes[2], pid;
char **pop, *argv[MAXUSRARGS], *gargv[MAXGLOBARGS];
- static char *envtz[2] = {"TZ=", NULL};
if (((*type != 'r') && (*type != 'w')) || type[1])
return (NULL);
@@ -153,11 +153,17 @@ ftpd_popen(program, type)
optreset = optind = optopt = 1;
/* Close syslogging to remove pwd.db missing msgs */
closelog();
- setenv("TZ", "", 1);
+ /* Trigger to sense new /etc/localtime after chroot */
+ if (getenv("TZ") == NULL) {
+ setenv("TZ", "", 0);
+ tzset();
+ unsetenv("TZ");
+ tzset();
+ }
exit(ls_main(gargc, gargv));
}
#endif
- execve(gargv[0], gargv, envtz);
+ execv(gargv[0], gargv);
_exit(1);
}
/* parent; assume fdopen can't fail... */