diff options
author | torstenb <torstenb@FreeBSD.org> | 1997-11-25 16:23:54 +0800 |
---|---|---|
committer | torstenb <torstenb@FreeBSD.org> | 1997-11-25 16:23:54 +0800 |
commit | 4083cf9997eb571e633fddf0f35e6d7d8b6904a8 (patch) | |
tree | e3cd739850f179ec94be2accf25ed15b46c43c38 | |
parent | 2b3d0d0d7808d2c285259971d70684e6036a5f0e (diff) | |
download | freebsd-ports-graphics-4083cf9997eb571e633fddf0f35e6d7d8b6904a8.tar.gz freebsd-ports-graphics-4083cf9997eb571e633fddf0f35e6d7d8b6904a8.tar.zst freebsd-ports-graphics-4083cf9997eb571e633fddf0f35e6d7d8b6904a8.zip |
fix passive mode ftp
PR: 3955
Submitted by: Ernest Hua <hua@chromatic.com>
-rw-r--r-- | ftp/mirror/files/patch-ae | 19 | ||||
-rw-r--r-- | ftp/mirror/files/patch-af | 58 |
2 files changed, 77 insertions, 0 deletions
diff --git a/ftp/mirror/files/patch-ae b/ftp/mirror/files/patch-ae new file mode 100644 index 00000000000..fbcf0ad2423 --- /dev/null +++ b/ftp/mirror/files/patch-ae @@ -0,0 +1,19 @@ +*** ftp.pl.orig Tue May 23 23:53:25 1995 +--- ftp.pl Tue Nov 25 09:20:17 1997 +*************** +*** 430,436 **** + return 0; + } + if( $ret == 1 ) { +! $response =~ m/^227 Entering Passive Mode \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)$/; + $newhost = sprintf( "%d.%d.%d.%d", $1, $2, $3, $4 ); + $newport = $5 * 256 + $6; + } +--- 430,436 ---- + return 0; + } + if( $ret == 1 ) { +! $response =~ m/^227 .* \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)$/; + $newhost = sprintf( "%d.%d.%d.%d", $1, $2, $3, $4 ); + $newport = $5 * 256 + $6; + } diff --git a/ftp/mirror/files/patch-af b/ftp/mirror/files/patch-af new file mode 100644 index 00000000000..ab7f5db0b87 --- /dev/null +++ b/ftp/mirror/files/patch-af @@ -0,0 +1,58 @@ +*** lchat.pl.orig Wed Jun 7 22:19:22 1995 +--- lchat.pl Tue Nov 25 09:20:20 1997 +*************** +*** 123,129 **** + # Similar to open_port, but does less. Used for PASV code with ftp.pl + # -Erez Zadok. + sub open_newport { ## public +! local($server, $port, $newsock) = @_; + + local($serveraddr,$serverproc); + +--- 123,129 ---- + # Similar to open_port, but does less. Used for PASV code with ftp.pl + # -Erez Zadok. + sub open_newport { ## public +! local($server, $port, *newsock) = @_; + + local($serveraddr,$serverproc); + +*************** +*** 142,159 **** + } + $serverproc = pack($sockaddr, 2, $port, $serveraddr); + +! unless (connect($newsock, $serverproc)) { +! ($!) = ($!, close($newsock)); # close newsock while saving $! + return undef; + } + # We opened with the local address set to ANY, at this stage we know + # which interface we are using. This is critical if our machine is + # multi-homed, with IP forwarding off, so fix-up. + local($fam,$lport); +! ($fam,$lport,$thisaddr) = unpack($sockaddr, getsockname($newsock)); + $thisproc = pack($sockaddr, 2, 0, $thisaddr); + # end of post-connect fixup +! select((select($newsock), $| = 1)[0]); + return 1; + } + ############################################################################## +--- 142,159 ---- + } + $serverproc = pack($sockaddr, 2, $port, $serveraddr); + +! unless (connect(newsock, $serverproc)) { +! ($!) = ($!, close(newsock)); # close newsock while saving $! + return undef; + } + # We opened with the local address set to ANY, at this stage we know + # which interface we are using. This is critical if our machine is + # multi-homed, with IP forwarding off, so fix-up. + local($fam,$lport); +! ($fam,$lport,$thisaddr) = unpack($sockaddr, getsockname(newsock)); + $thisproc = pack($sockaddr, 2, 0, $thisaddr); + # end of post-connect fixup +! select((select(newsock), $| = 1)[0]); + return 1; + } + ############################################################################## |