diff options
author | Damien Miller <djm@mindrot.org> | 2003-09-03 07:32:45 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-09-03 07:32:45 +1000 |
commit | 856f0be66908352828bb595f7ad5213623c0c610 (patch) | |
tree | 607c8df162abc4a5aa61cbaad86f9a4aaf71718a /auth.c | |
parent | 39638b6aebf5ca69ba75c79c0cc0572e1f396258 (diff) |
- markus@cvs.openbsd.org 2003/08/26 09:58:43
[auth-passwd.c auth.c auth.h auth1.c auth2-none.c auth2-passwd.c]
[auth2.c monitor.c]
fix passwd auth for 'username leaks via timing'; with djm@, original
patches from solar
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth.c,v 1.48 2003/06/02 09:17:34 markus Exp $"); | 26 | RCSID("$OpenBSD: auth.c,v 1.49 2003/08/26 09:58:43 markus Exp $"); |
27 | 27 | ||
28 | #ifdef HAVE_LOGIN_H | 28 | #ifdef HAVE_LOGIN_H |
29 | #include <login.h> | 29 | #include <login.h> |
@@ -589,3 +589,24 @@ auth_debug_reset(void) | |||
589 | auth_debug_init = 1; | 589 | auth_debug_init = 1; |
590 | } | 590 | } |
591 | } | 591 | } |
592 | |||
593 | struct passwd * | ||
594 | fakepw(void) | ||
595 | { | ||
596 | static struct passwd fake; | ||
597 | |||
598 | memset(&fake, 0, sizeof(fake)); | ||
599 | fake.pw_name = "NOUSER"; | ||
600 | fake.pw_passwd = | ||
601 | "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK"; | ||
602 | fake.pw_gecos = "NOUSER"; | ||
603 | fake.pw_uid = -1; | ||
604 | fake.pw_gid = -1; | ||
605 | #ifdef HAVE_PW_CLASS_IN_PASSWD | ||
606 | fake.pw_class = ""; | ||
607 | #endif | ||
608 | fake.pw_dir = "/nonexist"; | ||
609 | fake.pw_shell = "/nonexist"; | ||
610 | |||
611 | return (&fake); | ||
612 | } | ||