diff options
author | Sacha J Bernstein <sacha@sjbcom.com> | 2014-07-25 21:53:55 +0400 |
---|---|---|
committer | Sacha J Bernstein <sacha@sjbcom.com> | 2014-07-25 21:53:55 +0400 |
commit | e29a83ea6176104f8249b8ee5feb6e9fb48b3689 (patch) | |
tree | b2c8ccd83d5ff908ee05b392ae0e4317ce339cdc /src | |
parent | 9e55db0623bfb5fd5aa6cc3cee57a4327794b1ad (diff) |
Change from simply using the hub name as the radius realm to allowing the realm name to be configured
Diffstat (limited to 'src')
-rw-r--r-- | src/Cedar/Hub.h | 2 | ||||
-rw-r--r-- | src/Cedar/Sam.c | 4 | ||||
-rw-r--r-- | src/Cedar/Server.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/Cedar/Hub.h b/src/Cedar/Hub.h index 609b8e28..3a383d9c 100644 --- a/src/Cedar/Hub.h +++ b/src/Cedar/Hub.h @@ -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
diff --git a/src/Cedar/Sam.c b/src/Cedar/Sam.c index f4d1cb0a..8aade7da 100644 --- a/src/Cedar/Sam.c +++ b/src/Cedar/Sam.c @@ -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
diff --git a/src/Cedar/Server.c b/src/Cedar/Server.c index ac13078e..60f31ce5 100644 --- a/src/Cedar/Server.c +++ b/src/Cedar/Server.c @@ -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)
{
|