kfw fix: Add custom "Password incorrect" message to Leash_int_kinit_ex()
authorTom Yu <tlyu@mit.edu>
Mon, 12 Dec 2011 20:45:42 +0000 (20:45 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 12 Dec 2011 20:45:42 +0000 (20:45 +0000)
Overrides obscure KRB5KRB_AP_ERR_BAD_INTEGRITY message.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7050

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25557 dc483132-0cff-0310-8789-dd5450dbe970

src/windows/leashdll/lshfunc.c

index 760ebbd0e4424e191578080a6d634765aeb8f67a..6f2756672f00034696e182f6dd074e7f788f2ce0 100644 (file)
@@ -498,6 +498,7 @@ Leash_int_kinit_ex(
     char    first_part[256];
     char    second_part[256];
     char    temp[1024];
+    char*   custom_msg;
     int     count;
     int     i;
     int rc5 = 0;
@@ -598,10 +599,9 @@ Leash_int_kinit_ex(
             rcA = rcB;
     }
 #endif /* NO_AFS */
-
+    custom_msg = (rc5 == KRB5KRB_AP_ERR_BAD_INTEGRITY) ? "Password incorrect" : NULL;
     return leash_error_message("Ticket initialization failed.",
-                               rcL,
-                               rc5, rcA, 0,
+                               rcL, rc5, rcA, custom_msg,
                                displayErrors);
 }