Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiyuu Nobori <daiyuu.git@softether.co.jp>2016-11-27 12:02:30 +0300
committerDaiyuu Nobori <daiyuu.git@softether.co.jp>2016-11-27 12:02:30 +0300
commitc9cd73d90691ebf398f9662f1e004ad895327d77 (patch)
treef3a4e3c3a00497edc1decd328041b1806c60d7ac
parentc18fd5c12e4fe365a680f4f245c203a664764d4f (diff)
parent9f83dc0ba26665577f0c7add2d46048be8072214 (diff)
fix conflict
-rw-r--r--src/Cedar/Hub.h1
-rw-r--r--src/Cedar/Sam.c13
-rw-r--r--src/Cedar/Server.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/src/Cedar/Hub.h b/src/Cedar/Hub.h
index 3c1e39ef..c6bdd300 100644
--- a/src/Cedar/Hub.h
+++ b/src/Cedar/Hub.h
@@ -440,6 +440,7 @@ struct HUB
char RadiusSuffixFilter[MAX_SIZE]; // Radius suffix filter
bool RadiusConvertAllMsChapv2AuthRequestToEap; // Convert all MS-CHAPv2 auth request to EAP
bool RadiusUsePeapInsteadOfEap; // Use PEAP instead of EAP
+ char RadiusRealm[MAX_SIZE]; // 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 9fc5dc30..8201110d 100644
--- a/src/Cedar/Sam.c
+++ b/src/Cedar/Sam.c
@@ -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( IsEmptyStr(h->RadiusRealm) == false )
+ {
+ 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)), h->RadiusRealm);
+ name = CopyStrToUni(name_and_realm);
+ }
+ else
+ {
+ name = CopyStrToUni(username);
+ }
}
else
{
diff --git a/src/Cedar/Server.c b/src/Cedar/Server.c
index e2c54598..9a2a4aab 100644
--- a/src/Cedar/Server.c
+++ b/src/Cedar/Server.c
@@ -5022,6 +5022,7 @@ void SiWriteHubCfg(FOLDER *f, HUB *h)
CfgAddBool(f, "RadiusConvertAllMsChapv2AuthRequestToEap", h->RadiusConvertAllMsChapv2AuthRequestToEap);
CfgAddBool(f, "RadiusUsePeapInsteadOfEap", h->RadiusUsePeapInsteadOfEap);
+ CfgAddStr(f, "RadiusRealm", h->RadiusRealm);
}
Unlock(h->RadiusOptionLock);
@@ -5187,6 +5188,7 @@ void SiLoadHubCfg(SERVER *s, FOLDER *f, char *name)
interval = CfgGetInt(f, "RadiusRetryInterval");
CfgGetStr(f, "RadiusSuffixFilter", h->RadiusSuffixFilter, sizeof(h->RadiusSuffixFilter));
+ CfgGetStr(f, "RadiusRealm", h->RadiusRealm, sizeof(h->RadiusRealm));
h->RadiusConvertAllMsChapv2AuthRequestToEap = CfgGetBool(f, "RadiusConvertAllMsChapv2AuthRequestToEap");
h->RadiusUsePeapInsteadOfEap = CfgGetBool(f, "RadiusUsePeapInsteadOfEap");