Bug 12865

Summary: Static IP address pools - Add network - Name with space
Product: IPFire Reporter: Giuseppe C. <giuseppe>
Component: ---Assignee: Adolf Belka <adolf.belka>
Status: CLOSED FIXED QA Contact:
Severity: Minor Usability    
Priority: - Unknown - CC: adolf.belka, peter.mueller
Version: 2   
Hardware: unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 13136    

Description Giuseppe C. 2022-05-18 08:53:11 UTC
In openvpn when adding a new static ip address pools with a space in the name came out this error message: 'Invalid name. Allowed characters are A-Z, a-z, dash and space. '

In file ovpnmain.cgi at line 464 the check is if(!&General::validhostname($ccdname))
In file general-functions.pl at line 713  if ($hostname !~ /^[a-zA-Z0-9-]*$/) {
this check is correct, but before this commit (https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;f=config/cfgroot/general-functions.pl;h=5b4e33bc3b754dd14ecc279bc421ec232a489507) was if ($hostname !~ /^[a-zA-Z0-9-\s]*$/) { and so the space pass the check

Giuseppe
Comment 1 Adolf Belka 2022-05-18 10:46:43 UTC
Thanks for finding this @Giuseppe.

The static pool name needs to have a different or new check created for it to replace the hostname check, as hostnames should not have spaces in them.

I will pick this bug up.
Comment 2 Adolf Belka 2022-06-24 22:00:29 UTC
Patch created and tested out on a vm system

Patch submitted to dev mailing list and patchwork

https://patchwork.ipfire.org/project/ipfire/list/?series=2923
Comment 4 Adolf Belka 2022-06-30 11:11:51 UTC
Created a new road warrior pool with a name with spaces in it using the CU169 Testing version upgraded from CU168 on my vm testbed system.

New road warrior pool successfully created with spaces in the name.

Verifies that patch has worked in the CU169 Testing version.