Bug 1731468
| Summary: | check_ntp has too strict regexp for hostnames | ||
|---|---|---|---|
| Product: | [Fedora] Fedora EPEL | Reporter: | Kjetil T. Homme <kjetilho> |
| Component: | nagios-plugins | Assignee: | Stephen John Smoogen <smooge> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | epel7 | CC: | athmanem, b.heden, herrold, lemenkov, smooge, smooge, swilkerson |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | nagios-plugins-2.2.1-17.20190829gitfb792ff.fc29 nagios-plugins-2.2.1-17.20190829gitfb792ff.el7 nagios-plugins-2.2.1-17.20190829gitfb792ff.el6 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-09-11 21:18:41 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Kjetil T. Homme
2019-07-19 13:24:54 UTC
another example of a hostname which is disallowed is "0.pool.ntp.org".
here is a suggested regexp which handles the domain names and IPv6 as a bonus (does not accept IPv4-in-IPv6 literals, only pure v6 literals)
my $host = $opt_H if ($opt_H &&
($opt_H =~ m/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/ || # IPv4
$opt_H =~ m/^([0-9a-f]{1,4}:){7}([0-9a-f]{1,4})$/i || # IPv6 without ::
$opt_H =~ m/^:(:[0-9a-f]{1,4})+$/i || # IPv6 with leading ::
$opt_H =~ m/^([0-9a-f]{1,4}:)+:$/i || # IPv6 with trailing ::
$opt_H =~ m/^([0-9a-f]{1,4}:)+(:[0-9a-f]{1,4})+$/i || # IPv6 with middle ::
$opt_H =~ m/^[a-z0-9][-a-z0-9]*(\.[a-z0-9][-a-z0-9]*)*$/)); # hostnames
Thanks for both the bug and the patch. I would ask that you open this upstream, but that was rather 'dead' when I looked earlier this year. However I do recommend it in case it starts up so others can get this fix. FEDORA-EPEL-2019-9b63c08c0f has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-9b63c08c0f FEDORA-EPEL-2019-22c97df420 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-22c97df420 nagios-plugins-2.2.1-17.20190829gitfb792ff.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-22c97df420 nagios-plugins-2.2.1-17.20190829gitfb792ff.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-9b63c08c0f FEDORA-2019-fef2650216 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-fef2650216 nagios-plugins-2.2.1-17.20190829gitfb792ff.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-fef2650216 nagios-plugins-2.2.1-17.20190829gitfb792ff.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report. nagios-plugins-2.2.1-17.20190829gitfb792ff.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report. nagios-plugins-2.2.1-17.20190829gitfb792ff.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report. |