From: Vlad S. <vl...@cr...> - 2008-05-10 15:36:21
|
patched, submitted. Thanks Daniel Stasinski wrote: > Here is an interesting one that has been broken since AOLserver 4.0. > > In hosts.allow, you can use either a full or partial hostname, or > ipaddr/netmask. Not all work. > > 192.168.0.10/255.255.255.255 <- Gives error "Invalid address or > hostname "192.168.0.10". should be ipaddr/netmask or hostname" > 192.168.0.10/255.255.255.0 <- This fixes the above -BUT- it allows in > the whole class C, which may not really be what is wanted. > bob.someserver.com <- this works (though haven't looked deep enough > to see if it does sanity check on forward + reverse lookup to > guarantee it is really the right host) > > The error is caused by inet_addr() returning INADDR_NONE on > 255.255.255.255 . Using inet_aton() resolves this issue. A patch to > nsperm.c at around line #739 follows: > > *slash = '\0'; > if (inet_aton(net, &ip) == 0 || inet_aton(slash+1, &mask) == 0) { > Tcl_AppendResult(interp, "invalid address or hostname \"", > net, "\". " "should be ipaddr/netmask > or hostname", NULL); > goto fail; > } > > Daniel > -- Vlad Seryakov vl...@cr... http://www.crystalballinc.com/vlad/ |