Search
j0ke.net Open Build Service
>
Projects
>
home:netmax
>
nagios-plugins
> nagios-plugins-0012-fix-perl-ntp-ipv6.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File nagios-plugins-0012-fix-perl-ntp-ipv6.patch of Package nagios-plugins
diff -up ./plugins-scripts/check_ntp.pl.fix_ipv6 ./plugins-scripts/check_ntp.pl --- ./plugins-scripts/check_ntp.pl.fix_ipv6 2019-08-29 21:07:13.497504795 +0000 +++ ./plugins-scripts/check_ntp.pl 2019-08-29 21:11:48.626816686 +0000 @@ -112,13 +112,23 @@ if (defined $opt_j || defined $opt_k ) { } $opt_H = shift unless ($opt_H); -my $host = $1 if ($opt_H && $opt_H =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z][-a-zA-Z0-9]+(\.[a-zA-Z][-a-zA-Z0-9]+)*)$/); + +## From https://bugzilla.redhat.com/show_bug.cgi?id=1731468 +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 + unless ($host) { print "No target host specified\n"; print_usage(); exit $ERRORS{'UNKNOWN'}; } + my ($timeout, $owarn, $ocrit, $jwarn, $jcrit); $timeout = $TIMEOUT;