]> andersk Git - gssapi-openssh.git/blobdiff - openssh/auth2-passwd.c
check for existence of globus_gss_assist_map_and_authorize()
[gssapi-openssh.git] / openssh / auth2-passwd.c
index 67fb4c9216be4445e0e4200d58b6062342bc6f2b..2321ef47be38145250fc16b51354d3d7d2a44cd5 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2-passwd.c,v 1.4 2003/08/26 09:58:43 markus Exp $");
+RCSID("$OpenBSD: auth2-passwd.c,v 1.5 2003/12/31 00:24:50 dtucker Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
@@ -38,21 +38,29 @@ extern ServerOptions options;
 static int
 userauth_passwd(Authctxt *authctxt)
 {
-       char *password;
+       char *password, *newpass;
        int authenticated = 0;
        int change;
-       u_int len;
+       u_int len, newlen;
+
        change = packet_get_char();
-       if (change)
-               logit("password change not supported");
        password = packet_get_string(&len);
+       if (change) {
+               /* discard new password from packet */
+               newpass = packet_get_string(&newlen);
+               memset(newpass, 0, newlen);
+               xfree(newpass);
+       }
        packet_check_eom();
-       if (PRIVSEP(auth_password(authctxt, password)) == 1
+
+       if (change)
+               logit("password change not supported");
+       else if (PRIVSEP(auth_password(authctxt, password)) == 1)
+               authenticated = 1;
 #ifdef HAVE_CYGWIN
-           && check_nt_auth(1, authctxt->pw)
+       if (check_nt_auth(1, authctxt->pw) == 0)
+               authenticated = 0;
 #endif
-           )
-               authenticated = 1;
        memset(password, 0, len);
        xfree(password);
        return authenticated;
This page took 0.033983 seconds and 4 git commands to generate.