From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 617bb64f6315b93f7b6dbbe7304ae634ca4fad78 Date: Sat, 25 Jun 2022 09:15:37 +0000 Message-ID: <4LVSyL0NJzz2y5h@people01.haj.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3319838476067427861==" List-Id: --===============3319838476067427861== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, next has been updated via 617bb64f6315b93f7b6dbbe7304ae634ca4fad78 (commit) via 0b4618f9a3817e6d2c76a96b0db00f50fc8e0b57 (commit) via dcc2f7e0f2887e6c15e29971a4d27ecccac884f4 (commit) from de6ef4d40adec7e1093b73c4397f042e830db15e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 617bb64f6315b93f7b6dbbe7304ae634ca4fad78 Author: Peter M=C3=BCller Date: Sat Jun 25 09:15:17 2022 +0000 Core Update 169: Ship general-functions.pl =20 Signed-off-by: Peter M=C3=BCller commit 0b4618f9a3817e6d2c76a96b0db00f50fc8e0b57 Author: Adolf Belka Date: Fri Jun 24 23:58:57 2022 +0200 general-functions.pl: Fix for bug #12865 - Static IP address pools - Add = network - Name wit> =20 - The fix for bug #12428 removed spaces from the validhostname subroutine= as hostnames are not supposed to have spaces - This resulted in spaces no longer being allowed for the Static IP Addre= ss Pools names - New subroutine created called validccdname. This allows letters, upper = and lower case, numbers, spaces and dashes =20 Fixes: Bug #12865 Tested-by: Adolf Belka Signed-off-by: Adolf Belka commit dcc2f7e0f2887e6c15e29971a4d27ecccac884f4 Author: Adolf Belka Date: Fri Jun 24 23:58:56 2022 +0200 ovpnmain.cgi: Fix for bug #12865 - Static IP address pools - Add network = - Name with space =20 - The fix for bug #12428 removed spaces from the validhostname subroutine= as hostnames are not supposed to have spaces - This resulted in spaces no longer being allowed for the Static IP Addre= ss Pools names - New subroutine created called validccdname in general-functions.pl =20 Fixes: Bug #12865 Tested-by: Adolf Belka Signed-off-by: Adolf Belka ----------------------------------------------------------------------- Summary of changes: config/cfgroot/general-functions.pl | 15 +++++++++++++++ config/rootfiles/core/169/filelists/files | 1 + html/cgi-bin/ovpnmain.cgi | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) Difference in files: diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-fun= ctions.pl index 6f49585dc..16a05cecf 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -721,6 +721,21 @@ sub validhostname return 1; } =20 +sub validccdname +{ + # Checks a ccdname for letters, numbers and spaces + my $ccdname =3D $_[0]; + + # ccdname should be at least one character in length + # but no more than 63 characters + if (length ($ccdname) < 1 || length ($ccdname) > 63) { + return 0;} + # Only valid characters are a-z, A-Z, 0-9, space and - + if ($ccdname !~ /^[a-zA-Z0-9 -]*$/) { + return 0;} + return 1; +} + sub validdomainname { my $part; diff --git a/config/rootfiles/core/169/filelists/files b/config/rootfiles/cor= e/169/filelists/files index c5dee1e28..de0b40e8b 100644 --- a/config/rootfiles/core/169/filelists/files +++ b/config/rootfiles/core/169/filelists/files @@ -220,6 +220,7 @@ srv/web/ipfire/html/images/qr-code.png srv/web/ipfire/html/images/qr-code.svg srv/web/ipfire/html/themes/ipfire/include/functions.pl usr/sbin/setup +var/ipfire/general-functions.pl var/ipfire/header.pl var/ipfire/main/manualpages var/ipfire/suricata/ruleset-sources diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 736d17541..90d3710e4 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -473,7 +473,7 @@ sub addccdnet return } =20 - if(!&General::validhostname($ccdname)) + if(!&General::validccdname($ccdname)) { $errormessage=3D$Lang::tr{'ccd err invalidname'}; return; hooks/post-receive -- IPFire 2.x development tree --===============3319838476067427861==--