From 4e967c787d1af6041338cb27cd14b088d565cd42 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sat, 29 Nov 2025 08:51:48 +0100 Subject: [PATCH] net/freeradius: modify VLAN fallback logic #5050 While it's nice to constrain this it's also very inflexible. With fallback disabled we can retain values in tunnel pw and VLAN ID. Enabling it without these options may be weird, but not a large problem. Template was rearranged to generate the most logic outcome. Some due maintenance sprinkled on top. --- .../OPNsense/Freeradius/forms/general.xml | 14 ++--- .../models/OPNsense/Freeradius/General.xml | 18 ------ .../views/OPNsense/Freeradius/general.volt | 57 +++++++++---------- 3 files changed, 34 insertions(+), 55 deletions(-) diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/general.xml b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/general.xml index 98beb72d9..aca416362 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/general.xml +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/general.xml @@ -25,6 +25,13 @@ true Define the Fallback VLAN group ID. + + general.fallback_tunnel_password + + password + true + Define the Fallback VLAN Tunnel-Password. Allowed characters are 0-9, a-z, A-Z, and ,._-!$%/()+#=: with up to 128 characters. + general.ldap_enabled @@ -152,11 +159,4 @@ true Fallback for proxy server. Default disabled. - - general.fallback_tunnel_password - - password - true - Define the Fallback Tunnel-Password. Allowed characters are 0-9, a-z, A-Z, and ,._-!$%/()+#=: with up to 128 characters. - diff --git a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/General.xml b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/General.xml index 754287d6e..b530c42bc 100644 --- a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/General.xml +++ b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/General.xml @@ -23,27 +23,9 @@ 1 4096 - - - VLAN fallback assignment needs to be enabled. - DependConstraint - - fallbackvlan_enabled - - - /^([0-9a-zA-Z._\-\!\$\%\/\(\)\+\#\=\{\}:]){1,128}$/u - - - VLAN fallback assignment needs to be enabled. - DependConstraint - - fallbackvlan_enabled - - - 0 diff --git a/net/freeradius/src/opnsense/mvc/app/views/OPNsense/Freeradius/general.volt b/net/freeradius/src/opnsense/mvc/app/views/OPNsense/Freeradius/general.volt index d87dedf7e..4db7788a6 100644 --- a/net/freeradius/src/opnsense/mvc/app/views/OPNsense/Freeradius/general.volt +++ b/net/freeradius/src/opnsense/mvc/app/views/OPNsense/Freeradius/general.volt @@ -1,36 +1,33 @@ {# - -OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. -This file is Copyright © 2017 by Michael Muenz -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -#} + # Copyright (c) 2014-2017 Deciso B.V. + # Copyright (c) 2017 Michael Muenz + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1 Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2 Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #}
{{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} -
-
+
@@ -52,7 +49,7 @@ POSSIBILITY OF SUCH DAMAGE. updateServiceControlUI('freeradius'); $("#saveAct_progress").removeClass("fa fa-spinner fa-pulse"); }); - }); + }, true); }); });