diff options
author | des <des@FreeBSD.org> | 2011-09-27 18:42:09 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2011-09-27 18:42:09 +0000 |
commit | 36218c005590db91faf5512b555184080c5f69e9 (patch) | |
tree | 130dd7fb3b7a30bfa9217e2f22165249d18fe88d /lib/libfetch/ftp.c | |
parent | 23b1a7445907e5a1c17a8896effea103a9908fe1 (diff) | |
download | FreeBSD-src-36218c005590db91faf5512b555184080c5f69e9.zip FreeBSD-src-36218c005590db91faf5512b555184080c5f69e9.tar.gz |
Think first, commit second.
1. Allow the caller to select active mode.
2. Fix the envar logic so it *always* overrides the caller's flags.
3. Document the change from active to passive.
Diffstat (limited to 'lib/libfetch/ftp.c')
-rw-r--r-- | lib/libfetch/ftp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 75af7a4..22af1b5 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -633,13 +633,12 @@ ftp_transfer(conn_t *conn, const char *oper, const char *file, /* check flags */ low = CHECK_FLAG('l'); - pasv = CHECK_FLAG('p'); + pasv = CHECK_FLAG('p') || !CHECK_FLAG('P'); verbose = CHECK_FLAG('v'); /* passive mode */ - if (!pasv) - pasv = ((s = getenv("FTP_PASSIVE_MODE")) == NULL || - strncasecmp(s, "no", 2) == 0); + if ((s = getenv("FTP_PASSIVE_MODE")) != NULL) + pasv = (strncasecmp(s, "no", 2) != 0); /* isolate filename */ filename = ftp_filename(file, &filenamelen, &type); |