kdc: Ensure we cope with a samAccountName with a space in it
authorAndrew Bartlett <abartlet@samba.org>
Thu, 12 Mar 2015 00:29:56 +0000 (13:29 +1300)
committerGünther Deschner <gd@samba.org>
Thu, 12 Mar 2015 16:13:42 +0000 (17:13 +0100)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/kdc/db-glue.c

index 0bc907ef6093f182b7c56da98f000b798f2d822b..8f2b361b57186cbbe97c1abcb02087b6672d1831 100644 (file)
@@ -1601,7 +1601,10 @@ static krb5_error_code samba_kdc_lookup_server(krb5_context context,
 
                /* TODO: Check if it is our realm, otherwise give referral */
 
-               ret = krb5_unparse_name_flags(context, principal,  KRB5_PRINCIPAL_UNPARSE_NO_REALM, &short_princ);
+               ret = krb5_unparse_name_flags(context, principal,
+                                             KRB5_PRINCIPAL_UNPARSE_NO_REALM |
+                                             KRB5_PRINCIPAL_UNPARSE_DISPLAY,
+                                             &short_princ);
 
                if (ret != 0) {
                        krb5_set_error_message(context, ret, "samba_kdc_lookup_principal: could not parse principal");