diff options
author | Alexandra Ellwood <lxs@mit.edu> | 2008-10-22 20:41:34 +0000 |
---|---|---|
committer | Alexandra Ellwood <lxs@mit.edu> | 2008-10-22 20:41:34 +0000 |
commit | cfb1e42df6635e93139a7fe024111d4de02c1b3d (patch) | |
tree | d74ce1856331df1d3bd88ac40b71bb5b2f1030fa /src/kim | |
parent | 50e7f8e37b9d532343d9316677559664df88b466 (diff) | |
download | krb5-cfb1e42df6635e93139a7fe024111d4de02c1b3d.tar.gz krb5-cfb1e42df6635e93139a7fe024111d4de02c1b3d.tar.xz krb5-cfb1e42df6635e93139a7fe024111d4de02c1b3d.zip |
KIM should only display error dialogs if it has displayed UI already
ticket: new
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20909 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kim')
-rw-r--r-- | src/kim/lib/kim_credential.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/kim/lib/kim_credential.c b/src/kim/lib/kim_credential.c index 6a997159ec..c565f80ccd 100644 --- a/src/kim/lib/kim_credential.c +++ b/src/kim/lib/kim_credential.c @@ -403,17 +403,12 @@ kim_error kim_credential_create_new_with_password (kim_credential *out_credentia /* remember identity and options if the user wanted to */ kim_credential_remember_prefs (identity, options); - } else { - /* new creds failed, report error to user */ - kim_error terr = kim_ui_handle_kim_error (&context, identity, - kim_ui_error_type_authentication, - err); - - if (prompt_count) { - /* User was prompted and might have entered bad info - * so let them try again. */ - err = terr; - } + } else if (prompt_count) { + /* User was prompted and might have entered bad info + * so report error and try again. */ + err = kim_ui_handle_kim_error (&context, identity, + kim_ui_error_type_authentication, + err); } if (free_creds) { krb5_free_cred_contents (credential->context, &creds); } @@ -423,16 +418,11 @@ kim_error kim_credential_create_new_with_password (kim_credential *out_credentia /* identity obtained or the user gave up */ done_with_identity = 1; - } else { - /* new creds failed, report error to user */ - kim_error terr = kim_ui_handle_kim_error (&context, identity, - kim_ui_error_type_authentication, - err); - - if (!in_identity) { - /* User entered an identity so let them try again */ - err = terr; - } + } else if (!in_identity) { + /* User entered an identity so report error and try again */ + err = kim_ui_handle_kim_error (&context, identity, + kim_ui_error_type_authentication, + err); } if (identity != in_identity) { kim_identity_free (&identity); } |