Commit Graph

349 Commits

Author SHA1 Message Date
lukem ae07641250 Fixes from <Todd.Miller@cs.colorado.edu>, with some cleanup and reworks by me:
* only echo "Passive mode" in verbose mode; scripts that use ftp
  may get unwanted output otherwise
* disable progress bar and modification time preservation when
  retreiving to a non-regular files. fixes progress bar getting in
  way of "get file /dev/tty"
* setup el_init() et al if editing is set, not if fromatty.
  TODO: migrate this to a function, and call if editing is turned on later
	in the session. also implement edit_cleanup if editing is turned off
* call el_set() after setting SIGWINCH handler. This fixes the problem
  when suspending in a non-cbreak shell (e.g, csh) would trash your tty mode.
* reset interactive mode correctly in auto_fetch() mget mode
1997-03-16 14:24:14 +00:00
christos 067f3f2db4 SMALLFTP->SMALL; remove SMALL from Makefile 1997-03-14 01:39:31 +00:00
christos 49258416ec Deal with SMALLFTP a bit differently [by compiling complete.c] 1997-03-13 22:38:39 +00:00
lukem 3b5054739d Features:
* support remglobbing of auto_fetch arguments
* new flag - '-e'; disable editing
* "page file" == "get file |${PAGER-less}"

Bugfixes/cleanup:
* consistently use a trailing '.' on messages
* code cleanup, including buffer overrun fixes, use puts
  and putchar in places, etc (inspired by OpenBSD mods)
* disable progress bar when local-file is a pipe or '-'
* skip \r in http headers
* fix remote ftpd slash bug more elegantly (so it works with ////)
* abort_remote(): check if cout==NULL before using it. should fix [bin/3273]
* fixed up cosmetic problems when complete_remote() generated errors from the
  remote server (such as "no files found", "login with user and pass", ...)
  done by adding extra argument to remglob(), which is a pointer to an error
  buffer to put messages in rather than printing to stdout.
1997-03-13 06:23:11 +00:00
lukem 4c7551e4f0 don't display negative ETA upon SIGINFO because filesize isn't known 1997-02-01 11:26:34 +00:00
lukem 3a50014d60 [Yet Another Huge Ftp Commit - hopefully the last for a while,
barring any more little things people want added ...]

New features:
* progressmeter is now asynchronous, so "stalled" transfers can be
  detected. "- stalled -" is displayed instead of the ETA in this case.
  When the xfer resumes, the time that the xfer was stalled for is
  factored out of the ETA. It is debatable whether this is better than
  not factoring it out, but I like it this way (I.e, if it stalls for 8
  seconds and the ETA was 30 seconds, when it resumes the ETA will still
  be 30 seconds).
* verbosity can be disabled on the command line (-V), so that in auto-fetch
  mode the only lines displayed will be a description of the file, and
  the progress bar (if possible)
* if the screen is resized (and detected via the SIGWINCH signal), the
  progress bar will rescale automatically.

Bugs fixed:
* progress bar will not use the last character on the line, as this can
  cause problems on some terminals
* screen dimensions (via ioctl(TIOCWINSZ)) should use stdout not stdin
* progressmeter() used some vars before initialising them
* ^D will quit now. [fixes bin/3162]
* use hstrerror() to generate error message for host name lookup failure.
* use getcwd instead of getwd (it should have been OK, but why tempt fate?)
* auto-fetch transfers will always return a positive exit value upon failure
  or interruption, relative to the file's position in argv[].
* remote completion of / will work, without putting a leading "///".
  This is actually a bug in ftpd(1), where "NLST /" prefixes all names
  with "//", but fixing every ftpd(1) is not an option...
1997-02-01 10:44:54 +00:00
thorpej e911ec0bfe Don't try to divide by zero in progressmeter().
From Thorsten Frueauf <frueauf@ira.uka.de>, PR #3160.
1997-01-30 03:36:26 +00:00
veego 13c790f77f Add missing ; 1997-01-19 20:17:37 +00:00
lukem 7a7fa80740 New features:
* Command line editing via editline(3) library.
* Context sensitive command and file completion, including remote files.

Enhancements to auto-fetch feature:
* Support for http:// URLs using the http protocol, including proxy HTTP
  support via $htty_proxy if it's defined.
* The connection is kept open between successive files on the same host.
  (obviously, this does not count for http requests.)
* Return value of ftp is 0 on no error, or the offset in argv[] of the file
  which failed (i.e., argv[x] failed, ftp returns x).
* If the path in an ftp URL or classic format line has a trailing '/',
  cd to the path and enter interactive mode. Fixes [bin/3011], albiet
  requiring the user to help ftp in determining the operation.

Other changes:
* '-P port' works for normal ftp, and is the default for all classic style
  auto-fetch transfers and for ftp URLs that don't specify the port.
  (previously it would just work for the first xfer.)
* Some code moved into separated files along logical divisions.
* Editing and completion can be compiled out with -DSMALLFTP.
1997-01-19 14:19:02 +00:00
tls 9d225a1783 RCS ID police 1997-01-09 20:18:21 +00:00
lukem 53b51b68ea doproxy(): remove leading "proxy " from input buffer so if another() is called
and line[] is reparsed to build margc/margv, commands don't get confused.
1997-01-03 02:55:59 +00:00
lukem e699917c51 * preserve modtime if size is 0 [bin/3040, Enami Tsugutomo]
* in autofetch mode, don't retry a file if the connection failed - skip it
  and move to the next file. [bin/3051, Matt Green]
* only print error messages from SIZE or MDTM if the user used 'size' or
  'modt' (respectively). prevents extraneous warnings during normal transfers
  when connected to a site which doesn't support these (behaviour prior to
  last commit), but still allows error feedback to specific user requests
  for this info (which the last commit broke).
