/* reenter enter_identity so just forget this identity
* even if we got an error */
- if (err == KIM_USER_CANCELED_ERR) { err = KIM_NO_ERROR; }
+ if (err == KIM_USER_CANCELED_ERR ||
+ err == KIM_DUPLICATE_UI_REQUEST_ERR) {
+ err = KIM_NO_ERROR;
+ }
+
kim_identity_free (&identity);
}
kim_string_free (&new_password);
}
- if (!err || err == KIM_USER_CANCELED_ERR) {
+ if (!err || err == KIM_USER_CANCELED_ERR ||
+ err == KIM_DUPLICATE_UI_REQUEST_ERR) {
/* new creds obtained or the user gave up */
done_with_credentials = 1;
- /* remember identity and options if the user wanted to */
- kim_credential_remember_prefs (identity, options);
+ if (!err) {
+ /* remember identity and options if the user wanted to */
+ kim_credential_remember_prefs (identity, options);
+ }
+
+ if (err == KIM_DUPLICATE_UI_REQUEST_ERR) {
+ kim_ccache ccache = NULL;
+ /* credential for this identity was obtained, but via a different
+ * dialog. Find it. */
+
+ err = kim_ccache_create_from_client_identity (&ccache,
+ identity);
+
+ if (!err) {
+ err = kim_ccache_get_valid_credential (ccache,
+ &credential);
+ }
+
+ kim_ccache_free (&ccache);
+ }
} else if (prompt_count) {
/* User was prompted and might have entered bad info
error_code KIM_USER_CANCELED_ERR, "The user cancelled the operation"
error_code KIM_NO_SERVER_ERR, "KerberosAgent is not responding"
error_code KIM_NO_UI_ERR, "Unable to display a user interface from this environment"
+error_code KIM_DUPLICATE_UI_REQUEST_ERR, "UI just handled this request."
index 100
# Preferences Errors
rejected_message,
rejected_description);
- } else if (err && err != KIM_USER_CANCELED_ERR) {
+ } else if (err && err != KIM_USER_CANCELED_ERR &&
+ err != KIM_DUPLICATE_UI_REQUEST_ERR) {
/* New creds failed, report error to user.
* Overwrite error so we loop and let the user try again.
* The user always gets prompted so we always loop. */
kim_string_free (&saved_password);
}
+
+ if (err == KIM_DUPLICATE_UI_REQUEST_ERR) { err = KIM_NO_ERROR; }
}
kim_string_free (&rejected_message);
/* reenter select_identity so just forget this identity
* even if we got an error */
- if (err == KIM_USER_CANCELED_ERR) { err = KIM_NO_ERROR; }
+ if (err == KIM_USER_CANCELED_ERR ||
+ err == KIM_DUPLICATE_UI_REQUEST_ERR) { err = KIM_NO_ERROR; }
kim_identity_free (&identity);
}