Hello Community.
Unlike other topics here, I cannot create a location group because the drop-down menu to choose countries is missing.
Version 2.29, core update 198, fresh installation
Any Ideas?
Best regards
Wolf
Hello Community.
Unlike other topics here, I cannot create a location group because the drop-down menu to choose countries is missing.
Version 2.29, core update 198, fresh installation
Any Ideas?
Best regards
Wolf
Hallo @toddler25
Welcome to the IPFire community.
I just tried to create a Location Group. entered a name and a remark and then pressed the Add button and the following error message was shown.
Software error:
Undefined subroutine &General::validcc called at /srv/web/ipfire/cgi-bin/fwhosts.cgi line 706.
For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.
There is definitely something wrong there. I will have a look and see if I can figure out what is happening here and how to fix it.
At the higher level in the GUI, I get “Invalid Country Code”. That seems correct, since I haven’t chosen a country for obvious reasons :-).
The error message I got is because in a change in the fwhosts.cgi code we added a call to a subroutine to check the country code but the change to the general-functions.pl file didn’t get shipped with the CU198 upgrade.
Just added the subroutine into general-functions.pl on my system and then I don’t get the original error message but now I get the message
Error messages
Invalid Country Code
which as you say is because it hasn’t given the option to add any locations.
There must have been some other changes to the fwhosts.cgi code in CU198 and I will have to try and find what those were.
I might also create a CU197 vm system so I can check the actual pages that are shown.
Looking at the changes to fwhosts.cgi in CU198 I can’t see anything that should stop the locations being shown to choose from.
I am going to check out CU197 to see if the same problem was already there in that version or not as there were quite a lot of changes to fwhosts.cgi in CU196.
I have confirmed that the problem was there in CU197.
If you have an existing set of location groups and select one to edit then the drop down box with the locations is shown but not for the creation of a new location group.
It looks like the error occurred in CU196 as there were no changes to fwhosts.cgi in CU197.
I will install a CU195 and confirm that it works and then also install CU196 and check that it already has the problem.
If the above turns out to be the case then I will look through the fwhosts.cgi changes in CU196 and see what need to be modified.
I was incorrect that the problem was there also with CU197.
How the groups sections (Network/Host Groups, Location Groups & Service Groups) work is by first creating an empty group with a name and a remark (if required) and then you edit that group to put in the contents.
The problem that occurred in CU198 is that a fix for a CSS (Cross Site Scripting) vulnerability added a check for the Country Code being valid but that is being checked when the empty group is first created, when of course the group does not yet contain any Country Code. An empty result is showing up as a fail.
I will look at the best fix for this. Either we could move the Country Code check to when the group is edited or we could not carry out the validcc check if the variable is empty.
I have submitted a couple of patches to fix this issue.
And now, how to get the patches?
Following and waiting for where to get patch also. And would this fix make it to 199 ?
The patch is in the IPFire Development mailing list.
https://lists.ipfire.org/development/20251117173047.184929-1-adolf.belka@ipfire.org/T/#t
There are two patches. The first one is so that users who have an existing IPFire system and are upgrading will get the changes in general-functions.pl that were created for CU198 but were missed of to be shipped in CU198.
That patch has been merged into next which will become CU199.
The second patch is required by users with either an upgraded system or a fresh install.
This patch still needs to be reviewed and accepted before being merged. The change I made works but it might not be implemented in a way that is the appropriate code approach. So that patch is not yet merged. It should be able to make it in to CU199 but that is not guaranteed until it has been merged.
Like I read in another forum post, you can edit the file /var/ipfire/fwhosts/customlocationgrp directly if it’s very urgent to have a location group. The format is (example):
11,Allowed Countries SSH,DE,Location Group
7,Allowed Countries SSH,BR,Location Group
9,Allowed Countries HTTP,DE,Location Group
3,Allowed Countries HTTPS,DE,Location Group
8,Allowed Countries SSH,PY,Location Group
5,Allowed Countries HTTPS,PY,Location Group
4,Allowed Countries HTTPS,BR,Location Group
After that, you can edit the location groups, but you will not be able to create a new one via the GUI because of the bug above.
The patches which Adolf sent to fix this issue have now been pushed out to the testing channel. I’ve tested this myself and the issue does appear to be resolved.
If you’re willing to test this pre-release you can follow the instructions here
Thanks,
A G