summaryrefslogtreecommitdiff
path: root/auth2-passwd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-12-31 11:43:24 +1100
committerDarren Tucker <dtucker@zip.com.au>2003-12-31 11:43:24 +1100
commitea2870619d295b0ff6398b3115c4a4e0ac543edb (patch)
treedece7fcb87968a4bff58e7171a8a3ddf385b67cb /auth2-passwd.c
parent0b3b97512fc3bae1aad38ddff2222bcca5f80f0e (diff)
- dtucker@cvs.openbsd.org 2003/12/31 00:24:50
[auth2-passwd.c] Ignore password change request during password auth (which we currently don't support) and discard proposed new password. corrections/ok markus@
Diffstat (limited to 'auth2-passwd.c')
-rw-r--r--auth2-passwd.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/auth2-passwd.c b/auth2-passwd.c
index 67fb4c921..a4f482d2e 100644
--- a/auth2-passwd.c
+++ b/auth2-passwd.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2-passwd.c,v 1.4 2003/08/26 09:58:43 markus Exp $"); 26RCSID("$OpenBSD: auth2-passwd.c,v 1.5 2003/12/31 00:24:50 dtucker Exp $");
27 27
28#include "xmalloc.h" 28#include "xmalloc.h"
29#include "packet.h" 29#include "packet.h"
@@ -38,16 +38,24 @@ extern ServerOptions options;
38static int 38static int
39userauth_passwd(Authctxt *authctxt) 39userauth_passwd(Authctxt *authctxt)
40{ 40{
41 char *password; 41 char *password, *newpass;
42 int authenticated = 0; 42 int authenticated = 0;
43 int change; 43 int change;
44 u_int len; 44 u_int len, newlen;
45
45 change = packet_get_char(); 46 change = packet_get_char();
46 if (change)
47 logit("password change not supported");
48 password = packet_get_string(&len); 47 password = packet_get_string(&len);
48 if (change) {
49 /* discard new password from packet */
50 newpass = packet_get_string(&newlen);
51 memset(newpass, 0, newlen);
52 xfree(newpass);
53 }
49 packet_check_eom(); 54 packet_check_eom();
50 if (PRIVSEP(auth_password(authctxt, password)) == 1 55
56 if (change)
57 logit("password change not supported");
58 else if (PRIVSEP(auth_password(authctxt, password)) == 1
51#ifdef HAVE_CYGWIN 59#ifdef HAVE_CYGWIN
52 && check_nt_auth(1, authctxt->pw) 60 && check_nt_auth(1, authctxt->pw)
53#endif 61#endif