handle user@corp.net username correctly

This commit is contained in:
Daryl Poe 2014-08-15 15:45:06 -06:00
parent b07a5c11e4
commit 248c918508
1 changed files with 6 additions and 15 deletions

View File

@ -706,22 +706,13 @@ int freerdp_parse_username(char* username, char** user, char** domain)
}
else
{
p = strchr(username, '@');
if (p)
{
length = p - username;
*user = (char*) malloc(length + 1);
strncpy(*user, username, length);
(*user)[length] = '\0';
*domain = _strdup(&p[1]);
}
else
{
/* 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;
}