A error in auth.c of openssh-2.1.1p2 port on systems with a mixture of shadowed and non-shadowed passwords and Japanese Translations.
Damien Miller
djm at mindrot.org
Sun Jul 2 18:43:39 EST 2000
On Sun, 2 Jul 2000, HARUYAMA Seigo wrote:
>
> Hi.
>
> I have found a error of openssh-2.1.1p2 port on systems with a
> mixture of shadowed and non-shadowed passwords.
Thanks for the report - this slipped in with the new expiry checking
code.
Here is the fix that was applied:
Index: auth.c
===================================================================
RCS file: /var/cvs/openssh/auth.c,v
retrieving revision 1.9
diff -u -r1.9 auth.c
--- auth.c 2000/06/26 01:31:33 1.9
+++ auth.c 2000/07/02 08:42:19
@@ -65,17 +65,18 @@
return 0;
spw = getspnam(pw->pw_name);
- if (spw == NULL)
- return 0;
-
- /* Check account expiry */
- if ((spw->sp_expire > 0) && ((time(NULL) / 86400) > spw->sp_expire))
- return 0;
+ if (spw != NULL) {
+ int days = time(NULL) / 86400;
- /* Check password expiry */
- if ((spw->sp_lstchg > 0) && (spw->sp_inact > 0) &&
- ((time(NULL) / 86400) > (spw->sp_lstchg + spw->sp_inact)))
- return 0;
+ /* Check account expiry */
+ if ((spw->sp_expire > 0) && (days > spw->sp_expire))
+ return 0;
+
+ /* Check password expiry */
+ if ((spw->sp_lstchg > 0) && (spw->sp_inact > 0) &&
+ (days > (spw->sp_lstchg + spw->sp_inact)))
+ return 0;
+ }
#else
/* Shouldn't be called if pw is NULL, but better safe than sorry... */
if (!pw)
--d
--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)
More information about the openssh-unix-dev
mailing list