Respect FETCH_BIND_ADDRESS when opening the data connection.
PR: misc/98872
This commit is contained in:
parent
c23fb8a4d3
commit
9aa2cb8613
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=159566
@ -596,6 +596,7 @@ _ftp_transfer(conn_t *conn, const char *oper, const char *file,
|
||||
struct sockaddr_storage sa;
|
||||
struct sockaddr_in6 *sin6;
|
||||
struct sockaddr_in *sin4;
|
||||
const char *bindaddr;
|
||||
const char *filename;
|
||||
int filenamelen, type;
|
||||
int low, pasv, verbose;
|
||||
@ -740,6 +741,10 @@ _ftp_transfer(conn_t *conn, const char *oper, const char *file,
|
||||
/* connect to data port */
|
||||
if (verbose)
|
||||
_fetch_info("opening data connection");
|
||||
bindaddr = getenv("FETCH_BIND_ADDRESS");
|
||||
if (bindaddr != NULL && *bindaddr != '\0' &&
|
||||
_fetch_bind(sd, sa.ss_family, bindaddr) != 0)
|
||||
goto sysouch;
|
||||
if (connect(sd, (struct sockaddr *)&sa, sa.ss_len) == -1)
|
||||
goto sysouch;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user