Subject: Incorrect Logging Times

From: Herman Weaver/IS/CCC <[email-masked]>
Date: 23 Feb 96 15:10:38 EDT

Hi,

I'm using wu-ftp 2.4 (no beta) on AIX 4.1.4.  In the ftpaccess file I log all 
commands which 
works fine but the time stamps on all the entries are wrong.  Anyone seen this 
problem 
before?

I hope there's a fix....

Herman Weaver
Network Systems Engineer
CCC Information Services

---

From: Mike Loewen <[email-masked]>
Date: Sat, 24 Feb 1996 12:01:07 -0500 (EST)

> works fine but the time stamps on all the entries are wrong.  Anyone seen this 

   Make sure this line appears in your src/config.h file:

#undef  SETPROCTITLE

Mike Loewen			Center for Academic Computing
Email:	[email-masked]		The Pennsylvania State University
Phone:	(814) 863-4356		University Park, PA  16802
Office:	17 Willard Bldg.	http://ripsaw.cac.psu.edu/mloewen.html

---

From: Nik Conwell <[email-masked]>
Date: Wed, 28 Feb 1996 07:05:19 -0500 (EST)

>    Make sure this line appears in your src/config.h file:

I've also fixed the setproctitle stuff, and sent the fix in to the
moderators.  I didn't get any response back from them...  The patch is for an
older version (2.4.2B5) of wu-ftpd, so it should probably be put on the
current version by hand!!  (The AIX_LEAVE_ENV stuff is the fix). 

Here's an excerpt of a message talking about it: 

4) The setproctitle support code kills the environment variables.  This
messes up the syslog code in that syslog appears to get its timezone from the
environment (TZ??) (on the first call).  If you do a syslog before a
setproctitle, things will be ok.  If you do a setproctitle before a syslog,
the syslog timezone will be wrong (will probably default to GMT). 

Here's the code change I made...

acs-tst [src] gnudiff -c ftpd.c.19950829 ftpd.c
*** ftpd.c.19950829     Thu Aug 24 11:32:03 1995
--- ftpd.c      Tue Aug 29 09:25:18 1995
***************
*** 314,325 ****
--- 314,333 ----
      openlog("ftpd", LOG_PID);
  #endif
  
+ 
  #ifdef SETPROCTITLE
      /* Save start and extent of argv for setproctitle. */
      Argv = argv;
+ #ifdef AIX_LEAVE_ENV
+     /* LastArgv will be set when we figure it out as the last argv entry.  It */
+     /* should not be the last envp entry since erasing the env entries will */
+     /* cause problems with things trying to get at them (such as syslog, for */
+     /* figuring out the date/time (ENV TZ)). */
+ #else
      while (*envp)
          envp++;
      LastArgv = envp[-1] + strlen(envp[-1]);
+ #endif /* AIX_LEAVE_ENV */
  #endif /* SETPROCTITLE */
  
      argc--, argv++;
***************
*** 393,398 ****
--- 401,409 ----
          argc--, argv++;
      }
      (void) freopen(_PATH_DEVNULL, "w", stderr);
+ #ifdef AIX_LEAVE_ENV
+     LastArgv = argv[-1] + strlen(argv[-1]) + 1;
+ #endif /* AIX_LEAVE_ENV */
  
      /* Checking for random signals ... */
  #ifndef SIG_DEBUG