On Mon, 27 Nov 2006, Sebastien Delafond wrote:
severity 400599 wishlist
tag 400599 + patch pending
thanks
This should hit the Debian archive pretty soon now; I'm also copying
Clinton Wong, original author of Net::Socks maintainership, so he can
incorporate this patch if he desires.
Thanks for the quick response!
You probably should add the package-dependency on "libnet-dns-perl", since
my patch uses this module.
Cheers,
Chris
On Mon, Nov 27, 2006 at 03:34:46PM +0100, Christian Schwarz wrote:
Package: libnet-socks-perl
Version: 0.03-4
In SOCKS.pm, the author wrote "#fixme - check to make sure peer_addr is
dotted decimal or do name resolution on it first". I've fixed this with a
small (hacky) patch (see attachment).
(The patch is needed, when using Net::SOCKS together with SpamAssassin.)
It would be nice if you could include this patch in the next Debian
release and forward it to the upstream maintainer.
Feel free to contact me, if you need more info.
Cheers,
Chris
--- SOCKS.pm.ref 2006-11-27 15:15:04.000000000 +0100
+++ SOCKS.pm 2006-11-27 15:15:59.000000000 +0100
@@ -345,8 +345,22 @@
if ($rc==SOCKS_OKAY) {
-#fixme - check to make sure peer_addr is dotted decimal or do name
-# resolution on it first
+ # resolve name
+ unless (${*self}{peer_addr} =~ /^\d+\.\d+\.\d+\.\d+$/o) {
+ #die "peer_addr not an IP adress: ${*self}{peer_addr}\n";
+ #print STDERR "debug: peer_addr not an IP adress: ${*self}{peer_addr} --
resolving...\n";
+ my $res = Net::DNS::Resolver->new;
+ my $query = $res->search(${*self}{peer_addr});
+ my $ip;
+ if ($query) {
+ foreach my $rr ($query->answer) {
+ next unless $rr->type eq "A";
+ $ip = $rr->address;
+ }
+ }
+ $ip or die "cannot resolve name ${*self}{peer_addr}";
+ ${*self}{peer_addr} = $ip;
+ }
# send the request
print { ${*self}{fh} } pack ('CCn', 4, $req_num, ${*self}{peer_port}) .
-- _,, Christian Schwarz
/ o \__ [EMAIL PROTECTED]
! ___; [EMAIL PROTECTED], [EMAIL PROTECTED]
\ /
\\\______/ ! PGP-fp: 8F 61 EB 6D CF 23 CA D7 34 05 14 5C C8 DC 22 BA
\ / http://schwarz-online.com
-.-.,---,-,-..---,-,-.,----.-.-
"DIE ENTE BLEIBT DRAUSSEN!"
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]