]> andersk Git - openssh.git/blobdiff - auth-bsdauth.c
- (dtucker) [contrib/cygwin/ssh-host-config] Add a test and warning for a
[openssh.git] / auth-bsdauth.c
index fa06732cc2e63eda04e0a669ba16f7537271ab4d..920c977d85a67a065f6bba1af989e0322b79c3a4 100644 (file)
@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth-bsdauth.c,v 1.3 2002/03/18 17:50:31 provos Exp $");
+RCSID("$OpenBSD: auth-bsdauth.c,v 1.6 2005/01/19 13:11:47 dtucker Exp $");
 
 #ifdef BSD_AUTH
 #include "xmalloc.h"
@@ -57,7 +57,7 @@ bsdauth_query(void *ctx, char **name, char **infotxt,
                debug3("bsdauth_query: style %s",
                    authctxt->style ? authctxt->style : "<default>");
                authctxt->as = auth_userchallenge(authctxt->user,
-                    authctxt->style, "auth-ssh", &challenge);
+                   authctxt->style, "auth-ssh", &challenge);
                if (authctxt->as == NULL)
                        challenge = NULL;
                debug2("bsdauth_query: <%s>", challenge ? challenge : "empty");
@@ -66,10 +66,10 @@ bsdauth_query(void *ctx, char **name, char **infotxt,
        if (challenge == NULL)
                return -1;
 
-       *name       = xstrdup("");
-       *infotxt    = xstrdup("");
+       *name = xstrdup("");
+       *infotxt = xstrdup("");
        *numprompts = 1;
-       *prompts = xmalloc(*numprompts * sizeof(char*));
+       *prompts = xmalloc(*numprompts * sizeof(char *));
        *echo_on = xmalloc(*numprompts * sizeof(u_int));
        (*echo_on)[0] = 0;
        (*prompts)[0] = xstrdup(challenge);
@@ -83,6 +83,9 @@ bsdauth_respond(void *ctx, u_int numresponses, char **responses)
        Authctxt *authctxt = ctx;
        int authok;
 
+       if (!authctxt->valid)
+               return -1;
+
        if (authctxt->as == 0)
                error("bsdauth_respond: no bsd auth session");
 
This page took 0.039407 seconds and 4 git commands to generate.