Commit Graph

354 Commits

Author SHA1 Message Date
wiz aded0d2cce Whitespace cleanup. 2001-12-01 16:43:07 +00:00
lukem 9058fce64e use u_char instead of char in base64_encode().
problem noticed by Jorgen Lundman in private mail.
2001-11-29 02:12:33 +00:00
yamt 410d1db249 don't make broken file with -R option. 2001-11-25 11:41:09 +00:00
yamt 01d580bd93 handle "*" in Content-Range properly. 2001-11-25 11:24:45 +00:00
tacha a2ffc24485 If no_proxy condition is true && urltype == FTP_URL_T, use fetch_ftp to retrieve. 2001-10-15 05:05:43 +00:00
lukem 37fe23659d put "site" in alphabetical order. noted by Mike Barcroft in private email 2001-06-20 02:12:22 +00:00
cgd a8ec668ddf convert to use getprogname() 2001-02-19 23:03:42 +00:00
lukem 83a00b2109 - display a limited progress bar (containing bytes xferred and xfer rate)
when the file size is unknown
- disable progress bar during remglob()
2001-02-19 20:02:42 +00:00
lukem ac52e9e4de minor knf 2001-02-19 18:15:28 +00:00
jdolecek 8e4be8f5bb call setlocale() on startup 2001-01-09 22:25:55 +00:00
lukem 8ec0002acd invoke cmdtab.c_handler()s with argv[0] == c_name instead of the
supplied name. that way the full (unambiguous) name is displayed in
error messages and usage strings.
2000-12-15 02:22:50 +00:00
itojun 4b0b785e16 fix INET6-less build (like x_ftp). PR11578 2000-11-27 16:08:03 +00:00
lukem 294b3e3a95 be more explicit that $ftp_proxy and $http_proxy are not supported for
interactive sessions
2000-11-27 10:19:12 +00:00
itojun 75e162d7c2 cope with 2553bis getnameinfo (always attach scope id)
getnameinfo error check.
2000-11-24 13:01:24 +00:00
itojun 6d80a2bff1 use NI_MAXHOST with getnameinfo. we can assume presense of getnameinfo. 2000-11-15 04:09:19 +00:00
lukem ecd3d78091 - implement "mreget"; as per "mget" but uses "reget" instead of "get"
- add -N netrc and $NETRC, as methods to select an alternative .netrc file
- cache local user name and home directory for further use
- in mget(), use docase() instead of a local version to do the case
  conversion.
2000-11-15 00:10:59 +00:00
is 135600f947 More format string cleanup by sommerfeld. 2000-10-11 14:46:00 +00:00
lukem 0aa81b3ec3 explicitly use SOCK_STREAM with socket() instead of res->ai_socktype,
because it appears that linux with glibc doesn't set the latter
correctly after one of getaddrinfo() or getnameinfo().
2000-09-28 12:29:23 +00:00
lukem ddc9ba4e19 clarify that $ftp_proxy only works for full URLs and can't be used for
interactive connections.
2000-09-28 12:26:19 +00:00
lukem bac7eba63f since everything else here uses ANSI C, we might as well replace __STRING()
with the ANSI C stringization stuff...
2000-09-14 13:48:33 +00:00
lukem 52b579665e always include <netdb.h>, not just when INET6 is defined.
resolves PR [bin/10970] by Richard Earnshaw <rearnsha@cambridge.arm.com>>
2000-09-08 11:54:53 +00:00
lukem b8fb63ea1c base64_encode should be static. picked up by hp/ux(!) compiler 2000-08-28 12:06:11 +00:00
lukem a6eda9569f It appears that whilst Apache 1.3.9 incorrectly puts a trailing space
after the chunksize (before the \r\n), Apache 1.3.11 puts *multiple*
trailing spaces after the chunksize. I 'm fairly certain that this is
contrary to RFC 2068 section 3.6, but whatever...
Found by David Brownlee <abs@mono.org>
2000-08-27 06:39:25 +00:00
lukem 872f81b081 - in progressmeter() perform the check for foregroundproc() a little earlier
- removed unused variable `items' in list_vertical()
2000-08-27 06:31:23 +00:00
lukem e3cdb47e47 * implement parseport(), which takes a string and attempts to convert
it to a numeric port number
* use parseport() in parse_url() and hookup()
* don't try and lookup the port number using getaddrinfo(), as it's too hard
  to separate a failed host name lookup from a failed service name lookup.
  this was causing lossage on systems that don't have `http' in services(5)
  (such as solaris), but only crept in when we started using getaddrinfo()
  unconditionally.
