diff --git a/files/sites-available/default b/files/sites-available/default index b77ca8f..90767ec 100644 --- a/files/sites-available/default +++ b/files/sites-available/default @@ -418,7 +418,20 @@ authorize { # # See "Authorization Queries" in mods-available/sql sql + update control { + Tmp-String-0 := "%{sql:SELECT node_ip FROM node_assignments WHERE username='%{User-Name}'}" + } + if (&control:Tmp-String-0 == "") { + reject + } + + if (&control:Tmp-String-0 != "%{NAS-IP-Address}") { + update reply { + Reply-Message := "Wrong node" + } + reject + } # If you are using /etc/smbpasswd, and are also doing mschap authentication, the un-comment this line, and configure the 'smbpasswd' module. # smbpasswd