Subject: Time difference during logging..

From: Denise Tjong <[email-masked]>
Date: Thu, 18 Jan 1996 17:34:34 -0500

Hi

I've installed academ's wu-ftpd beta 8 version on AIX3.2.5 and everything
seems to work fine except the time it logs in the xferlog file.

Any suggestions would be very appreciated.

Denise

---

From: [email-masked] (Koos van den Hout _U nix and we all_)
Date: Fri, 19 Jan 1996 09:02:03 +0100 (MET)

> Any suggestions would be very appreciated.

Let me guess : the difference is an exact number of hours so it looks like
your host has been moved to the Greenwich meridian ?

Anyway, what is probably happening is that the SETPROCTITLE code is
overwriting the environment in stead of overwriting the command line.

Solution : rebuild wu-ftpd without SETPROCTITLE enabled.

                                                Grtx. KH

-- 
  **  FAQ on current wu-ftpd at http://www.hvu.nl/~koos/wu-ftpd-faq.html  **
  Koos van den Hout,           Internetter, Unix freak and BBS SysOp at large
  [email-masked] (Home)        BBS Koos z'n Doos (+31-30-6036637 28k8)
  [email-masked] (Work)  <-- finger -l for PGPkey    (+31-30-6056619 14k4)
  http://www.hvu.nl/~koos (WWW)    Looking for a license plate with "RFC 822"
  We are root. You will be assimilated. Resistance is useless. Clickety Click

---

From: Nik Conwell <[email-masked]>
Date: Mon, 22 Jan 1996 15:03:06 -0500 (EST)

> Solution : rebuild wu-ftpd without SETPROCTITLE enabled.

I've also fixed this, and sent the fix in to the moderators.  I didn't 
get any response back from them...  Here's a message talking about it:

>From [email-masked] Fri Nov 17 08:35:42 1995
Date: Mon, 25 Sep 1995 16:05:23 -0400 (EDT)
From: Nik Conwell <[email-masked]>
Sender: Nik Conwell <[email-masked]>
Reply-To: Nik Conwell <[email-masked]>
Subject: Re: AIX version of WU-FTPD
To: [email-masked], [email-masked], 
    Jason Patterson <[email-masked]>
In-Reply-To: <v01530500ac8c213f0794@[150.131.15.59]>
Message-ID: <[email-masked]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII

On Mon, 25 Sep 1995, David L. Thompson wrote:

> I have been trying to get the AIX version of the beta up and running.  I've
> run into a few problems and thought that I would mention them.

Thanks for consolidating these and bringing them up.  I had also run into a
couple of these problems (and had notified the wu-ftpd admins...). 

I've also recently found/fixed another (this problem also appears in sendmail
since it uses setproctitle code that looks suspiciously the same...).  

ATTN: Jason Patterson (<[email-masked]>), this code may fix your
timezone problem as well (I've no Solaris experience, so can't be sure...)

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...  (Only the AIX_LEAVE_ENV stuff is important
- some other mods I made showed up in the diff.)

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
***************
*** 495,500 ****
--- 506,512 ----
      if (fcntl(fileno(stdin), F_SETOWN, getpid()) == -1)
          syslog(LOG_ERR, "fcntl F_SETOWN: %m");
  #endif
+ 
      dolog(&his_addr);
      /* Set up default state */
      data = -1;
***************
*** 1049,1054 ****
--- 1061,1071 ----
  
        if (!meta_authenticate(pw->pw_name, passwd, error_str)) {
        reply(530, error_str);
+ 
+ #ifdef LOG_FAILED
+       syslog(LOG_INFO, "failed login from %s [%s], %s",
+              remotehost, remoteaddr, the_user);
+ #endif
          return;
        }
  
***************
*** 2615,2626 ****
      setproctitle(proctitle);
  #endif /* SETPROCTITLE */
  
- #if 0 /* this is redundant unless the caller doesn't do *anything*, and
-          tcpd will pick it up and deal with it better anyways. _H*/
      if (logging)
          syslog(LOG_INFO, "connection from %s [%s]", remotehost,
                 remoteaddr);
- #endif
  }
  
  /* Record logout in wtmp file and exit with supplied status. */
--- 2632,2640 ----

Let me know what you think about this.
Thanks very much.

-nik

Nik Conwell                 Boston University                   [email-masked]