Bugzilla – Attachment 183 Details for
Bug 442
sshd allows login via public-key when account locked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Make check for locked pw not depend on HAS_SHADOW_EXPIRE
openssh-lock.patch (text/plain), 1.48 KB, created by
Darren Tucker
on 2002-11-24 17:53:23 AEDT
(
hide
)
Description:
Make check for locked pw not depend on HAS_SHADOW_EXPIRE
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2002-11-24 17:53:23 AEDT
Size:
1.48 KB
patch
obsolete
>Index: auth.c >=================================================================== >RCS file: /cvs/openssh/auth.c,v >retrieving revision 1.61 >diff -u -u -r1.61 auth.c >--- auth.c 9 Nov 2002 16:11:12 -0000 1.61 >+++ auth.c 24 Nov 2002 06:47:39 -0000 >@@ -72,7 +72,7 @@ > allowed_user(struct passwd * pw) > { > struct stat st; >- const char *hostname = NULL, *ipaddr = NULL; >+ const char *hostname = NULL, *ipaddr = NULL, *passwd; > char *shell; > int i; > #ifdef WITH_AIXAUTHENTICATE >@@ -81,11 +81,14 @@ > #if !defined(USE_PAM) && defined(HAVE_SHADOW_H) && \ > !defined(DISABLE_SHADOW) && defined(HAS_SHADOW_EXPIRE) > struct spwd *spw; >+#endif > > /* Shouldn't be called if pw is NULL, but better safe than sorry... */ > if (!pw || !pw->pw_name) > return 0; > >+#if !defined(USE_PAM) && defined(HAVE_SHADOW_H) && \ >+ !defined(DISABLE_SHADOW) && defined(HAS_SHADOW_EXPIRE) > #define DAY (24L * 60 * 60) /* 1 day in seconds */ > spw = getspnam(pw->pw_name); > if (spw != NULL) { >@@ -116,11 +119,19 @@ > return 0; > } > } >+#endif >+ >+#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) >+ passwd = spw->sp_pwdp; > #else >- /* Shouldn't be called if pw is NULL, but better safe than sorry... */ >- if (!pw || !pw->pw_name) >- return 0; >+ passwd = pw->pw_passwd; > #endif >+ /* check for locked account */ >+ if (strcmp(passwd, "*LK*") == 0 || passwd[0] == '!') { >+ log("User %.100s not allowed because account is locked", >+ pw->pw_name); >+ return 0; >+ } > > /* > * Get the shell from the password data. An empty shell field is
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 442
:
181
|
183
|
237
|
239
|
249
|
368
|
370