summaryrefslogtreecommitdiffstats
path: root/libexec/ftpd
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1998-05-18 00:06:28 +0000
committerache <ache@FreeBSD.org>1998-05-18 00:06:28 +0000
commit66c1e653c876ad8f890ff6d279232f408505c678 (patch)
tree54d45d0a5a64c9ec762ab7bb51898f354cd674da /libexec/ftpd
parentcf73abacf64ec3efb95391eb2ed8534616b34af0 (diff)
downloadFreeBSD-src-66c1e653c876ad8f890ff6d279232f408505c678.zip
FreeBSD-src-66c1e653c876ad8f890ff6d279232f408505c678.tar.gz
Back out "always UTC" fix since some people want visually identical 'ls'
output for local users. FTP protocol RFC also says that 'ls' output is not machine-readable. "always UTC" still possible with TZ= in ftpd environment by price of having UTC in log files too. Fix INTERNAL_LS to sense new /etc/localtime after chroot
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 33884b9..665dc45 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.13 1998/05/15 16:30:09 ache Exp $";
+ "$Id: popen.c,v 1.14 1998/05/15 16:51:06 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... */
OpenPOWER on IntegriCloud