Bug 2500542

Summary: check_ntp.pl: hostname regex missing case-insensitive flag after IPv6 refactor
Product: [Fedora] Fedora Reporter: Samuel Dainard <sdainard>
Component: nagios-pluginsAssignee: Guido Aulisi <guido.aulisi>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 45CC: guido.aulisi, igor.raits, lemenkov, ondrejj, ssmoogen
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: nagios-plugins-2.5-2.el9 nagios-plugins-2.5-2.el10_4 nagios-plugins-2.5-2.fc44 nagios-plugins-2.5-2.fc43 nagios-plugins-2.5-2.fc45 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-09-12 00:35:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Samuel Dainard 2026-07-14 19:23:57 UTC
The IPv6 validation patch (from RHBZ#1731468, nagios-plugins-0012-fix-perl-ntp-ipv6.patch) refactored the hostname validation in check_ntp.pl from a single regex using [a-zA-Z0-9] character classes into separate patterns. All IPv6 patterns correctly use the /i flag, but the hostname pattern uses [a-z0-9] without /i, effectively rejecting uppercase hostnames.

Reproducible: Always

Steps to Reproduce:
1. Install nagios-plugins-ntp
2. Run: check_ntp -H MyHost.Example.Com
3. Observe exit with UNKNOWN: "No target host specified"

alt : Verify the regex directly:
  
  perl -e 'my $h = "MyHost.Example.Com"; print(($h =~ m/^[a-z0-9][-a-z0-9]*(\.[a-z0-9][-a-z0-9]*)*$/) ? "MATCH\n" : "NO MATCH\n");'
Actual Results:
Plugin exits with UNKNOWN status because the hostname fails regex validation.

Expected Results:
Hostname validation should be case-insensitive per RFC 952/1123. The plugin should proceed with the NTP
  check.

Additional Information:
The fix is adding /i to the hostname regex in nagios-plugins-0012-fix-perl-ntp-ipv6.patch line 17:
  
  > -  $opt_H =~ m/^[a-z0-9][-a-z0-9]*(\.[a-z0-9][-a-z0-9]*)*$/)); # hostnames
  > +  $opt_H =~ m/^[a-z0-9][-a-z0-9]*(\.[a-z0-9][-a-z0-9]*)*$/i)); # hostnames
  
Original bug introducing the regression: https://bugzilla.redhat.com/show_bug.cgi?id=1731468
   (https://bugzilla.redhat.com/show_bug.cgi?id=1731468)

Comment 1 Aoife Moloney 2026-08-17 15:19:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.

Comment 2 Jan ONDREJ 2026-08-24 11:23:13 UTC
Applied in nagios-plugins-2.5.0-2.

Comment 3 Fedora Update System 2026-09-03 11:44:35 UTC
FEDORA-2026-c2fbd942bc (nagios-plugins-2.5-2.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-c2fbd942bc

Comment 4 Fedora Update System 2026-09-03 11:58:46 UTC
FEDORA-2026-7ac5fb031f (nagios-plugins-2.5-2.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-7ac5fb031f

Comment 5 Fedora Update System 2026-09-03 12:27:30 UTC
FEDORA-EPEL-2026-df80b78e8b (nagios-plugins-2.5-2.el10_4) has been submitted as an update to Fedora EPEL 10.4.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-df80b78e8b

Comment 6 Fedora Update System 2026-09-03 13:15:34 UTC
FEDORA-EPEL-2026-b3ba209e5d (nagios-plugins-2.5-2.el9) has been submitted as an update to Fedora EPEL 9.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-b3ba209e5d

Comment 7 Fedora Update System 2026-09-04 01:34:14 UTC
FEDORA-EPEL-2026-df80b78e8b has been pushed to the Fedora EPEL 10.4 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-df80b78e8b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2026-09-04 01:40:15 UTC
FEDORA-EPEL-2026-b3ba209e5d has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-b3ba209e5d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2026-09-04 01:50:41 UTC
FEDORA-2026-c2fbd942bc has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-c2fbd942bc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-c2fbd942bc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2026-09-04 16:24:53 UTC
FEDORA-2026-7ac5fb031f has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-7ac5fb031f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-7ac5fb031f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2026-09-12 00:35:33 UTC
FEDORA-EPEL-2026-b3ba209e5d (nagios-plugins-2.5-2.el9) has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2026-09-12 00:46:47 UTC
FEDORA-EPEL-2026-df80b78e8b (nagios-plugins-2.5-2.el10_4) has been pushed to the Fedora EPEL 10.4 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2026-09-12 01:05:54 UTC
FEDORA-2026-c2fbd942bc (nagios-plugins-2.5-2.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2026-09-12 01:14:49 UTC
FEDORA-2026-7ac5fb031f (nagios-plugins-2.5-2.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2026-09-26 18:31:52 UTC
FEDORA-2026-c213ad9471 (nagios-plugins-2.5-2.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-c213ad9471

Comment 16 Fedora Update System 2026-09-27 01:47:03 UTC
FEDORA-2026-c213ad9471 has been pushed to the Fedora 45 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-c213ad9471`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-c213ad9471

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2026-10-05 00:16:55 UTC
FEDORA-2026-c213ad9471 (nagios-plugins-2.5-2.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.