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:
Diffstat (limited to 'src/Cedar/Sam.c')
-rw-r--r--src/Cedar/Sam.c13
1 files changed, 12 insertions, 1 deletions
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
{