Merge from vendor branch TNF:
[pkgsrcv2.git] / net / mirror / patches / patch-ae
1 $NetBSD$
2
3 --- ftp.pl.orig Fri Jun  5 05:10:27 1998
4 +++ ftp.pl      Wed Apr 19 23:14:00 2000
5 @@ -233,7 +233,7 @@
6                         }
7                         else {
8                                 print $showfd "proxy connection failed " if $proxy;
9 -                               print $showfd "Cannot open ftp to $connect_site\n" if $ftp_show;
10 +                               print $showfd "Cannot open ftp to $newhost:$newport\n" if $ftp_show;
11                                 return 0;
12                         }
13                 }
14 @@ -270,6 +270,14 @@
15         $SIG{ 'PIPE' } = "ftp'ftp__sighandler";
16  }
17  
18 +# Setup a signal handler for user interrupts.
19 +sub ftp'set_user_signals
20 +{
21 +       $ftp_logger = @_;
22 +       $SIG{ 'INT' } = "ftp'ftp__sighandler";
23 +}
24
25 +
26  # &ftp'set_namemap( function to map outgoing name,  function to map incoming )
27  sub ftp'set_namemap
28  {
29 @@ -486,7 +494,7 @@
30                 return 0;
31         }
32         if( $ret == 1 ) {
33 -               if( $response =~ m/^227 Entering Passive Mode \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)/ ){
34 +               if($response =~ m/^227 .*\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)/){
35                         $newhost = sprintf( "%d.%d.%d.%d", $1, $2, $3, $4 );
36                         $newport = $5 * 256 + $6;
37                 }
38 @@ -581,6 +589,9 @@
39                 return 0;
40         }
41  
42 +       # shut down our end of the socket
43 +       &close_data_socket;
44 +
45         # read the close
46         #
47         $ret = &expect($timeout,
48 @@ -590,8 +601,6 @@
49                 $ret = 0;
50         }
51  
52 -       # shut down our end of the socket
53 -       &close_data_socket;
54  
55         if( ! $ret ){
56                 return 0;
57 @@ -708,6 +717,7 @@
58         if( ! $service_open ){
59                 return 0;
60         }
61 +       chmod 0600, $loc_fname;
62  
63         if( $loc_fname eq "" ){
64                 $loc_fname = $rem_fname;