* 'account': only accept one optional argument
* if invoked as pftp, default to passive mode on (from FreeBSD)
* remove leading '0 ' in progress bar - looked ugly
* use warn instead of perror
* use strncpy when src isn't known to have safe length
* remglob(): use mkstemp() to prevent symlink games, and don't override
  _PATH_TMP, use it as the prefix to the temp file
1996-12-29 04:05:29 +00:00
christos 764c65979e - make sure that the reply string is null-terminated, and copy only up to
the initialized copy of the source string, since the source string is not
  null terminated at this point.
1996-12-25 16:02:06 +00:00
christos 942194d9f4 - Don't print the '500 command not understood' reply for the SIZE and
MDTM commands which are not supported by all ftp servers, unless we
  are in debugging mode.
1996-12-25 16:00:38 +00:00
lukem dd6f8f2061 'b' == bits not bytes. for all prefixes >= 'K', explicitly specify 'B'
afterwards. don't print anything for a pure byte count. rework ETA display
as well.
1996-12-06 04:33:45 +00:00
lukem 2bee2a678e * note that nlist and ls and equivalent
* fix up optional argument descriptions for dir, ls, nlist, and user.
1996-12-06 02:28:13 +00:00
lukem b6df1b3d2d functionality mods:
* implement 'progress bar/meter' (inspired by ncftp). use 'progress' to
  toggle on. it will display current file size to 5 digits, automatically
  determining suffix (up to 16384 P (petabytes) == 2^64).
* 'ls' now uses NLST (unadorned listing), a la older ftp clients. 'dir'
  still does LIST (long listing). idea from John Nemeth <jnemeth@cue.bc.ca>

bug fixes:
* return first line of reply in reply_string[] from getreply(), instead
  of last line. This fixes [bin/741] (parsing of SYST), and also means
  that SIZE and MDTM messages will be parsed correctly if they're longer
  than 1 line.
* parse URL-style auto-ftps that have no filename correctly
  (e.g, ftp://host, ftp://host/, ftp://host/dir/). pointed out by
  Jaromir Dolecek <dolecek@saruman.ics.muni.cz>
* pass the correct size array in 2nd arg of utimes() when setting the
  modification time
1996-12-06 02:06:46 +00:00
lukem 8ef5f80460 More features, some of which were inspired by changes that
friedman@gnu.ai.mit.edu (Noah Friedman) made to his modified ftp:
- implement "lpwd" - local pwd
- implement "preserve" - toggle preserving of file modification
  times on retrieved files
- allow for explicit "on" or "off" arg to toggle commands
- "exit" synonym for "quit", "msend" synonym for "mput"
- in confirmation mode, allow 'a' (yes to rest of current command),
  and 'p' (turn off prompt mode, as if 'prompt off' was done,
  effective immediately)
- "modtime" returns time formatted as localtime, not GMT

Bug fixes:
- check for extraneous args on commands
- cleanup const usage, line formatting
- create 0 length temporary file in remglob() to prevent symlink games
  (from OpenBSD)
- check length of filename of ~/.netrc (from OpenBSD)
1996-11-28 03:12:28 +00:00
fvdl 7970a0483a Correct the connecthelp info. This is really ftp, not tftp. 1996-11-25 09:53:50 +00:00
lukem 36d3d1fd0f cleanups/bugfixes:
- don't echo 'ACCT' parameter when debugging (a la 'PASS')
- Fix checking of directory access for "/foo", the parent
  directory is "/", not "" (from FreeBSD)
- remove trailing whitespace on lines
- add any missing NetBSD tags
- cleanups to man page, includinging sorting options description

feature additions:
- variable sized hash marks (from [bin/683], but done in the hash command
  as an optional arg)
- more user-friendly transfer time printing (from FreeBSD, with mods)
- '-p' command line option to jump into PASV mode (closes [bin/2857],
  but with an option rather than checking argv[0])
- SIGINFO support for printing xfer stats when sending/receiving requests
- '-P port' for changing the port to connect to (from thorpej@netbsd.org)
- '-a': bypass normal login, and try anonymous login (from OpenBSD
  via thorpej)
- autofetch files via url (ftp://...) or "classic" (host:/file)
  (from OpenBSD via thorpej)
- 'ftp' synonymous with 'open' (from FreeBSD)
1996-11-25 05:13:18 +00:00
pk a5d6cd101b Fence off NULL args in getcmd() (fixes/works around PR#824). 1996-05-07 00:16:55 +00:00
cgd 0cfde2b269 add -Dunix to CFLAGS 1995-11-22 21:52:48 +00:00
pk 6a4e77edfb Correct timersub() argument order (from Thomas Eberhardt; PR#1470). 1995-09-16 22:32:59 +00:00
pk 7b44b2859d Avoid falling off the end of a fixed-length array (from John F. Woods; PR#1431). 1995-09-15 00:32:33 +00:00
cgd 456a083153 needs string.h for protos. 1995-09-14 01:39:52 +00:00
tls 917ef72d79 Sync with 4.4lite2 1995-09-08 01:05:59 +00:00
mycroft 800709ce22 Use inet_aton(), not inet_addr(). 1995-05-21 15:50:45 +00:00
mycroft e60255f2bc Update to use timer{add,sub}(). 1995-03-21 14:16:23 +00:00
jtc db9433b832 Describe -t (enable packet tracing) command line flag (PR #713).
Alphabetize description of command line flags.

Packet tracing is an unimplemented feature, I've decided to keep it's
documentation since ever other UN*X vendor I checked still does.  Not
a particularly useful reason.
1995-01-13 00:09:41 +00:00
cgd 06da9a1040 needs string.h 1994-12-24 16:42:19 +00:00
jtc f9ffa0ef02 Null terminate case-mapped filenames (PR #640). 1994-12-15 08:58:44 +00:00
mycroft 8e14ac7b00 Fix null pointer dereference. 1994-09-17 00:51:10 +00:00
mycroft 46d22e0d6a Fix option parsing bug reported by Uwe Arndt, and another related bogon. 1994-08-31 21:32:33 +00:00
mycroft 8126499a9d Add RCS ids. 1994-08-29 03:09:05 +00:00
cgd 7e8f5e6f63 passive mode support, from David Carrel <carrel@cisco.com>, and cleaned
up for the new ftp sources by me.
1994-08-25 04:27:41 +00:00
cgd 17f8e276eb the previous local changes 1994-08-25 03:49:46 +00:00
mycroft 1955443aa9 Clean up deleted files. 1994-08-25 03:48:12 +00:00
cgd dea9ded20c clean up import, no local changes. 1994-08-25 03:47:50 +00:00
cgd dd93b648c8 Initial revision 1994-08-25 03:27:56 +00:00
cgd 9e9d953286 kill typo 1994-03-28 07:11:18 +00:00
cgd ab97926575 off_t foo 1994-03-27 10:05:14 +00:00
jtc 41954280cb spelling mistakes 1994-02-03 17:47:18 +00:00
jtc 7e06b2a1e2 Fix spelling errors. 1994-01-11 02:21:43 +00:00
mycroft 1749f47c4a Display bytes/second rather than kbytes/sec, and use 3 digits of
precision for transfer time.
1993-09-23 23:15:42 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft c3e42d1c64 Add RCS indentifiers. 1993-08-01 07:22:47 +00:00
mycroft 690cae8181 Add RCS indentifiers. 1993-07-31 15:17:49 +00:00
mycroft 1b67cec37d Fix various bugs in man pages (from 386BSD patch 130). 1993-04-22 03:27:28 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00