1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-12-08 03:01:31 +03:00

Add configuration option and code to implement using the Hub name as the Radius realm

This commit is contained in:
Sacha J Bernstein
2014-07-25 11:21:28 -04:00
parent 16b713b98d
commit 2e231be197
3 changed files with 15 additions and 1 deletions

View File

@ -211,7 +211,18 @@ bool SamAuthUserByPlainPassword(CONNECTION *c, HUB *hub, char *username, char *p
AUTHRADIUS *auth = (AUTHRADIUS *)u->AuthData;
if (ast || auth->RadiusUsername == NULL || UniStrLen(auth->RadiusUsername) == 0)
{
name = CopyStrToUni(username);
if( h->RadiusIncludeRealm )
{
char name_and_realm[MAX_SIZE];
name_and_realm = StrCpy(name_and_realm, MAX_SIZE, username);
name_and_realm = StrCpy(name_and_realm, (MAX_SIZE - StrLen(name_and_realm)), "@");
name_and_realm = StrCpy(name_and_realm, (MAX_SIZE - StrLen(name_and_realm)), hub.name);
name = CopyStrToUni(name_and_realm);
}
else
{
name = CopyStrToUni(username);
}
}
else
{