From 5be4b2d7786d3eaee9e11c3bc4cdbfa451006947 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 10 Mar 2014 16:24:34 -0400 Subject: gssd: Drop full domain when constructing the Ad hostname. When trying to use the special MS Windows hostanme we need to stop at the first '.' if we got a FQDN from gethostname() Tee HOST$@REALM form in fact uses the AD samAccountName attribute to represent 'HOST', and that attribute is always the host's shortname. Characters like '.' are actually illegal for a shortname in AD. Signed-off-by: Simo Sorce Signed-off-by: Steve Dickson --- utils/gssd/krb5_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index 208c72b..4b57141 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -819,8 +819,10 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname, /* Compute the active directory machine name HOST$ */ strcpy(myhostad, myhostname); - for (i = 0; myhostad[i] != 0; ++i) + for (i = 0; myhostad[i] != 0; ++i) { + if (myhostad[i] == '.') break; myhostad[i] = toupper(myhostad[i]); + } myhostad[i] = '$'; myhostad[i+1] = 0; -- cgit