mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-10 00:13:04 +01:00
Cause PORT commands to use the high IP port range. This makes fetch
(and its friends) more firewall friendly. PR: 10580 Submitted by: nsayer
This commit is contained in:
parent
e048f09fdf
commit
96d29cd5c2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45163
@ -14,7 +14,7 @@
|
||||
* Turned inside out. Now returns xfers as new file ids, not as a special
|
||||
* `state' of FTP_t
|
||||
*
|
||||
* $Id: ftpio.c,v 1.29 1997/12/20 04:06:05 jb Exp $
|
||||
* $Id: ftpio.c,v 1.30 1998/04/11 07:28:53 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -809,7 +809,16 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t
|
||||
*fp = fdopen(s, mode);
|
||||
}
|
||||
else {
|
||||
int fd;
|
||||
int fd,portrange;
|
||||
|
||||
#ifdef IP_PORTRANGE
|
||||
portrange = IP_PORTRANGE_HIGH;
|
||||
if (setsockopt(s, IPPROTO_IP, IP_PORTRANGE, (char *)
|
||||
&portrange, sizeof(portrange)) < 0) {
|
||||
close(s);
|
||||
return FAILURE;
|
||||
};
|
||||
#endif
|
||||
|
||||
i = sizeof sin;
|
||||
getsockname(ftp->fd_ctrl, (struct sockaddr *)&sin, &i);
|
||||
|
Loading…
Reference in New Issue
Block a user