Bug 12865 - Static IP address pools - Add network - Name with space
Summary: Static IP address pools - Add network - Name with space
Status: CLOSED FIXED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: unspecified Unspecified
: - Unknown - Minor Usability
Assignee: Adolf Belka
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 13136
  Show dependency treegraph
 
Reported: 2022-05-18 08:53 UTC by Giuseppe C.
Modified: 2023-05-30 11:01 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.