From c3f310ecd25624e31b0d011a32493415903c8628 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Tue, 14 Mar 2017 10:34:00 +0100
Subject: [PATCH] UTIL: Use max 15 characters for AD host UPN

We do not want to use host principal with AD
"host/name.domain.tld@DOMAIN.TLD" becasue it does not work.
We need to use correct user principal for AD hosts. And we cannot
rely all fallback "*$" becuase of other principals in keytab.

Resolves:
https://pagure.io/SSSD/sssd/issue/3329
---
 src/util/sss_krb5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c
index 4808a77..0ab5b61 100644
--- a/src/util/sss_krb5.c
+++ b/src/util/sss_krb5.c
@@ -50,7 +50,7 @@ sss_krb5_get_primary(TALLOC_CTX *mem_ctx,
             *c = toupper(*c);
         }
 
-        primary = talloc_asprintf(mem_ctx, "%s$", shortname);
+        primary = talloc_asprintf(mem_ctx, ".15%s$", shortname);
         talloc_free(shortname);
         return primary;
     }
