INN commit: branches/2.5/frontends (pullnews.in)

INN Commit rra at isc.org
Wed Mar 18 20:47:11 UTC 2015


    Date: Wednesday, March 18, 2015 @ 13:47:11
  Author: iulius
Revision: 9797

pullnews:  when giving a port along with a server name, check there is only one
":" 

Otherwise, it is very likely that the given server name is an IPv6 address,
and therefore its end should not be interpreted as a port.

Modified:
  branches/2.5/frontends/pullnews.in

-------------+
 pullnews.in |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Modified: pullnews.in
===================================================================
--- pullnews.in	2015-03-18 20:46:20 UTC (rev 9796)
+++ pullnews.in	2015-03-18 20:47:11 UTC (rev 9797)
@@ -263,7 +263,12 @@
 my $pathSteps           = $opt_P if defined $opt_P;
 my $path_limit;
 
-$localPort = $1 if not defined $opt_p and $localServer =~ s/:(\d+)$//;
+# Find a possible port at the end of the news server name.
+# Count the number of ":" to check that it is not an IPv6 address.
+if (not defined $opt_p) {
+    my @colons = split(/:/, $localServer);
+    $localPort = $1 if ((scalar(@colons) == 2) and ($localServer =~ s/:(\d+)$//));
+}
 
 die "can\'t have both ``-s'' and ``-r''\n"  if $opt_s && $opt_r;
 



More information about the inn-committers mailing list