Commit Graph

514 Commits

Author SHA1 Message Date
lukem 00ff9c6dba Document about:ftp and about:version. 2007-07-18 06:40:01 +00:00
lukem d5855ca07b Enforce restriction that (http) proxied URL fetchs don't support
being restarted at this time.
PR #28697.
2007-06-05 00:31:20 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
lukem f4f2ed1c79 Display times in RFC2822 form rather than using ctime(3), since
the former is more explicit about the timezone offset.
2007-05-24 05:05:18 +00:00
lukem 6ca11a7da7 Revert previous "64bit fix" because it actually removed desired functionality.
Instead, use the appropriate format specifier & cast to display the time_t.
2007-05-24 02:51:41 +00:00
tnn fd95c698a3 Unbreak debug printf on 64-bit arches. 2007-05-22 18:02:18 +00:00
lukem 3ba7505832 * main: call tzset() to ensure TZ is setup for other <time.h> functions.
* remotemodtime(): use strptime() to parse the reply.
* fetch_url(): ensure struct tm is zeroed before calling strptime().
2007-05-22 05:16:48 +00:00
lukem c007c5280e * Modify parse_url() to consistently strip the leading `/' off ftp URLs.
Fixes PR 17617.
* Use 'RFCnnnn' (with leading 0) instead of 'RFC nnnn', to be
  consistent with the style in the RFC index.
* Refer to RFC3916 instead of 1738 or 2732.
* Expand the list of supported RFCs in ftp(1) to contain the document
  name as well.
2007-05-15 23:54:18 +00:00
lukem 8b1e1fad90 Switch from fparseln() to the internal getline() when parsing HTTP headers.
Makes ftp a bit more portable (not needing fparseln()) at the expense of not
supporting arbitrary long header lines, which I'm not concerned about
because we don't support header line continuation either...
2007-05-10 12:22:04 +00:00
lukem aeb5730de8 Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659. 2007-05-10 05:59:30 +00:00
lukem 2294f71cef Use getline() instead of fparseln() 2007-05-10 05:35:31 +00:00
lukem 82552a7668 Implement copy_bytes() to copy bytes from one fd to another via the
provided buffer, with optional rate-limiting and hash-mark printing,
using one loop and handle short writes.
Refactor sendrequest() and recvrequest() to use copy_data().
Addresses PR 15943.
2007-05-10 05:17:10 +00:00
martin 0c85e08d0f const-as-const-can: make the "suffixes" pointers const, as probably was
intended, but done wrong originally (redundant const was removed
per PR bin/36280)
2007-05-05 18:09:24 +00:00
christos ac6a20066f PR/36280: Christer Folkesson: Remove extra const 2007-05-05 16:57:54 +00:00
lukem bab591a531 fix rev 1.144: initconn() may be called with verbose==-1 (e.g., during remote
completion), so only print out the successful EPSV response if verbose>0.
2007-04-18 01:50:45 +00:00
lukem 036f5d17ed Clean up use of confirm() and mbort() so that the current operation
is always passed in (instead of depending upon the 'mname' global).
For confirm(), if the second argument is NULL print the "Continue with <cmd>"
prompt.  This fixes up the the display of interrupted prompts.
2007-04-18 01:39:04 +00:00
lukem 8a06b9bff0 * Implement -s srcaddr; uses srcaddr as the local IP address for all
connections.
  Based on code in the version of ftp that FreeBSD had before they
  replaced it with lukemftp.
* Move error message handling into ftp_connect() rather than in the
  caller, so that more specific error reporting can occur.
* Improve consistency of various warning and error messages.
2007-04-17 05:52:03 +00:00
lukem 31835c3a13 Replace a "while" with an "if" since the code path only gets executed once. 2007-04-16 00:43:43 +00:00
lukem 7898b5e0a8 Use the IEC 60027-2 2^n based "KiB", "MiB", "GiB", (etc)
suffixes for byte displays since we're using 2^n scaling,
instead of the SI 10^n based "KB", "MB", "GB" (etc).
2007-04-12 06:13:02 +00:00
lukem 98b66d0b78 Fix using /usr/bin/ftp as a slave process on the end of a pipe by calling
fflush(stdout) before each command.
Taken from FreeBSD's pre-lukemftp version of ftp.
2007-04-12 04:25:00 +00:00
lukem 00e5aa03ea whitespace pedantry 2007-04-12 04:18:22 +00:00
lukem b1e08b00c3 Various fixes from Nicholas Marriott sent to openbsd-tech and in private email:
* Prevent segfault if a .netrc token is too long.
* Prevent segfault when using a macro from an empty macdef.
* Check more return values.
2007-04-12 01:28:13 +00:00
lukem ea73350dac Suppress printing non-COMPLETE reply strings from EPSV and EPRT, as we're
going to fall back to PASV / PORT (respectively) if the former fail,
and this avoids printing a failure reply followed by a success reply.
Should fix a problem with the emacs ftp wrapper.
2007-04-11 05:03:25 +00:00
lukem 7aab13aa67 Revert rename of "debug" command from "ftp_debug" back to "debug". 2007-04-11 04:40:19 +00:00
lukem 06cab527ea getpass() can return NULL upon error in some implementations
(as documented in older standards documents, before the API was obsoleted).
Problem observed in tnftp on Solaris by Emil Mikulic.
2007-04-11 00:52:38 +00:00
christos 748af04e26 gcc4 does not care about &foo; use volatile instead. From Anon Ymous 2006-12-13 18:04:08 +00:00
christos c0179c282a spell precede; from Zafer 2006-11-25 16:48:31 +00:00
lukem 5b87c223c9 Use "see" instead of "c.f.".
Per feedback from Valeriy E. Ushakov.
2006-10-27 01:29:17 +00:00
christos f2640eb139 simplify 421 printing code (jani at xeebioneurope dot de) 2006-10-23 19:53:24 +00:00
elad 3bd9466e80 PR/32855: der Mouse: [dM] ftp -q is broken (or misdocumented)
Patch applied, thanks!
2006-10-07 10:49:14 +00:00
elad fb85339a04 PR/34540: b1ff at fr33 dot b33r dot net: bogus free() in ftp(1)
Applied patch, thanks!
2006-09-22 22:29:25 +00:00
lukem af2c479f62 If a file upload (via -u) fails, return an non-zero exit value based on the
index of the file that caused the problem (a la auto-fetch retrieval).
Problem noted by A P Garcia in private email.
2006-07-26 14:28:11 +00:00
jnemeth c287edd2a0 Coverity CID 3610: derefencing NULL pointer. 2006-05-23 23:59:48 +00:00
mrg 084c052803 quell GCC 4.1 uninitialised variable warnings.
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
christos 20fe0cf746 Coverity CID 1447: Avoid buffer overflow. 2006-05-01 23:02:03 +00:00
christos 186743bc31 Coverity CID 1448: Avoid static array overflow. 2006-05-01 23:00:33 +00:00
christos 69f8117233 Coverity CID 873: Only align if we printed a string. 2006-04-28 20:07:57 +00:00
christos 61e04d677f Coverity CID 874: Don't check local; it cannot be NULL. 2006-04-28 20:06:50 +00:00
christos fc5177078a Coverity CID 875: local is not allowed to be NULL; don't check for it. 2006-04-28 20:05:43 +00:00
christos 32d85d8f66 Coverity CID 2194: Don't forget to free port. 2006-04-28 20:02:07 +00:00
christos 5c8a52b0f1 Coverity CID 2195: Free path in all code paths, not some. 2006-04-28 19:59:44 +00:00
christos 76fc0d5b65 rename debug to ftp_debug. grr libssh. 2006-01-31 20:05:35 +00:00
christos e22794108e Rename xfoo() to ftp_foo() to avoid collisions with libssh. Don't ask. 2006-01-31 20:01:23 +00:00
christos 13d27fec78 recognize 307 redirect code. 2006-01-02 12:30:01 +00:00
lukem c114b2eb28 Don't clear the trailing character on the auth_url() username;
we now use getline() and that newline strips for us.
Problem found & fixed by Mark Davies.
2005-08-21 16:16:33 +00:00
lukem dccca90900 Revert back to using an int (instead of size_t) for holding a value that may
be negative.
Fixes progressbar display on terminals <43 columns wide.
Bug noted and solution suggested by Gavan Fantom.
2005-07-19 00:41:05 +00:00
wiz fdf8185afa In macdef, point to $ command (from jmc@openbsd), and split paragraph (it was getting a bit big). 2005-07-06 11:21:26 +00:00
wiz ee1fddfe1e Use more macros, and use them more consistently.
Fix a few typos.
2005-07-06 11:18:05 +00:00
lukem 5f450b0c4b Improve the description of the macros.
Patch from David H. Gutteridge in PR 24296.
2005-07-05 09:29:54 +00:00
christos b771909d19 forgot to remove the file pointer from the macro. 2005-06-29 05:00:30 +00:00