Re: Proftpd users

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Wed Apr 21 2004 - 15:00:10 AKDT

On Wed, 21 Apr 2004, Joshua Kugler wrote:

> Here you go...
>
> There are a bunch of #ifdef's, so it may very well be a system specific thing.
>
> j----- k-----
>
> int log_wtmp(char *line, const char *name, const char *host, p_in_addr_t *ip)

Aha, ip in 1.2.9 is as struct of pr_netaddr_t.

> #else /* Non-SVR4 systems */
>
> if (fd < 0 && (fd = open(WTMP_FILE,O_WRONLY|O_APPEND,0)) < 0) {
> log_pri(PR_LOG_WARNING, "wtmp %s: %s", WTMP_FILE, strerror(errno));
> return -1;
> }
>
> if (fstat(fd,&buf) == 0) {
> memset(&ut,0,sizeof(ut));
> #ifdef HAVE_UTMAXTYPE
> #ifdef LINUX
> if (ip)
> memcpy(&ut.ut_addr,ip,sizeof(ut.ut_addr));

Same code as in 1.2.9 here, but working off of different data types. So,
working our way back:

In proftpd-1.2.8/include.conf.h:

  typedef struct in_addr p_in_addr_t;

In /usr/includ/linux/in.h:

  /* Internet address. */
  struct in_addr {
          __u32 s_addr;
  };

So, that would work. The bug, then, was introduced in 1.2.9 when they went
for struct that would contain all the pertinent connection info (resolvable
name, IPv6 support, socket family, etc.). Sounds like the conversion to
support IPV6 caused the problems, then.

<Whew> I feel a lot better. Ironically, I told the proftpd maintainer that I
thought they had changed the calling semantics of log_wtmp, and that ip was
probably previously a pointer to an unsigned int. I just didn't know when
that was.

So, for those of you looking to upgrade to 1.2.9, you'll want to patch the
source beforehand, or wait for the next release of proftpd.

        --Arthur Corliss
          Bolverk's Lair -- http://arthur.corlissfamily.org/
          Digital Mages -- http://www.digitalmages.com/
          "Live Free or Die, the Only Way to Live" -- NH State Motto
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Apr 21 14:59:32 2004

This archive was generated by hypermail 2.1.8 : Wed Apr 21 2004 - 14:59:34 AKDT