2000-08-06 08:51:22 +00:00
lukem 29d497f491 - rename NO_QUAD to NO_LONG_LONG, QUAD* -> LL* and add ULL* (unsigned)
equivalents. name change suggested by Klaus Klein <kjk@netbsd.org>
- change defined(BSD4_4) || HAVE_SIN_LEN tests into HAVE_SOCKADDR_SA_LEN,
  and set the latter if BSD4_4 exists
2000-08-01 22:47:25 +00:00
lukem 8c77deb113 - we can't just rename BSD4_4 -> HAVE_SIN_LEN, since bsd systems define BSD4_4;
change tests to test for either defined(BSD4_4) or HAVE_SIN_LEN
- more KNF
2000-07-31 00:56:07 +00:00
lukem 88fb659da9 * always set (struct sockinet).su_len after getsockname() et al, so
that it's valid on systems which don't have sin_len and need the `compat'
  version
* fix the accept() in dataconn() to use the correct struct elem
2000-07-30 09:32:09 +00:00
lukem fad4243147 * always use getaddrinfo() and getnameinfo() instead of maintaining two code
paths. (lukemftp will provide replacements for these on older systems)
* rename __USE_SELECT to USE_SELECT
* rename BSD4_4 to HAVE_SIN_LEN
* replace union sockunion {} with struct sockinet {}, and modify the code
  accordingly. this is possibly more portable, as it doesn't rely upon the
  structure alignment within the union for our own stuff.
  (XXX: haven't tested the ipv6 stuff)
2000-07-30 06:10:43 +00:00
lukem 241987dc61 clean up NO_QUAD support: create helper #defines and use as appropriate:
#define		NOQUAD		! NOQUAD
	-------		------		- ------
	QUADF		"%ld"		"%lld"
	QUADFP(x)	"%" x "ld"	"%" x "lld"
	QUADT		long		long long
	STRTOL(x,y,z)	strtol(x,y,z)	strtoll(x,y,z)
2000-07-30 04:42:37 +00:00
lukem 6ac5c69c3e rename "opts" to "remopts", so people used to "o host" don't get bitten... 2000-07-28 12:01:40 +00:00
lukem ef0145331b rename "opts" to "remopts", so people used to "o host" don't get bitten... 2000-07-28 11:45:11 +00:00
lukem d49ddf30cd no trailing , on last item in enum 2000-07-28 11:03:13 +00:00
lukem b2a6191c15 add rfc 2389, since that's now supported 2000-07-18 07:18:36 +00:00
lukem 7816d2586e add support for FEAT and OPTS commands with `features' and `opts'.
(from RFC 2389).

add support for MLST & MLSD (machine parseble listings) with 'mlst', 'mlsd'
and 'pmlsd' (mlsd |$PAGER) commands.  (from draft-ietf-ftpext-mlst-11)

rename remotesyst() to getremoteinfo(), and modify to parse the result from
FEAT (if supported), and take into account the support for the various
extensions such as MDTM, SIZE, REST (STREAM), MLSD, and FEAT/OPTS.
put each feature into one of the following categories:
	- known to work (explicit FEAT)
	- unknown but assume works until explicit failure, when it's
	  then tagged as `known not to work'.
	- known not to work (FEAT succeeded but didn't return anything,
	  or was unknown and then explicit failure)
assign results into features[] matrix.

add support to getreply() so that an optional callback will be called
for each line received from the server except for the first and last.
this is used in FEAT (and MLST) parsing.

modify various commands to check if REST (STREAM), MDTM and SIZE are
explicitly or implicitly supported before using.

fix `syst' when verbose is off.

minor knf (indent goto labels by one space, etc).

