ClearOS Bug Tracker


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0022161ClearOSapp-certificate-manager - Certificate Managerpublic2018-11-01 09:182020-05-04 05:29
ReporterNickH 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version7.5.0 
Target Version7.6.0 UpdatesFixed in Version7.6.0 
Summary0022161: When importing, the filter for allowable Names is incorrect
DescriptionWhen you import a certificate, you have to give it a name but the restrictions on the allowable names has been incorrectly implemented. The filter in line 747 of /usr/clearos/apps/certificate_manager/libraries/External_Certificates.php is currently:

return strlen($name) > 3 && preg_match("%^[a-zA-Z0-9\\-_]+(\\.[a-zA-Z0-9\\-_])*$%", $name);

This will allow "test", "test.1", "test.1.2.3" but not "test.123". If you have a period in the name you must have only one character after it before having another period. It looks like the test string is incorrect and needs a "+" after the last "]" to read:

return strlen($name) > 3 && preg_match("%^[a-zA-Z0-9\\-_]+(\\.[a-zA-Z0-9\\-_]+)*$%", $name);

Then it will insist on at least one character after the period, but allow as many as you want. This will allow you to input an FQDN as a name but will not allow a name ending in a period.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008571)
user2
2018-11-09 09:51

More restrictions were lifted: alphanumeric, dash, underscore and periods are fine:

preg_match("/^[a-zA-Z0-9\-_\.]+$/", $name)
(0014291)
NickH (developer)
2020-05-04 05:29

Migrated to https://gitlab.com/clearos/clearfoundation/app-certificate-manager/-/issues/35 [^]

- Issue History
Date Modified Username Field Change
2018-11-01 09:18 NickH New Issue
2018-11-02 08:21 user2 Status new => confirmed
2018-11-02 08:21 user2 Product Version 7.5.0 Updates => 7.5.0
2018-11-02 08:21 user2 Target Version => 7.6.0 Updates
2018-11-09 09:51 user2 Note Added: 0008571
2018-11-09 09:51 user2 Status confirmed => resolved
2018-11-09 09:51 user2 Fixed in Version => 7.6.0
2018-11-09 09:51 user2 Resolution open => fixed
2018-11-09 09:51 user2 Assigned To => user2
2020-05-04 05:29 NickH Note Added: 0014291
2020-05-04 05:29 NickH Status resolved => closed
2020-05-04 05:29 NickH Assigned To user2 =>