summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-11-09 00:33:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:25:24 -0500
commited77e4e57beee0c9c8b0c4c75626c41ebfc5b0c4 (patch)
tree5511351e20b0ac0c7489a2ac1f5f2b9973a6baec /source4/auth
parenta779d288a84bc64393f64798006a06432f3a6197 (diff)
downloadsamba-ed77e4e57beee0c9c8b0c4c75626c41ebfc5b0c4.tar.gz
samba-ed77e4e57beee0c9c8b0c4c75626c41ebfc5b0c4.tar.bz2
samba-ed77e4e57beee0c9c8b0c4c75626c41ebfc5b0c4.zip
r19644: Merge up to current lorikeet-heimdal, incling adding
gsskrb5_set_default_realm(), which should fix mimir's issues. Andrew Bartlett (This used to be commit 8117e76d2adee163925a29df872015ff5021a1d3)
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/gensec/gensec_gssapi.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index 9f796dc9d1..8e40973e4a 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -198,13 +198,31 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security)
ret = gsskrb5_set_send_to_kdc(&send_to_kdc);
if (ret) {
DEBUG(1,("gensec_krb5_start: gsskrb5_set_send_to_kdc failed\n"));
+ talloc_free(gensec_gssapi_state);
return NT_STATUS_INTERNAL_ERROR;
}
+ if (lp_realm() && *lp_realm()) {
+ char *upper_realm = strupper_talloc(gensec_gssapi_state, lp_realm());
+ if (!upper_realm) {
+ DEBUG(1,("gensec_krb5_start: could not uppercase realm: %s\n", lp_realm()));
+ talloc_free(gensec_gssapi_state);
+ return NT_STATUS_NO_MEMORY;
+ }
+ ret = gsskrb5_set_default_realm(upper_realm);
+ talloc_free(upper_realm);
+ if (ret) {
+ DEBUG(1,("gensec_krb5_start: gsskrb5_set_default_realm failed\n"));
+ talloc_free(gensec_gssapi_state);
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+ }
+
ret = smb_krb5_init_context(gensec_gssapi_state,
&gensec_gssapi_state->smb_krb5_context);
if (ret) {
DEBUG(1,("gensec_krb5_start: krb5_init_context failed (%s)\n",
error_message(ret)));
+ talloc_free(gensec_gssapi_state);
return NT_STATUS_INTERNAL_ERROR;
}
return NT_STATUS_OK;