simply various command usage handlers by assuming that argv != NULL except
for quit() and disconnect().
2000-07-18 07:16:52 +00:00
lukem 6f9c683fe4 minor knf. call setbinary()/setascii() with non-NULL 2nd arg 2000-07-18 06:49:21 +00:00
lukem 144c518689 convert to new knf 2000-07-18 06:45:03 +00:00
itojun bbef2fbaac errx?/warnx? audit. do not pass variable alone, use %s. idea from openbsd 2000-07-07 15:10:32 +00:00
lukem 040253276f * migrate the SYST parsing from setpeer() into a separate remotesyst().
call remotesyst() only when login has been successful
  some servers don't let you run SYST until you've successfully logged in.
* in fetch_ftp(), always call setpeer() with autologin disabled, and use
  the following ftp_login() to DTRT.
  this prevents ftp from trying to login a second time if the first autologin
  fails when connecting to a remote site anonymously using autofetch.
* reset unix_proxy and unix_server in cleanuppeer()
* missed a function conversion in the KNF sweep...
2000-06-15 13:08:23 +00:00
lukem f970de1382 from itojun: better fix for previous (doesn't need in_addr_t or u_int32_t) 2000-06-11 15:15:52 +00:00
lukem f48d57e2d2 portability fixes for lukemftp:
* initconn(): use in_addr_t instead of u_int32_t when manipulating IPv6
  addresses (and assume anything with ipv6 has in_addr_t; if not, i'll
  add an autoconf test for it)
* ai_unmapped(): not all systems have sin_len; so only set #ifdef BSD4_4
* fix some lint
2000-06-11 02:12:05 +00:00
lukem 71c4464e3e - fix ai_unmapped() to be a no-op in the !def INET6 case
- display `(-INET6)' at the end of the version string if !def INET6
- clarify in the man page that IPv6 support may not be present (for lukemftp :)
2000-06-05 09:22:52 +00:00
itojun b347bd9b87 updated comment on IPv4 mapped address. sync with kame. 2000-06-01 04:26:38 +00:00
lukem 413a4004df Add support for 'ftp -u url file ...', to upload a list of files to given url.
Mostly based on [bin/10019] by Scott Aaron Bamford <sab@ansic.net>
2000-05-31 14:23:57 +00:00
lukem 04b8305c9e Fix examples on using pipes in local filenames. AFAICT, ftp has always
required `dir . |more' not as `dir |more' treats `|more' as the remote
filename. Resolves [bin/9922] by Geoff Wing <mason@primenet.com.au>
2000-05-31 10:25:15 +00:00
itojun 6fc49112e9 document IPv4 mapped address twists.
- ftp(1): treats IPv4 mapped destination as IPv4 peer, not native IPv6 peer.
  this does not support network with SIIT translator.
- rshd(8)/rlogind(8): rejects accesses from IPv4 mapped peer, to avoid
  possible abuse of IPv4 mapped addr (rshd/rlogind use source address-based
  auth so it is important to check the condition).
2000-05-30 05:21:46 +00:00
itojun b8cb7f6356 more comment on IPv4 mapped address handling. 2000-05-30 02:11:42 +00:00
itojun 288fc74e2e convert IPv4 mapped address (::ffff:10.1.1.1) into real IPv4 address
before touching it.  IPv4 mapped address complicates too many things
in FTP protocol handling.
2000-05-29 14:57:27 +00:00
lukem bd22f3362b Change `ls' to use the `LIST' and not `NLST' FTP protocol command.
Now that after many years on not caring we find certain popular
ftp servers are starting to obey RFC959 to the letter of the law
and will only return a list of filenames (not directories or
other filetypes) in the output of `NLST', then `LIST' is more useful
in this case. (Note that the aforementioned pedanticness means that
filename completion isn't as useful as it could be...)
Fixes [bin/8937] by David A. Gatwood <dgatwood@deepspace.mklinux.org>
2000-05-28 07:53:30 +00:00
itojun b4f15c3bf0 do not pass scoped IPv6 address notation on Host: directive, since
scope identifier is local to the originating node.
do not allow scoped IPv6 address notation in URL, if it is via proxy.
2000-05-25 15:35:51 +00:00