diff --git a/lib/gssapi/krb5/acquire_cred.c b/lib/gssapi/krb5/acquire_cred.c index 688f7f2ef..6b6251606 100644 --- a/lib/gssapi/krb5/acquire_cred.c +++ b/lib/gssapi/krb5/acquire_cred.c @@ -208,6 +208,7 @@ acquire_cred_with_password(OM_uint32 *minor_status, krb5_error_code kret; time_t now; OM_uint32 left; + const char *realm; if (!is_valid_password_cred_store(cred_store)) { *minor_status = GSS_KRB5_S_G_BAD_PASSWORD_CRED_STORE; @@ -239,6 +240,10 @@ acquire_cred_with_password(OM_uint32 *minor_status, if (kret) goto end; + realm = krb5_principal_get_realm(context, handle->principal); + + krb5_get_init_creds_opt_set_default_flags(context, "gss_krb5", realm, opt); + /* * Get the current time before the AS exchange so we don't * accidentally end up returning a value that puts advertised