ldirectord behavior when virtual server hostname contains 'y' or 'z' char

Horms horms at verge.net.au
Fri Aug 12 02:49:26 BST 2005


On Thu, Aug 11, 2005 at 10:37:48AM -0500, MCCLUER, JOHN W (JOHN) wrote:
> 
> The ldirectord program, in subroutine ld_gethostservbyname uses a regexp to
> validate the hostname/ip address.
> 
> The regexp will fail if a lower-case 'y' or 'z' char is present in the hostname.
> 
> I assume this is a bug.  Correct?

Yes, thanks for spotting that, though I think y or z need to be present
in the port name, not the hostname for the bug to manifest. I guess I
typed z instead of x (I notice they are next to each other on the
keyboard). This patch should fix the problem. Funny that no one noticed
before, I guess y and z don't come up in port names very often.

-- 
Horms

Index: ldirectord
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/ldirectord/ldirectord,v
retrieving revision 1.118
diff -u -r1.118 ldirectord
--- ldirectord	5 Aug 2005 06:15:47 -0000	1.118
+++ ldirectord	12 Aug 2005 01:47:56 -0000
@@ -3282,7 +3282,7 @@
 	my $port;
 
 	$hostserv =~ 
-		/(\d+\.\d+\.\d+\.\d+|[A-Za-z0-9.-]+)(:(\d+|[A-Za-x0-9-]+))?/ 
+		/(\d+\.\d+\.\d+\.\d+|[A-Za-z0-9.-]+)(:(\d+|[A-Za-z0-9-]+))?/ 
 		or return(undef);
 	$ip=$1;
 	$port=$3;


More information about the lvs-users mailing list