diff options
author | Simo Sorce <simo@redhat.com> | 2015-01-06 14:24:58 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-01-06 14:33:26 -0500 |
commit | 12cfa317b8cdee94d0c4a6daf30dec56cd8d8fe2 (patch) | |
tree | d56e28d4044097795031f54466ee57f6cc4949e5 /src | |
parent | 4e22b88064cb973264fc0ba967017a1b6e3cb4d8 (diff) | |
download | gss-ntlmssp-12cfa317b8cdee94d0c4a6daf30dec56cd8d8fe2.tar.gz gss-ntlmssp-12cfa317b8cdee94d0c4a6daf30dec56cd8d8fe2.tar.xz gss-ntlmssp-12cfa317b8cdee94d0c4a6daf30dec56cd8d8fe2.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/gss_names.c | 13 |
1 files 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); |