From 4f9937d3512920fac1fdaaaeb9a47573a588b28d Mon Sep 17 00:00:00 2001 From: "noussair.hamrit" Date: Tue, 8 Sep 2026 11:37:20 +0200 Subject: [PATCH] fix(freeradius): replace MySQL SUBSTRING_INDEX with PostgreSQL split_part --- files/sites-available/default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/sites-available/default b/files/sites-available/default index 33ce4b9..2c1b219 100644 --- a/files/sites-available/default +++ b/files/sites-available/default @@ -443,7 +443,7 @@ authorize { # Engineers → dynamic pool if (&control:Tmp-String-1 == "engineer") { update control { - Pool-Name := "engineers-%{sql:SELECT SUBSTRING_INDEX('%{User-Name}','@',-1)}" + Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}" } } # If you are using /etc/smbpasswd, and are also doing mschap authentication, the un-comment this line, and configure the 'smbpasswd' module. @@ -650,7 +650,7 @@ accounting { ### rebuild Pool-Name update control { - Pool-Name := "engineers-%{sql:SELECT SUBSTRING_INDEX('%{User-Name}','@',-1)}" + Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}" } ### apply only for engineers