From 5bf59b08107ef0042f825e5c098e0c0bf8038314 Mon Sep 17 00:00:00 2001 From: Daryl Poe Date: Fri, 15 Aug 2014 15:45:06 -0600 Subject: [PATCH] handle user@corp.net username correctly (cherry picked from commit 248c9185084e99121ea5e99610384bb3a2c0f803) --- client/common/cmdline.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 6fd21c5f3..345e11cde 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -816,21 +816,12 @@ int freerdp_parse_username(char* username, char** user, char** domain) } else { - p = strchr(username, '@'); - - if (p) - { - length = (int) (p - username); - *user = (char*) malloc(length + 1); - strncpy(*user, username, length); - (*user)[length] = '\0'; - *domain = _strdup(&p[1]); - } - else - { - *user = _strdup(username); - *domain = NULL; - } + /* Do not break up the name for '@'; both credSSP and the + * ClientInfo PDU expect 'user@corp.net' to be transmitted + * as username 'user@corp.net', domain empty. + */ + *user = _strdup(username); + *domain = NULL; } return 0;