fix(freeradius): replace MySQL SUBSTRING_INDEX with PostgreSQL split_part

This commit is contained in:
2026-09-08 11:37:20 +02:00
parent a656e83473
commit 4f9937d351
+2 -2
View File
@@ -443,7 +443,7 @@ authorize {
# Engineers → dynamic pool # Engineers → dynamic pool
if (&control:Tmp-String-1 == "engineer") { if (&control:Tmp-String-1 == "engineer") {
update control { 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. # 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 ### rebuild Pool-Name
update control { 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 ### apply only for engineers