summaryrefslogtreecommitdiffstats
path: root/src/gss_names.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gss_names.c')
-rw-r--r--src/gss_names.c13
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);