]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Set prompt type for OTP preauth prompt
authorGreg Hudson <ghudson@mit.edu>
Mon, 25 Jul 2016 17:23:31 +0000 (13:23 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 25 Jul 2016 22:41:49 +0000 (18:41 -0400)
Add k5_set_prompt_type() calls around the prompter invocation in
preauth_otp.c, and add the comment we conventionally put before
prompter invocations.

ticket: 8464 (new)

src/lib/krb5/krb/preauth_otp.c

index 3de528b5ae19b5d8747e83cb1483151d87db2f5a..01c48b40f3b7a952a263cc72baec4000a0c01b2c 100644 (file)
@@ -31,6 +31,7 @@
 #include "k5-int.h"
 #include "k5-json.h"
 #include "int-proto.h"
+#include "os-proto.h"
 
 #include <krb5/clpreauth_plugin.h>
 #include <ctype.h>
@@ -475,6 +476,7 @@ doprompt(krb5_context context, krb5_prompter_fct prompter, void *prompter_data,
     krb5_prompt prompt;
     krb5_data prompt_reply;
     krb5_error_code retval;
+    krb5_prompt_type prompt_type = KRB5_PROMPT_TYPE_PREAUTH;
 
     if (prompttxt == NULL || out == NULL)
         return EINVAL;
@@ -486,7 +488,10 @@ doprompt(krb5_context context, krb5_prompter_fct prompter, void *prompter_data,
     prompt.prompt = (char *)prompttxt;
     prompt.hidden = 1;
 
+    /* PROMPTER_INVOCATION */
+    k5_set_prompt_types(context, &prompt_type);
     retval = (*prompter)(context, prompter_data, NULL, banner, 1, &prompt);
+    k5_set_prompt_types(context, NULL);
     if (retval != 0)
         return retval;