[wpkg-users] False match of IP address to host name pattern

Rainer Meier r.meier at wpkg.org
Tue Sep 29 18:29:18 CEST 2009


Hi Stefan,

Pendl Stefan wrote:
>     I had the following wrong match:
> 
> 2009-09-29 16:21:38, DEBUG   : Found network service: {3FA06DD1-FB69-4CE5-B782-A7692479FBDD}
> 2009-09-29 16:21:38, DEBUG   : Reading DHCP address.
> 2009-09-29 16:21:38, DEBUG   : Found DHCP address: 129.0.40.227
> 2009-09-29 16:21:38, DEBUG   : Found profile 'GL[01].\|PRM0.\|INO[01].' matching IP '129.0.40.227'
> 2009-09-29 16:21:38, DEBUG   : Profiles applying to the current host:|DesktopPC|
> This resulted in removing software from several hosts with different IP addresses too.
> 
> I do not use IP matching, so I do not understand, what the cause of the problem is.
> I do have several other host patterns with the pipe for multiple different host names.
> 
> Running WPKG 1.1.2
> 
> Thanks for any insight.

It looks like you hit a very rare case of overmatching. Your host definition
"GL[01].\|PRM0.\|INO[01]." contains exactly 3 period characters ("."). WPKG
first tries a 1:1 match to the hostname (which obviously fails with your
regexp). Then it tries IP matching. Obviously your regexp can be splitted into 4
parts which makes it look like it qualifies for IP matching:

GL[01] . \|PRM0 . \|INO[01] .

So it tries IP-matching. Unfortunately JScript does not throw an error when
trying to parse "GL[01]" as an integer. So finally it thinks that your IP is in
range.

The work-around for WPKG 1.1.2 is easy. Just add another "." and WPKG will not
think any more it could be an IP.

So you might change
"GL[01].\|PRM0.\|INO[01]."
to
"GL[01].\|PRM0.\|INO[01].|dummy."


Meanwhile I've checked in a change which is supposed to detect non-numeric
values and then the IP match fails (as expected in this case).
Get it from here (version 1.1.3-RC1) if you like to test it:
<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?view=log>

br,
Rainer



More information about the wpkg-users mailing list