Subject: linux shadow broken in beta14

From: Jon Lewis <[email-masked]>
Date: Mon, 25 Aug 1997 13:40:26 -0400 (EDT)

Either the shadow aging in beta14 is broken, or my systems are...and I
prefer to fix wu-ftpd than every other shadow app I have.

After upgrading from a hacked up beta11 to beta14, I was getting complaints
from numerous users about ftp not working.  It turned out beta11 didn't do
aging, and the way beta14 does it is incompatible with my shadow files.  The
following patch appears to fix the problem.
  
--- wu-ftpd-2.4.2-beta-14/src/ftpd.c    Mon Aug 11 23:43:08 1997
+++ wu-ftpd-2.4.2-beta-14-fdt/src/ftpd.c        Mon Aug 25 13:02:41 1997
@@ -968,8 +976,8 @@
                now = time((time_t*) 0);
                today = now / (60*60*24);
                
-               if ((spw->sp_expire!= -1) && (spw->sp_expire < today)) expired++;
-               if ((spw->sp_max != -1) && (spw->sp_lstchg + spw->sp_max < today)) expired++;
+               if ((spw->sp_expire > 0) && (spw->sp_expire < today)) expired++;
+               if ((spw->sp_max > 0) && (spw->sp_lstchg + spw->sp_max < today)) expired++;
               free(save.pw_passwd);
                save.pw_passwd = sgetsave(expired?"":spw->sp_pwdp);
            }

------------------------------------------------------------------
 Jon Lewis <[email-masked]>  |  Unsolicited commercial e-mail will
 Network Administrator       |  be proof-read for $199/message.
 Florida Digital Turnpike    |  
______http://inorganic5.fdt.net/~jlewis/pgp for PGP public key____

---

From: Simon Kirby <[email-masked]>
Date: Mon, 25 Aug 1997 11:32:48 -0700 (PDT)

> +++ wu-ftpd-2.4.2-beta-14-fdt/src/ftpd.c        Mon Aug 25 13:02:41 1997

I had to do this, too, when upgrading from beta13 to beta14.  You made
pretty much the exact the same changes I did the first time 'round, but
then I noticed that it still wasn't working with some users.  I tried this
next:

*** wu-ftpd-2.4.2-beta-14/src/ftpd.c.orig       Mon Aug 11 20:43:08 1997
--- wu-ftpd-2.4.2-beta-14/src/ftpd.c    Thu Aug 21 17:44:33 1997
***************
*** 968,975 ****
                 now = time((time_t*) 0);
                 today = now / (60*60*24);

!                if ((spw->sp_expire!= -1) && (spw->sp_expire < today)) expired++;
!                if ((spw->sp_max != -1) && (spw->sp_lstchg + spw->sp_max < today)) expired++;
               free(save.pw_passwd);
                 save.pw_passwd = sgetsave(expired?"":spw->sp_pwdp);
             }
--- 968,977 ----
                 now = time((time_t*) 0);
                 today = now / (60*60*24);

!                if ((spw->sp_expire > 0) && (spw->sp_expire < today)) expired++;
!                if ((spw->sp_max > 0) &&
!                    (spw->sp_lstchg > 0) &&
!                    (spw->sp_lstchg + spw->sp_max < today)) expired++;
               free(save.pw_passwd);
                 save.pw_passwd = sgetsave(expired?"":spw->sp_pwdp);
             }

---
This fixes problems with users which had 0 in their "password last
changed" time. 

Simon-

,---------------------------+--------------------------,
| Simon Kirby               |   Systems Administration |
| mailto:[email-masked]  | NetNation Communications |
| http://www.netnation.com/ |     Tech: (604) 688-2102 |
`--------+------------------+--------------+-----------'
         | * FREE DOMAIN NAME SUBMISSION * |
         | http://www.domain-registry.com/ |
         `---------------------------------'

---

From: Jon Lewis <[email-masked]>
Date: Tue, 26 Aug 1997 00:20:14 -0400 (EDT)

> This fixes problems with users which had 0 in their "password last

How can you have a sp_lstchg of 0?  Assuming they have a password, I would
expect your /bin/passwd would have set sp_lstchg to the time the password
was set.

---

From: Ahmed Ossama <[email-masked]>
Date: Tue, 26 Aug 1997 12:25:52 -0400

Hi all,

I have downloaded and installed wuftpd-2.4. The compilation and
installation went on without problems. Also by running ckconfig
everything was fine.

When trying to connect to the ftp server after typing in the user name
(whether anonymous or anyother valid user) I get a message:

>user <userid> access denied
>login failed.

Any clues?

Thanks.

Ahmed Ossama.
__________________________________________________________________

InTouch Communications Services		Tel: +(20.2)337.6407
3 Musadak Street, Dokki,		Fax: +(20.2)337.6480
Cairo 12311, Egypt.			Email: [email-masked]
__________________________________________________________________

---

From: Michael Brennen <[email-masked]>
Date: Tue, 26 Aug 1997 08:54:31 -0500 (CDT)

You need to upgrade to the beta below first; it has many bug and security
fixes.  Then go over the various resources to debug remaining problems.

   -- Michael

> >user <userid> access denied

This is the location for the latest wu-ftpd.  You can't see the
directory contents, but get the file anyway.  It's there.

ftp://ftp.academ.com/pub/wu-ftpd/private/wu-ftpd-2.4.2-beta-14.tar.Z

wu-ftpd FAQ:  http://www.cetis.hvu.nl/~koos/wu-ftpd-faq.html
              OR
              send mail to [email-masked]
              with a subject line: send faq

guest howto:  ftp://ftp.fni.com/pub/wu-ftpd/guest-howto
              OR
              send mail to "[email-masked]"
              (immediate autoresponder; subject does not matter)

wu-ftpd Resource Center:  http://www.landfield.com/wu-ftpd/
wu-ftpd list archive:     http://www.landfield.com/wu-ftpd/mail-archive/

There are additional security references in the above docs.