> > From: me
> > Hostnames are lowercased in GetNameInfo() for sure.
> From: Mark
> Everything is usually coverted to lower case for comparison since DNS
> does not distinguish case in hostnames. This should also be the
> behaviour in HostRange. Patches welcomed :-)
2.2.0 case-insensitive HostRange() patch follows my sig.
(If you look closely you'll see we're all TOTALLY wrong. Mark
LOVES upper case: relative hostnames (the uppercase variable
VUQNAME) are uppercased in GetNameInfo(). Cool.)
steve
- - -
--- src/item.c.orig 2007-04-29 08:04:30.000000000 -0500
+++ src/item.c 2007-05-04 07:13:35.000000000 -0500
@@ -1053,7 +1053,7 @@
sp++;
sscanf(sp,"%ld",&cmp);
*sp = '\0';
-Debug("SRDEBUG FuzzyHostMatch: refbase=%s,cmp=%d\n",refbase,cmp);
+Debug("SRDEBUG FuzzyHostMatch: split refhost=%s into refbase=%s and
cmp=%d\n",refhost,refbase,cmp);
if (cmp < 0)
{
@@ -1073,9 +1073,9 @@
return 1;
}
-if (strcmp(refbase,arg0) != 0)
+if (strcmp(refbase,ToUpperStr(arg0)) != 0)
{
- Debug("SRDEBUG Failed on name (%s != %s)\n",refbase,arg0);
+ Debug("SRDEBUG Failed on name (%s != %s)\n",refbase,ToUpperStr(arg0));
return 1;
}
--- doc/cfengine-Reference.texinfo.orig 2007-04-29 14:11:48.000000000 -0500
+++ doc/cfengine-Reference.texinfo 2007-05-04 07:15:08.000000000 -0500
@@ -1720,7 +1720,7 @@
@item IPRange(@var{address-range})
True if the current host lies within the specified IP range
@item HostRange(@var{basename,start-stop})
-True if the current relative domain name begins with basename and ends with an
integer
+True if the current relative domain name begins with basename and ends with an
integer. Note well: matching is case insensitive (both hostname and basename
are converted to all upper case.)
between start and stop
@item IsDefined(@var{variable-id})
True if the named variable is defined. Note well: use the variable name, not
its contents (that is,
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine