Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 50e207e3762cb571d9ee7d4fe7e2cdcc > files > 16

solidmysql-5.0.51-1mdv2009.0.src.rpm

From: Chad MILLERDate: March 27 2007 6:21pm
Subject: bk commit into 5.0 tree (cmiller:1.2418) BUG#27427

Below is the list of changes that have just been committed into a local
5.0 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-03-27 12:21:19-04:00, cmiller@stripped +1 -0
  Bug#27427: resolveip fails on hostnames with a leading digit
  
  Patch by Kasper Dupont.  No CLA required for this size of patch.
  
  "resolveip" program produces incorrect result if given a hostname
  starting with a digit.  Someone seems to have thought that names 
  can not have digits at the beginning.
  
  Instead, use the resolver library to work out the rules of hostnames, 
  as it will undoubtedly be better at it than we are.

  extra/resolveip.c@stripped, 2007-03-27 12:21:17-04:00, cmiller@stripped +4 -2
    Hostnames may begin with a number.  We should use the resolver
    library to make such decisions.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	cmiller
# Host:	zippy.cornsilk.net
# Root:	/home/cmiller/work/mysql/mysql-5.0-comeng

--- 1.25/extra/resolveip.c	2006-12-23 14:04:04 -05:00
+++ 1.26/extra/resolveip.c	2007-03-27 12:21:17 -04:00
@@ -106,6 +106,7 @@
 {
   struct hostent *hpaddr;
   in_addr_t taddr;
+  struct in_addr addr;
   char *ip,**q;
   int error=0;
 
@@ -118,9 +119,10 @@
   {
     ip = *argv++;    
 
-    if (my_isdigit(&my_charset_latin1,ip[0]))
+    /* Not compatible with IPv6!  Probably should use getnameinfo(). */
+    if (inet_aton(ip, &addr) != 0)
     {
-      taddr = inet_addr(ip);
+      taddr= addr.s_addr;
       if (taddr == htonl(INADDR_BROADCAST))
       {	
 	puts("Broadcast");