mirror of https://github.com/FreeRDP/FreeRDP
handle user@corp.net username correctly
(cherry picked from commit 248c918508
)
This commit is contained in:
parent
ee8ed97c7d
commit
5bf59b0810
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue