Commit Graph

348 Commits

Author SHA1 Message Date
itojun 46169e86bf inhibit too-noisy message for scoped address data transfer
(will be enabled in "debug" mode).
2000-03-14 16:36:05 +00:00
itojun 4a340575cc make debugging output unambiguous on IPv6 numeric addrs (don't use host:port) 2000-03-09 22:07:59 +00:00
itojun 3c079a0744 http://[::1]:8080/ is legal.
send Host: directive with RFC2732 bracket notation for IPv6 numeric,
otherwise "host:port" is ambiguous to servers (clarification will be submitted
as update to RFC2732).
2000-03-09 22:01:26 +00:00
lukem 8575d2f491 only use IPTOS_ setsockopt()s if they're defined (e.g, SunOS doesn't).
from Havard.Eidnes@runit.sintef.no
2000-02-28 10:12:27 +00:00
lukem b5df4bcc84 only use getaddrinfo() et al if both NI_NUMERICHOST *and* INET6 are defined...
(allows --disable-ipv6 in lukemftp's configure script to disable this as
well, which is good for testing when it appears getaddrinfo() is borken)
2000-02-14 21:46:26 +00:00
lukem 0f9b481624 crank 2000-01-31 22:01:52 +00:00
lukem 7044ee274b define private type `sigfunc' as
typedef void (*sigfunc) __P((int));
and replace use of sig_t and void (*)(int).

certain other OSes define sig_t differently to that (they add extra arguments),
and it causes problems due to function mismatches, etc...
2000-01-31 22:01:03 +00:00
lukem be8fac301a crank version 2000-01-26 11:37:12 +00:00
lukem 0ac52b3131 roll back to using sscanf() instead of strptime() to parse `yyyymmddhhmmss'
strings, since the latter technically can't parse dates without non
alphanumerics between the elements (even though netbsd's strptime() copes).
2000-01-26 11:31:55 +00:00
lukem d2196602e3 put spaces between the % specifiers in the strptime format string 2000-01-26 10:15:40 +00:00
lukem dfee5c0f62 crank version 2000-01-25 07:14:11 +00:00
lukem 61d86056a0 work around bug in apache 1.3.9 which incorrectly puts a trailing
space after the chunksize.
noted by Jun-ichiro itojun Hagino <itojun@itojun.org> in [bin/9096]
2000-01-25 07:13:45 +00:00
lukem ec9eefea83 be harsher about workaround 2000-01-25 06:45:18 +00:00
lukem 852392d00d work around lame ftpd's that don't return a correct post-Y2K date in
the output of `MDTM'.

obviously the programmer of aforementioned lame ftpd's did something like
	"19%02d", tm->tm_year
instead of
	"%04d", tm->tm_year + TM_YEAR_BASE

fixes [bin/9289] by jbernard@mines.edu
2000-01-25 06:11:00 +00:00
lukem b5a4e862d8 complete_ambiguous(): be consistent about completing unambiguous matches; if
the word is already complete then return CC_REFRESH so that the higher layer
may append a suffix if necessary.  Fix from Launey Thomas <ljt@alum.mit.edu>.
2000-01-20 13:19:46 +00:00
lukem 80b66e48af change references from draft-ietf-ipngwg-url-literal-01.txt to RFC 2732 1999-12-21 13:00:18 +00:00
lukem f442e9dbbd add dependency on version.h 1999-12-12 02:14:53 +00:00
lukem eee70cc0f0 crank version 1999-12-12 02:12:29 +00:00
lukem d30bdcd79c separate out the main `data pump' loop into two: one that supports
rate limiting and one that doesn't. simplifies the code, and speeds
up the latter case a bit, at the expense of duplicating a few lines...
1999-12-11 02:02:21 +00:00
lukem 3851d504a7 Fix chunked support; probably broke after rate limiting was added.
Problem noticed/debugging assisted by giles lean <giles@nemeton.com.au>.

XXX: rate limiting with chunked xfers might not limit correctly (i.e,
the limit may be too high or too low); fixing this is non trivial,
and will probably occur if i ever rototill fetch_url()
1999-12-11 00:56:13 +00:00
lukem ef03015b86 move version into separate file to reduce recompilation after version crank. 1999-12-05 22:54:35 +00:00
lukem bcd625e612 crank version 1999-12-05 22:50:06 +00:00
lukem e36391c2c9 * remove unnecessary freeaddrinfo(res), since res0 was changed to be
freed earlier in itojun's last commit. fixes [bin/8948].
* remove `const char *reason'; it was being assigned but not used.
1999-12-05 22:49:27 +00:00
itojun 05e574f6a9 fix memory leak in fetch_url (no freeaddrinfo was there).
sync with recent KAME.
1999-12-03 06:10:01 +00:00
lukem d0090fb777 * implement xsl_init() and xsl_add(); error checking forms of sl_{init,add}()
* fix bug where the second press of <TAB> on an empty word (i.e, list
  all options) may have resulted in an strncmp() against NULL.  (detected
  by _DIAGASSERT())
1999-11-28 06:32:04 +00:00
lukem 21da08ce70 in cleanuppeer(), reset username to NULL after free()ing it.
fixes [bin/8870] by Wolfgang Rupprecht <wolfgang@wsrcc.com>
1999-11-27 01:00:06 +00:00
lukem 7047fe4a36 bump version 1999-11-26 23:26:05 +00:00
lukem f25449279d * complete_remote(): use remglob("", ...) instead of remglob(".", ...),
for listings of the current working directory; some ftp servers don't
  like `NLST .'.
  [noted by Giles Lean <giles@nemeton.com.au>]
* recvrequest(): treat remote=="" as remote==NULL when calling command().
  (to support the above change)
* support `[user@]' in `[user@]host' and `[user@]host[:][path]'.
  [based on idea (and initial code) from David Maxwell <david@fundy.ca>]
* `idle' may be invoked without any args
* reformat some comments
* reformat usage string in program and man page
* call updateremotepwd() after successful login, not after successful connect
* always call setsockopt(, IPPROTO_IP, IP_TOS, ) (et al); using #if
  defined(IPPROTO_IP) doesn't work on certain foreign systems where
  enums instead of #defines are used...
  [noted by Matthias Pfaller <leo@dachau.marco.de>]
1999-11-26 21:41:55 +00:00
lukem ecb8a0755a - implement `set rprompt'; right side version of `set prompt'. depends on
EL_RPROMPT support i added to editline(3).
- allow $FTPPROMPT and $FTPRPROMPT to override defaults for the relevant
  prompts
- move `%' formatting code from prompt() to expandbuf().
- implement `%.' and `%c', similar to the same % codes in tcsh(1)
  (functionality I added to tcsh nearly 6 years ago), except that `%.'
  always does `...trailing' and `%c' always does `/<x>trailing'.
- unknown `%foo' codes get printed as `%foo'
1999-11-12 02:50:38 +00:00
lukem 14fbd5079e - implement updateremotepwd(); update the global variable `remotepwd'
to contain the remote working directory.
- add `set prompt', a user configurable prompt. (defaults to `ftp> ').
  the following escape characters a la tcsh(1) are supported: %/, %m,
  %M, and %n.
