Commit Graph

220 Commits

Author SHA1 Message Date
Ander Juaristi 994c4dcce7 Remove unused variable in ftp code
* src/ftp.c (getftp): fix compiler warning for unused variable.
2015-12-13 16:06:53 +01:00
Ander Juaristi 160f0e908f Fix Coverity issues
* src/ftp.c (getftp): on error, close the file and attempt to remove it
   before exiting.
 * src/hsts.c (hsts_store_open): update modification time in the end.
2015-12-10 23:21:27 +01:00
Ygal Blum ad5a283528 Fix compilation when without-ssl is selected 2015-12-03 16:12:35 +01:00
Ander Juaristi f8901af4e0 Added support for FTPS
* doc/wget.texi: updated documentation to reflect the new FTPS functionality.
 * src/ftp-basic.c (ftp_greeting): new function to read the server's greeting.
   (ftp_login): greeting code was previously here. Moved to ftp_greeting to
   support FTPS implicit mode.
   (ftp_auth): wrapper around the AUTH TLS command.
   (ftp_ccc): wrapper around the CCC command.
   (ftp_pbsz): wrapper around the PBSZ command.
   (ftp_prot): wraooer around the PROT command.
 * src/ftp.c (get_ftp_greeting): new static function.
   (init_control_ssl_connection): new static function to start SSL/TLS on the
   control channel.
   (getftp): added hooks to support FTPS commands (RFCs 2228 and 4217).
   (ftp_loop_internal): test for new FTPS error codes.
 * src/ftp.h: new enum 'prot_level' with available FTPS protection levels +
   prototypes of previous functions. New flag for enum 'wget_ftp_fstatus' to track
   whether the data channel has some security mechanism enabled or not.
 * src/gnutls.c (struct wgnutls_transport_context): new field 'session_data'.
   (wgnutls_close): free GnuTLS session data before exiting.
   (ssl_connect_wget): save/resume SSL/TLS session.
 * src/http.c (establish_connection): refactor ssl_connect_wget call.
   (metalink_from_http): take into account SCHEME_FTPS as well.
 * src/init.c, src/main.c, src/options.h: new command line/wgetrc options.
   (main): in recursive downloads, check for SCHEME_FTPS as well.
 * src/openssl.c (struct openssl_transport_context): new field 'sess'.
   (ssl_connect_wget): save/resume SSL/TLS session.
 * src/retr.c (retrieve_url): check new scheme SCHEME_FTPS.
 * src/ssl.h (ssl_connect_wget): refactor. New parameter of type 'int *'.
 * src/url.c. src/url.h: new scheme SCHEME_FTPS.
 * src/wget.h: new FTPS error codes.
 * src/metalink.h: support FTPS scheme.
2015-09-14 10:16:44 +02:00
Tim Rühsen 075d755696 Fix IP address exposure in FTP code
* src/ftp.c (getftp): Do not use PORT when PASV fails.
* tests/FTPServer.px: Add pasv_not_supported server flag.
* tests/Makefile.am: Add Test-ftp-pasv-not-supported.px
* tests/Test-ftp-pasv-not-supported.px: New test

Fix IP address exposure when automatically falling back from
passive mode to active mode (using the PORT command). A behavior that
may be used to expose a client's privacy even when using a proxy.
2015-08-11 17:38:33 +02:00
Nikolay Merinov 0e6d6ca963 Fix timestamping and continue behaviour with ftp protocol.
* src/ftp.c (ftp_loop_internal): Add option `force_full_retrieve' that force to
retrieve full file.
(ftp_retrieve_list): Pass `true' as `force_full_retrieve' option to
`ftp_loop_internal' if we want to download file with newer timestamp than local
copy.
2015-05-01 00:28:08 +02:00
Tim Ruehsen 799c545722 src/ftp.c: make sure warc_tmp becomes closed before return
Reported-by: Coverity bug #1188044
2015-03-18 10:46:11 +01:00
Giuseppe Scrivano 16f1fb1d1f maint: update copyright year ranges to include 2015 2015-03-09 16:32:01 +01:00
Cong Ma 26790c3583 ftp: fix invalid pointer dereference in getftp() (tiny change)
The pointer respline in use after being passed to ftp_response() may be
uninitialized if ftp_response() fails.  Ensure that respline be used
after checking the return value of ftp_response().
2014-12-16 15:51:36 +01:00
Darshit Shah e6713474c0 Fix indentation in ftp.c (getftp) 2014-12-04 19:24:04 +05:30
Darshit Shah aaefe8bc83 Remove illogical assertion in ftp.c
A call to assert(1) will always fail and cause Wget to crash. If such a
situation does arise, Wget should invoke abort() and provide a useful
error message to the user prior to exiting.
2014-12-04 19:24:04 +05:30
Tim Ruehsen 4850e9c873 Replaced xfree_null() by xfree() and nullify argument after freeing. 2014-12-01 16:15:37 +01:00
Darshit Shah e94a542d0f Declare extern numurls in common header 2014-11-22 17:26:06 +05:30
Tim Rühsen 7b43510fe3 Fixes possible issues with Wget running in a turkish locale 2014-11-20 10:56:21 +01:00
Tim Rühsen 1356e90a14 Trivial fixes for C89 compliancy 2014-11-20 09:56:57 +01:00
Tim Rühsen 148065bc00 content for commit 6092205538 2014-10-29 16:18:01 +01:00
Darshit Shah 69c45cba43 Add checks for valid listing file in FTP
When Wget retrieves a file through FTP, it first downloads a .listing
file and parses it for information about the files and other metadata.
Some servers may serve invalid .listing files. This patch checks for one
such known inconsistency wherein multiple lines in a listing file have
the same name. Such a filesystem is clearly not possible and hence we
eliminate duplicate entries here.

Signed-off-by: Darshit Shah <darnir@gmail.com>
2014-10-27 09:18:13 +01:00
Giuseppe Scrivano c03855be40 ftp: Replace main() with main in comments. 2014-06-12 18:49:16 +02:00
Giuseppe Scrivano 8e6de1fb5f Drop usage of strncpy 2014-06-12 18:49:13 +02:00
Darshit Shah 4eeabffee6 More progress bar aesthetic changes
This commit introduces two new changes to how the progress bar looks:
1. Support the --progress=bar:noscroll option which will prevent the filename
   from scrolling in the progress bar
2. Print human readable value for the amount already downloaded for any file
2014-05-30 13:28:02 +05:30
Tim Ruehsen 38a7829dcb Fix compiler warnings 2014-05-12 12:18:50 +02:00
Darshit Shah 8c2fd06ba8 Add --show-progress to force display progress bar
This is a relatively large commit that implements two major features:

1. Implement --show-progress switch to force the display of the progress bar in
   any verbosity level
2. Edit the implementation of the progress bar so that the filename is displayed
   in the same line.
2014-05-01 01:07:43 +02:00
Darshit Shah 97787110a2 Fix compiler warnings 2014-03-26 12:38:39 +01:00
Yousong Zhou dfa1f4e064 Make wget capable of starting downloads from a specified position.
This patch adds an option `--start-pos' for specifying starting position
of a HTTP or FTP download.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2014-03-21 11:21:00 +01:00
Andrea Urbani c3835a425a "LIST" or "LIST -a" ftp command according to the remote system 2013-10-28 23:37:10 +01:00
Tomas Hozza c78caecbb4 Document missing options and fix --preserve-permissions
Added documentation for --regex-type and --preserve-permissions
options.

