On 2006-03-14 14:17:14 -0800, Elliot Foster wrote: > John Peacock wrote: > >Peter J. Holzer wrote: > >>2) Net::DNS assigns a random id when the package is loaded and just > >> increments the id for each request. This also makes ID guessing easy. > >> What's worse, with forkserver the package is loaded in the parent > >> process, so every child goes through the same sequence of IDs! > > > >This is more of a problem, since we are actively urging people to use > >forkserver. Can we use eval "use Net::DNS" after we fork to prevent > >this from happening? Can we poke a new ID value manually for each > >fork instance? > > There is code in trunk to deal with this specific issue, around line 124 > of ~/qpsmtpd, where the _fork subroutine is defined.
You are right. But I don't understand it:
# cope with different versions of Net::DNS
eval {
$Net::DNS::Resolver::global{id} = 1;
$Net::DNS::Resolver::global{id} =
int(rand(Net::DNS::Resolver::MAX_ID()));
# print "Next DNS ID: $Net::DNS::Resolver::global{id}\n";
};
if ($@) {
# print "Next DNS ID: " . Net::DNS::Header::nextid() . "\n";
}
which version of Net::DNS has a variable %Net::DNS::Resolver::global?
Neither 0.48 nor 0.57 seem to have it. Is this for some old version or a
new one which hasn't been released yet?
the ($@) branch doesn't do anything.
hp
--
_ | Peter J. Holzer | Ich sehe nun ein, dass Computer wenig
|_|_) | Sysadmin WSR | geeignet sind, um sich was zu merken.
| | | [EMAIL PROTECTED] |
__/ | http://www.hjp.at/ | -- Holger Lembke in dan-am
pgpob0523Mqtz.pgp
Description: PGP signature
