summaryrefslogtreecommitdiff
path: root/source4/kdc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-07-06 12:33:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:17 -0500
commit78d5afa84b9e18abf129878cdfef966bbb0e414b (patch)
treeb4407bb7310532ee17d0accd688ca53eb2dd9f2e /source4/kdc
parent755741f93d3e5a67a6bd9c98f0d46ff0dce80009 (diff)
downloadsamba-78d5afa84b9e18abf129878cdfef966bbb0e414b.tar.gz
samba-78d5afa84b9e18abf129878cdfef966bbb0e414b.tar.bz2
samba-78d5afa84b9e18abf129878cdfef966bbb0e414b.zip
r8181: Allow host/foo.realm/realm@REALM requests, assuming that the realm
forms both differ only in case. We may need a better solution than this later. Andrew Bartlett (This used to be commit a0ad13f5bceb17c1b856548825e5509921b409f0)
Diffstat (limited to 'source4/kdc')
-rw-r--r--source4/kdc/hdb-ldb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c
index 0875803be0..96f415ac01 100644
--- a/source4/kdc/hdb-ldb.c
+++ b/source4/kdc/hdb-ldb.c
@@ -460,7 +460,15 @@ static krb5_error_code LDB_lookup_principal(krb5_context context, struct ldb_con
struct ldb_message **msg;
- ret = krb5_unparse_name(context, principal, &princ_str);
+ struct Principal princ = *principal;
+
+ /* Allow host/dns.name/realm@REALM, just convert into host/dns.name@REALM */
+ if (princ.name.name_string.len == 3
+ && StrCaseCmp(princ.name.name_string.val[2], princ.realm) == 0) {
+ princ.name.name_string.len = 2;
+ }
+
+ ret = krb5_unparse_name(context, &princ, &princ_str);
if (ret != 0) {
krb5_set_error_string(context, "LDB_lookup_principal: could not parse principal");