head	1.3;
access;
symbols
	RELEASE_7_1_0:1.2
	RELEASE_6_4_0:1.2
	RELEASE_5_EOL:1.2
	RELEASE_7_0_0:1.2
	RELEASE_6_3_0:1.2
	PRE_XORG_7:1.2
	RELEASE_4_EOL:1.2
	RELEASE_6_2_0:1.2
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.2
	RELEASE_4_11_0:1.2
	RELEASE_5_3_0:1.2
	RELEASE_4_10_0:1.2
	RELEASE_5_2_1:1.2
	RELEASE_5_2_0:1.2
	RELEASE_4_9_0:1.2
	RELEASE_5_1_0:1.2
	RELEASE_4_8_0:1.2
	RELEASE_5_0_0:1.2
	RELEASE_4_7_0:1.2
	RELEASE_4_6_2:1.2
	RELEASE_4_6_1:1.2
	RELEASE_4_6_0:1.2
	RELEASE_5_0_DP1:1.2
	RELEASE_4_5_0:1.2
	RELEASE_4_4_0:1.2
	RELEASE_4_3_0:1.2
	RELEASE_4_2_0:1.2
	RELEASE_4_1_1:1.2
	RELEASE_4_1_0:1.2
	RELEASE_3_5_0:1.2
	RELEASE_4_0_0:1.2
	RELEASE_3_4_0:1.2
	RELEASE_3_3_0:1.2
	RELEASE_3_2_0:1.2
	RELEASE_3_1_0:1.2
	RELEASE_2_2_8:1.2
	RELEASE_3_0_0:1.2
	RELEASE_2_2_7:1.2
	RELEASE_2_2_6:1.1;
locks; strict;
comment	@# @;


1.3
date	2009.02.22.20.46.47;	author beech;	state dead;
branches;
next	1.2;

1.2
date	98.06.08.12.41.14;	author torstenb;	state Exp;
branches;
next	1.1;

1.1
date	97.11.25.08.23.54;	author torstenb;	state Exp;
branches;
next	;


desc
@@


1.3
log
@- The ftp/mirror port's lchat.pl file uses the old pack('S n a4 x8', ...)
  method for constructing a sockaddr_in to pass to connect().
  This approach breaks on more recent FreeBSDs which are more strict about
  the first two bytes of sockaddr_in.

- Patch modifies lchat.pl to use perl's &Socket'pack_sockaddr_in and
  &Socket'unpack_sockaddr_in functions to do the right thing.

PR:		ports/131911
Submitted by:	G. Paul Ziemba <p-fbsd-bugs@@ziemba.us>
@
text
@*** lchat.pl.orig	Fri May 29 21:05:46 1998
--- lchat.pl	Mon Jun  8 14:34:37 1998
***************
*** 161,167 ****
  # 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);
  
--- 161,167 ----
  # 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);
  
***************
*** 180,197 ****
  	}
  	$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;
  }
  ##############################################################################
--- 180,197 ----
  	}
  	$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;
  }
  ##############################################################################
@


1.2
log
@- Upgrade to 2.9
- Use perl5
@
text
@@


1.1
log
@fix passive mode ftp

PR:		3955
Submitted by:	Ernest Hua <hua@@chromatic.com>
@
text
@d1 2
a2 2
*** lchat.pl.orig	Wed Jun  7 22:19:22 1995
--- lchat.pl	Tue Nov 25 09:20:20 1997
d4 1
a4 1
*** 123,129 ****
d12 1
a12 1
--- 123,129 ----
d21 1
a21 1
*** 142,159 ****
d40 1
a40 1
--- 142,159 ----
@
