mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-12-26 10:09:52 +03:00
Change from simply using the hub name as the radius realm to allowing the realm name to be configured
This commit is contained in:
parent
9e55db0623
commit
e29a83ea61
@ -424,7 +424,7 @@ struct HUB
|
||||
UINT RadiusRetryInterval; // Radius retry interval
|
||||
BUF *RadiusSecret; // Radius shared key
|
||||
char RadiusSuffixFilter[MAX_SIZE]; // Radius suffix filter
|
||||
bool RadiusIncludeRealm; // Radius - Should be use hub name as realm
|
||||
char *RadiusRealm; // Radius realm (optional)
|
||||
volatile bool Halt; // Halting flag
|
||||
bool Offline; // Offline
|
||||
bool BeingOffline; // Be Doing Offline
|
||||
|
@ -211,12 +211,12 @@ bool SamAuthUserByPlainPassword(CONNECTION *c, HUB *hub, char *username, char *p
|
||||
AUTHRADIUS *auth = (AUTHRADIUS *)u->AuthData;
|
||||
if (ast || auth->RadiusUsername == NULL || UniStrLen(auth->RadiusUsername) == 0)
|
||||
{
|
||||
if( h->RadiusIncludeRealm )
|
||||
if( h->RadiusRealm && (StrLen(h->RadiusRealm) > 0) )
|
||||
{
|
||||
char name_and_realm[MAX_SIZE];
|
||||
StrCpy(name_and_realm, MAX_SIZE, username);
|
||||
StrCat(name_and_realm, (MAX_SIZE - StrLen(name_and_realm)), "@");
|
||||
StrCat(name_and_realm, (MAX_SIZE - StrLen(name_and_realm)), hub->Name);
|
||||
StrCat(name_and_realm, (MAX_SIZE - StrLen(name_and_realm)), h->RadiusRealm);
|
||||
name = CopyStrToUni(name_and_realm);
|
||||
}
|
||||
else
|
||||
|
@ -4926,7 +4926,7 @@ void SiWriteHubCfg(FOLDER *f, HUB *h)
|
||||
CfgAddInt(f, "RadiusServerPort", h->RadiusServerPort);
|
||||
CfgAddInt(f, "RadiusRetryInterval", h->RadiusRetryInterval);
|
||||
CfgAddStr(f, "RadiusSuffixFilter", h->RadiusSuffixFilter);
|
||||
CfgAddBool(f, "RadiusIncludeRealm", h->RadiusIncludeRealm);
|
||||
CfgAddStr(f, "RadiusRealm", h->RadiusRealm);
|
||||
}
|
||||
Unlock(h->RadiusOptionLock);
|
||||
|
||||
@ -5092,7 +5092,7 @@ void SiLoadHubCfg(SERVER *s, FOLDER *f, char *name)
|
||||
interval = CfgGetInt(f, "RadiusRetryInterval");
|
||||
|
||||
CfgGetStr(f, "RadiusSuffixFilter", h->RadiusSuffixFilter, sizeof(h->RadiusSuffixFilter));
|
||||
h->RadiusIncludeRealm = CfgGetBool(f, "RadiusIncludeRealm");
|
||||
CfgGetStr(f, "RadiusRealm", h->RadiusRealm, sizeof(h->RadiusRealm));
|
||||
|
||||
if (interval == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user