debian/0000755000000000000000000000000011743521020007161 5ustar debian/changelog0000644000000000000000000000560411743266641011057 0ustar libnet-socks-perl (0.03-13) unstable; urgency=low * Many thanks to Jari Aalto for *all* the changes in this upload: - remove deprecated dpatch and upgrade to packaging format "3.0 quilt" - update to Standards-Version to 3.9.3 and debhelper to 9 - add build-arch and build-indep targets; use dh_prep in rules file -- Sebastien Delafond Tue, 17 Apr 2012 15:18:25 +0200 libnet-socks-perl (0.03-12) unstable; urgency=low * Lintian cleanups. * Added debian/watch file. -- Sebastien Delafond Wed, 21 Oct 2009 14:31:16 +0200 libnet-socks-perl (0.03-11) unstable; urgency=low * Unconditionally remove usr/lib during the install phase (Closes: #479919). -- Sebastien Delafond Wed, 07 May 2008 07:33:29 -0700 libnet-socks-perl (0.03-10) unstable; urgency=low * Lintian cleanups. -- Sebastien Delafond Tue, 06 May 2008 22:22:01 -0700 libnet-socks-perl (0.03-9) unstable; urgency=low * Don't return 1 if Makefile does not exist (Closes: #470346). -- Sebastien Delafond Mon, 10 Mar 2008 12:17:10 -0700 libnet-socks-perl (0.03-8) unstable; urgency=low * Don't try to blindly remove /usr/lib/perl5 (Closes: #467992). * Lintian cleanups. -- Sebastien Delafond Tue, 26 Feb 2008 21:45:19 -0800 libnet-socks-perl (0.03-7) unstable; urgency=low * This should actually be a Build-Dep (Closes: #403087). -- Sebastien Delafond Thu, 14 Dec 2006 11:04:26 -0800 libnet-socks-perl (0.03-6) unstable; urgency=low * Added missing dependency on libnet-dns-perl ("use Net::DNS;"). -- Sebastien Delafond Tue, 28 Nov 2006 00:15:30 -0800 libnet-socks-perl (0.03-5) unstable; urgency=low * Added patch by Christian Schwarz to resolve hostnames (Closes: #400599). -- Sebastien Delafond Mon, 27 Nov 2006 12:33:19 -0800 libnet-socks-perl (0.03-4) unstable; urgency=low * Upgraded standards version to 3.7.2. * Moved debhelper and dpatch from Build-Depends-Indep to Build-Depends. -- Sebastien Delafond Thu, 15 Jun 2006 16:25:48 -0700 libnet-socks-perl (0.03-3) unstable; urgency=low * Upgraded standards version to 3.6.2.2. * Changed maintainer to . -- Sebastien Delafond Mon, 06 Feb 2006 17:09:56 -0800 libnet-socks-perl (0.03-2) unstable; urgency=low * Removed some part of the example. * Patched SOCKS.pm to avoid unecessary and bug-creating IP conversion * Fixed the "build-depends-without-arch-dep" lintian warning. -- Sebastien Delafond Sun, 24 Oct 2004 16:10:03 -0700 libnet-socks-perl (0.03-1) unstable; urgency=low * Initial Release (Closes: #272272). * Patched upstream example so it takes command-line args. -- Sebastien Delafond Sat, 18 Sep 2004 15:35:28 -0700 debian/watch0000644000000000000000000000012111267576655010235 0ustar version=3 http://search.cpan.org/~clintdw/SOCKS-0.03 \ .*SOCKS-(.*)\.tar.gz.* debian/docs0000644000000000000000000000001410747542150010041 0ustar README TODO debian/examples0000644000000000000000000000001010747542150010723 0ustar example debian/rules0000755000000000000000000000356311743266534010270 0ustar #!/usr/bin/make -f # This debian/rules file is provided as a template for normal perl # packages. It was created by Marc Brockschmidt for # the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may # be used freely wherever it is useful. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # If set to a true value then MakeMaker's prompt function will # always return the default without waiting for user input. export PERL_MM_USE_DEFAULT=1 PACKAGE=$(shell dh_listpackages) ifndef PERL PERL = /usr/bin/perl endif TMP =$(CURDIR)/debian/$(PACKAGE) build-arch: build build-indep: build build: build-stamp build-stamp: dh_testdir # Add commands to compile the package here $(PERL) Makefile.PL INSTALLDIRS=vendor $(MAKE) touch build-stamp clean: dh_testdir dh_testroot # Add commands to clean up after the build process here rm -f build-stamp install-stamp if [ -f Makefile ] ; then $(MAKE) distclean ; fi dh_clean install: install-stamp install-stamp: build-stamp dh_testdir dh_testroot dh_prep $(MAKE) test $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr # As this is a architecture independent package, we are not supposed to install # stuff to /usr/lib. MakeMaker creates the dirs, we delete them from the deb: rm -fr $(TMP)/usr/lib rm -fr $(CURDIR)/blib touch install-stamp binary-arch: # We have nothing to do by default. binary-indep: build install dh_testdir dh_testroot # dh_installcron # dh_installmenu dh_installexamples dh_installdocs dh_installchangelogs Changes dh_perl dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debian/control0000644000000000000000000000115011743266534010601 0ustar Source: libnet-socks-perl Section: perl Priority: optional Build-Depends-Indep: perl, libnet-dns-perl Build-Depends: debhelper (>= 9) Maintainer: Sebastien Delafond Standards-Version: 3.9.3 Homepage: http://search.cpan.org/~clintdw/ Package: libnet-socks-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, libnet-dns-perl Enhances: elza (>= 1.4.3-6) Description: Perl module providing an API to communicate with SOCKS servers This is a SOCKS client module that can communicate with SOCKS v4 and v5 servers. It currently allows you to make outgoing and incoming TCP connections. debian/patches/0000755000000000000000000000000011743521020010610 5ustar debian/patches/series0000644000000000000000000000006011743266554012043 0ustar 10_example.patch 20_SOCKS-pm.patch 30_dns.patch debian/patches/10_example.patch0000755000000000000000000000621011743266534013606 0ustar From: Sebastien Delafond Subject: Change shebang to /usr/bin/perl Ask for command-line parameters Remove the "accept"part of the listening test --- SOCKS-0.03.orig/example 1998-05-19 04:49:07.000000000 -0700 +++ SOCKS-0.03/example 2004-09-20 11:29:27.000000000 -0700 @@ -1,19 +1,32 @@ -#!/usr/local/bin/perl -w +#!/usr/bin/perl -w use strict; use Net::SOCKS; -print "Attempting to connect to 192.168.1.3 at port 79 using the socks\n"; -print "server at 192.168.1.3 port 1080\n"; +sub usage { + print "Usage:\n"; + print "\texample \n"; + print "to connect to : through SOCKS5 at :\n"; +} + +if ($#ARGV != 3) { + &usage(); + exit(1); +} + +my ($socks_addr, $socks_port, $target_addr, $target_port) = @ARGV; + +print "Attempting to connect to $target_addr at port $target_port using the socks\n"; +print "server at $socks_addr port $socks_port\n"; -my $sock = new Net::SOCKS(socks_addr => '192.168.1.3', - socks_port => 1080, +my $sock = new Net::SOCKS(socks_addr => $socks_addr, + socks_port => $socks_port, #user_id => 'the_user', #user_password => 'the_password', #force_nonanonymous => 1, protocol_version => 5); -my $f= $sock->connect(peer_addr => '192.168.1.3', peer_port => 79); +my $f= $sock->connect(peer_addr => $target_addr, peer_port => $target_port); print "connect status: ", Net::SOCKS::status_message($sock->param('status_num')), "\n"; @@ -23,29 +36,38 @@ $sock->close(); } -print "Attempting to listen() using the server at 192.168.1.3 port 1080\n"; +print "Attempting to listen() using the server at $socks_addr port $socks_port\n"; -$sock = new Net::SOCKS(socks_addr => '192.168.1.3', - socks_port => 1080, +$sock = new Net::SOCKS(socks_addr => $socks_addr, + socks_port => $socks_port, #user_id => 'the_user', #user_password => 'the_password', #force_nonanonymous => 1, protocol_version => 5); -my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => "192.168.1.3", - peer_port => 9999); +# We expect a connection from $target_addr:9999 +# This is just for the sake of testing that the SOCKS proxy lets us +# listen: we of course won't initiate a connection from +# $target_addr:9999 (and in the majoirty of cases, we simply *can not*, +# since $target_addr is likely to be remote) +# --Seb +my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => $target_addr, + peer_port => 9999); print "bind status: ", Net::SOCKS::status_message($sock->param('status_num')), "\n"; if ($sock->param('status_num') == SOCKS_OKAY) { print "Listening at the IP of ", $ip_dot_dec, " at port ", $port, "\n"; - $f= $sock->accept(); -} -print "accept status: ", - Net::SOCKS::status_message($sock->param('status_num')), "\n"; -if ($sock->param('status_num') == SOCKS_OKAY) { - while (<$f>) { print } +# Following is commented out, according to comment above. +# $f= $sock->accept(); +#} +#print "accept status: ", +# Net::SOCKS::status_message($sock->param('status_num')), "\n"; +# +#if ($sock->param('status_num') == SOCKS_OKAY) { +# while (<$f>) { print } +#} } $sock->close(); debian/patches/30_dns.patch0000755000000000000000000000254011743266534012743 0ustar From: Christian Schwarz Subject: Resolve name to numeric IP diff -urNad libnet-socks-perl-0.03~/lib/Net/SOCKS.pm libnet-socks-perl-0.03/lib/Net/SOCKS.pm --- libnet-socks-perl-0.03~/lib/Net/SOCKS.pm 2006-11-28 00:48:44.000000000 -0800 +++ libnet-socks-perl-0.03/lib/Net/SOCKS.pm 2006-11-28 00:48:51.000000000 -0800 @@ -8,6 +8,7 @@ use vars qw($VERSION @ISA @EXPORT); use IO::Socket; use Carp; +use Net::DNS; require Exporter; require AutoLoader; @@ -350,9 +351,22 @@ $rc=$self->_connect(); 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}) . debian/patches/20_SOCKS-pm.patch0000644000000000000000000000132511743266534013447 0ustar From: Sebastien Delafond Subject: Added a test to get rid of a warning message --- SOCKS-0.03.orig/lib/Net/SOCKS.pm 2004-10-24 16:14:19.000000000 -0700 +++ SOCKS-0.03/lib/Net/SOCKS.pm 1998-05-19 05:22:47.000000000 -0700 @@ -231,7 +231,13 @@ ${*self}{listen_addr} = ${*self}{socks_addr}; } - my $dotted_dec = inet_ntoa( pack ("N", ${*self}{listen_addr} ) ); + my $dotted_dec; + if (${*self}{listen_addr} =~ m/(\d+\.){3}\d+/) { + $dotted_dec = ${*self}{listen_addr}; + } else { + $dotted_dec = inet_ntoa( pack ("N", ${*self}{listen_addr} ) ); + } + if (${*self}{status_num}==SOCKS_OKAY) { return (${*self}{listen_addr}, $dotted_dec, ${*self}{listen_port}) } debian/source/0000755000000000000000000000000011743266534010501 5ustar debian/source/format0000644000000000000000000000001411743266534011707 0ustar 3.0 (quilt) debian/compat0000644000000000000000000000000211743266534010377 0ustar 9 debian/copyright0000644000000000000000000000157210747542150011133 0ustar This is the debian package for the Net::SOCKS module. It was created by Sebastien Delafond using dh-make-perl. The upstream author is: Clinton Wong . The module is available from: http://search.cpan.org/~clintdw/SOCKS/ The only change for the Debian package was the addition of the debian/ files. Copyright: Copyright (c) 1997-1998 Clinton Wong. All rights reserved. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl. Perl may be redistributed and/or modified it under the terms of either the GNU General Public License or the Artistic License. On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2' and the Artistic Licence in `/usr/share/common-licenses/Artistic'.