Merge pull request #2051 from bmiklautz/feat/atusername

handle user@corp.net username correctly
This commit is contained in:
Martin Fleisz 2014-08-19 15:39:52 +02:00
commit e027541d9e

View File

@ -816,22 +816,13 @@ int freerdp_parse_username(char* username, char** user, char** domain)
} }
else else
{ {
p = strchr(username, '@'); /* Do not break up the name for '@'; both credSSP and the
* ClientInfo PDU expect 'user@corp.net' to be transmitted
if (p) * as username 'user@corp.net', domain empty.
{ */
length = (int) (p - username);
*user = (char*) malloc(length + 1);
strncpy(*user, username, length);
(*user)[length] = '\0';
*domain = _strdup(&p[1]);
}
else
{
*user = _strdup(username); *user = _strdup(username);
*domain = NULL; *domain = NULL;
} }
}
return 0; return 0;
} }