Fixed --preserve-permissions to work properly also if downloading a
single file from FTP.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2013-07-11 22:01:43 +02:00
Tim Ruehsen 4df7703d62 fix segfault in ftp.c (ftp_loop_internal) 2013-06-22 13:22:24 +02:00
Tim Ruehsen 099d8ee3da replaced read_whole_file() by getline() 2013-05-17 20:19:02 +02:00
Nikolay Merinov 13c6e7832a Recieve ftp listing even when .listing file exist and --no-clobber option is given. 2012-10-07 15:22:34 +02:00
Tim Ruehsen 196f70a7df Silent compiler warning. 2012-04-21 13:48:18 +02:00
Gijs van Tulder e3820953b2 Add support for WARC files. 2011-11-04 22:25:00 +01:00
Steven Schweda 8c7bd588fe Fix some problems under VMS. 2011-10-23 13:11:22 +02:00
Giuseppe Scrivano bbe6b86c9e Return a network failure when FTP downloads fail and --timestamping is used. 2011-09-13 10:11:46 +02:00
Giuseppe Scrivano 3a62674582 Fix some memory leaks. 2011-03-11 15:25:58 +01:00
Giuseppe Scrivano 2f6aa1d741 mass change: update copyright years. 2011-01-01 13:19:37 +01:00
Giuseppe Scrivano 9ae052b1e2 Remove redundant guard. 2010-12-01 13:15:13 +01:00
Giuseppe Scrivano 8aa378bd9e Revert 2444. 2010-11-22 18:04:42 +01:00
Giuseppe Scrivano 2aa2a913c3 On a network error, attempt to resume the download, not restart it. 2010-11-21 22:56:20 +01:00
Giuseppe Scrivano a2596ccf21 Fix an infinite loop with error message '<filename> has sprung into existence' 2010-11-19 17:14:21 +01:00
Giuseppe Scrivano 7ae38d431e Fix indentation. 2010-10-11 22:49:14 +02:00
Steven Schubiger af928aaaaa Fix compiler warning. 2010-10-11 22:46:00 +02:00
Merinov Nikolay b5c9573ad6 Add --unlink. 2010-09-29 13:34:09 +02:00
Dennis, CHENG Renquan 6230b73df0 Fix problem when content-disposition is used with recursive downloading. 2010-09-24 14:07:58 +02:00
Giuseppe Scrivano 3e25a9817f Introduce --trust-server-names. Close CVE-2010-2252. 2010-07-28 21:22:22 +02:00
Leonid Petrov 29c0b3cc07 Fix symlinks resume via FTP. 2010-07-20 13:09:43 +02:00
Giuseppe Scrivano 29305e059f Rewrite last change considering SIZE return value, otherwise what RETR returns 2010-07-14 23:06:20 +02:00
Giuseppe Scrivano 6ef8c69c9d Take the maximum value between RETR and SIZE bytes counts for the file size 2010-07-14 01:23:17 +02:00
Giuseppe Scrivano 293008f682 Mass update copyright years. 2010-05-08 21:56:15 +02:00
Steven Schubiger a801efcd96 Don't delete an input file fetched via FTP. 2010-03-04 22:09:31 +01:00
Steven Schubiger ec6950f1a6 Make -i work with FTP. 2010-03-02 00:00:17 +01:00