From 12cfa317b8cdee94d0c4a6daf30dec56cd8d8fe2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 6 Jan 2015 14:24:58 -0500 Subject: Names with a . in the domain are enteprise names This allows people to put in an email address as the source name and have i treated automatically as an enterprise name as well. Although technically NetBIOS names can have dots it is unlikely and the user@domain form is generally undestood to be used with UPNs and email like addresses which use the DNS Domain Name. The fallback case for NetBIOS domain names with a dot is to configure the client to use the DOMAIN\user name form instead. --- src/gss_names.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gss_names.c b/src/gss_names.c index e76a3e8..1a35ed2 100644 --- a/src/gss_names.c +++ b/src/gss_names.c @@ -96,11 +96,18 @@ static uint32_t get_enterprise_name(uint32_t *minor_status, buf[len] = '\0'; e = strstr(buf, "\\@"); + if (e) { + /* remove escape */ + memmove(e, e + 1, len - (e - buf)); + } else { + /* check if domain part contains dot */ + e = strchr(buf, '@'); + if (e) { + e = strchr(e, '.'); + } + } if (!e) return GSSERRS(0, GSS_S_UNAVAILABLE); - /* remove escape */ - memmove(e, e + 1, len - (e - buf)); - *username = strdup(buf); if (NULL == *username) { set_GSSERR(ENOMEM); -- cgit