summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/fetch.c
AgeCommit message (Collapse)Author
2013-11-07more volatile for m68kchristos
2013-11-03let progressmeter deal with the timeout once we've started transferring.christos
2013-11-02PR/34796: Hauke Fath: ftp does not timeout on http fetches.christos
2013-02-23fix restart from anon ymouschristos
2012-12-22compile without SSLchristos
2012-12-22document https support, mentioning certificates are not validated, and obeychristos
https_proxy.
2012-12-21PR/47276: Add https supportchristos
2012-07-04As discussed on tech-net@: Don't display expected EHOSTUNREACH for all butis
the last connect attempts in terse mode.
2012-02-24subtracting two pointers yields ptrdiff_t, so cast it to int.apb
2012-02-24When given an URL that contains "://" but is not recognised,apb
print an error message. Now "ftp https://foo/bar" prints ftp: Unsupported URL scheme `https' instead of ftp: Can't lookup `https:ftp': No address associated with hostname ftp: Can't connect or login to host `https:?'
2011-12-10Move determination of socket buffer sizes from startup to the firstlukem
time a socket is used, as the previous logic assumed AF_INET sockets were available (which they may not be in an IPv6-only system). Per discussion with Maxim Konovalov and the FreeBSD problem 162661.
2011-09-16Use __deadjoerg
2010-03-05Back to using 'RFC xxxx' instead of 'RFCxxxx'lukem
2010-03-04Parse HTTP 'Date' entries in the `C' locale rather than the user's.lukem
Fix from [bin/42917] (with minor changes), from KAMADA Ken'ichi.
2009-08-17back out previous; luke says:christos
'@' is a reserved URI char per RFC 3986, use %40
2009-08-16use strrchr to find the last @ because we might want the username to containchristos
user@domain.
2009-08-13avoid NULL dereference in log output if the command line parserdrochner
failed to extract a port number from the URL
2009-07-13Rename internal getline() function to get_line() so it doesroy
conflict with the soon to be added getline(3) libc function.
2009-04-12Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare).lukem
2009-04-12fix -Wshadow issueslukem
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-22Use the service name to getaddrinfo() (along with the host name), so thatlukem
features such as DNS Service Discovery have a better chance of working. Suggested by David Young <dyoung>. Display the service name in various status & error messages. Don't getservbyname() the :port component of a URL; RFC 3986 says it's just an unsigned number, not a service name.
2007-12-05DPRINTF() consistency tweakslukem
2007-08-22Cast the field precision calculation to int.lukem
Should fix the amd64 build problem noticed by Paul Goyette.
2007-08-22Improve parsing of chunked transfer chunks per RFC2616:lukem
* more stringent chunk-size parsing * ignore optional trailing ';chunk-ext' stuff, instead of barfing * detect EOF before final \r\n.
2007-06-05Enforce restriction that (http) proxied URL fetchs don't supportlukem
being restarted at this time. PR #28697.
2007-05-24Display times in RFC2822 form rather than using ctime(3), sincelukem
the former is more explicit about the timezone offset.
2007-05-22* main: call tzset() to ensure TZ is setup for other <time.h> functions.lukem
* remotemodtime(): use strptime() to parse the reply. * fetch_url(): ensure struct tm is zeroed before calling strptime().
2007-05-15* Modify parse_url() to consistently strip the leading `/' off ftp URLs.lukem
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-10Switch from fparseln() to the internal getline() when parsing HTTP headers.lukem
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-04-17* Implement -s srcaddr; uses srcaddr as the local IP address for alllukem
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-11getpass() can return NULL upon error in some implementationslukem
(as documented in older standards documents, before the API was obsoleted). Problem observed in tnftp on Solaris by Emil Mikulic.
2006-12-13gcc4 does not care about &foo; use volatile instead. From Anon Ymouschristos
2006-11-25spell precede; from Zaferchristos
2006-09-22PR/34540: b1ff at fr33 dot b33r dot net: bogus free() in ftp(1)elad
Applied patch, thanks!
2006-07-26If a file upload (via -u) fails, return an non-zero exit value based on thelukem
index of the file that caused the problem (a la auto-fetch retrieval). Problem noted by A P Garcia in private email.
2006-04-28Coverity CID 2194: Don't forget to free port.christos
2006-04-28Coverity CID 2195: Free path in all code paths, not some.christos
2006-01-31rename debug to ftp_debug. grr libssh.christos
2006-01-31Rename xfoo() to ftp_foo() to avoid collisions with libssh. Don't ask.christos
2006-01-02recognize 307 redirect code.christos
2005-08-21Don't clear the trailing character on the auth_url() username;lukem
we now use getline() and that newline strips for us. Problem found & fixed by Mark Davies.
2005-06-29Add NO_USAGE and NO_DEBUG so that we can fit in the floppies again.christos
2005-06-10Implement:lukem
int getline(FILE *stream, char *buf, size_t buflen, const char **errormsg) Read a line from the FILE stream into buf/buflen using fgets(), so up to buflen-1 chars will be read and the result will be NUL terminated. If the line has a trailing newline it will be removed. If the line is too long, excess characters will be read until newline/EOF/error. Various -ve return values indicate different errors, and errormsg will be changed to an error description if it's not NULL. Convert to use getline() instead of fgets() whenever reading user input to ensure that an overly long input line doesn't leave excess characters for the next input operation to accidentally use as input. Zero out the password & account after we've finished with it. Consistently use getpass(3) (i.e, character echo suppressed) when reading the account data. For some reason, historically the "login" code suppressed echo for Account: yet the "user" command did not! Display the hostname in the "getaddrinfo failed" warning. Appease some -Wcast-qual warnings. Fixing all of these requires significant code refactoring. (mmm, legacy code).
2005-06-01* Only print the "Trying <address>..." message if verbose andlukem
there's more than one struct addrinfo in the getaddrinfo() result. * Don't use non-standard "u_int".
2005-05-29* fetch_ftp(): preserve 'anonftp' across a disconnect() so that multiplelukem
ftp auto-fetches on the same command line login automatically. * auto_fetch(): use an initialized volatile int to appease IRIX cc.
2005-05-19Use size_t instead of int where appropriate.lukem
2005-05-14Fix some cast issues highlighted by Scott Reynolds using gcc 4 on OSX.4lukem
2005-04-11gratuitous whitespace cleanup (before someone else jumps the gun...)lukem
2005-04-10In fetch_url(), don't call freeaddrinfo(res0) too early, as we use pointerslukem
to its contents later in the function. Problem found by Onno van der Linden.