1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

Cedar: allow @ in username

This commit is contained in:
Davide Beatrici 2018-11-28 15:51:04 +01:00
parent 974f18505b
commit a1722ac2e0

View File

@ -348,6 +348,7 @@ UINT PolicyNum()
// Check the name is valid for account name // Check the name is valid for account name
bool IsUserName(char *name) bool IsUserName(char *name)
{ {
UINT i, len;
char tmp[MAX_SIZE]; char tmp[MAX_SIZE];
// Validate arguments // Validate arguments
if (name == NULL) if (name == NULL)
@ -360,7 +361,8 @@ bool IsUserName(char *name)
Trim(name); Trim(name);
if (StrLen(name) == 0) len = StrLen(name);
if (len == 0)
{ {
return false; return false;
} }
@ -370,14 +372,12 @@ bool IsUserName(char *name)
return true; return true;
} }
if (IsSafeStr(name) == false) for (i = 0; i < len; i++)
{
if (IsSafeChar(name[i]) == false && name[i] != '@')
{ {
return false; return false;
} }
if (StrCmpi(name, "link") == 0)
{
return false;
} }
if (StrCmpi(name, LINK_USER_NAME) == 0) if (StrCmpi(name, LINK_USER_NAME) == 0)