- add global var `username'; used by prompt code
- fix a couple of minor memory leaks
- bump version
1999-11-11 02:53:02 +00:00
lukem 2ef6c64e80 whitespace nits 1999-11-11 01:19:11 +00:00
lukem b2edff6b32 - implement restarting file:/// non-proxied http:// URLs (with -R).
- fix a semicolono which stopped file:/// from working
1999-11-10 07:34:41 +00:00
lukem f8a1dcf0d2 - split the version string into product and version
- be consistent about reporting the version between:
	+ status command
	+ about:version URL fetch
	+ User-agent sent in http requests
1999-11-09 22:03:49 +00:00
lukem 3889281dc1 when using http/1.1 for unproxied http requests, send the port as a number
(e.g, `:80') instead of a name (e.g, `:http'), because the former is the
supported method that actually works...  noted by hubertf@netbsd.org
1999-11-09 07:46:22 +00:00
lukem f8233fe3ba prevent minor memory leak (unnecessary strdup) 1999-11-09 07:26:50 +00:00
lukem ed43430a7c support `about:version'. also display the version in the output of `status'. 1999-11-03 07:42:01 +00:00
lukem a5d1d869e7 hookup(): when using getservbyname() (when getaddrinfo() isn't available), if
the provided port is a valid number use that rather than trying to do
getservbyname() against it.
fixes a problem on foreign systems noted by Chuck Silvers <chuq@chuq.com>
1999-11-03 02:03:08 +00:00
lukem 4f2d3550d0 new features:
- add `usage'; displays the usage of a command.
  implemented by calling the c_handler() with argc = 0, argv = "funcname".
- add `passive auto'; does the same as $FTPMODE=auto.
- add `set [option value]'; display all options, or set an option to a value.
- add `unset option'; unset an option.
- add getoptionvalue() to retrieve an option's value, and replace a few
  global variables with calls to this.
- implement cleanuppeer(), which resets various bits of state back to
  `disconnected'. call in disconnect() and lostpeer().
- support completing on `options'.
- improve recovery after a SIGINT may have closed the connection.
  XXX: there's still a couple to fix

other stuff:
- various consistency fixes in the man page.
- ensure that the command usage strings in the code and man page match reality.
- mput/mget: check that the connection still exists before each xfer.
- minor cosmetic changes in confirm().
- set code correctly in sizecmd() and modtime()
- don't need \n in err() strings.
- change lostpeer to take an argument (rather than casting (sig_t)lostpeer
  in signal handlers)
- knf and whitespace police.
1999-10-24 12:31:36 +00:00
lukem f74df4b2ea * fix up confirm() (broke `a' and `p' in last commit)
* simplify main loop (don't need `top' variable any more)
* use a struct sockaddr_in6.sin6_addr for the result from inet_pton(),
  rather than u_char buf[16]
* add a few more comments
1999-10-13 02:47:54 +00:00
lukem 28f9cbb866 s/ARPANET/Internet/ ... 1999-10-12 08:11:59 +00:00
lukem da626f2307 a few user interface and cosmetic tweaks:
* confirm(): move from util.c to cmds.c. display mnemonic string in its prompt.
  add support for `q' (terminate current xfer), `?' (show help list)
* in various signal handlers, output a linefeed only if fromatty.
* if fgets(stdin) returned NULL (i.e, EOF), clearerr(stdin) because you don't
  want future fgets to fail. this is not done for the fgets() in the main
  command loop, since ftp will quit at that point.
* unless ftp is invoked with -a, don't retain the anonftp setting between
  hosts (`ftp somehost:' sets anonftp, but you don't want that to `stick'
  if you close that connection and open a new one).
1999-10-12 06:04:59 +00:00
lukem d5b5f0e034 * in the SIGINFO/SIGQUIT handler, print a newline before displaying
the xfer stats
* crankrate() should have a K&R decl (for consistency)
1999-10-11 12:35:42 +00:00
lukem bd5207d5ac if editing is enabled when intr() is called, print a newline. (cosmetic fix) 1999-10-11 12:34:17 +00:00
lukem 08ebd97c48 use sigjmp_buf for sigsetjmp(), instead of jmp_buf.
noted by Havard.Eidnes@runit.sintef.no.
1999-10-10 22:33:54 +00:00
lukem afb965e778 allow a second SIGINT during the "xfer aborted. waiting for remote to finish abort."
stage. if this occurs, just call lostpeer() to close the connection.  whilst this
might be considered brutal, it's also extremely handy if you're impatient or there's
lossage at the remote end.
1999-10-09 12:48:12 +00:00
lukem a53d7d57a9 * use sigsetjmp()/siglongjump() instead of setjmp()/longjmp(); the latter
don't save the signal mask on some foreign systems.
* ensure signal handlers don't use stdio and do reset errno if they
  don't exit with siglongjmp()
* use a common SIGINT handler for {send,recv}request()
1999-10-09 03:00:55 +00:00
simonb 7d7c6d9f66 Minor nit - don't append a '/' to tmpdir if it already ends in a '/'. 1999-10-07 02:05:22 +00:00
lukem ce2d63fcbf more propaganda :) 1999-10-06 08:57:46 +00:00
lukem 141ae91ed8 * fetch_url(): specifically set SIGQUIT to psummary before each xfer.
(work around editline's override)
* minor cleanup of signal handler (along the lines of similar work in
  recvrequest()). the handlers should now be reset everytime the cleanup
  handler was callled.
1999-10-05 22:12:34 +00:00
lukem c694a5290b * set SIGQUIT to psummary in each of the xfer routines. (editline seems to
override SIGQUIT when EL_SIGNAL = 1 (but we want the latter for all the
  other signal support it has).
* more fixes after previous rototill
1999-10-05 22:04:30 +00:00
lukem 781fce374d the prior change was a bit too aggressive in factoring out common code in
{send,recv}request(). completion and uploading now works again...
1999-10-05 13:44:39 +00:00
lukem 3f8b92b0b3 * factor out SIGINFO setting into a handler that is always active (but only
prints out info if bytes > 0). only set the handler if SIGINFO is defined
* hijack SIGQUIT to be the same as SIGINFO (foreign ports have this, and it's
  annoying to have SIGQUIT dump core on netbsd when it prints info on other
  systems)
* in {recv,send}request(), factor a lot of duplicated code out into a
  `cleanup' section at the end
* rework shell() a bit
1999-10-05 13:05:39 +00:00
lukem f45505380a add TNFi copyright to all files i've done more than a minor amount of work to... 1999-10-05 01:16:11 +00:00
lukem 4309cfaab3 enhancments from Marc Horowitz <marc@mit.edu> to improve connection timeouts:
* implement xsignal_restart(), which only sets the SA_RESTART flag if
  specifically requested
* xsignal() is now a wrapper to xsignal_restart(). INFO, USR1, USR2 and WINCH
  are restartable, ALRM, INT, PIPE and QUIT are not.
* improve getreply()'s timeout code to take advantage of the above.

other changes:
* improve wording of how globbing works for `classic' URLs (host:path).
  suggested by John Refling <johnr@imageworks.com> in relation to PRs
  [bin/8519] and [bin/8520]
* always compile in the `edit' command even if NO_EDITCOMPLETE defined.
  it's just a no-op in the latter case, which is more consistent to
  the users.
* always compile in about: support (i.e, remove NO_ABOUT).
  i'm entitled to some vanity in this program...
* clean up some whitespace
1999-10-05 00:54:07 +00:00
lukem 670c7ebebd restart_point is a global; no need for it here 1999-10-01 09:23:32 +00:00
lukem fcb1a22a1c If EPSV or EPRT fails, disable epsv4 for the rest of the current connection.
the disabled state can be overridden by toggling epsv4.

(I got sick of the errors about EPSV not being supported on almost
every server I connect to. This way we retain support for epsv4, but
it's not so whiny after the first failure...)
1999-10-01 08:01:12 +00:00
lukem 4c9f05c61f simple dependancy so addition of global vars to ftp_var.h is detected for main.c 1999-10-01 07:58:02 +00:00
lukem ad70c1982e prefix the global variables in ftp_var.h with GLOBAL, which defaults
to "extern" if it's not set. define GLOBAL to (empty) in main.c.
this effectively moves all the globals into main.c whilst retaining
namespace access to them in other source files.
(global vars in header files confuse foreign linkers)
1999-10-01 06:55:44 +00:00
lukem 46111773d1 * don't bother with "pathnames.h"; it contained just a single #define.
instead, include <paths.h> in the files that need it
* slightly reorg ftp_var.h
1999-10-01 06:18:32 +00:00
lukem 38100c05f4 * newer takes an optional second arg, so document this
* be a bit more explicit that the arguments to rate are in bytes
1999-10-01 05:08:31 +00:00
lukem 25790d921d * In the !NI_NUMERICHOST case (i.e, getaddrinfo() challenged systems), portnum
should be in host order. found/fixed by Matthias Pfaller <leo@dachau.marco.de>
* parse_url(): improve checking of portnum, and add an extra argument to pass
  back the parsed portnum to the caller (reduces a bit of code duplication)
* Move the KAME/WIDE copyrights after the BSD/TNFi ones. Since there was
  significantly less code added under the former, it's only fair on the latter.
1999-09-30 23:51:26 +00:00
lukem 1b3e840242 * fix initialisation of home[]
* fetch_url(): if path would be NULL, return strdup("")
1999-09-30 12:18:03 +00:00
lukem c4a3ce23de in empty(), FD_ZERO(&rmask) not (&cin). (hi christos! :)
fixes abort_remote() when __USE_SELECT is defined.
thanks to simonb@netbsd.org for reporting this bug
1999-09-30 06:35:13 +00:00
lukem 5f7fe832b6 #define BUFLEFT is always used... 1999-09-30 05:38:19 +00:00
lukem 9f5bda2e21 * consistentnly use memset(a,0,c); there were some cases of memset(a,'\0',c)
* remove explicit extern int h_errno; it's in <netdb.h>
* add <termios.h> back to util.c; it contains struct winsize on some systems
1999-09-29 00:44:01 +00:00
lukem 6c997b7af6 revert snprintf() -> sprintf(). the original idea was that sprintf() would be
more portable, except that certain systems have char *sprintf() instead of
int sprintf(). (we'll provide snprintf() on those)
1999-09-28 09:12:06 +00:00
lukem f3f34df069 don't fudge out the stalltime when calculating the ETA. this means that the
ETA might be over and will appear to drop rapidly, rather than being under
and appear not to change. the original code makes sense when you're testing
by suspending & resuming the client. however, the unfudged number is probably
better in reality, especially for slow spurty networks.

requested by ITOH Yasufumi <itohy@netbsd.org> in [bin/7977]
1999-09-28 07:54:01 +00:00
lukem 8c29ac4ade remove debugging cruft 1999-09-28 07:51:05 +00:00
lukem 256fc138f1 * add new commands:
lpage	page local files
	pdir	as dir, but through your $PAGER
	pls	as ls, but through your $PAGER
* implement docase() (a la dotrans() et al) and use appropriately, rototilling
  some duplicated code
* globulize(): modify to return a pointer to the strdup()ed result in all cases,
  and hack the code that calls it to take this into account
* replace strcpy() and strncpy() with strlcpy()
* put(), getit(): use some aptly named local vars instead of argv[...]
* delint
1999-09-28 06:47:38 +00:00
lukem 002c3f9216 * idle(): rename to idlecmd(). certain linux distributions have an incompatible
prototype for idle() in <unistd.h> (which i thought was against namespace
  and sensibility guidelines, but...)
* consistently use xsignal() instead of signal(). we get known behaviour
  in all cases (SA_RESTART), which is good for some borken foreign systems.
* remove signal.h from most files; it's unnecessary now
* fetch_url(): use `long chunksize' instead of ssize_t; it's more portable, and
  we're setting chunksize with strtol() anyway
* xsignal(): only use SA_RESTART if it exists. SunOS 4.x doesn't have it
  but has the inverse (SA_INTERRUPT). the original function i was inspired
  from had this support (lib/signal.c, W. Richard Stevens' `UNP 2nd ed Vol 1').
* remove <termios.h> from util.c; it should be unnecessary now
1999-09-27 23:32:31 +00:00
lukem 70c01ac44a * idle(): rename to idlecmd(). certain linux distributions have an incompatible
prototype for idle() in <unistd.h> (which i thought was against namespace
  and sensibility guidelines, but...)
* consistently use xsignal() instead of signal(). we get known behaviour
  in all cases (SA_RESTART), which is good for some borken foreign systems.
* remove signal.h from most files; it's unnecessary now
* fetch_url(): use `long chunksize' instead of ssize_t; it's more portable, and
  we're setting chunksize with strtol() anyway
* xsignal(): only use SA_RESTART if it exists. SunOS 4.x doesn't have it
  but has the inverse (SA_INTERRUPT). the original function i was inspired
  from had this support (lib/signal.c, W. Richard Stevens' `UNP 2nd ed Vol 1').
* remove <termios.h> from util.c; it should be unnecessary now
1999-09-27 23:09:42 +00:00
lukem 02e1aae831 remove now-unused variable left over from last commit.
(repeat after me; `test compile before commit...')
1999-09-26 14:21:50 +00:00
lukem 02387d2c93 Use tcgetpgrp(fd) instead of ioctl(fd, TIOCGPGRP, &var), because
Kimmo Suominen <kim@netbsd.org> informs me that it's more portable.
1999-09-26 14:18:01 +00:00
lukem 75e3195cad * replace ifdefs against __SVR4 and __linux__ with DIRENT_MISSING_D_NAMLEN;
it's more portable and more obvious
* remove the mkgmtime() && HAVE_TIMEGM stuff:
	a) why should netbsd have to define HAVE_TIMEGM to compile cleanly?
	b) foreign compiles of ftp should just be linked with working
	   timegm function

a more portable version of this ftp client will be released as a 3rdparty
product; no use polluting our code with half-baked attempts...
1999-09-26 02:00:12 +00:00
lukem a222db7c70 * use %lld instead of %qd to print out (long long) vars.
(slightly more portable; e.g, solaris supports this)
* remove some fluff (lint)
1999-09-24 14:28:14 +00:00
lukem 14b5ecf789 use an off_t instead of quad_t (or long #ifndef NO_QUAD) to store the
temporary restart point. (yet another portability fix...)
1999-09-24 12:52:18 +00:00
lukem ec4e414dc8 fix a couple of thinkos in my recent work:
* abort_remote(): replace borken MIN(4,BUFSIZ) with just BUFSIZ; it
  should have been MAX(4,BUFSIZ), but it's probably safe to assume that
  BUFSIZ is at least 3... (fix from simonb)
* auth_url(): use the correct variable when calculating a buffer size.
1999-09-24 06:57:37 +00:00
lukem cb8c56db8a if getsockopt() returns a buffer size of <= 0, set them to 8192.
this works around a problem in certain OS from Sun with a version < 5.6...
1999-09-24 06:14:40 +00:00
lukem e73d848293 in complete(), only copy the word if there is one.
`cd <TAB>' was triggering _DIAGASSERT(src != NULL)).
1999-09-24 05:35:09 +00:00
lukem 76c8d5f094 * finish replacing snprintf() with sprintf(), for portability reasons.
add lots of comments about how to size up the buffers, and add extra
  checks to hopefully ensure that there won't be an overflow (unless
  someone modifies the length of the sprintf()s).
* as part of the above, slightly rework the way the `*' bar is calculated.
  also fixes a display bug when > 160 stars were needed to be printed.
  the maximum progress bar width at this time is 256.
* remove some code that checks the port that was #if 0-ed out as part of the
  ipv6 migration; it's not going to be used again.
1999-09-24 00:48:24 +00:00
lukem 700e3c1ec7 * add support for `xferbuf', which sets both `sndbuf' and `rcvbuf'
* document the above three commands
* rototill the way the sndbuf and rcvbuf work. remove resetsockbufsize()
* use the appropriate socket buffer size as the size of the buffer that
  the read()/write() loops use. speeds up things in some cases.
1999-09-22 07:18:31 +00:00
lukem 5d3667b758 replace snprintf() with strlcpy(), strlcat(), or direct assignment
where appropriate. (strlc*() are easier to port to foriegn systems).

XXX; there's still a few snprintf's in the progress meter stuff to convert
1999-09-22 03:01:53 +00:00
lukem 84e2c387e7 * protect more of the AF_INET6 stuff with #ifdef INET6 (for portability)
* in the main data moving loops only call the initial gettimeofday() if
  rate throttling is enabled (saves a system call per loop when not
  throttling).
1999-09-21 13:17:22 +00:00
lukem 20a4d96576 reword EPSV status line 1999-09-21 13:10:16 +00:00
lukem 2ef7f5d71d add trailing . to message 1999-09-21 12:57:51 +00:00
lukem f7ead868c0 cast 4th arg to [gs]etsockopt() to (void *), to satisfy some foriegn systems 1999-09-21 11:18:27 +00:00
lukem 26738e38b8 only default to epsv4 if INET6 is defined 1999-09-21 10:11:56 +00:00
mycroft a502b0ee92 warn()->warnx() in a couple of places. 1999-09-14 22:49:14 +00:00
itojun a4e46e8ae8 sync with recent kAME.
- avoid s6_addr{8,16,32} which are nonstanard.
1999-09-03 04:29:57 +00:00
itojun b59b162709 ftpd(8): Copy sin6_scope_id from control connection to active data
connection destination, hoping this to help ftpd's behavior with
scoped IPv6 addresses.
I'm not sure if it is the right way, but it is the best way available to us.
LPRT or EPRT command gives no information about which interface (or scope)
to be used for new data connection.

ftp(1): On data connection establishment, warn if scoped address is used.
If peer (ftp daemon) does not handle scoped address, data connection
may not work right.

This seems to be sort of protocol spec hole, not implementation issue.
1999-09-01 05:03:41 +00:00
christos 915a67c083 The port number might have changed in the proxy case. Re-evaluate it. 1999-08-31 22:05:22 +00:00
christos 0f5eb412c3 fix proxy code. strtol() does not work very well for parsing port names. 1999-08-31 21:30:25 +00:00
christos 2cec9705c5 make ftp work again with the traditional gethostbyname/getservbyname
interfaces.
1999-08-29 22:21:57 +00:00
lukem 6d532c26d3 fetch_url() fixes:
- just display the hostname:port of the proxy url, rather than the full url.
  this prevents someone `shoulder surfing' a proxy username/password
  in $http_proxy. [suggested by perry]
- compact verbose notes for http fetchs; now displays
    (via host:port, with authorization, with proxy authorization)
  with each component being optional.
(and a couple introduced with the ipv6 mods...)
- don't override host with the canonical name; this prevented fetches from
  http/1.1 virtual hosts from working if the virtual host was a CNAME.
  [noted by bernd]
- call freeaddrinfo() if res was built with getaddrinfo()
1999-08-22 12:49:00 +00:00
lukem 8e17c17112 fix problem with www authentication: len passed to snprintf() for
auth_url() strings was 1 too small. noted by veego@
1999-08-01 12:22:23 +00:00
itojun 31055e9319 cleanup EPSV return code checking part.
remove debug fputs() left by mistake.
1999-07-20 17:52:03 +00:00
itojun a382c0c34d avoid false warnings on 22x reply code checks. previous code was too picky.
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
1999-07-17 22:39:18 +00:00
itojun 1e44889b75 implement more fallback case for EPSV. BSDI ftpd is very broken
that it returns status 228 against EPSV, where it must return status
of 229.

separate PASV and LPSV processing.

PR: 7976
1999-07-13 21:43:31 +00:00
lukem 375a0efb60 * change fetch_ftp() to be fully rfc 1738 compliant; if the URL contains
the an empty directory (e.g, between `some' and `path' in
  `ftp://host/some//path'), then execute `CWD ' (without a path).
  This command will probably fail on rfc 959 compliant servers, so
  issue a warning in this case and bail. [noted by cgd].
  (i wonder if the people who wrote rfc 1738 actually realised that this
  requirement appears to contravene the spec for `cwd' in rfc 959 ?)
* replace isurl() with isipv6addr(), and use appropriately. fixes
  auto-login with `classic ftp URLs' (e.g, `ftp somehost:')
* cleanup and rework some of the ipv6 stuff in parse_url()
* prevent potential coredump in fetch_ftp() when parsing `;type=X'
* KNF a few lines
* fix a couple of comments
* cleanup the man page a bit
1999-07-12 13:20:34 +00:00
itojun 940276557f add epsv4 command, which enable/disable the use of EPSV/EPRT.
this is mainly for (hypothetical) ftp server which disconnect clients
that use EPSV/EPRT.  I've never seen any ftp server like this, but
epsv4 command may be of use when such an ftp server is found.
1999-07-11 20:37:39 +00:00