diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2010-07-22 15:54:28 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-08-03 13:50:28 -0400 |
commit | 13d90c2ae8413317947d392c89fffca10ec83587 (patch) | |
tree | c0a29d768f49a5c0dd150d73912cb71fcc2d2055 | |
parent | 8f7d6fac40cc2150e66701b00cba32d7dbe59a38 (diff) | |
download | sssd-13d90c2ae8413317947d392c89fffca10ec83587.tar.gz sssd-13d90c2ae8413317947d392c89fffca10ec83587.tar.xz sssd-13d90c2ae8413317947d392c89fffca10ec83587.zip |
Fix getting default realm in the ldap child
-rw-r--r-- | src/providers/ldap/ldap_child.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c index 8ad0ad1f6..17c26855e 100644 --- a/src/providers/ldap/ldap_child.c +++ b/src/providers/ldap/ldap_child.c @@ -133,6 +133,7 @@ static int ldap_child_get_tgt_sync(TALLOC_CTX *memctx, char *ccname; char *realm_name = NULL; char *full_princ = NULL; + char *default_realm = NULL; krb5_context context = NULL; krb5_keytab keytab = NULL; krb5_ccache ccache = NULL; @@ -155,13 +156,21 @@ static int ldap_child_get_tgt_sync(TALLOC_CTX *memctx, } if (!realm_str) { - krberr = krb5_get_default_realm(context, &realm_name); + krberr = krb5_get_default_realm(context, &default_realm); if (krberr) { DEBUG(2, ("Failed to get default realm name: %s\n", sss_krb5_get_error_message(context, krberr))); ret = EFAULT; goto done; } + + realm_name = talloc_strdup(memctx, default_realm); + krb5_free_default_realm(context, default_realm); + if (!realm_name) { + ret = ENOMEM; + goto done; + } + } else { realm_name = talloc_strdup(memctx, realm_str); if (!realm_name) { |