941 Commits

Author SHA1 Message Date
Tim Rühsen
8775506f63 * src/http.c (http_loop): Fix memory leak 2024-06-09 20:00:45 +02:00
Tim Rühsen
567e67afd2 * src/retr.c (retrieve_from_url_list): Fix memory leak 2024-06-09 19:35:30 +02:00
Tim Rühsen
afa979b43f * src/retr.c (retrieve_from_file): Fix memleak 2024-06-02 14:26:01 +02:00
Tim Rühsen
cd643458b4 * src/warc.c (warc_close): Fix memleak 2024-06-02 14:22:17 +02:00
Tim Rühsen
b88ad88253 * src/warc.c (warc_start_new_file): Simplify code 2024-06-02 14:22:12 +02:00
Tim Rühsen
62fffab577 * src/httpc.c (http_loop): Fix memleak 2024-06-02 14:22:03 +02:00
Tim Rühsen
ecb59f2e02 * src/init.c (cleanup): Do not close stdout on exit 2024-06-02 14:21:58 +02:00
Tim Rühsen
42c83d8972 * src/iri.c (do_conversion): Initialize memory from realloc() 2024-06-02 14:20:06 +02:00
Tim Rühsen
bb0aa299e9 * src/warc.c (warc_write_end_record): Check warc_write_ok (fix use-after-free)" 2024-06-02 14:20:00 +02:00
Tim Rühsen
0490e301d4 * src/wget.h (DO_REALLOC): Initialize realloc'ed memory to help valgrind 2024-06-02 14:19:53 +02:00
Tim Rühsen
a582633c97 * src/utils.c (run_with_timeout): Set SIGALRM handler before setjmp() (reported by valgrind) 2024-06-02 14:19:50 +02:00
Tim Rühsen
5fe01167d1 * fuzz/wget_options_fuzzer.c: Fix indentation 2024-06-02 14:19:42 +02:00
Tim Rühsen
ed0c7c7e0e Properly re-implement userinfo parsing (rfc2396)
* src/url.c (url_skip_credentials): Properly re-implement userinfo parsing (rfc2396)

The reason why the implementation is based on RFC 2396, an outdated standard,
is that the whole file is based on that RFC, and mixing standard here might be
dangerous.
2024-06-02 12:40:21 +02:00
Tim Rühsen
bb59ef7fd4 * fuzz/Makefile.am (oss-fuzz): Add -lgmp 2024-05-24 19:20:32 +02:00
Darshit Shah
196ce0abd6 Support continious reading from stdin pipes
Rather than reading from stdin only once, leave the pipe open until the
other end closes it and keep reading from the file after each set of
URLs is read

* src/html-url.h(get_urls_file): Update prototype to add additional
  param
* src/html-url.c(get_urls_file): Pass through read_again to
  wget_read_from_file.
* src/retr.c(retrieve_from_file): Split the function into two. Introduce
  `retrieve_from_url_list` that actually performs the retrieval.
  Also, if `url_list` returns that the fd has been left open, then
  continue reading from it until the fd is closed.
  (retrieve_from_url_list): New function that does the retrieval from
  a list of URLs that was read from a file.
* src/utils.c(wget_read_from_file): Rename old function `wget_read_file`
  to this.
  Accept an additional output parameter that states whether the fd was
  left open and if we should continue reading from it after the current
  set of URLs have been processed
  (wget_read_file): Write it as a new wrapper function around
  `wget_read_from_file` to maintain API comptability across other users
2024-05-12 17:57:30 +02:00
Tim Rühsen
ca10f20aaf * gnulib: Update 2024-04-27 19:25:00 +02:00
Tim Rühsen
f6291c33cd Update gnulib link libraries
* fuzz/Makefile.am: Update gnulib link libraries.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
2024-04-20 16:19:51 +00:00
Sam James
5f0aa59239 Fix libproxy build with --disable-debug
The definition of debug_logprintf in src/log.c is guarded by ENABLE_DEBUG
(although its prototype is unconditionally available in src/log.h).

The uses of debug_logprintf in src/retr.c aren't guarded by ENABLE_DEBUG.

Use the DEBUGP macro which is designed for this purpose.

* src/retr.c (getproxy): Use DEBUGP macro.

Fixes: https://gitlab.com/gnuwget/wget/-/issues/19
Copyright-paperwork-exempt: Yes
2024-04-16 02:23:56 +00:00
Darshit Shah
1c934e67de Add a new testcase for pathconf truncation
* testenv/Test-recursive-pathmax.py: Add a new testcase. This test tries
  to check that Wget allows downloading long filenames as far as allowed
  by the OS and filesystem.
2024-03-16 19:14:57 +01:00
Darshit Shah
903373a83c * contrib/make-release: Automatically build and update online documentation 2024-03-11 23:46:36 +01:00
Darshit Shah
480e9d6efd * contrib/make-release: More minor fixes 2024-03-10 15:21:08 +01:00
Darshit Shah
637e58ad50 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2024-03-10 15:10:58 +01:00
Darshit Shah
dad28423c6 version 1.24.5
* NEWS: Record release date.
2024-03-10 15:08:04 +01:00
Darshit Shah
fdb4ae8ffe * contrib/make-release: Some more release management 2024-03-10 15:05:53 +01:00
Darshit Shah
999700ac5f * NEWS: Update the noteworthy NEWS 2024-03-10 11:25:53 +01:00
Darshit Shah
c9cc2e1d24 * bootstrap.conf: Organize alphabetically 2024-03-10 11:10:06 +01:00
Darshit Shah
a3158065a3 * gnulib: Update to the latest version 2024-03-10 11:03:33 +01:00
Tim Rühsen
e54a1f910e Remove obsolete Travis CI files
* .travis.yml: Remove.
* contrib/travis-ci: Remove.
2024-03-03 17:46:42 +01:00
Tim Rühsen
b32cc7afe0 Fix HSTS matching
* src/hsts.c (hsts_find_entry): Check for includeSubdomains,
  (test_hsts_new_entry): Fix test,
  (test_hsts_url_rewrite_superdomain): Improve test.

Reported-by: Hanno Böck <hanno@hboeck.de
2024-02-24 19:12:59 +01:00
Darshit Shah
3aa53a6220 Delete some redundant tests
* tests/Makefile.am: Remove some tests that are redundant with the
  Python testenv
* tests/Test-auth-basic.px: Delete file
* tests/Test-auth-no-challenge.px: Same
* tests/Test-auth-no-challenge-url.px: Same
* tests/Test-auth-retcode.px: Same
* tests/Test-auth-with-content-disposition.px: Same
* tests/Test-k.px: Same
2024-02-19 19:23:25 +05:30
Darshit Shah
0e0cdc2409 * Makefile.am: Ignore some lcov errors, allowing the tests to run through 2024-02-19 19:21:03 +05:30
Darshit Shah
84a75ace88 * README: Add a link to the COPYING file to meet the GNU Coding Standards 2024-02-19 18:43:12 +05:30
Darshit Shah
35204ab5d7 * bootstrap: Update script from gnulib 2024-02-19 18:37:51 +05:30
Darshit Shah
e377b80863 * gnulib: Update gnulib 2024-02-19 18:35:26 +05:30
Darshit Shah
f973f4857a * Update copyright year to 2024 2024-02-19 18:33:43 +05:30
Darshit Shah
f4da5456c2 Add tests for --convert-links option
* testenv/Makefile.am: Add two new tests, Test-k.py and Test-https-k.py
* testenv/Test-k.py: New file. Add a test based on tests/Test-k.px
* testenv/Test-https-k.py: New file. Add a new test to ensure that the
  protocol of the original host URL is retained when creatign absolute
  links.

This test is added as a result of an issue reported on StackExchange:
https://superuser.com/questions/1348940/making-wgets-convert-links-respect-http-vs-https
2024-02-19 18:27:38 +05:30
Darshit Shah
dfb9f65fc3 * testenv/conf/expected_files.py: Aesthetic changes only. Format file with black 2024-02-19 18:27:32 +05:30
Darshit Shah
642e740182 * testenv/conf/expected_files.py: Nicer diff printing on error 2024-02-19 18:27:19 +05:30
Darshit Shah
28009a048f * SECURITY.md: Add a file stating how to report security issues 2024-02-18 17:07:19 +05:30
Tim Rühsen
4100339a2b Parse 'srcset' HTML attr for 'source' HTML tag.
* src/html-url.c (struct known_tag): Use tag_handle_img() for 'source' tag.
* testenv/Test-recursive-include.py: Extend test.
2024-01-27 19:50:13 +01:00
Tim Rühsen
bedeb7dc27 * src/netrc.c (parse_netrc_fp): Add fetchmail compatibility (user and passwd)
Reported-by: Gerald Pfeifer <gerald@pfeifer.com>
2023-11-26 19:06:11 +01:00
Tim Rühsen
25525f8037 Fix confusing 'Cannot write to ... (Success)' message
* src/http.c (gethttp): Store/restore errno value.

Reported-by: Christian Rosentreter, Andries E. Brouwer
2023-10-22 14:01:09 +02:00
Jan-Michael Brummer
8e8900613c Add libproxy support
Add support for libproxy, which is capable to extract desktop
environment proxy configurations from dozens of systems and platforms.
This also enables wget to handle pac/wpad proxy server.

* configure.ac: Add check for libbproxy.
* src/retr.c (getproxy): Retrieve proxy via libproxy.

Copyright-paperwork-exempt: Yes
2023-10-20 18:08:01 +02:00
Tim Rühsen
73d24b2779 * src/retr.c: Fix sc_prohibit_empty_lines_at_EOF 2023-08-03 11:32:09 +02:00
Tim Rühsen
04ab356669 Fix crash when printing download rate
If the download rate is TB/s, a read buffer overflow happended
that either caused a crash or printed whatever string was pointed to.

* src/retr.c (retr_rate): Add missing array entrie for TB/s and Tb/s,
  (test_retr_rate): New test function.
* tests/unit-tests.c (all_tests): Run test 'test_retr_rate'.
* tests/unit-tests.h: Add prototype for test_retr_rate.

Reported-by: Wiebe Cazemier <wiebe@halfgaar.net>
2023-08-03 11:19:41 +02:00
Christian Weisgerber
4d99bb1ff1 * tests/Makefile.am: Remove './' from for portability (OpenBSD)
Copyright-paperwork-exempt: Yes
2023-08-03 10:39:56 +02:00
Yaakov Selkowitz
9c8668048d testenv: fix for Python 3.12
* testenv/server/http/http_server.py (HTTPSServer): Update for
  ssl.SSLContext APIs instead of deprecated ssl.wrap_socket().

ssl.wrap_socket() was deprecated in 3.7 and removed in 3.12.
This should be compatible back to 3.6 (RHEL 8 and newer).

Copyright-paperwork-exempt: Yes
2023-07-16 14:08:30 +02:00
Tim Rühsen
3583fa0c61 * src/url.c (test_uri_merge): Fix check 2023-07-01 18:20:32 +02:00
Tim Rühsen
834d090bf6 Add new unit test test_uri_merge()
* src/url.c: New test function test_uri_merge().
* tests/unit-tests.c (tests/unit-tests.c): Call test_uri_merge().
* tests/unit-tests.h (tests/unit-tests.h): Declare test_uri_merge().
2023-07-01 18:14:00 +02:00
Darshit Shah
fbbdf9ea01 Ensure that spaces are quoted when converting links
* src/convert.c(convert_links): Print the actual quoted newname when printing DEBUG output
  (local_quote_string): Also quote the ' ' charcter as %20. While it is okay
  to leave the characted as-is, quoting it covers more edge cases.
  And it should resolve a >10 year old bug with CSS url() parameters not being quoted

Bug-Id: 64082
Reported-By: Ethan Gibbs <ethan@snowsign.net>
Discussed-At: https://stackoverflow.com/q/13300017
2023-05-16 18:46:19 +02:00
Darshit Shah
5409cbcee2 Add new test to ensure CSS url() encoding
url() parameters in CSS cannot have spaces in them. Ensure that Wget does not do that
when using --convert-links

* testenv/test_css_url.py: New file
* testenv/Makefile: Add test_css_url.py to tests

Bug-Id: 64082
2023-05-16 00:11:25 +02:00
Darshit Shah
0fea7bc076 Automatically verify if commit author has assigned copyrights in the past
* contrib/commit-check: Add new script
* .gitlab-ci.yml: Add new test in the CI pipeline
2023-05-14 21:55:01 +02:00
Jan Palus
6ca59f4d60 * testenv/conf/expected_files.py: Ignore common.conf
Copyright-paperwork-exempt: Yes
2023-05-14 21:55:01 +02:00
Darshit Shah
27a832aee9 * AUTHORS: Rework file to prepare for autmated testing 2023-05-14 21:55:01 +02:00
Darshit Shah
719ab50a18 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2023-05-11 03:02:48 +02:00
Darshit Shah
76ab37bff9 contrib/make-release: Update regexes to match the NEWS file 2023-05-11 02:22:45 +02:00
Darshit Shah
774705838f cfg.mk: Replace uses of filesystem with file system 2023-05-11 01:03:23 +02:00
Darshit Shah
e234354080 Update NEWS 2023-05-11 00:48:44 +02:00
Darshit Shah
3a5ca80a1a bootstrap.sh: Update script from gnulib 2023-05-10 23:59:55 +02:00
Darshit Shah
c3fadea0a8 gnulib: Pull forward 2023-05-10 23:57:52 +02:00
jinfuchiang
2b723806a5 Update deprecated option '--html-extension' to '--adjust-extension'
* doc/wget.texi: Update option '--html-extension' to '--adjust-extension'.
  Renamed in Wget 1.12 to better reflect its behavior.

Copyright-paperwork-exempt: Yes
2023-04-09 20:29:07 +02:00
Tim Rühsen
9a35fe609c Don't write core dump if --secure-option value isn't suppported. 2023-03-19 17:39:45 +00:00
Tim Rühsen
d96d20630b * src/retr.c (fd_read_body): Increase bufsize from 8k to 64k 2023-02-18 17:26:23 +01:00
Tim Rühsen
c77c95033a * src/retr.c (fd_read_body): Simplify gzip initialization 2023-02-18 17:26:23 +01:00
Tim Rühsen
af1100f299 * src/retr.c (fd_read_body): Use MAX instead of max 2023-02-18 17:26:23 +01:00
Tim Rühsen
77929eda1b Simplify url_error function.
* src/url.c (url_error): simplify, remove url arg, return const char *.
* src/url.h (url_error): remove url arg, return const char *.
* src/html-url.c (get_urls_file): Simplify call to url_error(),
  remove call to free().
* src/http.c (metalink_from_http): Likewise.
* src/main.c (main): Likewise.
* src/metalink.c (retrieve_from_metalink, fetch_metalink_file): Likewise.
* src/recur.c (retrieve_tree): Likewise.
* src/res.c (res_retrieve_file): Likewise.
* src/retr.c (retrieve_url, retrieve_from_file): Likewise.
2023-02-18 17:25:56 +01:00
Tim Rühsen
218f6fee30 * src/url.c: Refactored url_error() 2023-02-18 17:25:56 +01:00
Tim Rühsen
2339d79b05 * tests/valgrind-suppressions: Add rule for 'strcmp-sse2.S in libdl.so' 2023-02-18 17:25:56 +01:00
Tim Rühsen
dcd2ed739e * configure.ac: Remove CC flags -Wc90-c99-compat and -Wlong-long 2023-02-17 14:00:02 +01:00
Tim Rühsen
24e876357a * fuzz/*: Use grep >/dev/null instead of grep -q 2023-02-17 13:46:58 +01:00
Tim Rühsen
8247a34521 * src/retr.c: Don't include hash.h 2023-02-17 13:46:58 +01:00
Tim Rühsen
4223996930 Update copyright years 2023-02-17 13:46:58 +01:00
Tim Rühsen
27d3fcba33 * gnulib: Update 2023-02-17 13:46:58 +01:00
Tim Rühsen
c69030a904 * configure.ac: Disable nettle if NTLM is explicitly disabled 2022-12-11 13:31:38 +01:00
Tim Rühsen
485217d0ff * configure.ac: Allow disabling NTLM if nettle present (Savannah #63431) 2022-12-10 16:43:38 +01:00
Tim Rühsen
9835085544 * fuzz/Makefile.am: Add -lz to fuzzer libs 2022-09-24 18:41:31 +02:00
Tim Rühsen
aab539bb44 * src/main.c (print_help): Add --retry-on-host-error to help text 2022-03-20 21:07:54 +01:00
Tim Rühsen
cb114fbbf7 Fix HSTS portability by using int64_t instead of time_t.
* src/hsts.c: Use int64_t instead of time_t.
* src/http.c: Use int64_t for parsing Strict-Transport-Security.
2022-03-20 20:57:10 +01:00
Tim Rühsen
1cda2bb5d5 src/http.c (time_to_rfc1123): Fix -Wformat-nonliteral 2022-03-20 20:53:10 +01:00
Tim Rühsen
565f566fab * src/warc.c (warc_process_cdx_line): Fix variable type to idx_t 2022-03-20 20:49:07 +01:00
Tim Rühsen
c7e6e378e5 * src/main.c (secs_to_human_time): Use snprintf instead of sprintf 2022-03-20 20:45:59 +01:00
Tim Rühsen
59d08d3290 * src/main.c (main): Remove unused variable 2022-03-20 20:44:32 +01:00
Tim Rühsen
8d5cdef9a9 * src/netrc.c (test_parse_netrc): Check if HAVE_FMEMOPEN is defined 2022-03-20 15:57:21 +01:00
Darshit Shah
9f93ffb44b maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2022-02-26 17:27:55 +01:00
Darshit Shah
40747a11e4 * NEWS: Update NEWS items for release 2022-02-26 17:20:26 +01:00
Darshit Shah
b6f3c6153e * .gitignore: Remove empty line at EOF 2022-02-26 17:02:26 +01:00
Darshit Shah
e1fa51206c * .gitignore: Update file 2022-02-26 16:54:51 +01:00
Darshit Shah
6d4a4e56c8 * src.hsts.c(hsts_read_database): Use SCNd64 for portable format flags 2022-02-26 16:51:21 +01:00
Darshit Shah
14a7f68f46 * configure.ac: Add some warning flags to ignore 2022-02-26 16:50:48 +01:00
Darshit Shah
ccc7866fea * cfg.mk: Remove passing syntax-checks from skip list 2022-02-26 16:24:57 +01:00
Darshit Shah
2730a00c0d Fix issues from syntax-check
* doc/wget.texi: s/time stamp/timestamp/
* src/ftp-ls.c(clean_line): Same
  (ftp_parse_vms_ls): Don't cast return value of x*alloc
* src/ftp.c: Don't cast return value of alloca
* src/css-url.c: wget.h should be the first include
* testenv/Makefile.am: Use $(PATH_SEPARATOR) instead of : when declaring
  a path
* testenv/Test-no_proxy-env.py: s/can not/cannot/
2022-02-26 16:20:30 +01:00
Darshit Shah
be936bda56 * Update Copyright years 2022-02-26 15:49:52 +01:00
Darshit Shah
7ba0a44939 * bootstrap: Update script 2022-02-26 15:45:03 +01:00
Darshit Shah
98c23153a2 * gnulib: Pull forward 2022-02-26 15:45:02 +01:00
Darshit Shah
3a470a90f2 Cleanup some incorrect uses of AM Conditionals
* configure.ac: Replace IRI_IS_ENABLED with WITH_IRI and
      METALINK_IS_ENABLED with WITH_METALINK
    * src/Makefile.am: Add the .c and .h files for IRI, Metalink and
      Xattr support to wget_SOURCES directly when needed instead of
      adding them as object files.
    * testenv/Makefile.am: Rename METALINK_IS_ENABLED to WITH_METALINK
2022-02-26 15:45:02 +01:00
Darshit Shah
f5263969fa Replace incorrect usage of AC_LIBOBJ in configure.ac
AC_LIBOBJ is to be used for providing replacement functions for
compatibility reasons. Not for conditional compilation of entire source
files. Autotools provides other methods for achieving that. However, our
build system has (ab-)used the AC_LIBOBJ macros for doing this for over
15 years. That stops today.

    * configure.ac: Replace uses of AC_LIBOBJ with automake conditionals
      that can be used in Makefiles
    * src/Makefile.am: Use the defined conditionals to select which
      files get built.
2022-02-26 15:20:29 +01:00
Darshit Shah
cc5ec2a158 Fix case where installed gettext is newer than minimum version
* configure.ac: Use AM_GNU_GETTEXT_REQUIRE_VERSION to specify a minimum
  version of gettext needed. This should allow newer versions of gettext
  to be copied for autipoint to use when available.

This commit hopefully fixes the annoying issue when building from
source on a system that has a newer version of gettext.
2022-02-25 17:25:30 +01:00
Tim Rühsen
f7ce79fd85 * src/netrc.c (test_parse_netrc): Free netrc structure 2022-02-13 18:00:07 +01:00
Tim Rühsen
d139fecbe8 * .gitlab-ci.yml: Fix path to llvm-symbolizer 2022-02-13 17:57:39 +01:00
Tim Rühsen
74a9d9e7c4 * src/netrc.c (test_parse_netrc): New unit test function 2022-02-13 17:28:02 +01:00
Aarni Koskela
446afdca21 * src/http.c (parse_strict_transport_security): Fix typo in string
Copyright-paperwork-exempt: Yes
2022-01-31 18:01:51 +01:00
Tim Rühsen
e6fa409a4d * .gitlab-ci.yml (Scan-Build): Allow failure due to two false positives 2022-01-23 14:10:49 +01:00
Tim Rühsen
a24e67e239 * configure.ac: Use pkg-config for gpgme, libidn2 and nettle 2022-01-23 14:10:49 +01:00
Tim Rühsen
c984cb316a * src/ftp.c: Small cleanups 2022-01-22 19:53:26 +01:00
Nik Soggia
35a6317b99 Print newline after dot progress bar in non-verbose mode
* src/progress.c (dot_finish): Print new in all progress bar contexts
  instead of just verbose

Copyright-paperwork-exempt: Yes
2022-01-16 00:01:39 +01:00
Tim Rühsen
9474a2c6f4 * .gitlab-ci.yml: Fix artifact path for the Scan-Build runner 2022-01-12 22:10:01 +01:00
Tim Rühsen
e7a4d818fa * src/main.c (main): Unlink output document when --unlink is given 2022-01-09 18:58:41 +01:00
Tim Rühsen
f354529708 fuzz/*.in: Update fuzzer corpora 2021-12-22 19:49:24 +01:00
Tim Rühsen
67d4cb3ab6 * .gitlab-ci.yml (CoverageReports): Fix artifacts paths 2021-12-22 17:00:47 +01:00
Tim Rühsen
d2af84fbb3 * tests/valgrind-suppressions: Fix libidn rule 2021-12-22 14:32:50 +01:00
Tim Rühsen
bfb5bedf7d * .gitlab-ci.yml: Fix artifacts paths 2021-12-22 14:29:00 +01:00
Tim Rühsen
8c5a620f0f * tests/valgrind-suppressions: Extend libidn rule 2021-12-22 14:01:47 +01:00
Tim Rühsen
c34c2529dc * src/log.c (logprintf): Check earlier for verbosity 2021-12-22 13:07:23 +01:00
Tim Rühsen
c7a37d82ee * src/http.c (http_loop): Fix memleak 2021-12-22 13:06:34 +01:00
Tim Rühsen
c81042295e Switch fuzzing build from C++ to C
* Makefile.am (oss-fuzz): Build with $CC instead of $CXX.
* README.md: Remove CXX and CXXFLAGS exports.
2021-12-21 19:20:52 +01:00
Darshit Shah
f75fcf2985 * src/http.c (http_loop): Hide password when printing status with -nv
Reported-By: Per Lundberg <perlun@gmail.com>
Closes: #61492
2021-12-01 23:38:52 +01:00
Darshit Shah
22611a77ba * gnulib: Pull forward 2021-12-01 23:03:56 +01:00
Darshit Shah
e1bacd2fa5 * src/hsts.c (hsts_read_database): Read time_t values as long long 2021-12-01 22:42:42 +01:00
Thomas Niederberger
faeb4d90c2 * src/main.c (print_help): Add command line option for TLS 1.3 2021-12-01 22:17:11 +01:00
Darshit Shah
65e6d5b3b8 * retr.c (rotate_backups): Non existent files are not errors in this function 2021-10-11 23:06:38 +02:00
Darshit Shah
aecf5fbf1b * ftp.c (ftp_loop_internal): Fix computation of total_downloaded_bytes
When continuing a FTP download, or not starting one because the file is
already fully retrieved, don't include the size of the file in the
total_downloaded_bytes. Only the actual amount of data retrieved over
the network should be considered there.

Fixes: #61277
Reported-By: Michal Ruprich <formaiko>
2021-10-08 20:37:51 +02:00
Darshit Shah
3ea9658c07 Remove suprious print statements
* src/gnutls.c: Remove fprintf statements. We should never print to
  console directly. Always honor the log levels.
  Fixes: #61125
2021-09-08 17:52:32 +02:00
Darshit Shah
31b82825a2 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2021-09-07 21:04:48 +02:00
Darshit Shah
d5588ac221 * NEWS: Update NEWS items for release 2021-09-07 20:57:24 +02:00
Darshit Shah
204a4bccf4 * cfg.mk: Disable the indent check 2021-09-07 20:57:24 +02:00
Darshit Shah
5a79362a56 * gnulib: Pull forward 2021-09-07 20:12:55 +02:00
WB
ebb96761f5 Fix #60956 (improve --page-requisites)
* src/html_url.c (tag_handle_link): Check for "alternate stylesheet",
  "icon" and "manifest".
2021-08-21 19:51:12 +02:00
Tim Rühsen
7899e1d17b * src/html-url.c (tag_handle_meta): Fix integer overflow 2021-08-07 14:29:02 +02:00
Tim Rühsen
254b2d3c7c * src/recur.c (download_child): Remove temporary robots.txt.tmp 2021-07-05 15:43:13 +02:00
Josef Moellers
718ab3f79b Long pathnames patch 2021-06-14 08:33:57 +02:00
Tim Rühsen
d73e8b42f7 * .gitlab-ci.yml: Remove scan-build deps from pages stage 2021-06-07 20:32:41 +02:00
Tim Rühsen
4a5a010eb3 * .gitlab-ci.yml: Move scan-build/ to public/ only if it exists 2021-06-07 00:11:11 +02:00
Tim Rühsen
89fc8d84b7 * .gitlab-ci.yml: Move scan-build results to parent directory 2021-06-06 23:48:42 +02:00
Tim Rühsen
a0e0965d1e * .gitlab-ci.yml: Move coverage results to parent directory 2021-06-06 23:34:46 +02:00
Tim Rühsen
96971867ea * .gitlab-ci.yml: Don't allow failure of scan-build 2021-06-06 23:26:33 +02:00
Tim Rühsen
5192dddbdd * .gitlab-ci.yml: Pages needs Build-Tarball 2021-06-06 23:18:24 +02:00
Tim Rühsen
91c42c799a * src/url.c (append_uri_pathel): Add cheap extra check to help static analyzers 2021-06-06 15:34:12 +02:00
Tim Rühsen
c778ac20b4 * src/http.c (gethttp): Add cheap extra check to help static analyzers 2021-06-06 15:34:06 +02:00
Tim Rühsen
4d3ee1604a * .gitlab-ci.yml: Exclude src/css_.o from scan-build 2021-06-06 15:34:03 +02:00
Tim Rühsen
a209bb1fac * src/main.c (main): Removed unused variable 2021-06-06 15:33:59 +02:00
Tim Rühsen
36e250e09a Revert "Long pathnames patch"
This reverts commit affad27664.

Manual tests with very long path names did not work with this patch.
We have to wait for a patch including automated tests.
2021-06-06 14:10:22 +02:00
Tim Rühsen
f3299cc606 * .lgtm.yml: Add autoconf-archive 2021-06-06 02:39:28 +02:00
Tim Rühsen
de4b94a5ae * .gitlab-ci.yml: Re-arrange stages 2021-06-06 02:39:28 +02:00
Tim Rühsen
c1599deb1f Remove .git/, .gitmodules and gnulib/ from bootstrap artefacts 2021-06-06 02:39:28 +02:00
Darshit Shah
61df89eb91 Updated Gitlab CI Pipeline
* .gitlab-ci.yml: COmpletely overhauled CI pipeline with dependencies
  for a faster and more robust CI.
2021-06-06 02:39:17 +02:00
jmoellers
affad27664 Long pathnames patch 2021-05-29 17:17:27 +00:00
Tim Rühsen
170896a76a * fuzz/wget_read_hunk_fuzzer.c: Add explicit cast for C++ compilation 2021-05-22 16:48:19 +02:00
Tim Rühsen
d4431a0b97 * fuzz/wget_ntlm_fuzzer.c: Add explicit cast for C++ compilation 2021-05-22 16:48:14 +02:00
Tim Rühsen
027d294114 * src/http.c (initialize_request): Send Host HTTP header first
This solves an issue where the server expects the Host: header
as first one. This seems plausible (ahem) as the Host: header is the
only one that is required.
2021-05-03 17:49:58 +02:00
Tim Rühsen
5fe8d26904 Improve wget_options_fuzzer
* fuzz/fuzzer.h: Ignore -Wunused-parameter.
* fuzz/wget_options_fuzzer.c: Let getaddrinfo() fail in while fuzzing.
* fuzz/wget_options_fuzzer.in/*: Update corpora from OSS-Fuzz.
2021-05-02 19:43:06 +02:00
Nekun
aabdf6eb66 Fix typo in VMS support code
* src/utils.c: Remove unpaired brace

Copyright-paperwork-exempt: Yes
2021-05-02 14:19:01 +02:00
Nils
1aada296dd Use "nofollow" instead of "no-follow" in messages
* src/html-url.c (get_urls_html_fm): Remove misleading debug message.
* src/recur.c (retrieve_tree): Fix no-follow -> follow in DEBUGP.

The attribute in html is "nofollow" so it is more consistent to call it
so than to hyphenate it.

Copyright-paperwork-exempt: Yes
2021-04-15 21:03:56 +02:00
Nils
f1cccd2c45 Print message for no-follow attribute only if norobots respected
* src/html-url.c (get_urls_html_fm): Remove misleading log message.
* src/recur.c (retrieve_tree): Add log message into correct if block.

Commit e39be32838 added a message that
said links will not be followed whenever the nofollow attribute is found
in a page. It didn't take into account that with -e robots=off (and
equivalents) links will still be followed.

This bug has been noticed multiple times:
* https://www.reddit.com/r/DataHoarder/comments/mprq89/wget_respects_nofollow_attribute_despite_e/
* https://gist.github.com/simonw/27e810771137408fd7834ad153750c41#gistcomment-3648191
* https://superuser.com/questions/1494761/wget-wont-ignore-no-follow-attributes

This commits makes it so that this message is only printed when a
nofollow link is found and the norobots convention is respected.

Copyright-paperwork-exempt: Yes
2021-04-15 21:02:28 +02:00
Tim Rühsen
11c626efc4 * configure.ac: Add AM_GNU_GETTEXT_VERSION 2021-04-15 20:56:27 +02:00
Tim Rühsen
db6166d011 * testenv/test/base_test.py: Rename valgrind-suppression-ssl -> valgrind-suppressions-ssl 2021-04-11 19:41:03 +02:00
Tim Rühsen
a65bc7c0e8 * testenv/test/base_test.py: Add --show-leak-kinds=all valgrind argument 2021-04-11 19:41:00 +02:00
Tim Rühsen
3a1ac38f00 * tests/WgetTests.pm: Add --show-leak-kinds=all valgrind argument 2021-04-11 19:40:56 +02:00
Tim Rühsen
d745ea0eb6 Fix testenv valgrind suppression
* testenv/Makefile.am: Remove valgrind-suppressions from EXTRA_DIST.
* testenv/valgrind-suppression-ssl: Rename to testenv/valgrind-suppressions-ssl.
2021-04-11 19:09:45 +02:00
Tim Rühsen
82afc6e6f0 * bootstrap.conf: Add 'rename' to gnulib modules
The missing module could be a reason for
https://savannah.gnu.org/bugs/?60346.

Reported-by: jrharris42@gmail.com
2021-04-11 13:16:21 +02:00
Tim Rühsen
90631a6fe5 * src/wget.h: Use strtoll() for str_to_wgint
This fixes a regression reported at https://savannah.gnu.org/bugs/?60353.

Reported-by: Michal Ruprich
2021-04-11 12:53:20 +02:00
Shamil Gumirov
fd2a061f6a Minor output fix to use quote_n() instead of quote()
* src/ftp.c (ftp_retrieve_list): change quote to quote_n
* src/iri.c (do_conversion): change quote to quote_n
* src/url.c (convert_fname): change quote to quote_n

The implementation quote() reuses the buffer it returns which
leads to printing the same string for each quote() call in one
output line. Instead, quote_n() should be used as highlighted in
the doc:
https://www.gnu.org/software/gnulib/manual/html_node/Quoting.html

Copyright-paperwork-exempt: Yes
2021-04-11 12:42:07 +02:00
Tim Rühsen
27b12dad12 * src/Makefile.am: Add metalink.c and xattr.c to EXTRA_wget_SOURCES 2021-04-05 12:37:28 +02:00
Tim Rühsen
c8d7a66217 * testenv/Makefile.am: Allow tarball build without python3 2021-04-05 12:37:15 +02:00
Tim Rühsen
6d58a04682 Fix spelling errors
* NEWS: trough -> through.
* README.checkout: Likewise.
* contrib/spell-checker: Add exclusion 'parm'
2021-04-04 17:14:57 +02:00
Tim Rühsen
7840db6c0b Remove gettext version requirements
* bootstrap.conf: Remove gettext version requirements
* configure.ac: Likewise.
2021-04-04 17:14:54 +02:00
Darshit Shah
cf788d60e4 Use a LOG_COMPILER for running fuzz tests
This prevents needing a special case in the fuzz tests to detect
valgrind usage and a new exec. Instead, we simply detect the environment
in a shell script and start the test with valgrind in the first place.

* fuzz/test-runner.sh: New script for running the fuzz tests
* fuzz/main.c (main): Remove code for re-running under valgrind
* fuzz/Makefile.am: Set the LOG_COMPILER to test-runner.sh and remember
  to add it to the list of extra files for packaging
2021-03-16 21:48:13 +01:00
Tim Rühsen
db4d5b6eb3 * configure.ac: Add AC_PROG_CC_C99 2021-03-07 19:56:36 +01:00
Darshit Shah
e9cf8da1a6 Bump gettext version to 0.20
* bootstrap.conf: Increase minimum version of gettext needed to 0.20
* configure.ac: Same
2021-03-07 14:50:11 +01:00
Darshit Shah
b743178b9d * bootstrap: Update script 2021-03-07 14:40:41 +01:00
Darshit Shah
65cc47b504 * gnulib: Pull forward 2021-03-07 14:39:53 +01:00
Darshit Shah
f7835691b4 Fix double free in FTP Code
* src/ftp.c(getftp): Don't free `target`. If it is not pointing to
  targetbuf, then it still pointing to its original location of u->dir.
  This location will be free'd later. Doing so now causes a double free
  and hence crashes Wget
* tests/Test-ftp-dir.px: New test to show double free error
* tests/Makefile.am: Add new test
2021-03-02 12:03:14 +01:00
Tim Rühsen
51ee45f017 * doc/wget.texi: Replace '' with in example
Needed to hide from texi2pod.pl replacement of '' -> ".

Reported-by: Vincent Lefevre
2021-01-31 18:23:36 +01:00
Tim Rühsen
7d9ed223fc Use gnulib's utime.h
* bootstrap.conf: Remove utime-h (included by utime).
* configure.ac: Remove header checks for utime.h and sys/utime.h.
* src/utils.c: Simply #include <utime.h>.
2021-01-23 19:28:58 +01:00
Tim Rühsen
f81191951a * configure.ac: Detect unresolved AX_ macros 2021-01-23 19:09:36 +01:00
Tim Rühsen
ea6143d56c * configure.ac: Use noyywrap for AC_PROG_LEX 2021-01-16 20:09:07 +01:00
Tim Rühsen
ad36a467ac Fix --quota on systems with 32bit long type
* src/init.c (cmd_bytes_sum): Use WGINT_MIN and WGINT_MAX in check.
* src/options.h (struct options): Make 'quota' of type wgint.
* src/retr.c: Make 'total_downloaded_bytes' of type wgint.
* src/utils.h: Fix comment.
* src/wget.h: Add WGINT_MIN, remove SUM_SIZE_INT.
2021-01-16 20:00:39 +01:00
Tim Rühsen
adc5aa0196 * configure.ac: Remove obsolete AC_HEADER_STDC 2021-01-16 19:34:53 +01:00
Tim Rühsen
5c8569ba5d * configure.ac: Replace ` with ' 2021-01-16 19:31:04 +01:00
Tim Rühsen
9f1c8dac77 * configure.ac: Use yywrap param for AC_PROG_LEX 2021-01-16 19:19:01 +01:00
Darshit Shah
6c84dc38bc maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2021-01-09 11:01:24 +01:00
Darshit Shah
f720bdda9f * NEWS: Update NEWS items for release 2021-01-09 10:55:08 +01:00
Darshit Shah
90d43efbea * gnulib: Pull forward 2021-01-09 10:55:02 +01:00
Darshit Shah
0031bdedfc * cfg.mk: Add manual_title for web docs 2021-01-09 10:54:27 +01:00
Darshit Shah
72ede7a028 * contrib/make-release: Update to use maintainer-makefile 2021-01-09 10:54:10 +01:00
Darshit Shah
473eef671b * bootstrap.conf: Add gendocs and gnu-web-doc-update modules 2021-01-09 01:49:07 +01:00
Darshit Shah
8c35102b37 * configure.ac(AM_INIT_AUTOMAKE): Create lzip archives when making a distribution 2021-01-09 01:03:43 +01:00
Darshit Shah
ae203984e8 Prepare for making releases
The maintainer makefile provides targets for making a release. They need
these things:
* cfg.mk: Set the hash of the NEWS file as it was at the beginning of
  this release
* .prev-version: Create the .prev-version file
2021-01-09 00:46:24 +01:00
Darshit Shah
5f6f86aa26 Prepare NEWS file for new release
* NEWS: Fix the copyright notice
* NEWS: Add header for new release
2021-01-09 00:46:06 +01:00
Darshit Shah
e9641d989b Use PRId64 to correctly identify the format specifier
* src/utils.c: Use PRId64 to correctly identify the format specifier for
wgint values. This fixes a warning on 32-bit systems where wgint is a
long long int instead of the long int that the format specifier
indicated.

Reported-by: Jeffrey Walton
2021-01-07 21:35:20 +01:00
Darshit Shah
9f3df123bb * src/retr.c(rotate_backups): Simplify logic for handling filename rotation 2021-01-03 15:59:49 +01:00
Matt Whitlock
1e89e5f66c * configure.ac: Don't use Bashisms 2021-01-03 15:22:22 +01:00
Darshit Shah
5a7f2f7e87 Run make update-copyright 2021-01-01 12:31:01 +01:00
Darshit Shah
2e5d281468 * gnulib: Pull forward 2021-01-01 12:15:48 +01:00
Darshit Shah
8923dcc788 * NEWS: Finalize release 2020-12-31 16:39:39 +01:00
Darshit Shah
c2517256e4 * gnulib: Update for release 2020-12-31 16:27:48 +01:00
Darshit Shah
37f0dca4e2 * src/main.c: Disable use-askpass on VMS 2020-12-30 23:04:13 +01:00
Steven M. Schweda
8af2171a34 Fixes for running on VMS
time_t on VMS is typically unsigned.  (Lazy man's solution to 2038?)
I added "(time_t)" type casts to negative values ("-1"), and changed
tests to avoid complaints.

* src/hsts.c (hsts_add_entry): Explicitly cast potentially negative time
  values to time_t to handle VMS quirks.
  (hsts_store_entry): Same
  (get_hsts_store_filename): Use new ajoin_dir_file function to join
  filenames
  (test_hsts_read_database): Same
* src/init.c (struct options): use-askpass is not implemented on VMS
  (ajoin_dir_file): New Function to join filenames in a platform
  agnostic manner
  (wgetrc_user_file_name): Use ajoin_dir_file to join paths. Doing this
  correctly, eliminates the need for a special case on VMS
* src/init.h: Add prototype for ajoin_dir_file
* src/log.c (check_redirect_output): Ignore on VMS
* src/main.c(option_data): Disable use-askpass on VMS
  (print_help): Same
  (get_hsts_database): Use ajoin_dir_file to join paths
  (print_version): Add VMS specific information to Version output
* src/utils.c (fork_to_background): Fix signature on VMS

Co-authored-by: Darshit Shah <darnir@gnu.org>
2020-12-30 22:50:32 +01:00
Tim Rühsen
7ec15b9c92 Remove SIZEOF_WGINT as wgint is always int64_t
* src/http.c (test_parse_range_header): Remove use of SIZEOF_WGINT.
* src/utils.c (human_readable): Remove superfluous HR_NUMTYPE,
*   (number_to_string): Remove use of SIZEOF_WGINT.
* src/utils.h: Remove use of SIZEOF_WGINT and HR_NUMTYPE.
* src/wget.h: Remove #define SIZEOF_WGINT.
2020-12-29 12:44:20 +00:00
Tim Rühsen
a16149e5bb src/wget.h: Cleanup code around wgint 2020-12-29 12:44:20 +00:00
Darshit Shah
db88ad441e Remove portability handling for str[n]casecmp
* src/mswindows.c: Gnulib ensures we always have str{n}casecmp
* configure.ac: Don't need to define HAVE_STR[N]CASECMP anymore
2020-12-29 12:44:20 +00:00
Darshit Shah
8b1aeab783 Remove portability handling code for wgint
Gnulib's stdint.h module promises a C99 compliant stdint.h file on all
platforms. Thus allowing us to directly use the fixed wodth integer
type, int64_t wihout needing to resort to all the checks being
performed.

* src/wget.h: Assume that int64_t is always available and use it
* src/mswindows.h: Remove portability code since gnulib handles it
* configure.ac: Remove sizeof checks for integer types that are no
  longer used
2020-12-29 12:44:20 +00:00
Tim Rühsen
dd2d960ba1 * .lgtm.yml: Call autoreconf to support Debian oldstable 2020-12-29 11:24:15 +01:00
Tim Rühsen
5b7d068a4b Fix --accept-regex/i--reject-regex for FTP
* src/ftp.c (ftp_retrieve_glob): Call accept_url() with the full URL

Reported-by: Frans de Boer <frans@fransdb.nl>
2020-12-28 23:33:48 +01:00
Darshit Shah
2e4504c553 * tests/valgrind-suppressions: Make suppression for libidn false positive more generic 2020-12-28 22:44:33 +01:00
Darshit Shah
a2f23b30c2 * Makefile.am: Clean up gnulib_po/stamp-po 2020-12-28 02:52:43 +01:00
Darshit Shah
73c474edf6 tests/valgrind-suppressions: Add suppressions for false positives 2020-12-28 02:34:02 +01:00
Darshit Shah
4fad8a7e2d testenv/Test--https.py: Fix missing import 2020-12-28 02:10:10 +01:00
Darshit Shah
9718667301 .gitlab-ci.yml: Everyone needs an autoreconf now 2020-12-28 02:08:14 +01:00
Darshit Shah
733ba71b13 .gitlab-ci.yml: Even Debian Stable requires running autoreconf 2020-12-28 01:57:13 +01:00
Darshit Shah
010cb79b43 Fix usage of Magic number of tests
testenv/test/base_test.py: Add new variable SKIP_TEST
testenv/Test--https-crl.py: Use SKIP_TEST instead of magic number
testenv/Test--https.py: Same
testenv/Test-hsts.py: Same
testenv/Test-no_proxy-env.py: Same
testenv/Test-pinnedpubkey-der-https.py: Same
testenv/Test-pinnedpubkey-der-no-check-https.py: Same
testenv/Test-pinnedpubkey-hash-https.py: Same
testenv/Test-pinnedpubkey-hash-no-check-fail-https.py: Same
testenv/Test-pinnedpubkey-pem-fail-https.py: Same
testenv/Test-pinnedpubkey-pem-https.py: Same
2020-12-28 01:54:16 +01:00
Darshit Shah
7c4d053902 .gitlab-ci.yml: All modern builds need autoreconf 2020-12-28 01:36:22 +01:00
Darshit Shah
13b3bc7f8f .po/POTFILES.in: Remove files containing no translateable strings 2020-12-28 01:31:31 +01:00
Darshit Shah
c80b1271d7 Fix issues reported by codespell 2020-12-28 01:23:34 +01:00
Darshit Shah
6898efd978 .gitlab-ci.yml: Need --force option to autopoint 2020-12-28 01:20:51 +01:00
Darshit Shah
d82f158e3d * .gitlab-ci.yml: Don't need autoreconf everywhere. Only on Arch
This (partially) reverts commit 0309d13794.
2020-12-28 01:10:32 +01:00
Darshit Shah
29917a3052 configure.ac: Revert to requiring gettext 0.19 2020-12-28 01:09:03 +01:00
Darshit Shah
0309d13794 .gitlab-ci.yml: Call autoreconf to refresh gettext files 2020-12-28 01:02:38 +01:00
Darshit Shah
5ef6756f0a * NEWS: Update NEWS items 2020-12-28 00:50:05 +01:00
Darshit Shah
749cfc9717 configure.ac: Raise minimum gettext version to 0.20 2020-12-28 00:48:01 +01:00
Darshit Shah
1942eaf409 Run autoupdate on configure.ac
* configure.ac, m4/{wget, wget_manywarnings}.m4: Run autoupdate
2020-12-28 00:39:30 +01:00
Darshit Shah
99b5977169 .gitignore: Ignore gnulib_po directory 2020-12-28 00:35:04 +01:00
Darshit Shah
0c2a33b5dc configure.ac: Replace obsolete macro AC_AIX with AC_USE_SYSTEM_EXTENSIONS 2020-12-28 00:12:39 +01:00
Darshit Shah
f4a3c1a35c bootstrap.conf: Remove unneeded text block 2020-12-27 23:47:49 +01:00
Darshit Shah
b99d519a57 m4/getpagesize.m4: Don't track autogenerated file 2020-12-27 22:29:42 +01:00
Darshit Shah
70bacc432d Remove unneeded files from gnulib
m4/exitfail.m4: Remove unneeded file
m4/wchar.m4: Same
m4/wctype.m4: Same

The latest versions of these files will be copied by gnulib-tool upon
its invokation. No need to track them around here
2020-12-27 22:06:29 +01:00
Darshit Shah
a11bfc2d4e Use a separate domain for translating gnulib
Use the --po-domain option to gnulib-tool to create a new textdomain
that can be used by gnulib files for translations. This way, we don't
have to maintain the list of all files that require translations in
gnulib.

* bootstrap.conf: Use --po-domain and --po-base options to create a
  separate base for gnulib translations
* src/main.c(i18n_initialize): Call bindtextdomain on wget-gnulib to
  include those translations as well
* Makefile.am: Add new directory gnulib_po to SUBDIRS
* configure.ac: Generate gnulib_po/Makefile.in
* lib/Makefile.am: Set AM_CPPFLAGS to empty since gnulib.mk expects it
  to be set
2020-12-27 21:15:45 +01:00
Darshit Shah
8d68a6307b po/POTFILES.in: Update the list of files that need translation 2020-12-27 20:53:18 +01:00
Darshit Shah
fd0f21b04c m4/getpagesize.m4: Update from gnulib 2020-12-27 20:47:12 +01:00
Darshit Shah
7e1bc0de8a configure.ac: Increase minimum required version to 2.64 2020-12-27 20:21:51 +01:00
Darshit Shah
3396b943e0 gnulib: Pull forward 2020-12-27 19:29:32 +01:00
Darshit Shah
3636b2a5af main.c (main): Warn when trying to use password without username 2020-12-22 22:25:26 +01:00
Tim Rühsen
015afd7cc7 * src/http.c (http_cleanup): Reset wget_cookie_jar after freeing
This silences the wget_options_fuzzer which triggered #28610 on
OSS-Fuzz. This issue can not happen with the Wget utility.
The fuzzer runs main(),...,cleanup() in a loop which the Wget utility
never does.
2020-12-13 18:23:39 +01:00
Tim Rühsen
794b7b1dbe * src/main.c: Add description to --help output of wait options 2020-11-08 18:46:11 +01:00
Tomas Hozza
314a4f42be testenv: Add test for handling of no_proxy environment variable
* testenv/Test-no_proxy-env.py: Added new test for no_proxy env
* testenv/Makefile.am: Added the new test to Makefile

Added new test with 5 cases, which are testing various combinations
of no_proxy environment variable definition and requested URLs.
The test is skipped if the system does not support resolution of
localhost subdomains to lcalhost address.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2020-07-11 22:54:26 +02:00
Tomas Hozza
8ffebe2160 testenv: Allow definition of environment variables for wget execuion
* testenv/README: Added description for new EnvironmentVariable hook
* testenv/conf/environment_variable.py: Added implementation of
EnvironmentVariable hook
* testenv/test/base_test.py: Modified exec_wget() to enable use of
EnvironmentVariable hook

Added new test hook called EnvironmentVariables, for defining environment
variables when wget is executed in tests. This is handy for testing
environment variables, which are accepted by wget.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2020-07-11 22:54:26 +02:00
Tomas Hozza
28196b6807 testenv: HTTPTest.begin() should return exit value
* testenv/test/http_test.py: Ensure that HTTPTest.begin() always returns
a value

Previously the HTTPTest.begin() method always returned None. However this
is not consistent with the begin() implementation of the parent class
(BaseTest). This change ensures that HTTPTest.begin() returns a value.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2020-07-11 22:54:26 +02:00
Darshit Shah
1fe9d4cf09 Minor documentation clarification
* src/wget.texi: Clarify behaviour of --quota
  Thanks to TheWild on IRC for pointing it out
2020-07-07 21:47:06 +02:00
Tim Rühsen
1656a1628c * src/ftp.c (ftp_loop_internal): Check for VERIFCERTERR to avoid SIGABRT
There is a bug that causes wget to exit with SIGABRT when trying to
receive files through FTP from a server with a certificate that failed
the verification.

The bug is filed in RedHat Bugzilla for Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1475861

Reported-by: Artem Egorenkov <aegorenk@redhat.com>
2020-06-29 18:04:52 +02:00
Tim Rühsen
e830f5f42b * src/host.c (lookup_host): Fix uninitialized pointer access in c-ares code
Reported-by: Swapnil More
2020-06-21 11:37:28 +02:00
Tim Rühsen
470a7dfc84 * src/gnutls.c (ssl_init): Small cleanup fixing output of ncerts 2020-05-22 15:49:12 +02:00
Tim Rühsen
c23eaff56f * src/convert.c (downloaded_files_free): Only compile if DEBUG_MALLOC or TESTING is defined 2020-05-01 17:54:58 +02:00
Tim Rühsen
5a141065c4 * src/netrc.c (free_netrc): Only compile if DEBUG_MALLOC or TESTING is defined 2020-05-01 17:54:58 +02:00
Вячеслав Петрищев
7a3a82faf8 Fix SSL/TLS timeout issues.
* connect.c (fd_read, fd_peek): Let implementation take care about timeout.
* gnutls.c (_do_handshake, _do_reauth, wgnutls_read_timeout): Fix support for interactive timeout.
* gnutls.c (wgnutls_peek): Let wgnutls_read_timeout() take care about timeout.
* openssl.c (openssl_read_peek): Fix 0 (-1) timeout.
* retr.c (fd_read_body): Avoid wrong 'interactive timeout'.
2020-05-01 17:53:47 +02:00
Вячеслав Петрищев
c12a295496 Set interactive to true for bar progress.
* src/progress.c (bar_set_params): Set interactive to true.
* src/retr.c (fd_read_body): Avoid call fd_read with 0 timeout.
2020-05-01 17:53:21 +02:00
Вячеслав Петрищев
fb5e2e628d New implementation for openssl_read, openssl_peek ssl_connect_with_timeout (openssl)
Add new implementation for openssl_read, openssl_peek
ssl_connect_with_timeout (openssl). Thats allow continue
read after ETIMEDOUT (if timeout < opt.read_timeout)
without 'Retrying', and do not create thread (under MSWin)
for every read. Old implementation, (with fix for 'timeout')
avaible for build with: -DOPENSSL_RUN_WITHTIMEOUT

Add timeout for transport_implementation {reader,peeker};

* src/init.c (cmd_time): Add check for negative value.
* src/connect.h (transport_implementation {reader,peeker}): Change function prototype.
* src/connect.c (select_fd_nb): New function, aviod conversion to blocked under MSWin.
* src/gnutls.c
   (gnutls_read): Fix: using timeout, seting ETIMEDOUT, conversion to blocked.
   (gnutls_peek): Likewise.
   (wgnutls_errstr): Add errmsg for ETIMEDOUT.
   (_do_handshake) (_do_reauth): Fix conversion to blocked.
* src/openssl.c:
   Add new implementation for openssl_read, openssl_peek, ssl_connect_with_timeout.
   (init_prng): when option --random-file given warn user if RAND_load_file() fail.
2020-05-01 17:51:48 +02:00
Tim Rühsen
9dacc2836a Add missing linefeed in output strings
* src/ftp.c (getftp): Add linefeed to error message.
* src/res.c (res_parse_from_file): Likewise.
* src/utils.c (fopen_stat): Likewise.
  (open_stat): Likewise.
2020-04-18 18:39:50 +02:00
Tim Rühsen
6e5cf727c5 * src/metalink.c: Include filename.h instead of dosname.h 2020-03-28 19:26:12 +01:00
Tim Rühsen
78ef6fab13 * gnulib: Update 2020-03-28 19:23:35 +01:00
Tomas Hozza
706e71564c Don't print message about loading crl or ca-cert files with --no-verbose
* src/gnutls.c (ssl_init): Use LOG_VERBOSE verbosity for informative
  message related to loading CRL or CA certificate file.

Before change [1], wget didn't produce any output related to loading CA
certificates when --no-verbose option has been used. When --no-verbose
option is used, only error messages and basic information should get
printed. Information about loading CRL or CA certificate is probably not
a basic information. Any error when loading the CRL or CA certificate
will be still printed with --no-verbose.

Some users rely on wget not printing such information and they consider
it a regression.

Reported as https://bugzilla.redhat.com/show_bug.cgi?id=1807267

[1] http://git.savannah.gnu.org/cgit/wget.git/commit/?id=e4a8fe84e2b813b65d91aec29298eecabe4850a5

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2020-03-24 14:58:01 +01:00
Tim Rühsen
103aaf7740 Add NTLM fuzzer
* configure.ac: Create WITH_NTLM conditional.
* fuzz/Makefile.am: Add wget_ntlm_fuzzer.
* fuzz/wget_ntlm_fuzzer.c: New file.
* fuzz/wget_ntlm_fuzzer.in/*: Initial fuzz corpora.
2020-03-06 18:52:37 +01:00
Tim Rühsen
4221b5656a * src/http.c (check_auth): Fix memory leak 2020-03-06 12:09:02 +01:00
Tim Rühsen
fe5fbdd947 * src/http-ntlm.c (mkhash): Fix read buffer overflow 2020-03-06 11:37:57 +01:00
Tim Rühsen
7c017e604c * README.checkout: Fix gperf typo and tab indentation 2020-03-05 21:08:07 +01:00
Tim Rühsen
0a0177c694 * .gitlab-ci.yml: Generate online docs and coverage reports for Gitlab 2020-03-05 21:08:07 +01:00
Tim Rühsen
238074e2b8 Add code coverage reporting
* configure.ac: Add AX_CODE_COVERAGE.
* Makefile.am: Add rules 'check-coverage' and 'fuzz-coverage'.
* fuzz/Makefile.am: Amend LDADD, AM_CFLAGS and AM_CPPFLAGS.
* src/Makefile.am: Amend LDADD, AM_CFLAGS and AM_CPPFLAGS.

This add a new configure option, --enable-code-coverage.

With this option enabled, generate test code coverage with
  make code-coverage
and generate coverage for the fuzz test corpora with
  make fuzz-coverage
2020-03-05 20:24:07 +01:00
Tim Rühsen
6377ae1647 * src/http.c: Don't cast 3rd param to request_set_header. 2020-03-05 19:19:42 +01:00
Tim Rühsen
4e5a75566a * README: Fix typo 'can retrieves' -> 'can retrieve' 2020-03-05 19:10:55 +01:00
Darshit Shah
2db7fe688d * doc/wget.texi: Add maintainers and mention wget2 2020-03-03 20:50:05 +01:00
Darshit Shah
87815e223d doc/wget.texi: Clarify usage of --level 2020-03-03 20:10:51 +01:00
Tim Rühsen
eb02512a40 * src/http.c (gethttp): Remove unneeded free of hstat.(message|error) 2020-03-03 19:33:53 +01:00
Tim Rühsen
1ac3812e8a * src/http.c (gethttp): Fix memleaks
Reported-by: Вячеслав Петрищев
2020-03-03 18:38:41 +01:00
Tim Rühsen
910c0abe7a * src/http.c (read_response_body): Fix memleak
Reported-by: Вячеслав Петрищев
2020-03-03 10:26:09 +01:00
Tim Rühsen
be51eeceab * contrib/spell-checker: Add lightening to exceptions 2020-02-29 18:23:45 +01:00
Tim Rühsen
f4a57afd42 Always build ssl_cleanup
* src/gnutls.c (ssl_cleanup): Don't build conditionally.
* src/openssl.c (ssl_cleanup): Likewise
2020-02-29 17:25:41 +01:00
Tim Rühsen
3e2f450c6a * doc/wget.texi: Fix spelling error
Reported-by: Jim Cathey
2020-02-28 22:03:35 +01:00
Tim Rühsen
fded294d7a * src/convert.c (convert_cleanup): Free downloaded_css_set 2020-02-27 20:04:24 +01:00
Tim Rühsen
c0d76ec935 * src/openssl.c (ssl_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:59:15 +01:00
Tim Rühsen
472823283c * src/gnutls.c (ssl_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:59:05 +01:00
Tim Rühsen
b0e94e582b * src/netrc.c (netrc_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:56:40 +01:00
Tim Rühsen
8215479ffb * src/log.c (log_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:56:05 +01:00
Tim Rühsen
30139c6745 * src/host.c (host_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:55:31 +01:00
Tim Rühsen
4588045b28 * src/spider.c (spider_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:54:48 +01:00
Tim Rühsen
765271fdf5 * src/res.c (res_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:53:57 +01:00
Tim Rühsen
e52e418bdd * src/convert.c (convert_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:53:15 +01:00
Tim Rühsen
a3d3322a48 * src/html-url.c (cleanup_html_url): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:51:55 +01:00
Tim Rühsen
ee187476de * src/http.c (http_cleanup): Free hashtable basic_authed_hosts 2020-02-27 19:33:47 +01:00
Tim Rühsen
8cd4dcc278 * src/cookies.c (cookie_jar_delete): Set psl to NULL after calling psl_free 2020-02-27 14:38:01 +01:00
Tim Rühsen
4d8bf37870 * src/init.c (cleanup): Call ssl_cleanup and connect_cleanup 2020-02-27 14:30:53 +01:00
Tim Rühsen
b209ca91fb Add ssl_cleanup to free memory
* src/ssl.h: Add declaration for ssl_cleanup.
* src/openssl.c: Add ssl_cleanup stub.
* src/gnutls.c: Implement ssl_cleanup.
2020-02-27 14:29:25 +01:00
Tim Rühsen
7146b9dc77 * src/http.c (http_cleanup): Call invalidate_persistent to free resources 2020-02-27 14:28:10 +01:00
Tim Rühsen
b3dc802efb * src/cookies.c: Free PSL in cookie_jar_delete 2020-02-27 14:27:05 +01:00
Tim Rühsen
6938c84aa4 * src/connect.c (connect_cleanup): Only needed with DEBUG_MALLOC or TESTING 2020-02-27 14:26:31 +01:00
Tim Rühsen
8010507d73 * src/http.c (http_loop): Avoid unneeded strdup 2020-02-27 11:35:50 +01:00
Вячеслав Петрищев
f747eea059 * src/http.c (gethttp): Fix memleak 2020-02-27 11:12:27 +01:00
Tim Rühsen
46a6e2957e * src/http.c: Do not reveal OS type to server via User-Agent: header
Following the "privacy by design" principle, which is now European law by
virtue of the GDPR since 2018, the client should not transmit the operating
system.

Fixes #57884
Reported-by: Bruno Haible
2020-02-23 18:51:10 +01:00
Tim Rühsen
04b7369490 * tests/unit-tests.c: Fix 'multiple definition of...' with gcc 10 2020-02-22 13:41:04 +01:00
Tim Rühsen
8e130c32ba Split unique_name into two functions with just one arg
* src/http.c (check_file_output): Call unique_name_passthrough.
* src/metalink.c (badhash_suffix): Call unique_name.
* src/url.c (url_file_name): Call unique_name_passthrough.
* src/utils.c: Split unique_name, amend description.
* src/utils.h: Amend unique_name, add unique_name_passthrough.
2020-02-22 12:59:18 +01:00
Tim Rühsen
88d841c651 * .gitlab-ci.yml: Set tag 'linux' explicitly for each runner 2020-02-22 08:53:56 +01:00
Tim Rühsen
d08bdbc878 * src/http.c (print_response_line): Fixed comparison
Introduced in 68868bbb37 (13.2.2020).

Reported-by: Gisle Vanem
2020-02-22 08:47:20 +01:00
Tim Rühsen
aba6e67eb7 Add valgrind suppressions
* testenv/valgrind-suppression-ssl: Add gnutls suppressions
* tests/valgrind-suppressions: Likewise
* tests/valgrind-suppressions-ssl: Likewise
2020-02-21 22:43:01 +01:00
Tim Rühsen
e1c4a2705f Add --gen-suppressions=all to valgrind options
* testenv/test/base_test.py: Add --gen-suppressions=all to valgrind options
* tests/Test-proxied-https-auth.px: Likewise
* tests/WgetTests.pm: Likewise
2020-02-21 22:42:22 +01:00
Tim Rühsen
f4dfddfaf3 * cfg.mk: Exclude sc_prohibit_gnu_make_extensions 2020-02-21 21:56:55 +01:00
Tim Rühsen
9934e228ac * src/retr.c (fd_read_body): Check timer before accessing (Coverity #600494) 2020-02-21 17:46:41 +01:00
Tim Rühsen
c65bddc086 * src/warc.c (warc_write_start_record): Check return values of fseek, fflush (Coverity #1419650) 2020-02-21 17:38:41 +01:00
Tim Rühsen
c5d0e58d0d * src/ftp-ls.c (eat_carets): Fix caret decoding issue (Coverity #1419653) 2020-02-21 14:55:03 +01:00
Tim Rühsen
365c00a4a2 * src/warc.c (warc_write_block_from_file): Check for write error (Coverity #1419654) 2020-02-21 14:41:40 +01:00
Tim Rühsen
4e519f5a80 * src/warc.c (warc_write_end_record): Check return value of fseeko (Coverity #1419657) 2020-02-21 14:37:40 +01:00
Tim Rühsen
08aa947c9d Add valgrind suppressions for HTTPS tests (GnuTLS false positive)
* testenv/valgrind-suppression-ssl: Add new rule
* tests/valgrind-suppressions: Likewise
* tests/valgrind-suppressions-ssl: Likewise
2020-02-21 13:20:45 +01:00
Tim Rühsen
43820b67bf * src/init.c (setoptval): Add missing comma (fix compilation) 2020-02-20 17:04:02 +01:00
Tim Rühsen
b8413cdd3d * .gitlab-ci.yml: Add spell-checking to VPATH/Debian 2020-02-20 16:24:43 +01:00
Tim Rühsen
b53c52c4c1 Fix typos found by codespell
*/*: Fix typos

Thanks to https://fossies.org/features.html#codespell

Reported-by: Jens Schleusener
2020-02-20 16:21:33 +01:00
Tim Rühsen
ce745c6a08 * contrib/spell-checker: Add new file 2020-02-20 16:20:52 +01:00
Tim Rühsen
9df2e0d746 * src/init.c (setoptval): Silence Coverity (Coverity #1419648) 2020-02-20 13:46:36 +01:00
Tim Rühsen
ada3396c72 * src/main.c (init_switches): Remove unneeded code (Coverity #1419658) 2020-02-20 13:20:21 +01:00
Tim Rühsen
9b1b9961ef * src/ftp-ls.c (ftp_parse_vms_ls): Fix use of uninitialized stack mem (Coverity #609373) 2020-02-20 13:17:31 +01:00
Tim Rühsen
79438d4d87 * src/retr.c (retrieve_url): Fix memory leak (Coverity #1316408) 2020-02-19 20:36:36 +01:00
Tim Rühsen
1c16819558 * src/http.c (set_file_timestamp): Fix stack memory leak (Coverity #1419655) 2020-02-19 19:13:48 +01:00
Tim Rühsen
d3f5311087 * src/main.c (main): Initialize variable (Coverity #1419660) 2020-02-19 18:54:06 +01:00
Tim Rühsen
4d1f6f5c09 * .gitlab-ci.yml: Fix linebreak 2020-02-19 18:44:14 +01:00
Tim Rühsen
1dfd1aa1cf * src/http.c (metalink_from_http): Fix memleak (Coverity #1419661, #1419656) 2020-02-19 17:07:52 +01:00
Tim Rühsen
2b48b50aa5 * .gitlab-ci.yml: Add 'coverity' runner 2020-02-19 17:06:06 +01:00
Tim Rühsen
e6c76e84aa * contrib/mk_authors: Create list of authors and translators since last version 2020-02-19 15:36:24 +01:00
Tim Rühsen
21bb9d54cb * src/progress.c (eta_to_human_short): Silence -Wformat-overflow 2020-02-19 14:44:21 +01:00
Tim Rühsen
8eda2da138 * .gitlab-ci.yml: Don't copy gnulib manually 2020-02-14 23:33:45 +01:00
Tim Rühsen
fa92fc336b * NEWS: Update 2020-02-14 16:31:59 +01:00
Tim Rühsen
e6b76459db Remove alloca includes and macros
* bootstrap.conf: Remove gnulib module 'alloca'.
* src/sysdep.h: Remove include of alloca.h.
* src/wget.h: Likewise,
  remove macros BOUNDED_TO_ALLOCA and STRDUP_ALLOCA.
2020-02-14 16:13:50 +01:00
Tim Rühsen
7aac99d6e5 * src/utils.h: Remove alloca_array 2020-02-14 16:09:36 +01:00
Tim Rühsen
28beee5e75 * src/convert.c (convert_links_in_hashtable): Remove use of alloca 2020-02-14 16:08:09 +01:00
Tim Rühsen
ca56ca94ee * src/convert.c (local_quote_string): Remove use of alloca 2020-02-14 16:00:05 +01:00
Tim Rühsen
951bcac6df * src/convert.c (replace_attr_refresh_hack): Remove use of alloca 2020-02-14 15:38:53 +01:00
Tim Rühsen
43ad3af58d * gnulib: Update 2020-02-14 15:31:10 +01:00
Tim Rühsen
a534d93a5f * bootstrap.conf: Use fnmatch-gnu instead of fnmatch 2020-02-14 15:30:14 +01:00
Tim Rühsen
6d1fcd1c48 * src/convert.c (write_backup_file): Remove use of alloca 2020-02-14 13:15:21 +01:00
Tim Rühsen
b62956872c * src/utils.c (fnmatch_nocase): Remove FNM_CASEFOLD emulation, gnulib takes care of it 2020-02-14 12:59:25 +01:00
Tim Rühsen
589b3743fa * src/cookies.c (cookie_header): Remove use of alloca 2020-02-14 12:50:32 +01:00
Tim Rühsen
d61d82c43c * src/cookies.c (cookie_header): Remove use of alloca 2020-02-14 12:43:12 +01:00
Tim Rühsen
f071030659 * src/cookies.c (cookie_handle_set_cookie): Remove use of alloca 2020-02-14 12:32:22 +01:00
Tim Rühsen
36ccb62e92 * src/cookies.c (parse_set_cookie): Explicitly convert from double to time_t 2020-02-14 12:04:41 +01:00
Tim Rühsen
e5cf56d7fa * src/cookies.c (parse_set_cookie): Remove use of alloca 2020-02-14 12:03:50 +01:00
Tim Rühsen
92c0d39894 * src/warc.c (warc_uuid_str): Add second param to windows_uuid_str 2020-02-14 11:53:10 +01:00
Tim Rühsen
78a848c69a * src/cookies.c (parse_set_cookie): Remove use of alloca 2020-02-14 11:48:19 +01:00
Tim Rühsen
8610b0b355 * src/main.c (main): Code clean, reduce allocations 2020-02-14 11:14:02 +01:00
Tim Rühsen
6bd21adabc * src/main.c: Modify macro IF_SSL to work with latest struct changes 2020-02-14 10:31:12 +01:00
Tim Rühsen
b92b628fd5 * configure.ac: List 'no' for --with-ssl in help output 2020-02-14 10:29:52 +01:00
Tim Rühsen
a274740598 * src/ftp.c (ftp_retrieve_dirs): Remove use of alloca 2020-02-13 20:19:26 +01:00
Tim Rühsen
94bae4dd18 * src/ftp.c (ftp_retrieve_list): Remove use of alloca 2020-02-13 20:11:45 +01:00
Tim Rühsen
d0695e269f * src/ftp.c (ftp_loop_internal): Remove use of alloca 2020-02-13 20:02:25 +01:00
Tim Rühsen
6a3e96275b * src/ftp.c (getftp): Remove use of alloca 2020-02-13 20:00:09 +01:00
Tim Rühsen
6d181cb8ef * src/http.c: Include xstrndup.h unconditionally 2020-02-13 19:34:36 +01:00
Tim Rühsen
89e09e59f2 * src/ftp-basic.c (ftp_request): Remove use of alloca 2020-02-13 17:10:01 +01:00
Tim Rühsen
5505aced03 * src/html-parse.c (name_allowed): Remove use of alloca 2020-02-13 17:01:29 +01:00
Tim Rühsen
6cc9acfd61 * src/netrc.c (search_netrc): Remove use of alloca 2020-02-13 16:55:41 +01:00
Tim Rühsen
e91e96ccb5 * src/init.c (parse_line): Remove use of alloca 2020-02-13 16:50:21 +01:00
Tim Rühsen
c3c04ffeba Remove use of alloca in setoptval
* src/init.c (setoptval): Remove use of alloca
* src/init.h: Add define MAX_LONGOPTION
* src/main.c (struct cmdline_option): Make 'long_name' a char array
2020-02-13 16:39:36 +01:00
Tim Rühsen
cbea3d41dd * src/http.c (check_auth): Remove use of alloca 2020-02-13 16:27:38 +01:00
Tim Rühsen
68868bbb37 * src/http.c (print_response_line): Remove use of alloca 2020-02-13 16:11:51 +01:00
Tim Rühsen
a3f2ba708d * src/http.c (request_set_user_header): Remove use of alloca 2020-02-13 16:11:23 +01:00
Tim Rühsen
f1ce7f5bd6 * src/http.c (metalink_from_http): Remove use of alloca 2020-02-13 16:00:19 +01:00
Tim Rühsen
704208b766 * src/http.c (basic_authentication_encode): Remove use of alloca 2020-02-13 15:54:16 +01:00
Tim Rühsen
0bc0729bcc * src/http.c (gethttp): Remove use of alloca 2020-02-13 15:40:48 +01:00
Tim Rühsen
572f6f9b39 * src/http.c (gethttp): Remove use of alloca 2020-02-13 15:34:13 +01:00
Tim Rühsen
e22dbe5af0 * src/http.c (set_file_timestamp): Remove use of alloca 2020-02-13 15:30:50 +01:00
Tim Rühsen
f460e1d049 * src/main.c (main): Remove use of alloca 2020-02-13 15:17:27 +01:00
Tim Rühsen
c0d8cceb93 * src/url.c (append_uri_pathel): Replace alloca by fixed array / sprintf 2020-02-13 15:04:17 +01:00
Tim Rühsen
c2d03b6293 * src/url.c (append_uri_pathel): Replace alloca by fixed array / xmalloc 2020-02-13 13:32:16 +01:00
Tim Rühsen
9adde1e441 * src/utils.c (make_directory): Replace alloca by fixed array / xmalloc 2020-02-13 12:09:34 +01:00
Tim Rühsen
4dd9dee2e7 * src/utils.c (unique_name_1): Replace alloca by xmalloc 2020-02-13 11:48:06 +01:00
Tim Rühsen
233f982f9d Add buffer size param to warc_uuid_str
* src/http.c (gethttp): Add buffer size param to warc_uuid_str.
* src/warc.c: Likewise
* src/warc.h: Likewise
2020-02-13 11:28:18 +01:00
Tim Rühsen
e5d0dda561 * src/http-ntlm.c (ntlm_output): Remove alloca 2020-02-12 17:05:01 +01:00
Tim Rühsen
17fad78290 * src/http-ntlm.c (mkhash): Replace alloca by fixed length array 2020-02-12 16:56:57 +01:00
Tim Rühsen
1ebd88063d * src/http-ntlm.c (ntlm_input): Replace alloca by fixed length array 2020-02-12 16:44:59 +01:00
Tim Rühsen
c65c23cfc7 * src/gnutls.c (ssl_init): Replace alloca by fixed length arrays 2020-02-12 16:24:45 +01:00
Tim Rühsen
94b9332f50 * src/retr.c (fd_read_body): Fix signedness warnings 2020-02-12 16:14:40 +01:00
Tim Rühsen
fd75f5d986 * src/retr.c (rotate_backups): Replace alloca by fixed length arrays 2020-02-12 16:13:40 +01:00
Tim Rühsen
473db08580 * src/wget.h: Add inline to _unhex 2020-02-12 16:12:09 +01:00
Tim Rühsen
0bb97fecb7 * src/metalink.h: Include dirname.h, remove declaration of last_component 2020-02-12 16:10:58 +01:00
Tim Rühsen
5debe0a96f * configure.ac: Add -Wno-undef -Wno-float-equal to gcc's WARN_CFLAGS 2020-02-12 16:09:57 +01:00
Tim Rühsen
8bc1d1447b * src/convert.c (convert_links): Fix previous commit 2020-02-12 10:52:06 +01:00
Tim Rühsen
fe4ade75cf * src/convert.c (convert_links): Add \n (Fixes #57795) 2020-02-12 09:57:27 +01:00
Ander Juaristi
928c54d27e Do not overwrite restval if len is smaller
* src/http.c (http_loop): overwrite 'restval' only if 'len' is
   greater than it. Else substract 'len' to 'restval'.

When retrying a request, only send a 'Range' header if the previous
request returned data.
2020-01-25 18:35:05 +01:00
Вячеслав Петрищев
33bc3aae51 Fix and cleanup progress bar code
*src/progress.c
 (struct dot_progress) accumulated, rows: Type changed to wgint
 (print_row_stats): Fix missing unit name 'T'
 (dot_update): Add ability to reduce dot_draw runtime
 (bar_update): Avoid integer overflow
2020-01-24 19:41:52 +01:00
Вячеслав Петрищев
d5dc68b1a9 * src/progress.c: Fix MINIMUM_SCREEN_WIDTH 2020-01-24 19:41:45 +01:00
Вячеслав Петрищев
68548acf0f * src/progress.c (prepare_filename): Replace zero-width mbc (\xe2\x80\x8b, ...) 2020-01-24 19:41:36 +01:00
Вячеслав Петрищев
ec68da677f Reenabling filename scrolling code in progress bar
* src/progress.c: Reenabling filename scrolling code
  (bar_create):  Reenabling file name scrolling.
  (bar_create):  Memory allocation, filename preparation.
  (bar_finish):  Filename  memory deallocation.
  (prepare_filename):  New function, replaces unprintable chars.
2020-01-24 19:39:51 +01:00
Вячеслав Петрищев
f7a1e6cd7b Fix multibyte handling in progress bar
* src/progress.c
  (count_cols): Fix return value if invalid multibyte sequence was encountered
  (bar_draw): Fix xrealoc size
2020-01-24 19:38:52 +01:00
Tim Rühsen
e2c0c2fbe5 * src/progress.c (print_row_stats): Fix two integer overflows 2020-01-10 13:56:39 +01:00
Tim Rühsen
bc7e82d3e9 * .gitlab-ci.yml: Fix path for llvm-symbolizer 2020-01-10 13:56:39 +01:00
Tim Rühsen
c1a46e9a3b * fuzz/wget_progress_fuzzer.in/*: Add fuzzer corpora 2020-01-10 13:56:39 +01:00
Tim Rühsen
f27daa1c17 * src/retr.c (calc_rate): Remove unwanted assertions 2020-01-10 13:56:39 +01:00
Tim Rühsen
07eebd2a20 Fix buffer overflows in progress 'bar' code
* src/progress.c (progress_interactive_p): Sanitize input.
  (progress_update): Likewise.
  (bar_create): Use larger BUF_LEN.
  (bar_create): Remove superfluous memset.
  (bar_create): Fix filename layout.
  (bar_create): Remove filename scrolling code, it caused many buffer
  overflows later in bar_create.
  (bar_create): Support TB/s download speed.
2020-01-10 13:56:39 +01:00
Tim Rühsen
34573bdf46 Add new fuzzer for the progress bar code
* Makefile.am: Add wget_progress_fuzzer.
* wget_progress_fuzzer.c: New file.
2020-01-10 13:56:39 +01:00
Darshit Shah
221f1ba3ef Update copyright year to 2020 2020-01-10 12:56:08 +01:00
Darshit Shah
c7fdfe3d60 * cfg.mk: Set update-copyright to use intervals 2020-01-10 12:52:36 +01:00
Tim Rühsen
6bd74e33d6 Fix segfault in progress bar in certain locales
* src/progress.c (create_image): Protect memset from negative count

Reported-by: JunDong Xie
2019-12-27 13:43:22 +01:00
Tim Rühsen
042f2727bf * src/progress.c (count_cols): Fix return value if USE_NLS_PROGRESS_BAR is undefined
Taking patch from #54126
Reported-by: Vyacheslav
Copyright-paperwork-exempt: Yes
2019-12-27 13:42:58 +01:00
Tim Rühsen
ce8ce5bfc0 * src/progress.c: Allow const names for set_progress_implementation. 2019-12-27 13:42:30 +01:00
Tim Rühsen
61b8078672 * src/progress.c (dot_draw): Avoid integer overflow 2019-12-27 13:42:01 +01:00
Tim Rühsen
03a8e59d85 * fuzz/README.md: Add --enable-assert to fuzzing build 2019-12-27 13:41:20 +01:00
Tim Rühsen
abe1ab1916 * src/progress.c (print_row_stats): Fix UB if eta < 0 2019-12-27 13:41:01 +01:00
Tim Rühsen
542524855a * src/progress.c (dot_update, dot_finish): Sanitize input 2019-12-27 13:40:52 +01:00
Tim Rühsen
f5d1dcf718 * src/retr.c (calc_rate): Fix division by 0 2019-12-27 13:40:33 +01:00
Tim Rühsen
1c1cba3a43 * src/retr.c (calc_rate): Add TB/s 2019-12-27 13:39:55 +01:00
Tim Rühsen
0179138fe5 * src/progress.c (create_image): Sanitize input param 'dl_total_time' 2019-12-27 13:39:50 +01:00
Tim Rühsen
ed135257b2 * fuzz/README.md: Update clang instructions 2019-12-27 13:39:11 +01:00
Lauri Nurmi
dd710bde96 Mark note to translators properly and elaborate its contents.
* src/progress.c (create_image): Likewise

The note was not even picked by xgettext to be included in the .pot,
so barely any translators even saw the note.
Also, this is one of the most cryptic messages to translate in wget,
unless the translator happens to guess where the string is used,
or looks at the source.

Copyright-paperwork-exempt: Yes
2019-12-26 19:02:36 +01:00
Lauri Nurmi
dc8bbdbb05 * src/main.c (print_help): Don't cut translatable string mid-sentence.
Complicates translating.

Copyright-paperwork-exempt: Yes
2019-12-26 19:00:11 +01:00
Tim Rühsen
777049389f * fuzz/wget_read_hunk_fuzzer.c: Use cast to fix C++ error 2019-11-24 16:33:34 +01:00
Tim Rühsen
96d74948a3 * src/Makefile.am: Add build_info.c to EXTRA_DIST 2019-11-21 12:16:28 +01:00
Tim Rühsen
b1f566719c * .gitlab-ci.yml: Skip tests on tarball build due to missing perl 2019-11-21 12:16:04 +01:00
Tim Rühsen
0751d053f5 * tests/WgetTests.pm: Support to set the wget executable for testing 2019-11-21 11:24:48 +01:00
Tim Rühsen
4cdda68752 * .gitlab-ci.yml: Add --with-ssl=no 2019-11-21 11:01:27 +01:00
Tim Rühsen
48f762a648 * .gitlab-ci.yml: Allow failure for Valgrind and Scan-Build CI runner 2019-11-21 10:56:10 +01:00
Tim Rühsen
feb52bfab7 * src/ftp.c (delelement): Make sure free'd pointer is set to NULL 2019-11-21 10:56:10 +01:00
Tim Rühsen
1656255767 * configure.ac: Remove -fno-sanitize-recover=integer
With this option on, several overflows from gnulib code (all
harmless and on purpose) would break our tests.
2019-11-21 10:56:10 +01:00
Tim Rühsen
2ba8da8f22 Replace XDIGIT_TO_NUM by _unhex() with proper unsigned handling
* src/wget.h: Replace XDIGIT_TO_NUM by _unhex()
* src/html-parse.c (decode_entity): Use _unhex()
* src/host.c (is_valid_ipv6_address): Use _unhex()
* src/url.c (url_unescape_1): Use unsigned char to avoid UB
* src/res.c (free_specs): Likewise

Code taken from Wget2. XDIGIT_TO_NUM had a signed issue, detected by
scan-build static anylyzer.
2019-11-21 10:56:10 +01:00
Tim Rühsen
a255d9f0c8 * src/connect.c (select_fd): Check for negative fd 2019-11-21 10:56:10 +01:00
Tim Rühsen
823a9c8e0d * .gitlab-ci.yml: Enable Windows executables for MinGW runner 2019-11-21 10:56:10 +01:00
Tim Rühsen
57ac97e6d8 * .gitlab-ci.yml: Add CI runners from Wget2 2019-11-21 10:56:10 +01:00
Tomas Hozza
bac6fbab6c testenv: enable running tests on different wget binary
* testenv/README: Document $WGET_PATH
* testenv/test/base_test.py: Use $WGET_PATH instead ../src/wget if set

Previously tests in testenv/ directory were run only on wget binary
which was built from sources in src/ directory. However as a
wget maintainer in a Linux distribution, I would like to be able to run
upstream tests on the wget binary distributed with the distribution.

This change enables one to define WGET_PATH environment variable
to a path to wget binary which should be used by tests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2019-11-21 10:50:34 +01:00
Tim Rühsen
1e4262e98d * AUTHORS: Add Darshit Shah and Tim Rühsen as maintainers 2019-11-21 10:49:56 +01:00
Tim Rühsen
6f3baab02c * src/cookie.c: Fix cookie file header to be recognized by 'file' 2019-11-19 12:37:46 +01:00
Tim Rühsen
b4dba956ce * .mailmap: Allow mapping contributors for statistics 2019-11-19 12:37:46 +01:00
Darshit Shah
f3b25875ab * configure.ac: Ignore -Wchkp which is deprecated 2019-10-03 13:49:32 +02:00
Darshit Shah
cd21cb3812 Update gnulib
* gnulib: Pull submodule
* bootstrap: Update file from gnulib
2019-10-03 13:45:02 +02:00
Tim Rühsen
b3f86f90cc Revert "Add . to perl path for all perl tests"
This reverts commit 79be99aff4.

/usr/bin/env 8.28 and below doesn't know -S.
2019-05-30 12:06:01 +02:00
Darshit Shah
60dc09b507 Revert " Hi, Thank you again Darshit for your response. The RejectHeaderField rule rejects ANY header"
I accidentally commited this patch.

This reverts commit 4ce2f93600.
2019-05-30 11:19:46 +02:00
Darshit Shah
02c059a857 * .gitignore: Update gitignore file 2019-05-30 11:19:15 +02:00
sulfastor
4ce2f93600 Hi, Thank you again Darshit for your response. The RejectHeaderField rule rejects ANY header
of the header field while RejectHeader rejects ONLY the specified full header.
	Since we wanted to be sure a header field is not sent to the server we wrote this rule.

	* doc/wget.texi: Added --disable-header documentation.
        * fuzz/wget_options_fuzzer.dict: Update with --disable-header inputs.
        * src/http.c (disabled_header): Checks for disabled headers
	(request_set_header): Doesn't let header to be set if disabled
	(gethttp): frees disabled header to let overriding
        * src/init.c (cmd_dis_header), (check_user_disabled_header) added new option disabled_headers.
        * src/main.c: added new option --disable-header, added help description
        * src/options.h: added new option --disable-header
	* src/utils.h (vec_remove_header)
	* src/utils.c (vec_remove_header) removes all header instances from vector
        * testenv/Makefile.am: Added new test files
        * testenv/server/http/http_server.py: Added new rule RejectHeaderField
        * testenv/conf/reject_header_field.py: Added new rule RejectHeaderField
        * testenv/README: Added help description for new rule
        * testenv/Test-disable-default-headers.py: Test without using --header
        * testenv/Test-disable-headers-after.py: Test using --header before --disable-header
        * testenv/Test-disable-headers-before.py: Test using --header after --disable-header

Signed-off-by: sulfastor <torresmoisesa@gmail.com>, adham elkarn <adhamelkarn@hotmail.com>
2019-05-30 10:01:24 +02:00
Tim Rühsen
0cdbc715a9 * src/log.c (log_vprintf_internal): Don't log twice 2019-05-28 16:26:03 +02:00
AviSoomirtee
95a677c7f5 * src/openssl.c (ssl_init): post handshake auth for OpenSSL
Copyright-paperwork-exempt: Yes
2019-05-25 18:10:37 +02:00
Tim Rühsen
96f48bf412 * bootstrap.conf: Explicitly set source_base and test_base 2019-05-24 11:14:19 +02:00
Tim Rühsen
95de9cd97f * src/convert.c (convert_basename): Do not pass NULL to strrchr() 2019-05-07 17:06:04 +02:00
Tim Rühsen
fac8f8099d * src/url.c (append_uri_pathel): Check for possible NULL dereference 2019-05-07 17:05:55 +02:00
Tim Rühsen
7da620c7ce * fuzz/main.c: Fix paths for WIN32 2019-05-07 17:05:32 +02:00
Tim Rühsen
e3790ad2a3 * bootstrap.conf: Work around VPATH issue 2019-05-07 17:05:26 +02:00
Tim Rühsen
021458ddf2 * configure.ac: Update gettext version to 0.19.3 2019-05-07 17:05:10 +02:00
Tim Rühsen
64618a9852 * bootstrap.conf: Remove rsync as prerequisite
'./bootstrap --skip-po' won't need wget nor rsync
2019-05-07 17:05:05 +02:00
Tim Rühsen
c9fa9d599e * bootstrap.conf: Replace prerequisite xz by gzip 2019-05-07 17:04:56 +02:00
Tim Rühsen
64f6f6847e Add sanitizer flags for ./configure
* bootstrap.conf: Add 'warning' gnulib module
* configure.ac: Add --enable-fsanitize-* flags
* tests/Makefile.am: Add compiler flags for unit testing
2019-05-03 11:27:30 +02:00
Tim Rühsen
94e2dd5ecd Add --enable-manywarnings from wget2
* .gitignore: Exclude /lib/Makefile.am
* bootstrap.conf: Use --makefile-name=gnulib.mk with gnulib-tool
* configure.ac: Use wget_MANYWARNINGS()
* lib/Makefile.am: Define empty noinst_LIBRARIES and MAINTAINERCLEANFILES
* m4/wget_manywarnings.m4: New file from GNU Wget2
* src/Makefile.am: Use WARN_CFLAGS for AM_CFLAGS
2019-05-02 12:53:19 +02:00
Tim Rühsen
14dc0c6af0 Add CONTRIBUTING.md
* CONTRIBUTING.md: New file for contributors
* README: Mention CONTRIBUTING.md
2019-04-28 20:36:14 +02:00
Tim Rühsen
6edf7a30b6 * fuzz/*.in/*: Update corpora from OSS-fuzz 2019-04-26 14:47:17 +02:00
Tim Rühsen
c34e9a8c47 * fuzz/get_ossfuzz_corpora: Remove -f from unzip, mkdir *.in/ 2019-04-26 14:14:12 +02:00
Tim Rühsen
370b778db2 * .gitlab-ci.yml: Update Gitlab CI WORKDIR to /usr/local 2019-04-26 11:04:03 +02:00
Eneas U de Queiroz
14e3712b8c * src/openssl.c: fix ssl_init for openssl 1.1.1
ssl_init fails with openssl 1.1.1 when openssl.cnf is not found.
Redundant calls to intialization functions were removed as
OPENSSL_config takes care of them for openssl versions < 1.1.0.
For versions > 1.1.0, OPENSSL_init_ssl is preferred.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
Copyright-paperwork-exempt: Yes
2019-04-26 10:33:49 +02:00
Leif Ryge
263546473f * doc/wget.texi: Fix typo in man page
Copyright-paperwork-exempt: Yes
2019-04-11 14:47:30 +02:00
raminfp
4574771a6a [log] miss check If logging is inhibited 2019-04-11 08:50:42 +00:00
Tim Rühsen
562eacb76a * src/iri.c (do_conversion): Remove unneeded debug lines 2019-04-05 13:01:57 +02:00
Darshit Shah
a220ead435 * NEWS: Update NEWS for new release 2019-04-05 11:59:19 +02:00
Tim Ruehsen
692d5c5215 Fix a buffer overflow vulnerability
* src/iri.c(do_conversion): Reallocate the output buffer to a larger
  size if it is already full
2019-04-05 11:54:30 +02:00
Darshit Shah
2ae601a719 * NEWS: Update NEWS for new release 2019-04-05 11:54:30 +02:00
Tim Rühsen
0eaa5f1771 * src/openssl.c (ssl_init): Check for X509_V_FLAG_PARTIAL_CHAIN 2019-04-03 14:54:45 +02:00
Darshit Shah
39f17b3555 * gnulib: Pull forward 2019-04-01 20:15:05 +02:00
Tim Rühsen
4c89c85a28 * fuzz/main.c (test_all_from): Fix indentation 2019-03-26 09:42:50 +01:00
Tim Rühsen
5d87635c66 Fix corner case in processing server response
* src/http.c (response_head_terminator): Don't access uninitialized data
* fuzz/wget_read_hunk_fuzzer.c: Sync response_head_terminator()
2019-03-25 16:05:56 +01:00
Tim Rühsen
4046cd2a71 Add new fuzzer wget_read_hunk_fuzzer.c
* fuzz/Makefile.am: Add wget_read_hunk_fuzzer
* fuzz/wget_read_hunk_fuzzer.c: New file
* fuzz/wget_read_hunk_fuzzer.in/*: Fuzz corpora
* src/connect.c: Add connect_cleanup()
* src/connect.h: Add prototype for connect_cleanup()
2019-03-25 14:57:07 +01:00
Tim Rühsen
ae6636a28f * fuzz/wget_netrc_fuzzer.c: Fix fuzzer 2019-03-03 17:05:58 +01:00
Tim Rühsen
acef0fb4c6 * fuzz/wget_ftpls_fuzzer.c: Fix fuzzer 2019-03-03 17:05:44 +01:00
Jeffrey Walton
7c1c8eb3b1 * src/openssl.c (ssl_init): Trust partial cert chain 2019-02-22 12:46:53 +01:00
Tim Rühsen
19661f1d9a * src/ftp-ls.c (ftp_parse_vms_ls): Use snprintf instead of strcpy/strcat 2019-02-20 10:32:47 +01:00
Darshit Shah
e39be32838 * src/html-url.c(get_urls_html_fm): Add message in verbose mode with no-follow attribute 2019-02-19 23:25:05 +01:00
Tim Rühsen
8d8abcffdf Fix fuzz/ tests for OpenBSD
* fuzz/wget_*_fuzzer.c: Take care when calling exit()
2019-02-19 17:18:49 +01:00
Tim Rühsen
93d21e4217 * fuzz/Makefile.am: Remove hard-coded gcc flags 2019-02-19 15:52:58 +01:00
Tim Rühsen
07f9fbd0b3 Fix STDERR closing/restoring in fuzzers
* fuzz/fuzzer.h: Add CLOSE_STDERR and RESTORE_STDERR
* fuzz/wget_*_fuzzer.c: Use CLOSE_STDERR and RESTORE_STDERR
2019-02-19 15:50:34 +01:00
Tim Rühsen
74866d9ea0 * configure.ac: Rearrange AM_ICONV before gl_INIT 2019-02-19 15:49:41 +01:00
Tim Rühsen
1098de2b49 Do not hard-code -ldl in fuzz/Makefile.am
* configure.ac: Search for dlopen and add library to $FUZZ_LIBS
* fuzz/Makefile.am: Link with $FUZZ_LIBS instead of -ldl

This fixes linking on BSD systems.

Reported-by: Nam Nguyen
2019-02-19 15:11:04 +01:00
Tim Rühsen
c7f31d62b2 * doc/wget.texi: Correct --logfile -> --output-file 2019-02-14 10:39:54 +01:00
Darshit Shah
c53552e8cd Update gnulib 2019-02-10 11:51:03 +01:00
Darshit Shah
8b975e83d3 Update copyright statements 2019-02-10 11:50:17 +01:00
Leon Klingele
9e7c1554bd docs: --no-cache also sets the 'Cache-Control: no-cache' header
* doc/wget.texi: Add Cache-Control to docs
* src/wget.h: Add Cache-Control to comment of SEND_NOCACHE

Copyright-paperwork-exempt: Yes
2019-01-23 22:04:01 +01:00
Tim Rühsen
caf30fbe28 * .gitlab-ci.yml: Add minimal build 2019-01-20 19:58:10 +01:00
Tim Rühsen
f1eda916a6 * src/init.c (cleanup): Check HAVE_HSTS
Reported-by: Simon Dales
2019-01-20 19:42:53 +01:00
André Wolski
5dceb6626b NTLM restart authentication (trivial change)
* src/http-ntlm.c (ntlm_input): Continue on NTLMSTATE_LAST,
  error on NTLMSTATE_TYPE3

The code comes from the cURL project. Thanks to Daniel Stenberg
for donating the code.

https://lists.gnu.org/archive/html/bug-wget/2018-12/msg00030.html
2018-12-31 10:24:27 +01:00
Tim Rühsen
fc65b4521a * contrib/spell-checker: Remove trailing whitespace 2018-12-28 19:05:42 +01:00
Tim Rühsen
fdb7fe613c Fix typos detected by codespell (via contrib/spell-checker) 2018-12-28 18:58:15 +01:00
Tim Rühsen
c0427ebf3c * contrib/spell-checker: Add script for spell checking 2018-12-28 18:55:20 +01:00
Tim Rühsen
af16b0f38f * fuzz/Makefile.am: Fix order of libraries for linking 2018-12-27 20:48:36 +01:00
Tim Rühsen
6ba1cb587c * src/wget.h: #undef _Noreturn when building with C++ 2018-12-27 20:47:58 +01:00
Tim Rühsen
5811c2222b * src/gnutls.c (ssl_connect_wget): Fix call to gnutls_set_default_priority() 2018-12-27 20:46:55 +01:00
Tim Rühsen
70cddf3e29 * NEWS: Add release changes for 1.20.1 2018-12-26 20:35:41 +01:00
Tim Rühsen
3cdfb594cf Don't save user/pw with --xattr
Also the Referer info is reduced to scheme+host+port.

* src/ftp.c (getftp): Change params of set_file_metadata()
* src/http.c (gethttp): Change params of set_file_metadata()
* src/xattr.c (set_file_metadata): Remove user/password from origin URL,
  reduce Referer value to scheme/host/port.
* src/xattr.h: Change prototype of set_file_metadata()
2018-12-26 14:38:24 +01:00
Tim Rühsen
c125d24762 Don't use extended attributes (--xattr) by default
* src/init.c (defaults): Set enable_xattr to false by default
* src/main.c (print_help): Reverse option logic of --xattr
* doc/wget.texi: Add description for --xattr

Users may not be aware that the origin URL and Referer are saved
including credentials, and possibly access tokens within
the urls.
2018-12-26 14:06:38 +01:00
Tim Rühsen
7c0a30d724 * .travis.yml: Email to wget-dev instead bug-wget mailing list 2018-12-13 15:22:17 +01:00
Darshit Shah
3becef17cb * NEWS: Prepare for new version 2018-11-30 01:11:19 +01:00
Darshit Shah
8f780fa274 * contrib/make-release: Add a small checklist for pending tasks 2018-11-13 17:44:51 +01:00
Darshit Shah
e55916e5de Prepare NEWS for new release 2018-11-13 16:24:17 +01:00
Darshit Shah
c4a6b89b2e * configure.ac: gnulib now expects autoconf >=2.63 2018-11-13 16:20:19 +01:00
Darshit Shah
3d4e1f47a1 * gnulib: Update library 2018-11-13 16:20:19 +01:00
Jay Satiro
61271d87f6 * src/init.c: Stop freeing the pointer returned by ws_mypath()
.. since ws_mypath() saves the address it returns in a static pointer
for reuse, to also be returned in later calls.
2018-11-13 15:51:51 +01:00
Darshit Shah
2bc2d2f803 * src/ftp.c(ftp_retrieve_glob): Honor {accept,reject}-regex switches as well 2018-11-13 15:51:51 +01:00
Darshit Shah
8c741da256 * src/ftp.c (ftp_retrieve_glob): Refactor to prevent looping over listing multiple times 2018-11-13 15:51:51 +01:00
Tim Rühsen
d3383d619b * .gitlab-ci.yml: Split into GnuTLS and OpenSSL build 2018-11-11 18:43:46 +01:00
Tim Rühsen
62dced2f43 * Makefile.am: dist clean po/stamp-po 2018-11-11 17:51:37 +01:00
Tim Rühsen
04116409a8 Remove auto-generated files from po/ 2018-11-11 16:58:09 +01:00
Tim Rühsen
7b8325b416 Add VPATH build 2018-11-11 16:57:41 +01:00
Tim Rühsen
11fad3fa72 Revert "Bail out on unexpected 416 server errors"
This reverts commit 6f3b995993.

The code is obviously wrong, see https://savannah.gnu.org/bugs/?54963
Also, the example from the original post doesn't work any more.
With other words, the broken server behavior has been fixed meanwhile.
2018-11-09 16:16:43 +01:00
Rosen Penev
a3643c6076 openssl: Do not use engines when OpenSSL does not support
* src/openssl.c: Check for OPENSSL_NO_ENGINE before
 including openssl/engine.h and before calling ENGINE_load_builtin_engines()

Fixes compilation with no engines compiled.

Copyright-paperwork-exempt: Yes
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-11-09 16:01:51 +01:00
Tim Rühsen
ed23e682da Fix HTTPS Perl tests
* tests/SSLTest.pm: Rename server cert and key file
* tests/Test-https*.px: Fix and remove OpenSSL hard-coding
* tests/certs/create-certs.sh: Script to generate test files
* tests/certs/*-template.txt: GnuTLS template files for certs and crl
* tests/certs/*.pem: Keys, certs, crls
* tests/certs/README: Removed commands, link to create-certs.sh
2018-11-09 15:47:53 +01:00
Kapus, Timotej
6d7cd9313c Replace some loops with string.h functions
* src/init.c: Replace loop with strspn
* src/url.c: Replace loop with strrchr

Copyright-paperwork-exempt: Yes
2018-10-28 10:36:46 +01:00
Luiz Angelo Daros de Luca
7903dbc9d8 * .gitmodules: Use https:// instead of git:// for gnulib
git:// does not work over http proxy

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Copyright-paperwork-exempt: Yes
2018-10-26 22:55:44 +02:00
Luiz Angelo Daros de Luca
fd85ac9cc6 * src/host.c (sufmatch): Fix dot-prefixed domain matching
Current sufmatch does not match when domain is dot-prefixed.
The example of no_proxy in man (.mit.edu) does use a dot-prefixed
domain.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Copyright-paperwork-exempt: Yes
2018-10-26 22:54:26 +02:00
Tim Rühsen
21daa24e72 * src/convert.c (convert_links): Fix fallthrough 2018-10-26 22:52:41 +02:00
Darshit Shah
6d6679ba86 * bootstrap: Update script from gnulib 2018-10-22 16:45:58 +02:00
Darshit Shah
d18f78b86b * gnulib: Update library 2018-10-22 16:45:58 +02:00
Tim Rühsen
85310bfa58 * .lgtm.yml: New file to add LGTM to Gitlab.com CI 2018-10-19 12:32:01 +02:00
Tim Rühsen
b29854528a * configure.ac: Fix build issue with libgpgme 2018-10-16 10:31:54 +02:00
Tim Rühsen
3d518f125c * fuzz/*_fuzzer.in/*: Update fuzzer corpora 2018-10-14 15:15:49 +02:00
Nikos Mavrogiannopoulos
c11cc83d9e Enable post-handshake auth under gnutls on TLS1.3 2018-10-08 15:55:48 +02:00
Tim Rühsen
0727b8f3a9 * src/http.c (resp_new): Fix code to avoid false positive by clang 2018-09-20 14:59:06 +02:00
Tim Rühsen
88a49c1e41 * src/convert.c (convert_links): Fix code to avoid false positive by clang 2018-09-20 14:58:27 +02:00
Tim Rühsen
02afe1e41c Add support for PCRE2 pattern matching
* configure.ac: Check for libpcre2-8
* src/init.c (choices): Test for HAVE_LIBPCRE2
* src/main.c (main): Set regex compile and match functions
* src/options.h: Test for HAVE_LIBPCRE2
* src/utils.c: Include pcre2.h, add functions
  compile_pcre2_regex() and match_pcre2_regex()
* src/utils.h: Declare compile_pcre2_regex() and match_pcre2_regex()

Fixes #54677
Reported-by: Noël Köthe
2018-09-19 16:22:25 +02:00
Tim Rühsen
79be99aff4 Add . to perl path for all perl tests
* tests/*.px: Add -I . to the shebang

This allows perl test to be run from tests/ directory, e.g. via
  ./Test--post-file.px
2018-09-07 10:48:14 +02:00
Tomas Hozza
2bbdfd76da Add TLS 1.3 support for GnuTLS
* doc/wget.texi: Add "TLSv1_3" to --secure-protocol
* src/gnutls.c (set_prio_default): Use GNUTLS_TLS1_3 where needed

Wget currently allows specifying "TLSv1_3" as the parameter for
--secure-protocol option. However it is only implemented for OpenSSL
and in case wget is compiled with GnuTLS, it causes wget to abort with:
GnuTLS: unimplemented 'secure-protocol' option value 6

GnuTLS contains TLS 1.3 implementation since version 3.6.3 [1]. However
currently it must be enabled explicitly in the application of it to be
used. This will change after the draft is finalized. [2] However for
the time being, I enabled it explicitly in case "TLSv1_3" is used with
--secure-protocol.

I also fixed man page to contain "TLSv1_3" in all listings of available
parameters for --secure-protocol

[1] https://lists.gnupg.org/pipermail/gnutls-devel/2018-July/008584.html
[2] https://nikmav.blogspot.com/2018/05/gnutls-and-tls-13.html

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2018-09-07 09:56:02 +02:00
Tomas Korbar
7ddcebd61e Avoid creating empty wget-log when using -O and -q in background
* src/log.c (check_redirect_output): Check for quiet mode
2018-08-29 12:34:03 +02:00
Tomas Hozza
2f451dbf4e * src/warc.c (warc_write_cdx_record): Fix RESOURCE LEAK found by Coverity
Error: RESOURCE_LEAK (CWE-772): - REAL ERROR
wget-1.19.5/src/warc.c:1376: alloc_fn: Storage is returned from allocation function "url_escape".
wget-1.19.5/src/url.c:284:3: alloc_fn: Storage is returned from allocation function "url_escape_1".
wget-1.19.5/src/url.c:255:3: alloc_fn: Storage is returned from allocation function "xmalloc".
wget-1.19.5/lib/xmalloc.c:41:11: alloc_fn: Storage is returned from allocation function "malloc".
wget-1.19.5/lib/xmalloc.c:41:11: var_assign: Assigning: "p" = "malloc(n)".
wget-1.19.5/lib/xmalloc.c:44:3: return_alloc: Returning allocated memory "p".
wget-1.19.5/src/url.c:255:3: var_assign: Assigning: "newstr" = "xmalloc(newlen + 1)".
wget-1.19.5/src/url.c:258:3: var_assign: Assigning: "p2" = "newstr".
wget-1.19.5/src/url.c:275:3: return_alloc: Returning allocated memory "newstr".
wget-1.19.5/src/url.c:284:3: return_alloc_fn: Directly returning storage allocated by "url_escape_1".
wget-1.19.5/src/warc.c:1376: var_assign: Assigning: "redirect_location" = storage returned from "url_escape(redirect_location)".
wget-1.19.5/src/warc.c:1381: noescape: Resource "redirect_location" is not freed or pointed-to in "fprintf".
wget-1.19.5/src/warc.c:1387: leaked_storage: Returning without freeing "redirect_location" leaks the storage that it points to.
\# 1385|     fflush (warc_current_cdx_file);
\# 1386|
\# 1387|->   return true;
\# 1388|   }
\# 1389|

url_escape() really returns a newly allocated memory and it leaks when the warc_write_cdx_record() returns. The memory returned from url_escape() is usually stored in a temporary variable in other parts of the project and then freed. I took the same approach.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2018-08-27 13:25:34 +02:00
Tomas Hozza
8b451f9f21 * src/warc.c (warc_write_start_record): Fix potential RESOURCE LEAK
In warc_write_start_record() function, the reutrn value of dup() is
directly used in gzdopen() call and not stored anywhere. However the
zlib documentation says that "The duplicated descriptor should be saved
to avoid a leak, since gzdopen does not close fd if it fails." [1].
This change stores the FD in a variable and closes it in case gzopen()
fails.

[1] https://www.zlib.net/manual.html

Error: RESOURCE_LEAK (CWE-772):
wget-1.19.5/src/warc.c:217: open_fn: Returning handle opened by "dup".
wget-1.19.5/src/warc.c:217: leaked_handle: Failing to save or close handle opened by "dup(fileno(warc_current_file))" leaks it.
\#  215|
\#  216|         /* Start a new GZIP stream. */
\#  217|->       warc_current_gzfile = gzdopen (dup (fileno (warc_current_file)), "wb9");
\#  218|         warc_current_gzfile_uncompressed_size = 0;
\#  219|

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2018-08-27 13:25:07 +02:00
Tomas Hozza
c045cdded4 * src/utils.c (open_stat): Fix RESOURCE LEAK found by Coverity
Error: RESOURCE_LEAK (CWE-772):
wget-1.19.5/src/utils.c:914: open_fn: Returning handle opened by "open". [Note: The source code implementation of the function has been overridden by a user model.]
wget-1.19.5/src/utils.c:914: var_assign: Assigning: "fd" = handle returned from "open(fname, flags, mode)".
wget-1.19.5/src/utils.c:921: noescape: Resource "fd" is not freed or pointed-to in "fstat". [Note: The source code implementation of the function has been overridden by a builtin model.]
wget-1.19.5/src/utils.c:924: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
\#  922|     {
\#  923|       logprintf (LOG_NOTQUIET, _("Failed to stat file %s, error: %s\n"), fname, strerror(errno));
\#  924|->     return -1;
\#  925|     }
\#  926|   #if !(defined(WINDOWS) || defined(__VMS))

This seems to be a real issue, since the opened file descriptor in "fd"
would leak. There is also additional check below the "fstat" call, which
closes the opened "fd".

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2018-08-27 13:24:46 +02:00
Tomas Hozza
dfef92bac3 * src/http.c (http_loop): Fix RESOURCE LEAK found by Coverity
Error: RESOURCE_LEAK (CWE-772):
wget-1.19.5/src/http.c:4486: alloc_fn: Storage is returned from allocation function "url_string".
wget-1.19.5/src/url.c:2248:3: alloc_fn: Storage is returned from allocation function "xmalloc".
wget-1.19.5/lib/xmalloc.c:41:11: alloc_fn: Storage is returned from allocation function "malloc".
wget-1.19.5/lib/xmalloc.c:41:11: var_assign: Assigning: "p" = "malloc(n)".
wget-1.19.5/lib/xmalloc.c:44:3: return_alloc: Returning allocated memory "p".
wget-1.19.5/src/url.c:2248:3: var_assign: Assigning: "result" = "xmalloc(size)".
wget-1.19.5/src/url.c:2248:3: var_assign: Assigning: "p" = "result".
wget-1.19.5/src/url.c:2250:3: noescape: Resource "p" is not freed or pointed-to in function "memcpy". [Note: The source code implementation of the function has been overridden by a builtin model.]
wget-1.19.5/src/url.c:2253:7: noescape: Resource "p" is not freed or pointed-to in function "memcpy". [Note: The source code implementation of the function has been overridden by a builtin model.]
wget-1.19.5/src/url.c:2257:11: noescape: Resource "p" is not freed or pointed-to in function "memcpy". [Note: The source code implementation of the function has been overridden by a builtin model.]
wget-1.19.5/src/url.c:2264:3: noescape: Resource "p" is not freed or pointed-to in function "memcpy". [Note: The source code implementation of the function has been overridden by a builtin model.]
wget-1.19.5/src/url.c:2270:7: identity_transfer: Passing "p" as argument 1 to function "number_to_string", which returns an offset off that argument.
wget-1.19.5/src/utils.c:1776:11: var_assign_parm: Assigning: "p" = "buffer".
wget-1.19.5/src/utils.c:1847:3: return_var: Returning "p", which is a copy of a parameter.
wget-1.19.5/src/url.c:2270:7: noescape: Resource "p" is not freed or pointed-to in function "number_to_string".
wget-1.19.5/src/utils.c:1774:25: noescape: "number_to_string(char *, wgint)" does not free or save its parameter "buffer".
wget-1.19.5/src/url.c:2270:7: var_assign: Assigning: "p" = "number_to_string(p, url->port)".
wget-1.19.5/src/url.c:2273:3: noescape: Resource "p" is not freed or pointed-to in function "full_path_write".
wget-1.19.5/src/url.c:1078:47: noescape: "full_path_write(struct url const *, char *)" does not free or save its parameter "where".
wget-1.19.5/src/url.c:2287:3: return_alloc: Returning allocated memory "result".
wget-1.19.5/src/http.c:4486: var_assign: Assigning: "hurl" = storage returned from "url_string(u, URL_AUTH_HIDE_PASSWD)".
wget-1.19.5/src/http.c:4487: noescape: Resource "hurl" is not freed or pointed-to in "logprintf".
wget-1.19.5/src/http.c:4513: leaked_storage: Variable "hurl" going out of scope leaks the storage it points to.
\# 4511|               {
\# 4512|                 printwhat (count, opt.ntry);
\# 4513|->               continue;
\# 4514|               }
\# 4515|             else

There are two conditional branches, which call continue, without freeing memory potentially allocated and pointed to by"hurl" pointer. In fase "!opt.verbose" is True and some of the appropriate conditions in the following if/else if construction, in which "continue" is called, are also true, then the memory allocated to "hurl" will leak.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2018-08-27 13:24:24 +02:00
Tomas Hozza
b8be904ac7 * src/http.c (check_auth): Fix RESOURCE LEAK found by Coverity
Error: RESOURCE_LEAK (CWE-772):
wget-1.19.5/src/http.c:2434: alloc_fn: Storage is returned from allocation function "xmalloc".
wget-1.19.5/lib/xmalloc.c:41:11: alloc_fn: Storage is returned from allocation function "malloc".
wget-1.19.5/lib/xmalloc.c:41:11: var_assign: Assigning: "p" = "malloc(n)".
wget-1.19.5/lib/xmalloc.c:44:3: return_alloc: Returning allocated memory "p".
wget-1.19.5/src/http.c:2434: var_assign: Assigning: "auth_stat" = storage returned from "xmalloc(4UL)".
wget-1.19.5/src/http.c:2446: noescape: Resource "auth_stat" is not freed or pointed-to in "create_authorization_line".
wget-1.19.5/src/http.c:5203:70: noescape: "create_authorization_line(char const *, char const *, char const *, char const *, char const *, _Bool *, uerr_t *)" does not free or save its parameter "auth_err".
wget-1.19.5/src/http.c:2476: leaked_storage: Variable "auth_stat" going out of scope leaks the storage it points to.
\# 2474|                 /* Creating the Authorization header went wrong */
\# 2475|               }
\# 2476|->         }
\# 2477|         else
\# 2478|           {

Error: RESOURCE_LEAK (CWE-772):
wget-1.19.5/src/http.c:2431: alloc_fn: Storage is returned from allocation function "url_full_path".
wget-1.19.5/src/url.c:1105:19: alloc_fn: Storage is returned from allocation function "xmalloc".
wget-1.19.5/lib/xmalloc.c:41:11: alloc_fn: Storage is returned from allocation function "malloc".
wget-1.19.5/lib/xmalloc.c:41:11: var_assign: Assigning: "p" = "malloc(n)".
wget-1.19.5/lib/xmalloc.c:44:3: return_alloc: Returning allocated memory "p".
wget-1.19.5/src/url.c:1105:19: var_assign: Assigning: "full_path" = "xmalloc(length + 1)".
wget-1.19.5/src/url.c:1107:3: noescape: Resource "full_path" is not freed or pointed-to in function "full_path_write".
wget-1.19.5/src/url.c:1078:47: noescape: "full_path_write(struct url const *, char *)" does not free or save its parameter "where".
wget-1.19.5/src/url.c:1110:3: return_alloc: Returning allocated memory "full_path".
wget-1.19.5/src/http.c:2431: var_assign: Assigning: "pth" = storage returned from "url_full_path(u)".
wget-1.19.5/src/http.c:2446: noescape: Resource "pth" is not freed or pointed-to in "create_authorization_line".
wget-1.19.5/src/http.c:5203:40: noescape: "create_authorization_line(char const *, char const *, char const *, char const *, char const *, _Bool *, uerr_t *)" does not free or save its parameter "path".
wget-1.19.5/src/http.c:2476: leaked_storage: Variable "pth" going out of scope leaks the storage it points to.
\# 2474|                 /* Creating the Authorization header went wrong */
\# 2475|               }
\# 2476|->         }
\# 2477|         else
\# 2478|           {

Both "pth" and "auth_stat" are allocated in "check_auth()" function. These are used for creating the HTTP Authorization Request header via "create_authorization_line()" function. In case the creation went OK (auth_err == RETROK), then the memory previously allocated to "pth" and "auth_stat" is freed. However if the creation failed, then the memory is never freed and it leaks.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2018-08-27 13:23:52 +02:00
Tomas Hozza
b24351183e * src/ftp.c (getftp): Fix RESOURCE LEAK found by Coverity
Error: RESOURCE_LEAK (CWE-772):
wget-1.19.5/src/ftp.c:1493: alloc_fn: Storage is returned from allocation function "fopen".
wget-1.19.5/src/ftp.c:1493: var_assign: Assigning: "fp" = storage returned from "fopen(con->target, "wb")".
wget-1.19.5/src/ftp.c:1811: leaked_storage: Variable "fp" going out of scope leaks the storage it points to.
\# 1809|     if (fp && !output_stream)
\# 1810|       fclose (fp);
\# 1811|->   return err;
\# 1812|   }
\# 1813|

It can happen, that "if (!output_stream || con->cmd & DO_LIST)" on line #1398 can be true, even though "output_stream != NULL". In this case a new file is opened to "fp". Later it may happen in the FTPS branch, that some error will occure and code will jump to label "exit_error". In "exit_error", the "fp" is closed only if "output_stream == NULL". However this may not be true as described earlier and "fp" leaks.

On line #1588, there is the following conditional free of "fp":

  /* Close the local file.  */
  if (!output_stream || con->cmd & DO_LIST)
    fclose (fp);

Therefore the conditional at the end of the function after "exit_error" label should be modified to:

  if (fp && (!output_stream || con->cmd & DO_LIST))
    fclose (fp);

This will ensure that "fp" does not leak in any case it sould be opened.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2018-08-27 13:20:48 +02:00
Tomas Hozza
2b2283d3e2 Don't limit the test suite HTTPS server to TLSv1
In Fedora, we are implementing crypto policies, in order to enhance the
security of user systems. This is done on the system level by global
configuration. It may happen that due to the active policy, only
TLSv1.2 or higher will be available in crypto libraries. While wget as
a client will by default determine the minimal TLS version supported by
both client and server, the HTTPS server implementation in testenv/
hardcodes use of TLSv1. As a result all HTTPS related tests fail in
case a more hardened crypto policy is set on the Fedora system.

This change removes the explicit TLS version setting and leaves the
determination of the minimal supported TLS version on the server and
client.

More information about Fedora change can be found here:
https://fedoraproject.org/wiki/Changes/StrongCryptoSettings

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2018-08-11 12:51:13 +02:00
Tim Rühsen
122a9f08a3 * src/gnutls.c (ssl_check_certificate): Fix grammar of error msg
Reported-by: Nicholas Sielicki
2018-06-13 20:34:24 +02:00
Tim Rühsen
333746f787 * fuzz/Makefile.am: Remove libtool LTLIB... from LDADD 2018-06-13 20:16:46 +02:00
Tim Rühsen
4fc69950da * src/http.c (http_loop): Fix --retry-on-host-error 2018-06-13 20:16:22 +02:00
ethus3h
e7979da9e8 Add new option --retry-on-host-error
* doc/wget.texi: Add docs for --retry-on-host-error
* src/http.c (http_loop): Add code for HOSTERR
* src/init.c: Add option --retry-on-host-error
* src/main.c: Likewise
* src/options.h: Add options.retry_on_host_error

Copyright-paperwork-exempt: Yes
2018-06-13 20:10:28 +02:00
Tim Rühsen
ad261f41ce Save original data to WARC file
* src/retr.c (write_data): Cleanup,
  (fd_read_body): Write to WARC before uncompressing

Fixes: #53968
2018-05-29 10:52:20 +02:00
Tim Rühsen
c88500fca8 * fuzz/get_ossfuzz_corpora: Speed up corpora download 2018-05-10 19:33:59 +02:00
Tim Rühsen
4188fcdced * src/main.c (print_version): Silence UBSAN message 2018-05-09 13:56:20 +02:00
Tim Rühsen
4bdb09d3a7 * src/utils.ci (file_exists_p): Fix stat(NULL,...) 2018-05-09 12:37:03 +02:00
Tim Rühsen
35f5f79ce1 * src/hsts.c (open_hsts_test_store): Fix unlink(NULL) 2018-05-09 12:29:39 +02:00
Tim Rühsen
3cbdc67c96 * src/hash.c: Silence UBSAN for hash functions 2018-05-09 12:16:51 +02:00
Tim Rühsen
cdaee00259 * fuzz/*_fuzzer.in: Update corpora from OSS-Fuzz 2018-05-09 11:45:22 +02:00
Tim Rühsen
ad2471425f * fuzz/get_ossfuzz_corpora: Fix path 2018-05-09 11:44:18 +02:00
Tim Rühsen
ace96e4412 * src/hsts.h: Fix header guard 2018-05-08 10:17:06 +02:00
Tim Rühsen
77286a2e03 * src/version.h: Add header guard 2018-05-08 10:10:44 +02:00
Tim Rühsen
7eff94e881 * src/host.c (wait_ares): Remove void assignment
Reported-by: Josef Moellers
2018-05-08 09:36:48 +02:00
Tim Rühsen
15a39093b8 Update NEWS file for new release 2018-05-06 18:38:29 +02:00
Tim Rühsen
1fc9c95ec1 Fix cookie injection (CVE-2018-0494)
* src/http.c (resp_new): Replace \r\n by space in continuation lines

Fixes #53763
 "Malicious website can write arbitrary cookie entries to cookie jar"

HTTP header parsing left the \r\n from continuation line intact.
The Set-Cookie code didn't check and could be tricked to write
\r\n into the cookie jar, allowing a server to generate cookies at will.
2018-05-06 18:24:58 +02:00
Tim Rühsen
f51936745a * tests/Test-https-weboftrust.px: Skip test, needs cert regen 2018-05-06 18:19:50 +02:00
Tim Rühsen
491c6914cb Fix make syntax-check
* cfg.mk: Add fuzzer reproducers to exception list
* po/POTFILES.in: Add src/spider.c
2018-05-06 17:44:37 +02:00
Tim Rühsen
a6452061f8 Fix HTTPS tests
* tests/Test-https-badcerts.px: Fix test return value
* tests/Test-https-crl.px: Likewise
* README: How to create certs with GnuTLS's certtool
* tests/certs/revokedcrl.pem: Recreated revocation
* tests/certs/server.crt: Recreated server cert with no expiry
* tests/certs/test-ca-cert.pem: Recreated CA cert with no expiry
2018-05-06 17:30:42 +02:00
Tim Rühsen
77cf701416 * src/init.c: Bring new --ciphers into right order in options array 2018-05-06 12:49:46 +02:00
Ander Juaristi
c4eb863299 * doc/wget.texi: Add description for --ciphers 2018-05-05 22:50:23 +02:00
Ander Juarist
b9c4cadd84 OpenSSL: Better seeding of PRNG
* src/openssl.c (init_prng): keep gathering entropy even though we
                              already have enough
   (ssl_connect_with_timeout_callback): reseed PRNG again just before
                                        the handshake

Reported-by: Jeffrey Walton <noloader@gmail.com>
2018-05-05 22:49:06 +02:00
Ander Juaristi
744671aac6 Enhance SSL/TLS security
This commit hardens SSL/TLS a bit more in the following ways:

 * Explicitly exclude NULL authentication and the 'MEDIUM' cipher list
   category. Ciphers in the 'HIGH' level are only considered - this
   includes all symmetric ciphers with key lengths larger than 128 bits,
   and some ('modern') 128-bit ciphers, such as AES in GCM mode.
 * Allow RSA key exchange by default, but exclude it when
   Perfect Forward Secrecy is desired (with --secure-protocol=PFS).
 * Introduce new option --ciphers to set the cipher list that the SSL/TLS
   engine will favor. This string is fed directly to the underlying TLS
   library (GnuTLS or OpenSSL) without further processing, and hence its
   format and syntax are directly dependent on the specific library.

Reported-by: Jeffrey Walton <noloader@gmail.com>
2018-05-05 22:49:06 +02:00
Tim Rühsen
26a50942d8 * src/netrc.c (parse_netrc_fp): Fix two memleaks 2018-04-28 20:50:30 +02:00
Tim Rühsen
a1c9018797 Add new fuzzer for the .netrc parser
* fuzz/wget_netrc_fuzzer.c: New fuzzer
* fuzz/wget_netrc_fuzzer.dict: Fuzzer dictionary
* fuzz/wget_netrc_fuzzer.in: Initial corpora
* src/ftp.c (getftp): Amend call to search_netrc()
* src/http.c (initialize_request): Likewise
* src/netrc.c: Cleanup, prepare code for fuzzing
* src/netrc.h: Cleanup
2018-04-28 20:49:57 +02:00
Tim Rühsen
734d0aee15 * src/utils.c (match_tail): Fix unsigned integer overflow 2018-04-27 12:56:25 +02:00
Tim Rühsen
7de006bade Add new fuzzer for the Set-Cookie parser
* fuzz/Makefile.am: Add wget_cookie_fuzzer
* fuzz/wget_cookie_fuzzer.c: New fuzzer
* fuzz/wget_cookie_fuzzer.dict: Fuzzers dictionary
* fuzz/wget_cookie_fuzzer.in: Initial corpora
2018-04-27 12:56:25 +02:00
Tim Rühsen
78838d761f Fix buffer overflow in CSS parser
* src/css-url.c (get_uri_string): Check input length
* fuzz/wget_css_fuzzer.repro/buffer-overflow-6600180399865856:
  Add reproducer corpus

Fixes OSS-Fuzz issue #8033.
This is a long standing bug affecting all versions <= 1.19.4.
2018-04-26 22:40:28 +02:00
Tim Rühsen
cb47f3aaa4 Fix buffer overflow in CSS parser
* src/css-url.c (get_urls_css): Check input string length
* fuzz/wget_css_fuzzer.repro/negative-size-param-5724866467594240:
  Add reproducer corpus

Fixes OSS-Fuzz issue #8032.
This is a long standing bug affecting all versions <= 1.19.4.
2018-04-26 21:25:28 +02:00
Tim Rühsen
acfd9b4d56 Exclude fuzz corpora from tarball
* fuzz/Makefile.am: Do not include corpora in tarball
* fuzz/main.c: SKIP if corpora directory isn't found (make check)

The fuzz corpora are thousands of files, not needed for a standard build
from a distribution tarball. The reproducers of former issues are being
included for regression testing.
2018-04-26 16:18:01 +02:00
Tim Rühsen
ceb5d2d794 * tests/Makefile.am: Add -I/src to AM_CPPFLAGS 2018-04-26 16:17:10 +02:00
Tim Rühsen
939dbb0ebb Add CSS slowness reproducer (fixed)
* fuzz/wget_css_fuzzer.repro/slowness-6275836549267456: New file

This file created an extreme CPU usage with the old CSS parser.
2018-04-26 16:07:46 +02:00
Tim Rühsen
caa08d7470 Update CSS grammar from 1.x to 2.2
* src/css-tokens.h: Add enums and fixate values
* src/css.l: Include config.h,
  ignore several compiler warnings,
  update the grammar to CSS 2.2

Fixes OSS-Fuzz issue #8010 (slowness issue).
This is a long standing bug affecting all versions <= 1.19.4.

Some crafted CSS input was extremely slow / CPU wasting, so it could
be used as a DOS attack against website scanning.

The code/grammar changes were backported from Wget2.x.
2018-04-26 13:10:39 +02:00
Tim Rühsen
76fb1fe6f6 * src/res.c (add_path): Fix memleak (parsing robots.txt)
Fixes OSS-Fuzz issue #8005.
This is a long standing bug affecting all versions <= 1.19.4.
2018-04-25 11:33:38 +02:00
Tim Rühsen
fe6d1247ad * src/ftp-ls.c (ftp_parse_winnt_ls): Fix integer overflow
Fixes OSS-Fuzz issue #7999.
This is a long standing bug affecting all versions <= 1.19.4.
2018-04-25 09:37:29 +02:00
Tim Rühsen
02325168ca Add new fuzzer for the URL parser
* fuzz/Makefile.am: Add wget_url_fuzzer
* fuzz/wget_url_fuzzer.c: New fuzzer
* fuzz/wget_url_fuzzer.in: Initial corpora
2018-04-24 21:36:06 +02:00
Tim Rühsen
93e5a97f25 Add new fuzzer for robots.txt parsing
* fuzz/Makefile.am: Add wget_robots_fuzzer
* fuzz/wget_robots_fuzzer.c: New fuzzer
* fuzz/wget_robots_fuzzer.in: Initial corpora
2018-04-24 11:47:49 +02:00
Tim Rühsen
36482a21ea * fuzz/README.md: Add CFLAGS for undefined sanitizer 2018-04-24 11:30:06 +02:00
Tim Rühsen
7ee3ad1c48 * src/ftp-ls.c (ftp_parse_winnt_ls): Fix integer overflow 2018-04-24 11:11:47 +02:00
Tim Rühsen
79c1f333dc * src/ftp-ls.c (ftp_parse_vms_ls): Fix integer overflow by left shift 2018-04-24 11:05:52 +02:00
Tim Rühsen
d8365b0607 * src/ftp-ls.c (ftp_parse_unix_ls): Fix integer overflow in date parsing 2018-04-24 10:55:29 +02:00
Tim Rühsen
b0f802c46c * src/ftp-ls.c (ftp_parse_winnt_ls): Fix heap-buffer-overflow
Fixes OSS-Fuzz issue #7931.
This is a long standing bug affecting all versions <= 1.19.4.
2018-04-22 12:45:51 +02:00
Tim Rühsen
96c64a859d * src/ftp-ls.c (ftp_parse_winnt_ls): Fix heap-buffer-overflow
Fixes OSS-Fuzz issue #7930.
This is a long standing bug affecting all versions <= 1.19.4.
2018-04-22 11:33:35 +02:00
Tim Rühsen
2269cc2f1b * fuzz/wget_ftpls_fuzzer.in: Update corpora 2018-04-22 00:29:47 +02:00
Tim Rühsen
7d3da08537 * src/ftp-ls.c (eat_carets): Fix heap-buffer-overflow 2018-04-21 23:48:01 +02:00
Tim Rühsen
2b61c46183 * src/ftp-ls.c (ftp_parse_winnt_ls): Fix memleak 2018-04-21 22:52:01 +02:00
Tim Rühsen
f0d715b264 * src/ftp-ls.c (ftp_parse_vms_ls): Fix heap-buffer-overflow 2018-04-21 22:47:17 +02:00
Tim Rühsen
b3ff8ce3d5 * src/ftp-ls.c (ftp_parse_vms_ls): Fix heap-buffer-overflow 2018-04-21 22:45:03 +02:00
Tim Rühsen
c7014fbaea * src/ftp-ls.c (ftp_parse_vms_ls): Fix memleak 2018-04-21 22:42:30 +02:00
Tim Rühsen
407cd5f23b Add new fuzzer for the FTP listing parsers
* fuzz/Makefile.am: Add wget_ftpls_fuzzer
* fuzz/wget_ftpls_fuzzer.c: New fuzzer
* fuzz/wget_ftpls_fuzzer.dict: Fuzzer dictionary
* fuzz/wget_ftpls_fuzzer.in/starter: Starting corpus
* src/ftp-ls.c: Parsing function take FILE * as argument,
  new function ftp_parse_ls_fp()
* src/ftp.c: Remove static from freefileinfo()
* src/ftp.h: Add ftp_parse_ls_fp() and freefileinfo()
2018-04-21 19:24:25 +02:00
Tim Rühsen
fbc5f3736e * fuzz/run-clang.sh: Remove -detect_leaks=0 from fuzzer command line 2018-04-21 18:22:37 +02:00
Tim Rühsen
7ecfe3ef70 * src/main.c (main): Fix memleak for fuzzing/testing 2018-04-21 18:21:52 +02:00
Tim Rühsen
7e635d173e * src/init.c: Fix fuzzing in case ~/.wgetrc doesn't exist 2018-04-21 16:33:45 +02:00
Tim Rühsen
e83dd5b0aa Fix fuzzer build for C++
* fuzz/wget_css_fuzzer.c: Include wget.h outside 'extern "C"',
  undef fopen_wgetrc directly after wget.h
* fuzz/wget_html_fuzzer.c: Likewise
2018-04-20 23:59:58 +02:00
Tim Rühsen
0b02993e39 * fuzz/Makefile.am: Add -I/lib to oss-fuzz builds 2018-04-20 23:28:12 +02:00
Tim Rühsen
23b0275feb Add new HTML parser fuzzer
* fuzz/Makefile.am: Add wget_html_fuzzer
* fuzz/wget_html_fuzzer.c: New fuzzer
* fuzz/wget_html_fuzzer.dict: HTML dictionary for fuzzing
* fuzz/wget_html_fuzzer.in: Initial corpora
* src/html-url.c: Add new function get_urls_html_fm()
* src/html-url.h: Add ne function get_urls_html_fm()
* src/wget.h: Fix define for fopen_wgetrc()
2018-04-20 22:33:58 +02:00
Tim Rühsen
77c31d301b * fuzz/wget_css_fuzzer.c: Fix build 2018-04-20 20:06:50 +02:00
Tim Rühsen
30bd99f3f5 * fuzz/wget_css_fuzzer.in/*: Update fuzzer corpora 2018-04-20 20:04:59 +02:00
Tim Rühsen
c9a091ae45 * src/css-url.c (get_uri_string): Fix buffer overflow (read) 2018-04-20 11:37:52 +02:00
Tim Rühsen
7a5db30b01 * src/iri.h: Fix C++ compile error 2018-04-20 10:17:55 +02:00
Tim Rühsen
9d899d7bb7 * src/http.c: Download and scan CSS files in spider mode 2018-04-19 23:05:06 +02:00
Tim Rühsen
d25d036fba * src/css-url.c (get_urls_css): Call yylex_destroy() to reset CSS scanner 2018-04-19 23:05:06 +02:00
Tim Rühsen
c1a368af89 Add new fuzzer wget_css_fuzzer.c
* fuzz/Makefile.am: Add wget_css_fuzzer.c
* fuzz/wget_css_fuzzer.c: New fuzzer
2018-04-19 23:05:06 +02:00
Tim Rühsen
ff3c7733b7 * src/html-url.h: Include needed header files 2018-04-18 20:41:08 +02:00
Tim Rühsen
cc7f15a529 * wget_options_fuzzer.in/*: Update fuzzer corpora 2018-04-18 16:46:44 +02:00
Tim Rühsen
ae6390e6a4 * fuzz/README.md: Add CXXFLAGS and more configure options 2018-04-18 16:43:51 +02:00
Tim Rühsen
3ae58dae13 Fix oss-fuzz issue with exit()
* src/wget.h: Define exit() as exit_wget()
* fuzz/wget_options_fuzzer.c: Implement exit_wget() and cleanup
2018-04-18 13:26:10 +02:00
Tim Rühsen
bb03572c2a * fuzz/wget_options_fuzzer.c: Declare fopen_* as C functions 2018-04-17 23:35:42 +02:00
Tim Rühsen
66b416b6cd Fix fopen/stdin issues with fuzzing
* fuzz/wget_options_fuzzer.c: Add fopen_wget() and fopen_wgetrc()
* src/utils.c: Use fopen_wgetrc() for config files,
  don't read from stdin when fuzzing
* src/wget.h: Define fopen as fopen_wget when fuzzing,
  define fopen_wgetrc as fopen when not fuzzing
2018-04-17 23:02:04 +02:00
Tim Rühsen
fdd86aada9 * configure.ac: AC_DEFINE FUZZING if --enable-fuzzing was given 2018-04-17 15:55:58 +02:00
Tim Rühsen
ce90ed78b6 * fuzz/wget_options_fuzzer.c: Write fuzzer crash reports 2018-04-17 12:41:34 +02:00
Tim Rühsen
3c4a6506a5 * src/log.c: Don't check_redirect_output() when fuzzing 2018-04-17 12:40:47 +02:00
Tim Rühsen
fbb4cd231e * src/main.c (promt_for_password): Avoid getpass() when fuzzing 2018-04-17 12:15:18 +02:00
Tim Rühsen
3ceb6e5630 Fix double fclose() with -d while fuzzing
* src/ftp.c (ftp_loop_internal): Set warc_tmp to NULL after ffclose()
* src/init.c (cleanup): Set output_stream to NULL after fclose()
* src/log.c (log_close): Set global stream vars to NULL after closing
* src/recur.c (retrieve_tree): Set rejectedlog to NULL after closing
* src/warc.c (warc_close): Set stream vars to NULL after closing
2018-04-17 11:59:54 +02:00
Tim Rühsen
eaf167aaaa * src/main.c (main): Don't background if TESTING 2018-04-17 11:50:36 +02:00
Tim Rühsen
7d5de64fc9 * src/init.c (initialize): Return error, don't exit() 2018-04-17 11:42:43 +02:00
Tim Rühsen
70042265be * src/init.c (cmd_use_askpass): Return false on error 2018-04-16 23:04:53 +02:00
Tim Rühsen
64758655c4 * src/utils.c (compile_posix_regex): Hard-code string to regcomp
regcomp() may be too cpu + memory intensive for fuzzing.
See https://sourceware.org/glibc/wiki/Security%20Exceptions
2018-04-16 22:04:54 +02:00
Tim Rühsen
e737c4b10e Fix 2 more memleaks
* src/init.c (initialize): Use global var for wgetrc filename
* src/iri.c (find_locale): Return strdup'ed locale string
* src/options.h (struct options): Add wgetrcfile
2018-04-16 22:02:11 +02:00
Tim Rühsen
05a8c064e9 * src/init.c (cleanup): Set output_stream to NULL after closing 2018-04-16 13:22:29 +02:00
Tim Rühsen
01002a168a Fix homedir memory leaks
* src/hsts.c: Use opt.homedir
* src/init.c: Likewise
* src/main.c: Likewise
* src/netrc.c: Likewise
* src/options.h (struct options): Add homedir
2018-04-16 13:19:03 +02:00
Tim Rühsen
73fd57585c * src/main.c (main): Free opt.encoding_remote properly 2018-04-16 12:21:52 +02:00
Tim Rühsen
7963260e76 * src/host.c (wait_ares): Free ptimer 2018-04-16 11:58:18 +02:00
Tim Rühsen
99a7039def * src/init.c (cleanup): Free regex objects properly 2018-04-16 11:57:39 +02:00
Tim Rühsen
d7e3acb2cc * src/init.c (cleanup): Never call cleanup() twice 2018-04-16 09:58:51 +02:00
Tim Rühsen
e0860dd1ff * src/init.c (cmd_bytes_sum): Fix integer over- and underflow 2018-04-16 09:58:51 +02:00
Tim Rühsen
15ef79f808 * src/main.c (save_hsts): Free hsts_store after closing 2018-04-16 09:58:51 +02:00
Tim Rühsen
79385a29fd Use strtol() instead of selfmade function
* src/init.c (cmd_number): Use strtol() instead of selfmade function
* bootstrap.conf: Add strtol gnulib module
2018-04-16 09:58:51 +02:00
Tim Rühsen
55da9f71f0 * src/hsts.c (hsts_hash_func): Allow integer overflow 2018-04-16 09:58:51 +02:00
Tim Rühsen
bec9816f40 * init.c (cmd_spec_mirror): Fix uninitialzed stack variable 2018-04-16 09:58:51 +02:00
Tim Rühsen
b86294e1c9 * src/init.c (cleanup): Free more variables 2018-04-16 09:58:51 +02:00
Tim Rühsen
7e1e5f3959 * wget_options_fuzzer.in: Add corpora directory 2018-04-16 09:58:51 +02:00
Tim Rühsen
4a6336d551 * fuzz/wget_options_fuzzer.c: Suppress error messages from wget 2018-04-16 09:58:51 +02:00
Tim Rühsen
328438e69b * src/utils.c (fopen_stat): Early return to allow fuzzing/fmemopen 2018-04-16 09:58:51 +02:00
Tim Rühsen
36f029d2f0 * src/init.c (initialize): Free mem before exit() 2018-04-16 09:58:51 +02:00
Tim Rühsen
a4402120ad Add OSS-Fuzz infrastruture
* Makefile.am: Add fuzz/ to SUBDIRS
* cfg.mk: Fix 'make syntax-check'
* configure.ac: Add --enable-fuzzing
* fuzz/Makefile.am: New file
* fuzz/README.md: New file
* fuzz/fuzzer.h: New file
* fuzz/get_all_corpora: New file
* fuzz/get_ossfuzz_corpora: New file
* fuzz/glob_crash.c: New file
* fuzz/main.c: New file
* fuzz/run-afl.sh: New file
* fuzz/run-clang.sh: New file
* fuzz/view-coverage.sh: New file
* fuzz/wget_options_fuzzer.c: New file
* fuzz/wget_options_fuzzer.dict: New file
* src/init.c (cleanup): Free more resources
* src/main.c (init_switches): Initialize only once,
  (print_usage): Don't print if TESTING is defined
* src/utils.h: Include wget.h
2018-04-16 09:58:51 +02:00
Tim Rühsen
de54c970b2 Move unit-test code to tests/
* src/Makefile.am: Remove test.c and test.h
* src/test.c: Rename to tests/unit-tests.c
* src/test.h: Rename to tests/unit-tests.h
* tests/Makefile.am: Add unit-tests.c and unit-tests.h
* src/hsts.c: Amend #include
* src/http.c: Likewise
* src/init.c: Likewise
* src/metalink.c: Likewise
* src/res.c: Likewise
* src/url.c: Likewise
* src/utils.c: Likewise
2018-04-05 15:06:47 +02:00
Tim Rühsen
3e84963e84 * src/main.c: Rename main() -> main_wget() for unit tests 2018-04-05 15:06:47 +02:00
Tim Rühsen
f56f970bc2 Fix some issues found by 'infer' 2018-03-14 14:43:35 +01:00
Tim Rühsen
0b54043d17 * src/openssl.c: Fix build for OpenSSL 1.1.0 without TLS1_3_VERSION 2018-03-08 16:17:14 +01:00
Tim Rühsen
040106b3e2 Add docs for --secure-protocol=TLSv1_3
* doc/wget.texi: Likewise
2018-03-08 15:30:28 +01:00
Loganaden Velvindron
fde8cefd13 Add TLS1.3 support for OpenSSL build
* src/init.c: Add 'tlsv1_3 for --secure-protocol
* src/openssl.c (ssl_init): Enable TLS1.3 if possible
* src/options.h: Add secure_protocol_tlsv1_3
* doc/wget.texi: Add description of TLSv1_3

Copyright-paperwork-exempt: Yes
2018-03-08 15:30:14 +01:00
Tim Rühsen
ba2b0654b4 * src/main.c: Add help text for --retry-on-http-error
Reported-by: Giovanni Tirloni
2018-03-07 10:32:08 +01:00
Tim Rühsen
375bfa98dc * src/url.c (convert_fname): Fix invalid free on iconv_open() failure
Reported-by: Volkmar Klatt
2018-03-01 16:03:29 +01:00
Tim Rühsen
bea54e0da4 * src/mswindows.c: Fix prototype of fork_to_background()
Reported-by: Gisle Vanem
2018-02-21 19:05:15 +01:00
Tim Rühsen
98ec26cc6d Fix warning to not print binary IP address
* tests/Test-https-badcerts.px: Likewise
* tests/Test-https-clientcert.px: Likewise
* tests/Test-https-crl.px: Likewise
* tests/Test-https-pfs.px: Likewise
* tests/Test-https-selfsigned.px: Likewise
* tests/Test-https-tlsv1.px: Likewise
* tests/Test-https-tlsv1x.px: Likewise
* tests/Test-https-weboftrust.px: Likewise
2018-02-09 10:33:07 +01:00
Tim Rühsen
9887b870d1 Use gnulib's utime()
* bootstrap.conf: Add modules utime and utime-h
* src/utils.c (touch): Remove own code for gnulib's utime()
2018-02-09 10:21:43 +01:00
Tim Rühsen
c722973212 Fix logging in background mode
* ../src/main.c: Re-init logfile if changed for background mode
* ../src/utils.c: fork_to_background() returns whether logfile changed
* ../src/utils.h: Set return type bool for fork_to_background()

Fixes: #53020
Reported-by: Noël Köthe
2018-02-09 10:21:43 +01:00
Tim Rühsen
bb7fa977a1 * src/http.c: Fix two typos in comments 2018-02-09 10:18:35 +01:00
Tim Rühsen
f2d6075a6e * testenv/conf/expected_files.py: Ignore pubring.gpg
Reported-by: Arkadiusz Miśkiewicz
2018-01-31 09:04:42 +01:00
Tim Rühsen
0caed28cda * bootstrap.conf: Replace gnulib module gettext by gettext-h 2018-01-31 09:01:54 +01:00
Tim Rühsen
d27032c446 Mention list and bugtracker for --help and in man page
* doc/wget.texi: Mention list and bugtracker in man page
* src/main.c: Mention list and bugtracker for --help
2018-01-22 10:39:49 +01:00
Darshit Shah
080fd0d93b * contrib/make-release: Add another release script 2018-01-21 13:50:45 +01:00
Darshit Shah
ab8a3c80df Update NEWS file for new release 2018-01-21 11:00:29 +01:00
Darshit Shah
11ecabcb3d Fix typo in documentation 2018-01-21 11:00:25 +01:00
Darshit Shah
d0a5d9f131 Switch off compression by default
Gzip compression has a number of bugs which need to be ironed out before
we can support it by default. Some of these stem from a misunderstanding
of the HTTP spec, but a lot of them are also due to many web servers not
being compliant with RFC 7231.

With this commit, I am marking GZip compression support as experimental
in GNU Wget pending further investigation and the addition of tests.

* src/init.c (defaults): Switch of compression support by default
* docs/wget.texi: State that compression is experimental
2018-01-21 10:51:11 +01:00
Darshit Shah
0ff71e5ff1 Pull gnulib module forward 2018-01-21 10:51:09 +01:00
Darshit Shah
0d0a95a01b Revert "* src/init.c (defaults): Set compression_none as the default compression"
This reverts commit 8283ac0846.
2018-01-21 10:50:44 +01:00
Darshit Shah
8283ac0846 * src/init.c (defaults): Set compression_none as the default compression 2018-01-21 10:17:39 +01:00
Reiji
a7cc4e2b37 * src/http.c (gethttp): Fix bug that prevented all files from being decompressed
Signed-off-by: Darshit Shah <darnir@gnu.org>
2018-01-20 14:04:28 +01:00
Tim Rühsen
55d25fc20c * src/host.c (sufmatch): Fix to domain matching 2018-01-19 19:32:01 +01:00
Gisle Vanem
513cc1c0c8 * src/netrc.c: Fix Standalone compilation of netrc file 2018-01-17 14:44:52 +01:00
Darshit Shah
3249045a91 * NEWS: Update NEWS file for new release 2018-01-14 12:17:31 +01:00
Darshit Shah
b1fc37f465 * bootstrap: Use the faster gnulib-tool.py script if possible 2018-01-14 11:33:52 +01:00
Darshit Shah
953bcdaba8 Sync the bootstrap script from gnulib 2018-01-14 11:28:51 +01:00
Darshit Shah
183fccdaad Update Copyright years 2018-01-14 11:24:43 +01:00
Darshit Shah
8240439e21 Replace HTTP urls with HTTPS where valid 2018-01-14 11:15:32 +01:00
Darshit Shah
a03716a0fe Update gnulib 2018-01-14 11:15:16 +01:00
Darshit Shah
d26c6c0028 * src/netrc.c: Search for the correct netrc file on Windows 2018-01-14 10:55:03 +01:00
Tim Rühsen
047746eb76 * src/http.c: Exclude *.gz and *.tgz from decompression 2018-01-10 15:46:13 +01:00
Tim Rühsen
d8df356d4b * src/utils.c (wg_pin_peer_pubkey): Fix format warning 2017-12-31 13:03:25 +01:00
Peter Wu
220c24ecb5 Avoid redirecting output to file when tcgetpgrp fails
* src/log.c (check_redirect_output): tcgetpgrp can return -1 (ENOTTY),
be sure to check whether a valid controlling terminal exists before
redirecting.

Fixes: #51181
2017-12-31 12:59:15 +01:00
Darshit Shah
3d2b2231cd Add new test for 416 responses
* testenv/server/http/http_server.py: If there are multiple requests in
which the requested range is unsatisfiable, then send a body in the in
the 2nd response onwards
* testenv/Test-416.py: New test to check how Wget handles 416 responses
2017-12-11 14:48:01 +01:00
Darshit Shah
693cee0109 Don't assume a 416 response has no body
* http.c(gethttp): In case of a 416 response, try to drain the socket of
any bytes before reusing the connection

Reported-By: Iru Cai <mytbk920423@gmail.com>
2017-12-08 18:44:17 +01:00
Tim Rühsen
6aa6b669ef Support building with OpenSSL 1.1 w/o deprecated features
* src/openssl.c (ssl_init): Fix code for the subject's issue

Reported-by: Matthew Thode
2017-11-26 18:59:47 +01:00
Tim Rühsen
8551ceccfe Avoid link conversion after 304 Not Modified
* src/http.c (gethttp): Handle 304 before setting document content type

Fixes: #52404
Reported-by: Ben Fuchs
2017-11-25 19:33:03 +01:00
YX Hao
19060db44f Fix printing mutibyte chars as unprintable chars on Windows
* src/log.c (get_warc_log_fp): Fix return value to stderr
* src/main.c (main): Init logging as soon as possible,
  fix locale/charset on Windows
2017-11-16 12:23:20 +01:00
Tim Rühsen
a30a5a9059 * tests/Test-https-weboftrust.px: Fix/add sslport 2017-11-16 12:12:16 +01:00
YX Hao
a9a953feee Convert remote path to local encoding
* src/url.c (url_file_name): Convert remote path to local encoding
2017-11-15 19:58:53 +01:00
Tim Rühsen
267cd51fff Do not use must-revalidate in Cache-Control header
As the bug report states, 'must-revalidate' is a request directive.

Fixes #52379
2017-11-10 10:57:46 +01:00
Darshit Shah
973c26ed7d Fix Segfault due to derefencing null ptr
* src/http.c(gethttp): When Encoding is gzip, ensure that the
Content-Type Header was actually seen. Without this, the "type" variable
is null causing a Segfault.

Reported-By: Noël Köthe <noel@debian.org>
2017-11-06 10:09:03 +01:00
Tim Rühsen
16d066f89c * src/http.c: Fix H_REDIRECTED 2017-11-03 22:23:04 +01:00
Tim Rühsen
a2477d487c * src/http.c: Add support for HTTP status code 308 2017-11-03 22:12:11 +01:00
Tim Rühsen
7ac72e063c Fix uninitialized value messages in tests
* tests/Test-https-*.px: Use correct variable in error message

Reported-by: Jeffrey Walton
2017-10-30 21:29:14 +01:00
Tim Rühsen
95891cbba3 Ignore dirmngr.conf, gpg.conf in test directories
* testenv/conf/expected_files.py: Ignore dirmngr.conf, gpg.conf

Libgpgme creates certain files if $HOME doesn't contain the .gnupg directory.
These files disturb some metalink tests if we don't ignore them.

Reported-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
2017-10-30 13:04:09 +01:00
Tim Rühsen
2486320a2a * contrib/release: Cleanup, use lzip instead of xz 2017-10-27 11:26:37 +02:00
Tim Rühsen
ba6b44f674 Fix heap overflow in HTTP protocol handling (CVE-2017-13090)
* src/retr.c (fd_read_body): Stop processing on negative chunk size

Reported-by: Antti Levomäki, Christian Jalio, Joonas Pihlaja from Forcepoint
Reported-by: Juhani Eronen from Finnish National Cyber Security Centre
2017-10-26 17:29:38 +02:00
Tim Rühsen
d892291fb8 Fix stack overflow in HTTP protocol handling (CVE-2017-13089)
* src/http.c (skip_short_body): Return error on negative chunk size

Reported-by: Antti Levomäki, Christian Jalio, Joonas Pihlaja from Forcepoint
Reported-by: Juhani Eronen from Finnish National Cyber Security Centre
2017-10-26 17:29:38 +02:00
Tim Rühsen
bec4c215a8 Update for release 1.19.2
* NEWS: Add news for 1.19.2
* doc/wget.texi: Fix 1.20 to 1.19.2
2017-10-26 16:31:57 +02:00
YX Hao
27d78d944f Avoid unnecessary UTF-8 encoded fallback (trivial change)
* src/retr.c (retrieve_url): Check for changed URL on redirect
2017-10-25 14:26:36 +02:00
Tim Rühsen
60f033426f Add GNU extensions to .netrc parsing
src/netrc.c (parse_netrc): Add 'port' and 'force' extensions

Reported-by: September 20Tim Landscheidt
2017-09-27 12:42:06 +02:00
Josef Moellers
6f3b995993 Bail out on unexpected 416 server errors
* src/http.c (gethttp): Stop on 416 if file is incomplete
2017-09-18 16:45:49 +02:00
Tim Schlueter
c451eec155 Add gzip Content-Encoding decompression
* src/http.c (struct http_stat): Add remote_encoding field.
(read_response_body): Enable gzip decompression.
(initialize_request): Send gzip Accept-Encoding header.
(gethttp): Decompress files with gzip Content-Encoding.
* src/retr.c: include zlib.h.
(zalloc): New function.
(zfree): New function.
(fd_read_body): Decompress gzip data.
* src/retr.h (fd_read_body enum): Add rb_compressed_gzip flag.
2017-08-04 14:34:53 +02:00
Tim Schlueter
b543dfe783 Add --compression option
* doc/wget.texi: Add --compression documentation.
* src/init.c (cmd_spec_compression): New function.
(commands[]): Add opt.compression.
(defaults): Set default opt.compression value.
* src/main.c (option_data[]): Add struct for --compression.
(print_help, help[]): Add description for --compression.
(main): Add incompatibility checks for --compression.
* src/options.h (struct options): Add compression enum and field.
2017-08-04 14:34:53 +02:00
Tim Schlueter
08ed2a5530 Adjust Extension based on Content-Encoding
* doc/wget.texi (--adjust-extension, adjust_extension): Updated documentation.
* src/http.c (encoding_t): New enum.
(struct http_stat): Add local_encoding field.
(gethttp): --adjust-extension based on Content-Encoding.
2017-08-04 14:34:53 +02:00
Darshit Shah
951d3e4cdd Document gperf as a requirement 2017-07-31 14:56:32 +02:00
Tim Rühsen
3ad3b3e36c * src/url.c (url_scheme): Use ASCII version of strncasecmp 2017-07-28 17:11:26 +02:00
Tim Rühsen
5fb6b6bd68 Fix misuse of strncasecmp
* src/http.c (set_content_type): Use c_strcasecmp instead of strncasecmp

See issue bug #51576
2017-07-28 16:56:27 +02:00
Tim Rühsen
f42229b1fd Fix python test suite for GnuTLS 3.5.12+
* testenv/Test-*.py: Replace 127.0.0.1 by localhost
* testenv/certs/server-template.cfg: Likewise
* testenv/certs/server-cert.pem: Regenerate
* testenv/certs/server-crl.pem: Likewise
* testenv/test/base_test.py: Hardcode 'localhost' as server domain

Reported-by: Ludovic Courtès <ludo@gnu.org>
2017-07-09 11:39:05 +02:00
Tim Rühsen
21154bdc36 Check for 304 response before applying --adjust-extension
* src/http.c (gethttp): Move 304 code before --adjust-extension code

This fixes applying --adjust-extension in combination with 304
HTTP responses. It could lead to .html extensions to arbitrary
files.

Reported-by: anfractuosity
2017-06-13 11:25:20 +02:00
Tim Rühsen
ae293c945a Fix buffer overflow in Public Key Pinning
* src/utils.c (wget_base64_decode): Add param for destination size,
  (wg_pubkey_pem_to_der): Amend call to wget_base64_decode(),
  (wg_pin_peer_pubkey): Likewise and fix code style.
* src/utils.h: Add param to wget_base64_decode()
* src/http-ntlm.c (ntlm_input): Amend call to wget_base64_decode()
* src/http.c (skip_content_type): Likewise

Fixes #51227
2017-06-13 10:23:04 +02:00
Tim Rühsen
407c1f990a * doc/wget.texi: Mention --no-config 2017-06-02 10:13:22 +02:00
Tim Rühsen
86b46a34a5 * testenv/Test-recursive-basic.py: Check crawled files 2017-05-16 11:20:57 +02:00
Tim Rühsen
5d4ada1b7b Fix two Metalink tests if $HOME is changed
* conf/expected_files.py (gen_local_fs_snapshot): Skip processing
  of 'pubring.kbx'
2017-05-16 10:24:52 +02:00
Tomas Hozza
876def8ebe Add command line option to disable use of .netrc
Although internally code uses option for (not) reading .netrc for
credentials, it was not possible to turn this behavior off on command
line. Note that it was possible to turn it off using wgetrc.

Idea for this change came from Bruce Jerrick (bmj001@gmail.com).
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1425097

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2017-05-15 16:06:50 +02:00
Tomas Hozza
f8c3df1f40 Fixed getting of credentials from .netrc
There seemed to be a copy&paste error in http.c code, which decides
whether to get credentials from .netrc. In ftp.c "user" and "pass"
variables are char*, while in http.c, these are char**. For this reason
they should be dereferenced when determining if password and user login
is set to some value.

Also since both variables are dereferenced on lines above the changed
code, it does not really make sense to check if they are NULL.

This patch is based on fix from Bruce Jerrick <bmj001@gmail.com>.
Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=1425097

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2017-05-15 16:06:50 +02:00
Tomas Hozza
17960b57d5 Added tests for HTTP authentication using credentials from .netrc
Getting credentials from .netrc has been broken from time to time, thus
adding a test coverage to prevent regressions.

Also added setting of "HOME" environment variable when executing wget,
to make sure LocalFiles like .netrc, which are created just for the
test, are actually used.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2017-05-15 16:06:50 +02:00
Tim Rühsen
40c0d30f5c Fix Test-https-badcerts.px
* util/createcerts.sh: Set date of invalid cert to +20 years
* tests/certs/invalid.crt: Re-generated
* tests/certs/invalid.key: Re-generated
2017-05-15 15:46:11 +02:00
Tim Rühsen
e2c702571f * util/createcerts.sh: Fix double equal (syntax-check) 2017-05-14 21:35:34 +02:00
Tim Rühsen
269fb6201d Fix Test-https-badcerts.px to work with GnuTLS
* tests/Test-https-badcerts.px: Remove OpenSSL requirement
* tests/certs/expired.crt: Re-created with valid dates
* tests/certs/expired.key: Likewise
* tests/certs/invalid.crt: Likewise
* tests/certs/invalid.key: Likewise
2017-05-14 11:10:15 +02:00
Vijo Cherian
c08778aeb3 New shell script to create the certs and keys required for TLS tests
* util/createcerts.sh: New file
2017-05-14 11:07:43 +02:00
Tim Rühsen
297c1e2ac3 Fix HTTPS testing for stricter OpenSSL
* testenv/certs/README: Amend cert creation extensions
* testenv/certs/ca-cert.pem: Created without OCSP signing purpose

Having the OCSP signing purpose set made newer versions of OpenSSL
fail due to stricter checking. Test version of OpenSSL was 1.1.0e.
2017-05-11 12:38:19 +02:00
Tim Rühsen
936efc3564 * src/iri.c (idn_encode): Better IDNA 2003 compatibility 2017-05-11 11:56:26 +02:00
Tim Rühsen
11d3de74ca * .gitlab-ci.yml: Also test OpenSSL build 2017-05-10 12:12:42 +02:00
Tim Rühsen
35d5b67cc1 * .gitlab-ci.yml: Remove installation of texlive 2017-05-10 10:41:42 +02:00
Tim Rühsen
da50a1ecc3 Add certs/wotca.pem to avoid temp. file creation
* tests/certs/wotca.pem: New file
* tests/Test-https-weboftrust.px: Remove creation of wotca.pem

This change let Test-https-weboftrust.px survive VPATH builds.
2017-05-10 10:34:42 +02:00
Tim Rühsen
1068ca07d3 * cfg.mk: Exclude ^tests/certs/.* from syntax-check 2017-05-10 10:05:18 +02:00
Tim Rühsen
0666e0f375 * po/POTFILES.in: Remove spider.c (syntax-check) 2017-05-10 10:04:34 +02:00
Tim Rühsen
0d9f8280e0 * tests/Test-https-selfsigned.px: Add newline at EOF (syntax-check) 2017-05-10 10:04:30 +02:00
Vijo Cherian
17f0e16ecc Removed all uses of temp files.
Added needed files to GIT
2017-05-09 16:45:13 -07:00
Vijo Cherian
cc74f8b7e2 Made CRL related files in the repo, instead of trying to generate them 2017-05-09 15:37:28 -07:00
Tim Rühsen
2894a37189 Cleanup on exit in Test-https-*.px
* tests/Test-https-*.px: Cleanup on exit
2017-05-09 16:58:33 +02:00
Tim Rühsen
4669ba5e0c Auto-generate interca.conf and rootca.conf
* configure.ac: Add interca.conf.in and rootca.conf.in to AC_CONFIG_FILES
* tests/certs/interca.conf: Removed
* tests/certs/rootca.conf: Removed
* tests/certs/interca.conf.in: New file
* tests/certs/rootca.conf.in: New file
2017-05-09 16:04:48 +02:00
Tim Rühsen
b5c2d083ea Fix path and VPATH issues of new https/TLS tests
* tests/SSLTest.pm: Use $srcdir in read-only files,
  (_setup_server): Remove unneeded path fixation code
* tests/Test-https-*.px: Use $srcdir for read-only files,
  use $cdir for writable files
* tests/certs/interca.conf: Adjust paths
* tests/certs/rootca.conf: Adjust paths
2017-05-09 15:21:23 +02:00
Tim Rühsen
466afc62b0 Check for test server name resolution in tests
* tests/Test-https-*.px: Skip if test server name resolution fails
2017-05-09 11:16:30 +02:00
Tim Rühsen
f68d001626 * tests/Makefile.am: Enable Test-https-badcerts again 2017-05-09 11:16:30 +02:00
Tim Rühsen
ffe75d0867 Fix WgetFeature.pm to allow multiple required features
* tests/WgetFeature.cfg: Remove file
* tests/WgetFeature.pm: Extend to multiple features, cleanup
2017-05-09 11:16:30 +02:00
Tim Rühsen
9aa894853f * .gitlab-ci.yml: Add wgettestingserver to /etc/hosts 2017-05-09 11:08:32 +02:00
Tim Rühsen
5337b94ce5 * tests/SSLServer.pm: Check for IO::Socket::SSL 2017-05-09 11:08:32 +02:00
Tim Rühsen
a26e6f3527 * tests/Test-https-*: Change server port to <= 32767 2017-05-09 11:08:32 +02:00
Tim Rühsen
b9fb74ddfa Move https test server ports from >32767 to <= 32767
* Test-https-badcerts.px: Change port
* Test-https-crl.px: Likewise
* Test-https-weboftrust.px: Likewise
2017-05-09 11:08:32 +02:00
Tim Rühsen
3132049ae4 * tests/Makefile.am: Add SSLTest.pm and SSLServer.pm to EXTRA_DIST 2017-05-09 11:08:32 +02:00
Tim Rühsen
c0c42da653 * tests//Makefile.am: Disable Test-https-badcerts.px 2017-05-09 11:08:32 +02:00
Tim Rühsen
888cc82c9d Add Gitlab CI (Debian)
* .gitlab-ci.yml: New file
2017-05-09 11:08:32 +02:00
Tim Rühsen
fce1b689e8 * .travis.yml: Use trusty for libidn2-dev 2017-05-06 13:03:28 +02:00
Tim Rühsen
580067d1e6 * tests/certs/test-ca-key.pem: Add newline at EOF 2017-05-04 16:51:49 +02:00
Tim Rühsen
5c4cc011fe Add static HOSTSALIAS file
* tests/certs/wgethosts: New file
* tests/Test-https-*.px: Remove creation of wgethosts file
2017-05-04 16:51:49 +02:00
Vijo Cherian
2a96249469 Added new tests for SSL
* tests/Test-https-badcerts.px : New file
* tests/Test-https-clientcert.px : New file
* tests/Test-https-crl.px : New file
* tests/Test-https-weboftrust.px : New file
* tests/certs/interca.conf : New file
* tests/certs/rootca.conf : New file
* tests/certs/test-ca-key.pem : New file

Added all new SSL / HTTPS tests to make check
Added Test for SSL Web of Trust, accept only if CA chain of trust is intact.
Added a test script for client certificate
Added Test for crlfile option of wget
Added test to make sure that wget doesn't accept expired or invalid certs

Some clean up : 1, Removed cause of warnings from perl & other cosmetic changes
                2, Fix  make -j 4 check such that it passes all tests
2017-05-04 16:51:49 +02:00
Tomas Hozza
0b41c7543a Mention TLSv1_1 and TLSv1_2 as secure-protocol values in help
* src/main.c: The --secure-protocol option accepts also values TLSv1_1
and TLSv1_2, as mentioned in the man page. However the help message
doesn't mention these two values. This patch adds TLSv1_1 and TLSv1_2 as
possible values to the help message.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2017-05-04 14:51:54 +02:00
Tim Rühsen
c4a2b2e77e * src/http.c (gethttp): Support Wayback Machine's X-Archive-Orig-last-modified 2017-05-03 16:37:11 +02:00
Vijo Cherian
f6376ac0dc Added new tests for SSL
* tests/Test-https-badcerts.px : New file
* tests/Test-https-clientcert.px : New file
* tests/Test-https-crl.px : New file
* tests/Test-https-weboftrust.px : New file
* tests/certs/interca.conf : New file
* tests/certs/rootca.conf : New file
* tests/certs/test-ca-key.pem : New file

Added all new SSL / HTTPS tests to make check
Added Test for SSL Web of Trust, accept only if CA chain of trust is intact.
Added a test script for client certificate
Added Test for crlfile option of wget
Added test to make sure that wget doesn't accept expired or invalid certs

Some clean up : Removed cause of warnings from perl & other cosmetic changes
2017-04-28 12:22:54 +02:00
Vijo Cherian
ac519c041e Added new tests for SSL
* tests/SSLServer.pm: New file
* tests/SSLTest.pm: New file
* tests/Test-https-pfs.px: New file
* tests/Test-https-selfsigned.px: New file
* tests/Test-https-tlsv1.px: New file
* tests/Test-https-tlsv1x.px: New file
* tests/certs/server.crt: New file
* tests/certs/server.key: New file
* tests/certs/test-ca-cert.pem: New file

Added 4 new test scripts all for SSL.
Added base pm for SSL testing.
Added SSL tests for TLSv1, TLSv1_1 and PFS.
Added test for self signed cert : check that it fails without
--no-check-certificate and passes with that flag.
2017-04-19 12:59:27 +02:00
Tim Rühsen
56c78c4b09 * src/utils.c: Remove non-portable __builtin_unreachable() 2017-04-18 13:22:25 +02:00
Tim Rühsen
0ec46cb109 Skip iconv() usage if HAVE_ICONV is not defined
This helps on broken iconv implementations, e.g. Solaris.

Reported-by: Mojca Miklavec
2017-04-18 13:17:19 +02:00
Tim Rühsen
67cb37ce5a Mention 'bash' for executing ./bootstrap
Reported-by: Mojca Miklavec
2017-04-18 10:47:15 +02:00
Tim Rühsen
0004d3ec22 * bootstrap.conf: Make 'sed' options more portable
'sed -i' works differently on FreeBSD.

Reported-by: Mojca Miklavec
2017-04-18 10:44:06 +02:00
Tim Rühsen
92bfe2a2e4 Fix charset transcoding issue for non-reversible codepoints
* src/url.c: Check iconv() against 0, not -1

On some libiconv implementations, unknown codepoints become
encoded as ?, e.g. when converting a non-ascii codepoint to ASCII.
This results in ambigious file names which also fails our tests.
2017-04-16 19:55:14 +02:00
Tim Rühsen
fc2f4233ed * src/iri.c: Fix WIN32 idn2_free, forgotten code 2017-04-16 19:50:10 +02:00
Darshit Shah
b2c38d33e1 * src/init.c: Set flstats correctly when using WGETRC env var 2017-04-14 01:16:49 +02:00
Tim Rühsen
6ef493b19e Fix use of idn2_free()
* src/connect.c (connect_to_ip): Use xfree() instead of idn2_free()
* src/host.c (lookup_host): Use xfree() instead of idn2_free()
* src/iri.h: Do not include idn2.h
* src/url.c (url_free): Use xfree() instead of idn2_free()
* src/url.h (struct url): Remove 'idn_allocated' from struct

Reported-by: Gisle Vanem
2017-04-08 11:05:55 +02:00
Anton Yuzhaninov
7ffe93cabb Fix perl warnings in tests
* tests/FTPServer.pm: Escape '{' in RE to fix warnings
* tests/FTPTest.pm: Likewise
* tests/HTTPServer.pm: Likewise
* tests/HTTPTest.pm: Likewise
* tests/Test-proxied-https-auth-keepalive.px: Likewise
* tests/Test-proxied-https-auth.px: Likewise
Escape '{' in RE to fix warnings:
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/{{ <-- HERE port}}/
2017-04-05 20:04:12 +02:00
klemens
f381831d88 Fix typos in comments 2017-04-01 19:38:09 +02:00
Tim Rühsen
02d40a4676 * src/metalink.c (retrieve_from_metalink): Fix len in memset() 2017-03-31 13:15:27 +02:00
Tim Rühsen
e89267fbbc Add gnulib module group-member 2017-03-24 11:36:01 +01:00
Vijo Cherian
400b8eba6c Safeguards against TOCTTOU
* src/utils.h: Add struct file_stat_s declaration,
  change prototypes of file_exists_p(),
  add prototypes for fopen_stat() and open_stat().
* src/utils.c: Extend file_exists_p(),
  new function fopen_stat() and open_stat(),
  add new param for file_exists_p().
* src/init.h: Add param file_stats_t to run_wgetrc().
* src/ftp.c: Amend calls to extended functions.
* src/hsts.c: Likewise.
* src/http.c: Likewise.
* src/init.c: Likewise.
* src/main.c: Likewise.
* src/metalink.c: Likewise.
* src/retr.c: Likewise.
* src/url.c: Likewise.

Added fopen_stat() and open_stat() that checks to makes sure the file didn't
change underneath us.
Return error from file_exists_p().
Added a way to return error from this file without major surgery to the
callers.

Fixes: #20369
2017-03-24 09:39:09 +01:00
Tim Rühsen
90a0a7499c Update gnulib 2017-03-24 09:19:52 +01:00
Christof Horschitz
1d71645c06 * src/warc.c (warc_write_cdx_record): Escape URLs 2017-03-22 15:01:04 +01:00
Mike Frysinger
e249844143 Include libunistring headers only when used
* src/iri.c: Check for libidn2 < 0.14 to include libunistring headers

The unistring functions are used only when an older version of libidn2
is used, so don't include its headers either w/newer libdin2 versions.
2017-03-20 09:39:20 +01:00
Tim Rühsen
84a93f4127 Fix links to www.robotstxt.org
* NEWS: Fix links
* doc/wget.texi: Likewise
* src/res.c: Likewise

Reported-by: Noël Köthe
2017-03-18 19:05:38 +01:00
Tim Rühsen
f31b93424b * tests/WgetTests.pm: Add -d to Wget test options 2017-03-13 21:31:09 +01:00
Tim Rühsen
90b487369a Include <arpa/inet.h> for Windows
Reported-by: Gisle Vanem
2017-03-08 13:00:54 +01:00
Tim Rühsen
57d748117f Fix updating HSTS entries
* src/hsts.c (hsts_store_entry): Always update 'created' field

Fixes: #50490
Reported-by: Deian Stefan, Atyansh Jaiswal, Jonathan Luck
2017-03-08 10:56:12 +01:00
Tim Rühsen
4d729e322f Fix CRLF injection in Wget host part
* src/url.c (url_parse): Reject control characters in host part of URL

Reported-by: Orange Tsai
2017-03-06 10:04:22 +01:00
Benjamin Esham
63c2aea255 * src/warc.c: Use warc_write_header_uri for all WARC-Target-URI fields
The WARC spec requires that all URIs be enclosed in angle brackets. This
was being done in most cases, but not for "WARC-Target-URI" fields in
WARC blocks of type "response", "resource", "revisit", and "metadata".
2017-03-04 12:51:39 +01:00
Tim Rühsen
ac4fed3220 Fix 504 status handling
* src/http.c (gethttp): Move 504 handling to correct place.
  (http_loop): Fix memeory leak.
* testenv/server/http/http_server.py: Add Content-Length header on non-2xx
  status codes with a body

Reported-by: Adam Sampson
2017-02-16 15:53:56 +01:00
YX Hao
cf5df5593d * src/url.c (url_file_name): Do not charset convert local directory
In a non-ASCII environment, the local path may contain non-ASCII
characters. The server responded file name must be converted before
it is concatenated to the local path. Conversion after concatenation
may result in 'iconv' errors.
2017-02-16 12:52:16 +01:00
Tim Rühsen
2215ee8d10 * configure.ac: Remove manually resetting of LIBICONV variable
Fixes: #48193
Reported-by: ilovezfs
Reported-by: Charles
2017-02-15 20:03:58 +01:00
Tim Rühsen
32e26dc199 * bootstrap.conf: Call gperf to create lib/unicase/special-casing-table.h 2017-02-15 14:45:23 +01:00
Tim Rühsen
21ac4ae356 * bootstrap.conf: Fix latest gnulib to work with gperf < 3.1 2017-02-15 13:03:10 +01:00
Darshit Shah
838c185ca9 Pull GNULib to latest.
* gnulib: Pull to latest commit. This fixes an issue with Gperf 3.1
2017-02-14 15:08:50 +01:00
Tim Rühsen
ac9be9b756 * src/main.c: Remove double 'verbose' option
Fixes: #50290
2017-02-12 21:18:23 +01:00
Tim Rühsen
6620c5156f * NEWS: update 2017-02-11 12:03:54 +01:00
Tim Rühsen
aebd49d9d4 isrc/http.c (check_retry_on_http_error): Fix gcc warning 2017-02-11 11:54:21 +01:00
Tom Szilagyi
d6d00006a0 Add support for --retry-on-http-error
* doc/wget.text: Add documentation
* src/http.c: Add function check_retry_on_http_error ()
* src/init.c: Add opt.retry_on_http_error
* src/main.c: Add struct for retry-on-http-error to option_data[]
* src/options.h: Add retry_on_http_error to struct options
2017-02-11 11:50:24 +01:00
Tim Rühsen
05acf5d3f6 Revert "Add support for --retry-on-http-error"
This reverts commit 977276374d.
2017-02-11 11:45:11 +01:00
Tim Rühsen
80c62c238e Change libtool library deps to non-libtool deps
Reported-by: Yousong Zhou
Fixes: #50260
2017-02-10 17:20:42 +01:00
Tom Szilagyi
977276374d Add support for --retry-on-http-error
* doc/wget.texi: Add description for --retry-on-http-error
* src/http.c (gethttp):
Consider given HTTP response codes as non-fatal, transient errors.
Supply a comma-separated list of 3-digit HTTP response codes as
argument. Useful to work around special circumstances where retries
are required, but the server responds with an error code normally not
retried by Wget. Such errors might be 503 (Service Unavailable) and
429 (Too Many Requests). Retries enabled by this option are performed
subject to the normal retry timing and retry count limitations of
Wget.

Using this option is intended to support special use cases only and is
generally not recommended, as it can force retries even in cases where
the server is actually trying to decrease its load. Please use it
wisely and only if you know what you are doing.

Example use and a starting point for manual testing:
  wget --retry-on-http-error=429,503 http://httpbin.org/status/503
2017-02-09 21:17:20 +01:00
Tim Rühsen
785c4b92dd * tests/WgetTests.pm: Add --no-config to wget invocation
Without --no-config, wgetrc commands may disturb the tests.

Reported-by: Dagobert Michelsen
2017-02-09 16:34:27 +01:00
Tim Rühsen
d7c34dc0a8 * tests/WgetTests.pm (_verify_download): Fix failure message
Reported-by: Zhiming Wang
2017-02-06 23:01:08 +01:00
Tim Rühsen
d061e553a1 * src/http.c (initialize_request): Fix regression in .netrc auth
Reported-by: Axel Reinhold
2017-02-06 21:44:18 +01:00
Tim Rühsen
2ddd2b69e4 * src/iri.c (idn_encode): Fix memory leak 2017-02-06 21:39:44 +01:00
Tim Rühsen
990f3d67d3 Remove skipping libunistring with --disable-iri
* configure.ac: Remove checking for IRI=no

On certain systems, gnulib falls back to libunistring
for mbtowc() and wcwidth() (used in src/progress.c).

Reported-by: Zhiming Wang
2017-02-06 11:25:48 +01:00
Tim Rühsen
d680b0b551 * bootstrap.conf: Add gnulib module wcwidth 2017-02-04 19:30:38 +01:00
Tim Rühsen
31ac36e170 Fix include/define clash with gnulib's unlink module
* src/options.h: Rename options.unlink to options.unlink_requested
* src/init.c: Replace options unlink member by unlink_requested
* src/http.c: Likewise
* src/ftp.c: Likewise
2017-02-04 18:02:54 +01:00
Tim Rühsen
51b401f5c4 * bootstrap.conf: Specify unicode modules more exact 2017-02-04 18:01:44 +01:00
Tim Rühsen
f2c4289557 * src/xattr.h: Fix #define fsetxattr for MacOS and FreeBSD
Reported-by: Zhiming Wang
2017-02-04 15:29:44 +01:00
Tim Rühsen
58546e52e2 * contrib/release: New release helper script 2017-02-03 16:16:30 +01:00
Tim Rühsen
820f3fc2b4 * cfg.mk: Fix syntax-check 2017-02-03 16:16:30 +01:00
Tim Rühsen
cc8464206d * doc/announcement_1.19.txt: Add new file 2017-02-03 15:19:05 +01:00
Tim Rühsen
366d82f349 * src/utils.c: Move macro FMT_MAX_LENGTH into scope 2017-02-03 12:35:49 +01:00
Tim Rühsen
f2574e90b7 * src/utils.c: Fix -Wformat= warnings 2017-02-03 12:33:38 +01:00
Tim Rühsen
81b3aaf75c * src/gnutls.c: Fix -Wformat= warnings 2017-02-03 12:31:51 +01:00
Tim Rühsen
17d2f42a3d * src/iri.c: Remove unused macro IDNA_FLAGS 2017-02-03 12:28:37 +01:00
Tim Rühsen
638df40476 * src/iri.c: Remove use of __func__ macros 2017-02-03 12:28:05 +01:00
Tim Rühsen
00bafe72f1 * src/http.c: Fix -Wformat= warnings 2017-02-03 12:24:41 +01:00
Tim Rühsen
e777c01f43 * src/progress.c: Remove unused macro move_to_end 2017-02-03 12:18:14 +01:00
Tim Rühsen
3ba112ea57 * src/html-parse.c: Remove unused macro SKIP_NON_WS 2017-02-03 12:15:24 +01:00
Tim Rühsen
485fcfcc20 * src/hsts.c: Remove unused macro CHECK_EXPLICIT_PORT 2017-02-03 12:09:18 +01:00
Tim Rühsen
a5094731cd * src/hsts.c: Fix -Wformat= warnings 2017-02-03 12:08:08 +01:00
Tim Rühsen
3186eb2976 * src/hash.c: Explicitly convert float to int 2017-02-03 12:03:50 +01:00
Tim Rühsen
9947663af8 * src/ftp-ls.c: Fix -Wformat= warnings 2017-02-03 11:59:33 +01:00
Tim Rühsen
cfae085665 * src/ftp.c (ftp_retrieve_list): Add default to switch 2017-02-03 11:57:02 +01:00
Tim Rühsen
e69808256b * src/css-url.h: Remove redundant declaration 2017-02-03 11:53:28 +01:00
Tim Rühsen
11989ef669 * src/ftp.c: Fix -Wformat= warning 2017-02-03 11:52:08 +01:00
Tim Rühsen
5fceab6cb9 * src/http.c (test_parse_range_header): Fix constants 2017-02-03 10:32:42 +01:00
Dale R. Worley
d6eead1794 Improve documentation of --trust-server-names. 2017-02-02 12:10:43 +01:00
Tim Rühsen
d0e02a54ae * src/url.c (mkalldirs): Add newline to log message 2017-02-02 11:11:50 +01:00
Tim Rühsen
2e70409844 * src/cookies.c (check_domain_match): Add newline to DEBUG lines 2017-02-02 11:11:07 +01:00
Tim Rühsen
4734e8d4d7 * NEWS: update 2017-01-17 15:16:40 +01:00
Tim Rühsen
0fe8a5c40e * README.checkout: Link HTTPS where possible, update flex homepage 2017-01-17 14:25:15 +01:00
Tim Rühsen
1b9374ee59 * README.checkout: Fix libidn to libidn2 2017-01-17 14:07:16 +01:00
Tim Rühsen
6de24fe3c0 * src/iri.c: Use TR46 non-transitional for toASCII conversion 2017-01-13 15:53:03 +01:00
Tim Rühsen
0ab3d92c85 * src/main.c: Fix _Noreturn compiler warnings 2017-01-13 15:50:19 +01:00
Tim Rühsen
4cf8af84e0 * src/utils.c: Fix _Noreturn compiler warning 2017-01-13 15:49:05 +01:00
Tim Rühsen
42b8761cbc * src/init.c (setval_internal): Fix sign compare warning 2017-01-13 15:47:02 +01:00
Tim Rühsen
fd0f759597 Replace home-grown portability code by gnulib modules
* bootstrap.conf: Add intprops, inttypes, limits-h, signal-h,
  stat, sys_types
* src/ftp.c: Replace 'struct_stat' by 'struct stat'
* src/hsts.c: Likewise
* src/http.c: Likewise
* src/main.c: Likewise
* src/netrc.c: Likewise
* src/retr.c: Likewise
* src/url.c: Likewise
* src/utils.c: Likewise
* src/sysdep.h: Remove old portability code

Further portability issues should be addressed by gnulib.
2017-01-13 15:38:15 +01:00
Tim Rühsen
a384f5e2e9 Replace WGET_* m4 macros by gnulib modules
* bootstrap.conf: Add hostent, inet_ntop, nanosleep, utimens
* configure.ac: Remove WGET_STRUCT_UTIMBUF, WGET_FNMATCH,
  WGET_NANOSLEEP, WGET_POSIX_CLOCK, WGET_NSL_SOCKET
* m4/wget.m4: Likewise
* src/Makefile.am: Add $(LIB_NANOSLEEP) $(LIB_POSIX_SPAWN) to LDADD
* tests/Makefile.am: Likewise
* src/host.c (print_address): Use inet_ntop also for IPV4
2017-01-13 12:54:35 +01:00
Tim Rühsen
5ae1f37902 Remove libidn vulnerability work-around
* src/iri.c (_utf8_is_valid): Removed

Since we are using libidn2 for IDNs, we no longer need
this work-around.
2017-01-13 12:03:47 +01:00
Tim Rühsen
0eb4a21b6c * src/iri.c (idn_encode): Use TR46 transitional if available 2017-01-13 11:45:18 +01:00
Tim Rühsen
60dc3c21b2 * gnulibx: Update 2017-01-13 10:59:25 +01:00
Tim Rühsen
1a01a6b2d0 Fix previous commit 2427ca4ac0 2017-01-07 15:59:11 +01:00
vijeth-aradhya
2427ca4ac0 Fix http.c and ftp.c passwd logic error
* src/ftp.c (getftp): Fix password/user selection
* src/http.c (initialize_request): Likewise

Before, netrc password won over interactive
--ask-password but now --ask-password wins
after change of program logic

Fixes Issue #48811
2017-01-06 16:18:40 +01:00
Giuseppe Scrivano
42c2ce71bc * src/main.c (main): Add missing \n in error message 2016-12-31 17:11:01 +01:00
Giuseppe Scrivano
def133f26f Check that fd_set has not fds bigger than FD_SETSIZE
* src/connect.c: check that the fd is not bigger than FD_SETSIZE
  before using FD_SET.  An fd_set cannot hold fds bigger than
  FD_SETSIZE, causing out-of-bounds write to a buffer on the stack.

Reported by: Jann Horn <jannh@google.com>
2016-12-28 12:24:19 +01:00
Nikos Mavrogiannopoulos
b9ed06afd8 Avoid calling the gnutls priority functions multiple times
* src/gnutls.c (ssl_connect_wget): Call gnutls_set_default_priority()
  for --secure-protocol=auto (default).

The patch fixes a behavior that may have unintended side-effects in
certain gnutls versions. Instead use the default priorities when no
options are given.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2016-12-20 14:48:31 +01:00
Tim Rühsen
1bdc20d774 Print debug message when skipping certain recursive downloads
* src/recur.c (retrieve_tree): Print debug message instead silently
  skipping recursive downloads.
2016-12-19 12:19:52 +01:00
Rahul Bedarkar
e4e9d3c1c8 Rename base64_{encode,decode} (trivial patch)
* src/http-ntlm.c: Rename base64_{encode,decode}
* src/http.c: Likewise
* src/utils.c: Likewise
* src/utils.h: Likewise

When statically linking with gnutls, we get definition clash error for
base64_encode which is also defined by gnutls.

To prevent definition clash, rename base64_{encode,decode}

Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
2016-12-14 15:52:52 +01:00
Tim Rühsen
dcdd618b18 Add support for psl_latest()
* configure.ac: Add check for psl_latest(),
  remove --with-psl-file
* src/cookies.c (check_domain_match): Use psl_latest() if available
2016-12-11 21:04:40 +01:00
Piotr Wajda
3c796b9a85 Respect -o parameter again
* log.c: don't choose log output dynamically when opt.lfilename is set

 Regression introduced by dd5c549f6a
 Reported-by: Dale R. Worley
2016-11-09 13:32:14 +01:00
Tim Rühsen
00ae9b4ee2 Move Wget from IDN2003 (libidn) to IDN2008 (libidn2)
* .travis.yml: Install libidn2-dev instead libidn11-dev.
* bootstrap.conf: Add modules libunistring-optional, unistr/base,
  unicase/tolower.
* configure.ac: Check for libidn2.
* src/Makefile.am: Add $(LTLIBUNISTRING) to LDADD.
* tests/Makefile.am: Set LDADD similar to LDADD in src/Makefile.am
* src/connect.c: Use libidn2 code instead of libidn.
* src/host.c: Likewise.
* src/iri.c: Likewise.
* src/iri.h: Likewise.
* src/options.h: Likewise.
* src/url.c: Likewise.
* src/url.h: Likewise.
* src/log.c: Fix C99 comment.

IDN2003 should not be used any more due to security concerns.
We use libunistring (resp. the unicode code from gnulib) for
lowercasing UTF-8 before we give data to libidn2.
TR#46 is missing, no support in libidn2 nor in libunistring.
2016-11-07 11:03:42 +01:00
Tim Rühsen
2242d5aee4 Use -O0 in contrib scripts
* contrib/check-hard: Use -O0 instead of -O2 to speed up script.
* contrib/travis-ci: Likewise.
2016-11-03 15:47:41 +01:00
Tim Rühsen
77a546348c Update gnulib 2016-11-03 13:28:17 +01:00
Tim Rühsen
be5517f98f * src/metalink.c: Fix typo 'suceeded' -> 'succeeded'
Reported-by: Göran Uddeborg <goeran@uddeborg.se>,
             Anders Jonsson <anders.jonsson@norsjovallen.se>
2016-10-22 22:21:39 +02:00
losgrandes
dd5c549f6a Fixes #45790: wget prints it's progress even when background
* src/log.c: Use tcgetpgrp(STDIN_FILENO) != getpgrp() to determine when to print to STD* or logfile.
  Deprecate log_request_redirect_output function.
  Use different file handles for STD* and logfile, to easily switch between them when changing fg/bg.
* src/log.h: Make redirect_output function externally linked.
* src/main.c: Don't use deprecated log_request_redirect_output function. Use redirect_output instead.
* src/mswindows.c: Don't use deprecated log_request_redirect_output function. Use redirect_output instead.
2016-10-21 19:33:29 +02:00
losgrandes
78e0ec5f03 Fixes #46584: wget --spider always returns zero exit status
* src/ftp.c: Return error as exit value if even one file doesn't exist
2016-10-21 10:24:28 +02:00
Tim Rühsen
807d1c7d94 * src/http.c (gethttp): Accept 206 for request w/o Range header
Fixes: #49319
2016-10-12 14:59:36 +02:00
Tim Rühsen
3d1d5b317b * tests/Makefile.am: Let WGETRC work on *nix and Windows 2016-10-07 13:27:07 +02:00
Tim Rühsen
517d799b6f Properly include iconv.h
* src/iri.c: Check HAVE_ICONV to include iconv.h
* src/url.c: Same
2016-10-07 13:24:15 +02:00
Tim Rühsen
f79bb20f1b * bootstrap.conf: Add pipe-posix for pipe() 2016-10-07 13:23:27 +02:00
Tim Rühsen
e5164a8260 Amend redirection behavior
* src/recur.c (descend_redirect): Ignore WG_RR_LIST and WG_RR_REGEX
  for redirections.
* testenv/Makefile.am: Add Test-recursive-redirect.py
* testenv/Test-recursive-redirect.py: New test

Test-recursive-redirect.py written by Dale R. Worley.

Reported-by: "Dale R. Worley" <worley@ariadne.com>
2016-10-07 11:49:07 +02:00
Matthew White
a35f3dd4f6 New: Metalink/XML v3 python class, update tests to use this class
* testenv/misc/metalinkv3_xml.py: New Metalink/XML v3 python class
* testenv/Test-metalink-xml-abspath-trust.py: Update test to use the
  new Metalink/XML v3 python class
* testenv/Test-metalink-xml-abspath.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-absprefix-trust.py: Update test to use the
  new Metalink/XML v3 python class
* testenv/Test-metalink-xml-absprefix.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-continue.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-emptyprefix-trust.py: Update test to use
  the new Metalink/XML v3 python class
* testenv/Test-metalink-xml-homepath-trust.py: Update test to use the
  new Metalink/XML v3 python class
* testenv/Test-metalink-xml-homepath.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-homeprefix-trust.py: Update test to use
  the new Metalink/XML v3 python class
* testenv/Test-metalink-xml-homeprefix.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-nohash.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-nourls.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-prefix-trust.py: Update test to use the
  new Metalink/XML v3 python class
* testenv/Test-metalink-xml-prefix.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-relpath-trust.py: Update test to use the
  new Metalink/XML v3 python class
* testenv/Test-metalink-xml-relpath.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-relprefix-trust.py: Update test to use the
  new Metalink/XML v3 python class
* testenv/Test-metalink-xml-relprefix.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-size.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml-trust.py: Update test to use the new
  Metalink/XML v3 python class
* testenv/Test-metalink-xml.py: Update test to use the new
  Metalink/XML v3 python class
2016-09-30 19:44:06 +02:00
Matthew White
c403e67935 New: --metalink-over-http Content-Type/Disposition Metalink/XML processing
* src/http.c (metalink_from_http): Process the Content-Type header.
  Add an application/metalink4+xml URL as metalink metaurl.  If the
  option opt.content_disposition is true, the Content-Disposition's
  filename is the metaurl's name
* doc/wget.texi: Update --content-disposition and --metalink-over-http
* doc/metalink-standard.txt: Update doc. Content-Type/Disposition
  processing through --metalink-over-http. Update download naming
  system about --trust-server-names and --content-disposition
* testenv/Makefile.am: Add new files
* testenv/Test-metalink-http-xml-type.py: New file. Metalink/HTTP
  Content-Type/Disposition header automated Metalink/XML tests
* testenv/Test-metalink-http-xml-type-trust.py: New file. Metalink/HTTP
  Content-Type/Disposition header with --trust-server-names automated
  Metalink/XML tests
* testenv/Test-metalink-http-xml-type-content.py: New file. Metalink/HTTP
  Content-Type/Disposition header with --content-disposition automated
  Metalink/XML tests
* testenv/Test-metalink-http-xml-type-trust-content.py: New file.
  Metalink/HTTP Content-Type/Disposition header with --trust-server-names
  and --content-disposition automated Metalink/XML tests

Process the Content-Type header, identify an application/metalink4+xml
file.  The Content-Disposition could provide an alternate name through
the "filename" field for the metalink xml file.  Respectively, the cli
options --metalink-over-http and --content-disposition are required.

When Metalink/XML auto-processing, to use the Content-Disposition's
filename, the cli option --trust-server-names is also required.
2016-09-30 19:44:06 +02:00
Matthew White
3021466817 Bugfix: Set NULL variable due to --content-disposition to Metalink origin
* src/http.c (http_loop): Prevent SIGSEGV when hstat.local_file is
  NULL, opt.content_disposition has a role in leaving the value unset
* src/http.c (gethttp): If hs->local_file is NULL (aka http_loop()'s
  hstat.local_file), set it to the value of hs->metalink->origin
2016-09-30 19:44:06 +02:00
Matthew White
c89767d8d1 New: --trust-server-names saves Metalink/HTTP xml files using the "name" field
* src/metalink.c (retrieve_from_metalink): If opt.trustservernames is
  true, use the basename of the metaurl's name to save the xml file
* doc/metalink-standard.txt: Update doc. With --trust-server-names any
  Metalink/HTTP Link application/metalink4+xml file is saved using the
  basename of the "name" field, if any. Update Metalink/HTTP examples
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-http-xml-trust-name.py: New file. Metalink/HTTP
  automated Metalink/XML, save xml files using the "name" field tests
2016-09-30 19:44:06 +02:00
Matthew White
f030cdf8e2 Bugfix: Detect when a metalink:file doesn't have any hash
* src/metalink.c (retrieve_from_metalink): Reject any metalink:file
  without hashes. Prompt the error and switch to the next file
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-xml-nohash.py: New file. Metalink/XML with no
  hashes tests

Prevent SIGSEGV.
2016-09-30 19:44:06 +02:00
Matthew White
5dccb2a9ce Bugfix: Detect malformed base64 Metalink/HTTP Digest header
* src/http.c (metalink_from_http): Fix hash_bin_len type. Use ssize_t
  instead than size_t. Reject -1 as base64_decode() return value
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-http-baddigest.py: New file. Metalink/HTTP
  malformed base64 Digest header tests

On malformed base64 input, ssize_t base64_decode() returns -1. Such
value is too big for a size_t variable, and used as xmalloc() value
will exaust all the memory.
2016-09-30 19:44:06 +02:00
Matthew White
0538e791fb New option --metalink-index to process Metalink application/metalink4+xml
* NEWS: Mention the effect of --metalink-index over Metalink
* src/init.c: Add new option metalinkindex (opt.metalink_index),
  initialize to -1
* src/main.c: Add new option metalink-index (--metalink-index=NUMBER)
* src/options.h: Add new option metalink_index (int)
* src/metalink.h: Add declaration of functions fetch_metalink_file(),
  replace_metalink_basename()
* src/metalink.c: Add functions fetch_metalink_file() simple file
  fetch, replace_metalink_basename() replace file basename
* src/metalink.c (retrieve_from_metalink): New. Process Metalink
  application/metalink4+xml of opt.metalink_index ordinal number
* doc/wget.texi: Add new option metalink-index (--metalink-index)
  documentation
* doc/metalink-standard.txt: Updated doc. Add documentation about
  Metalink application/metalink4+xml metaurls download naming system
* doc/metalink-standard.txt: Update Metalink/XML and HTTP examples
* testenv/Makefile.am: Add new files
* testenv/Test-metalink-http-xml.py: New file. Metalink/HTTP automated
  Metalink/XML "application/metalink4+xml" --metalink-index tests
* testenv/Test-metalink-http-xml-trust.py: New file. Metalink/HTTP
  automated Metalink/XML "application/metalink4+xml" --metalink-index
  retrieval with --trust-server-names tests

WARNING: Do not use lib/dirname.c (dir_name) to get the directory
name, it may append a dot '.' character to the directory name.
2016-09-30 19:44:06 +02:00
Matthew White
acb1d1a668 Bugfix: Prevent sorting when there are less than two elements
* src/utils.c (stable_sort): Add condition nmemb > 1, sort only when
  there is more than one element

Prevent SIGSEGV.
2016-09-30 19:44:06 +02:00
Matthew White
628fb565c7 New: Parse Metalink/HTTP header for application/metalink4+xml
* src/http.c (metalink_from_http): Parse Metalink/HTTP header for
  metaurls application/metalink4+xml media types
* src/metalink.h: Add function declaration metalink_meta_cmp()
* src/metalink.c: Add function metalink_meta_cmp() compare metalink
  metaurls priorities

Add Metalink/HTTP application/metalink4+xml media types as metaurls to
the metalink variable that will be used to download the files.
2016-09-30 19:44:05 +02:00
Matthew White
64ab90ee66 New test: Metalink shall not concatenate '/' to an empty directory prefix
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-xml-emptyprefix-trust.py: New file.
  Metalink/XML empty directory prefix (--directory-prefix '') tests

Detect a '/' character wrongfully concatenated to an empty directory
prefix '' (not NULL), resulting in an absolute path as '/dir/file',
instead than 'dir/file'.
2016-09-30 19:44:05 +02:00
Matthew White
9532861aef Bugfix: Remove surrounding quotes from Metalink/HTTP key's value
* src/metalink.h: Add declaration of function dequote_metalink_string()
* src/metalink.c: Add function dequote_metalink_string() remove
  surrounding quotes from string, \' or \"
* src/metalink.c (find_key_value, find_key_values): Call dequote_metalink_string()
  to remove the surrounding quotes from the parsed value
* src/metalink.c (test_find_key_value, test_find_key_values): Add
  quoted key's values for unit-tests
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-http-quoted.py: New file. Metalink/HTTP quoted
  values tests

Some Metalink/HTTP keys, like "type" [2], may have a quoted value [1]:
Link: <http://example.com/example.ext.meta4>; rel=describedby;
type="application/metalink4+xml"

Wget was expecting a dequoted value from the Metalink module. This
patch addresses this problem.

References:
 [1] Metalink/HTTP: Mirrors and Hashes
     1.1. Example Metalink Server Response
     https://tools.ietf.org/html/rfc6249#section-1.1

 [2] Additional Link Relations
     6. "type"
     https://tools.ietf.org/html/rfc6903#section-6
2016-09-30 19:44:05 +02:00
Matthew White
8aca8fc80d Bugfix: Process Metalink/XML url strings containing white spaces and CRLF
* src/metalink.h: Add declaration of function clean_metalink_string()
* src/metalink.c: Add directive #include "xmemdup0.h"
* src/metalink.c: Add function clean_metalink_string() remove leading
  and trailing white spaces and CRLF from string
* src/metalink.c (retrieve_from_metalink): Remove leading and trailing
  white spaces and CRLF from url resource mres->url
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-xml-urlbreak.py: New test. Metalink/XML white
  spaces and CRLF in url resources tests

White spaces and CRLF are not automatically removed by libmetalink
from url strings. The Wget's Metalink module was unable to process
such url strings. This patch implements the processing of such url
strings cleaning off leading and trailing white spaces and CRLF.

If a parsed Metalink/XML url string contains strings separated by
CRLF, only the first of the series is accepted.
2016-09-30 19:44:05 +02:00
Matthew White
ba82a47173 New test: Detect when there are no good Metalink url resources
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-xml-nourls.py: New file. Metalink/XML unknown
  urls tests

Test if when there are no good Metalink url resources there is any
segmentation fault.
2016-09-30 19:44:05 +02:00
Matthew White
70360b3eab New: Metalink file size mismatch returns error code METALINK_SIZE_ERROR
* src/wget.h (uerr_t): Add error code METALINK_SIZE_ERROR to enum
* src/metalink.c (retrieve_from_metalink): Use boolean variable
  size_ok, when false set retr_err to METALINK_SIZE_ERROR
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-xml-size.py: New file. Metalink/XML file size
  tests (<size></size>)

Before this patch, no appropriate error code was returned to inform a
file size mismatch.

This patch introduces the error code METALINK_SIZE_ERROR to inform a
file size mismatch.
2016-09-30 19:44:05 +02:00
Matthew White
c29983a044 New: Metalink/XML and Metalink/HTTP file naming safety rules
* NEWS: Mention the effect of --trust-server-names over Metalink
* src/metalink.h: Add declaration of function append_suffix_number()
* src/metalink.c: Add function append_suffix_number() append number to
  string
* src/metalink.c (retrieve_from_metalink): Safer Metalink/XML and
  Metalink/HTTP download naming system, opt.trustservernames based
* doc/metalink-standard.txt: Update doc. Explain new Metalink/XML and
  Metalin/HTTP download naming system and --trust-server-names role
* testenv/Makefile.am: Add new files
* testenv/Test-metalink-xml-continue.py: Update test. Metalink/XML
  continue/keep existing files (HTTP 416) with --continue tests
* testenv/Test-metalink-xml.py: Update test. Metalink/XML naming tests
* testenv/Test-metalink-xml-trust.py: New file. Metalink/XML naming
  tests with --trust-server-names
* testenv/Test-metalink-xml-abspath.py: Update test. Metalink/XML
  absolute path tests
* testenv/Test-metalink-xml-abspath-trust.py: New file. Metalink/XML
  absolute path tests with --trust-server-names
* testenv/Test-metalink-xml-relpath.py: Update test. Metalink/XML
  relative path tests
* testenv/Test-metalink-xml-relpath-trust.py: New file. Metalink/XML
  relative path tests with --trust-server-names
* testenv/Test-metalink-xml-homepath.py: Update test. Metalink/XML
  home path and ~ (tilde) tests
* testenv/Test-metalink-xml-homepath-trust.py: New file. Metalink/XML
  home path and ~ (tilde) tests with --trust-server-names
* testenv/Test-metalink-xml-prefix.py: New file. Metalink/XML naming
  tests with --directory-prefix
* testenv/Test-metalink-xml-prefix-trust.py: New file. Metalink/XML
  naming tests with --directory-prefix and --trust-server-names
* testenv/Test-metalink-xml-absprefix.py: New file. Metalink/XML
  absolute --directory-prefix tests
* testenv/Test-metalink-xml-absprefix-trust.py: New file. Metalink/XML
  absolute --directory-prefix tests with --trust-server-names
* testenv/Test-metalink-xml-relprefix.py: New file. Metalink/XML
  relative --directory-prefix tests
* testenv/Test-metalink-xml-relprefix-trust.py: New file. Metalink/XML
  relative --directory-prefix tests with --trust-server-names
* testenv/Test-metalink-xml-homeprefix.py: New file. Metalink/XML home
  --directory-prefix tests
* testenv/Test-metalink-xml-homeprefix-trust.py: New file. Metalink/XML
  home --directory-prefix tests with --trust-server-names

The option --trust-server-names allows to use the file names parsed
from a Metalink/XML file.  Without --trust-server-names, the safety
mechanism provides secure and predictable file names.
2016-09-30 19:44:05 +02:00
Matthew White
5f3ed5eec8 New document: Metalink/XML and Metalink/HTTP standard reference
* doc/metalink-standard.txt: New doc. Implemented and recommended
  Metalink/XML and Metalink/HTTP standard features
2016-09-30 19:44:05 +02:00
Matthew White
43ec7008f2 Enforce Metalink file name verification, strip directory if necessary
* NEWS: Mention the use of a safe Metalink destination path
* src/metalink.h: Add declaration of functions get_metalink_basename(),
  last_component(), metalink_check_safe_path()
* src/metalink.c: Add directive #include "dosname.h"
* src/metalink.c: Add function get_metalink_basename() to return the
  basename of a file name, strip w32's drive letter prefixes
* src/metalink.c (retrieve_from_metalink): Enforce Metalink file name
  verification, if the file name is unsafe try its basename
* doc/metalink.txt: Update document. Explain --directory-prefix

The function get_metalink_basename() uses FILE_SYSTEM_PREFIX_LEN to
catch any 'C:D:file' (w32 environment), then it removes each drive
letter prefix, i.e. 'C:' and 'D:'.

Unsafe file names contain an absolute, relative, or home path.  Safe
paths can be verified by libmetalink's metalink_check_safe_path().
2016-09-30 19:44:03 +02:00
Matthew White
7d4942864b Implement Metalink/XML --directory-prefix option in Metalink module
* NEWS: Mention the effect of --directory-prefix over Metalink
* src/metalink.c (retrieve_from_metalink): Add opt.dir_prefix as
  prefix to the metalink:file name mfile->name
* doc/metalink.txt: Update document. Explain --directory-prefix

When --directory-prefix=<prefix> is used, set the top of the retrieval
tree to prefix. The default is . (the current directory). Metalink/XML
and Metalink/HTTP files will be downloaded under prefix.
2016-09-27 20:29:03 +02:00
Matthew White
666b7862bf Change mfile->name to filename in Metalink module's messages
* src/metalink.c (retrieve_from_metalink): Change mfile->name to
  filename when referring to the downloaded file

The file name could have been changed by unique_create() (or by any
other mean) before downloading. Use the name of the downloaded file
(filename) when printing output which refer to it.
2016-09-27 20:29:03 +02:00
Matthew White
f3f349a0cf Add file size computation in Metalink module
* NEWS: Mention Metalink's file size verification
* src/metalink.c (retrieve_from_metalink): Add file size computation
* doc/metalink.txt: Update document. Remove resolved bugs

Reject downloaded files when they do not agree with their Metalink/XML
metalink:size: https://tools.ietf.org/html/rfc5854#section-4.2.14

At the moment of writing, Metalink/HTTP headers do not provide a file
size field. This information could be obtained from the Content-Length
header field: https://tools.ietf.org/html/rfc6249#section-7
2016-09-27 20:29:03 +02:00
Matthew White
6b1860da37 Update Metalink/XML tests and add a new test for home paths
* testenv/Test-metalink-xml-relpath.py: Update test
* testenv/Test-metalink-xml-homepath.py: New file. Reject home paths
* testenv/Makefile.am: Add new file

When --input-metalink=<file> is used, each metalink:file name is
verified by libmetalink's metalink_check_safe_path(). By design,
absolute, relative and home paths are rejected.

At the moment of writing, when --metalink-over-http is used, absolute,
relative, and home paths aren't a concern. The destination file name
is a combination of URL's file name and cli's "Directory Options"
handled by src/url.c (url_file_name).
2016-09-27 20:29:03 +02:00
Matthew White
ff444ebc2a Bugfix: Keep the download progress when alternating metalink:url
* NEWS: Mention the effects of --continue over Metalink
* src/metalink.c (retrieve_from_metalink): On download error, resume
  output_stream with the next mres->url. Keep fully downloaded files
  started with --continue, otherwise rename/remove the file
* testenv/Makefile.am: Add new file
* testenv/Test-metalink-xml-continue.py: New file. Metalink/XML
  continue/keep existing files (HTTP 416) with --continue tests

Before this patch, with --continue, existing and/or fully retrieved
files which fail the sanity tests were renamed (--keep-badhash), or
removed.

This patch ensures that --continue doesn't rename/remove existing
and/or fully retrieved files (HTTP 416) which fail the sanity tests.
2016-09-27 20:28:50 +02:00
Matthew White
96554861f9 Bugfix: Fix NULL filename and output_stream in Metalink module
* NEWS: Mention the Metalink "path/file" name format handling
* src/metalink.c (retrieve_from_metalink): Fix NULL filename, set
  filename to the right "path/file" value
* src/metalink.c (retrieve_from_metalink): Fix NULL output_stream, set
  output_stream to filename when it is created by retrieve_url()
* src/metalink.c (retrieve_from_metalink): Add RFC5854 comments about
  proper metalink:file "path/file" name format handling
* doc/metalink.txt: Update document. Remove resolved bugs

If unique_create() cannot create/open the destination file, filename
and output_stream remain NULL. If fopen() is used instead, filename
always remains NULL. Both functions cannot create "path/file" trees.

Setting filename to the right value is sufficient to prevent SIGSEGV
generating from testing a NULL value. This also allows retrieve_url()
to create a "path/file" tree through opt.output_document.

Reading NULL as output_stream, when it shall not be, leads to wrong
results. For instance, a non-NULL output_stream tells when a stream
was interrupted, reading NULL instead means to assume the contrary.

This patch conforms to the RFC5854 specification:
  The Metalink Download Description Format
  4.1.2.1.  The "name" Attribute
  https://tools.ietf.org/html/rfc5854#section-4.1.2.1
2016-09-27 20:17:08 +02:00
Matthew White
bcb9bf7ae4 Add metalink description
* doc/metalink.txt

Evaluation of "Directory Options" on the command line interacting with
the option '--input-metalink=file':

$ wget --input-metalink=file <directory options>
2016-09-19 05:56:40 +02:00
Matthew White
ea038006d1 Use python .replace instead than re.sub in Metalink tests
* testenv/Test-metalink-http.py: Use python .replace
* testenv/Test-metalink-xml.py: Use python .replace
* testenv/Test-metalink-xml-abspath.py: Use python .replace
* testenv/Test-metalink-xml-relpath.py: Use python .replace

Use python .replace instead than re.sub, remove 'import re'.
2016-09-19 05:56:40 +02:00
Matthew White
77e2c54991 Fix: Change Metalink/XML v3 file name into test.metalink
* testenv/Test-metalink-xml-abspath.py: Change Metalink/XML v3 file
  name from test.meta4 into test.metalink
* testenv/Test-metalink-xml-relpath.py: Change Metalink/XML v3 file
  name from test.meta4 into test.metalink
* testenv/Test-metalink-xml.py: Change Metalink/XML v3 file name from
  test.meta4 into test.metalink
2016-09-19 05:55:04 +02:00
Tim Rühsen
7ffbccec4c Add two Metalink/XML tests
* testenv/Test-metalink-xml-abspath.py: Reject absolute paths
* testenv/Test-metalink-xml-relpath.py: Reject relative paths
* testenv/Makefile.am: Add both new files to metalink tests
2016-09-13 11:45:02 +02:00
Tim Rühsen
a2c4849900 Fix crash on 'srcset' inline URIs
* src/html-url.c (tag_handle_img): Check append_url() for NULL
  return value before dereference.

Crashed reproducable with parsing srcset="data:..." inline data.
Reported-by: Coverity
2016-09-09 11:44:02 +02:00
Tim Rühsen
40870e1271 * src/hsts.c (hsts_store_open): NULL check param for fclose().
Reported-by: Coverity
2016-09-09 10:22:58 +02:00
Tim Rühsen
15c1e0eb7b * src/ftp-ls.c (ftp_parse_winnt_ls): Fix memset params 2016-09-09 10:22:58 +02:00
Tim Rühsen
eba724a128 * src/utils.c (stable_sort): Use xmalloc instead of malloc 2016-09-09 10:22:58 +02:00
Tim Rühsen
66a9883c8f * src/ftp-ls.c (ftp_parse_winnt_ls): Initialize struct fileinfo cur
Reported-by: Coverity
2016-09-08 16:51:15 +02:00
Tim Rühsen
4febe72bd2 Add const to url param of some functions
* src/http.c: Add const to first param of initialize_request(),
  initialize_proxy_configuration(), establish_connection(),
  check_file_output(), check_auth(), gethttp(), http_loop().
* src/http.h: Add const to first param of http_loop().
2016-09-08 16:13:54 +02:00
Tim Rühsen
c629ec7fd1 * Makefile.am: Remove trailing empty line 2016-09-08 14:20:33 +02:00
Tim Rühsen
03da900c5b * src/recur.c (retrieve_tree): Fix possible NULL dereference
Reported-by: Coverity
2016-09-08 13:04:37 +02:00
Tim Rühsen
b7b67e23cd * src/http.c (initialize_request): Fix check for user
Reported-by: Coverity
2016-09-08 12:48:32 +02:00
Tim Rühsen
22aed3ed4b * src/retr.c (retrieve_url): NULL check mynewloc
Reported-by: Coverity
2016-09-08 12:46:25 +02:00
Tim Rühsen
b4465afa8a * src/utils.c (stable_sort): Reduce tmp allocation size
Reported-by: Coverity
2016-09-08 12:44:17 +02:00
Tim Rühsen
a232835fd1 * Makefile.am: Add target 'check-valgrind' 2016-09-08 11:20:25 +02:00
Tim Rühsen
a78b83b1e9 Fix some issues detected by Coverity
* src/connect.c (connect_to_ip): Check return value of setsockopt.
* src/ftp.c (ftp_retrieve_list): Check return value of chmod.
* src/http.c (digest_authentication_encode): Cleanup code.
* src/init.c (setval_internal): Explicitely check comind range.
* src/main.c (main): Explicitely check optarg.
* src/retr.c (retr_rate): Use snprintf instead sprintf,
  (retrieve_from_file): More verbose error message,
  (rotate_backups): Use snprintf instead sprintf, check return
  value of rename().
* src/url.c (mkalldirs): Check return value of unlink().
* src/utils.c (strdupdelim): Explicitely check beg and end for NULL,
  (merge_vecs): Fix sizeof argument to char *,
  (stable_sort): Use malloc instead of alloca.
2016-09-08 10:12:02 +02:00
Tim Rühsen
37a5257c66 Code cleanup for --use-askpass
* bootstrap.conf: Add xmemdup0 and strpbrk.
* src/init.c (cmd_use_askpass): Add 'const' to char *,
  remove check for file existence.
* src/main.c (run_use_askpass): C89 compat init of argv,
  added \n to error messages,
  fixed stripping of \n and \r from input,
  make run_use_askpass and use_askpass static.
2016-09-08 09:07:32 +02:00
Tim Rühsen
49af22ca94 * src/http.c (check_file_output): Replace asprintf by aprint 2016-09-07 09:31:43 +02:00
Tim Rühsen
d505714a32 * testenv/README: Remove obsolete references to TEST_NAME 2016-09-04 14:56:06 +02:00
Liam R. Howlett
21e1725e12 Add --use-askpass=COMMAND support
* doc/wget.texi: Add --use-askpass to documentation.
* src/init.c: Add cmd_use_askpasss to set opt.use_askpass based on
argument, WGET_ASKPASS, and SSH_ASKPASS environment variables.
opt.wget-askpass is freed in cleanup ()
* src/main.c: Update options & add spawn process of opt.use_askpass
command.
* src/options.h: Addition of string use_askpass.
* src/url.c: Function scheme_leading_string to access the leading
string of a parsed url.
* src/url.h: Prototype for scheme_leading_string for returning the
leading string.
* bootstrap.conf: Add posix_spawn to gnulib_modules

This adds the --use-askpass option which is disabled by default.

--use-askpass=COMMAND will request the username and password for a given
URL by executing the external program COMMAND.  If COMMAND is left
blank, then the external program in the environment variable
WGET_ASKPASS will be used.  If WGET_ASKPASS is not set then the
environment variable SSH_ASKPASS is used.  If there is no value set, an
error is returned.  If an error occurs requesting the username or
password, wget will exit.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>
2016-09-03 21:01:24 +02:00
Dale R. Worley
796e30dcea Add tests for recursion and redirection.
* testenv/Test-recursive-basic.py: New file. Test basic recursion
    * testenv/Test-recursive-include.py: New File. Recursion test with
    include directories
    * testenv/Test-redirect.py: New File. Basic redirection tests
    * testenv/Makefile.am: Add new tests to makefile
2016-09-02 17:46:36 +02:00
Dale R. Worley
b919f988f2 Sort test names into order.
* testenv/Makefile.am: Sort all the python tests in alphabetical
    order
2016-09-02 17:45:19 +02:00
Dale R. Worley
ca1ee7d32f Corrections and amplifications to test documentation
* testenv/README: Update documentation to meet current project
    status
    * testenv/Test-Proto.py: Same
2016-09-02 17:44:10 +02:00
Giuseppe Scrivano
690c47e3b1 Append .tmp to temporary files
* src/http.c (struct http_stat): Add `temporary` flag.
(check_file_output): Append .tmp to temporary files.
(open_output_stream): Refactor condition to use hs->temporary instead.

Reported-by: "Misra, Deapesh" <dmisra@verisign.com>
Discovered by: Dawid Golunski (http://legalhackers.com)
2016-08-24 12:29:01 +02:00
Tim Rühsen
9ffb64ba6a Limit file mode to u=rw on temp. downloaded files
* bootstrap.conf: Add gnulib modules fopen, open.
* src/http.c (open_output_stream): Limit file mode to u=rw
on temporary downloaded files.

Reported-by: "Misra, Deapesh" <dmisra@verisign.com>
Discovered by: Dawid Golunski (http://legalhackers.com)
2016-08-24 12:28:55 +02:00
Giuseppe Scrivano
6698260f15 Fix some make syntax-check issues
cfg.mk: Skip .der files.
testenv/certs/server-template.cfg: Remove empty final line.
testenv/certs/ca-template.cfg: Likewise.
2016-08-21 15:35:36 +02:00
Tim Rühsen
0787d7253e * src/css-url.c (get_urls_css): Fix memory leak 2016-08-17 23:13:27 +02:00
Tim Rühsen
964f4646da * src/html-url.c (get_urls_html): Fix memory leak 2016-08-17 23:12:25 +02:00
Tim Rühsen
262baeb113 Improve PSL cookie checking
* configure.ac: Add --with-psl-file to set a PSL file
* src/cookies.c (check_domain_match): Load PSL_FILE with
  fallback to built-in data.

This change allows package maintainers to make Wget use the latest
PSL (DAFSA or plain text), without updating libpsl itself.

E.g. Debian now comes with a DAFSA binary within the 'publicsuffix'
package which allows very fast loading (no parsing or processing needed).
2016-08-17 16:32:26 +02:00
Tobias Stoeckmann
f4aeb41899 Fix stack overflow with way too many cookies
* src/cookies.c (cookie_header): Use heap instead of stack.
* src/http.c (request_send): Likewise.

If wget has to handle an insanely large amount of cookies (~700,000 on
32 bit systems or ~530,000 on 64 bit systems), the stack is not large
enough to hold these pointers, leading to undefined behaviour according
to POSIX; expect a segmentation fault in real life. ;)

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2016-08-10 19:59:25 +02:00
Tobias Stoeckmann
a9d49e5b15 Fix signal race condition
The signal handler for SIGALRM calls longjmp, but the handler is
installed before the jump target has been initialized. If another
process sends SIGALRM right between handler installation and target
initialization, the jump leads to undefined behavior.

This can easily be fixed by moving the signal handler installation
into the "SETJMP == 0" conditional block, which means that the target
has just been initialized.

* src/utils.c: call signal after SETJMP.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2016-08-09 17:38:29 +02:00
Jeffery To
0fe79eeacb Remove hyphens from command names
* src/init.c: Remove hyphens from command names
* src/main.c: Likewise

Options with hyphens (or underscores) in their command name cannot be
set in a wgetrc file.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2016-08-05 09:45:09 +02:00
Tim Rühsen
e3fb4c3859 * src/metalink.c (badhash_suffix): Fix quoting 2016-08-04 13:09:28 +02:00
Matthew White
943a6d585f Add new option --keep-badhash to keep Metalink's files with a bad hash
* src/init.c: Add keepbadhash
* src/main.c: Add keep-badhash
* src/options.h: Add keep_badhash
* doc/wget.texi: Add docs for --keep-badhash
* src/metalink.h: Add prototypes badhash_suffix(), badhash_or_remove()
* src/metalink.c: New functions badhash_suffix(), badhash_or_remove().
  (retrieve_from_metalink): Call badhash_or_remove() on download error

With --keep-badhash, append .badhash to Metalink's files with checksum
mismatch. (retrieve_from_metalink): unique_create() may append another
suffix to avoid overwriting existing files.

Without --keep-badhash, remove downloaded files with checksum mismatch
(this conforms to the old behaviour).
2016-08-04 12:03:49 +02:00
Tim Rühsen
7fad76db4c * src/metalink.c: Remove C++ style comments 2016-08-03 13:48:07 +02:00
Matthew White
3e7e29f358 Add gnulib modules 'link', 'unlink' and 'symlink'
* bootstrap.conf: Add 'link', 'unlink' and 'symlink'
2016-08-03 13:44:34 +02:00
Matthew White
e0b60fd073 New: --continue continues partially downloaded Metalink's files
* src/metalink.c (retrieve_from_metalink): Continue file download if
  opt.always_rest is true

Without --continue, download as a new file with an unique name (this
conforms to the old behaviour).
2016-08-03 13:37:27 +02:00
Matthew White
9db02a0c46 Add support for Metalink's md2, and md4 hashes
* bootstrap.conf: Add crypto/md2, and crypto/md4
* src/metalink.c (retrieve_from_metalink): Add md2, and md4 support

This patch adds support for the deprecated (insecure) md2, and md4
Message-Digest algorithms to the Metalink module.
2016-08-03 12:58:43 +02:00
Matthew White
edad3c1df3 Add support for Metalink's md5, sha1, sha224, sha384, and sha512 hashes
* bootstrap.conf: Add crypto/sha512
* src/metalink.c (retrieve_from_metalink): Add md5, sha1, sha224,
  sha384, and sha512 support

Metalink's checksum verification was limited to sha256. This patch
adds support for md5, sha1, sha224, sha384, and sha512.
2016-08-03 12:49:26 +02:00
Sean Burford
20cac2c5ab Style fixes and DEBUG on setxattr failure.
* src/ftp.c: Fix style.
* src/http.c: Likewise.
* src/xattr.h: Likewise.
* src/xattr.c: Likewise,
  (write_xattr_metadata): Print debug msg on error.
2016-07-27 17:05:57 +02:00
Sean Burford
a933bdd31e Keep fetched URLs in POSIX extended attributes
* configure.ac: Check for xattr availability
* src/Makefile.am: Add xattr.c
* src/ftp.c: Include xattr.h.
  (getftp): Set attributes if enabled.
* src/http.c: Include xattr.h.
  (gethttp): Add parameter 'original_url',
  set attributes if enabled.
  (http_loop): Add 'original_url' to call of gethttp().
* src/init.c: Add new option --xattr.
* src/main.c: Add new option --xattr, add description to help text.
* src/options.h: Add new config member 'enable_xattr'.
* src/xatrr.c: New file.
* src/xattr.h: New file.

These attributes provide a lightweight method of later determining
where a file was downloaded from.

This patch changes:
*   autoconf detects whether extended attributes are available and
    enables the code if they are.
*   The new flags --xattr and --no-xattr control whether xattr is enabled.
*   The new command "xattr = (on|off)" can be used in ~/.wgetrc or /etc/wgetrc
*   The original and redirected URLs are recorded as shown below.
*   This works for both single fetches and recursive mode.

The attributes that are set are:
user.xdg.origin.url: The URL that the content was fetched from.
user.xdg.referrer.url: The URL that was originally requested.

Here is an example, where http://archive.org redirects to https://archive.org:
$ wget --xattr http://archive.org
...
$ getfattr -d index.html
user.xdg.origin.url="https://archive.org/"
user.xdg.referrer.url="http://archive.org/"

These attributes were chosen based on those stored by Google Chrome
https://bugs.chromium.org/p/chromium/issues/detail?id=45903
and curl https://github.com/curl/curl/blob/master/src/tool_xattr.c
2016-07-22 13:42:23 +02:00
Noël Köthe
ef372a4f27 Fix typos
* ChangeLog-2014-12-10: invokation -> invocation
* doc/wget.texi: invokation -> invocation
* src/main.c: seperated -> separated
* src/options.h: seperated -> separated
* testenv/README: invokation -> invocation
* testenv/conf/wget_commands.py: invokation -> invocation
2016-07-02 19:01:24 +02:00
Tim Rühsen
0b151f51eb Fix creating docs when make uses 'sh -e'
* doc/Makefile.am: Save fallback for pod2man --utf8

Reported-by: Jérémie Courrèges-Anglas <jca@wxcvbn.org>
2016-06-30 15:19:26 +02:00
Tim Rühsen
309e72c74f Fix compilation for OpenSSL 1.1.0
* src/openssl.c (ssl_init): Use SSL_is_init_finished() instead of
  SSL_state(), conditionally skip SSLeay function calls

The python test suite makes SSL_peek() hang, consuming 100% CPU time.
This does not happen on real world TLS connections, though, but needs
investigations.
2016-06-30 13:24:33 +02:00
Tim Rühsen
2318c309d4 Add script to generate test certs non-interactive
* Test-pinnedpubkey-hash-https.py: Read hashed pubkey from file
* Test-pinnedpubkey-hash-no-check-fail-https.py: Use invalid hash
* certs/make_ca.sh: New script to generate test certs non-interactive
* certs/ca-template.cfg: New file (template for CA cert)
* certs/server-template.cfg: New file (template for server cert)
* certs/server-pubkey-sha256.base64: New file (pubkey sha256 hash)
2016-06-29 12:54:06 +02:00
Ander Juaristi
cdc3e28d8e Bypass world-writable checks on Windows
* src/hsts.c (hsts_file_access_valid): we should check for "world-writable"
   files only on Unix-based systems. It's difficult to mimic the same behavior
   on Windows, so it's better to just not do it.

Reported-by: Gisle Vanem <gvanem@yahoo.no>
Reported-by: Eli Zaretskii <eliz@gnu.org>
2016-06-27 09:54:32 +02:00
Tim Rühsen
43359f47c4 Update gnulib and bootstrap
* gnulib: Sync gnulib submodule with upstream
* bootstrap: Update to latest version from gnulib/build-aux/
2016-06-14 09:27:58 +02:00
Tim Rühsen
e1e7afb210 Use ICONV_CONST to avoid type warning for iconv()
* src/iri.c (do_conversion): Cast 2. param of iconv() to
 'ICONV_CONST char **'
* src/url.c (convert_fname): Likewise
2016-06-12 21:51:34 +02:00
Tim Rühsen
7e585fe23d Remove check for HAVE_ICONV in src/url.c
* src/url.c: Remove check for HAVE_ICONV
2016-06-12 21:49:23 +02:00
Tim Rühsen
526e98f7c4 Add gnulib module 'langinfo'
* bootstrap.conf: Add 'langinfo'
2016-06-12 20:55:03 +02:00
Tim Rühsen
d75f43f083 Include gnulib fcntl.h instead of sys/fcntl.h
* src/gnutls.c: Include gnulib fcntl.h
2016-06-12 17:06:31 +02:00
Tim Rühsen
d4f97dc9af Add libraries to LDADD for wget
* src/Makefile.am: Add $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB)
 $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO) $(LIB_SELECT)
 $(LTLIBICONV) $(LTLIBINTL) $(LTLIBTHREAD) $(SERVENT_LIB) to LDADD
2016-06-12 17:02:12 +02:00
Tim Rühsen
ade62eb400 Explicitely mention Python3 in README.checkout
* README.checkout: Python test suite needs Python3
2016-06-10 15:14:43 +02:00
Giuseppe Scrivano
bd7f36705b NEWS: update 2016-06-09 17:31:57 +02:00
Giuseppe Scrivano
e996e322ff ftp: understand --trust-server-names on a HTTP->FTP redirect
If not --trust-server-names is used, FTP will also get the destination
file name from the original url specified by the user instead of the
redirected url.  Closes CVE-2016-4971.

* src/ftp.c (ftp_get_listing): Add argument original_url.
(getftp): Likewise.
(ftp_loop_internal): Likewise.  Use original_url to generate the
file name if --trust-server-names is not provided.
(ftp_retrieve_glob): Likewise.
(ftp_loop): Likewise.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2016-06-09 15:02:49 +02:00
Tim Rühsen
2bdfc4f521 Fix warnings for --disable-iri configure flag
* src/iri.h: Fix #define for parse_charset
* src/html-url.c: Surround some IRI code parts by #ifdef ENABLE_IRI
* src/http.c: Likewise
* src/iri.h: Likewise
* src/recur.c: Likewise
* src/retr.c: Likewise
2016-06-07 12:52:59 +02:00
Tim Rühsen
2c736abb4c Fix warning about redefinition of MAP_FAILED
* src/sysdep.h: Removed definition of MAP_FAILED
* src/utils.c: Check and define MAP_FAILED after including sys/mmap.h
2016-06-07 09:56:01 +02:00
Tim Rühsen
7c0752c4cb Add new Test for missing scheme behavior
* testenv/Makefile.am: Add Test-missing-scheme-retval.py
* testenv: New file Test-missing-scheme-retval.py

Idea and Perl implementation by Zdenek Dohnal <zdohnal@redhat.com>
2016-06-03 10:16:40 +02:00
Tim Rühsen
302aa79abb Fallback to pod2man without utf-8 on error
* doc/Makefile.am: Fallback to pod2man without utf-8 on error
2016-05-27 16:44:50 +02:00
Ander Juaristi
5224d752a5 Correct HSTS debug message
* src/main.c (save_hsts): save the in-memory HSTS database to a file
   only if something changed.
 * src/hsts.c (struct hsts_store): new field 'changed'.
   (hsts_match): update field 'changed' accordingly.
   (hsts_store_entry): update field 'changed' accordingly.
   (hsts_store_has_changed): new function.
 * src/hsts.h (hsts_store_has_changed): new function.
2016-05-26 16:37:51 +02:00
Ander Juaristi
2aaf12990c Check the HSTS file is not world-writable
* hsts.c (hsts_file_access_valid): check that the file is a regular
   file, and that it's not world-writable.
   (hsts_store_open): if the HSTS database file does not meet the
   above requirements, disable HSTS at all.
2016-05-26 16:29:29 +02:00
Tim Rühsen
2e6f629061 Improve description of Perl libraries needed for test suite
* README.checkout: Improve text about Perl libraries
2016-05-24 09:38:15 +02:00
Tim Rühsen
a952f81f3e Remove special handling for Emacs in progress bar code
* src/progress.c: Remove special 'emacs' code

Fixes #47989
2016-05-23 21:46:29 +02:00
Jernej Simončič
42cc84b6b6 Fix xsleep() for Windows (trivial change)
* src/mswindows.c (xsleep): Fix check for number of seconds
2016-04-25 15:50:23 +02:00
Sergio Gelato
96ab9cad88 More accurate log message from do_conversion()
* src/iri.c (do_conversion): More accurate log message
2016-04-17 15:28:48 +02:00
Tim Rühsen
268163444d Include sys/select.h if HAVE_LIBCARES
* src/hosts.c: Include sys/select.h if HAVE_LIBCARES

Reported-by: Gisle Vanem <gvanem@yahoo.no>
2016-04-17 14:18:55 +02:00
Gisle Vanem
53800415a9 Fix Windows gnulib/c-ares incompatibility of select()
* src/host.c: Undef 'select' on Windows
2016-04-17 14:15:51 +02:00
Tim Rühsen
528770ca8b Set X flags for python tests
* testenv/*.py: Set eXecute flags

Regression from commit 926e42d467
2016-04-15 21:36:51 +02:00
Ander Juaristi
2f1c6a05c8 Strictly comply with RFC 6797
* src/hsts.c (hsts_store_entry): strictly comply with RFC 6797.

RFC 6797 states in section 8.1 that the UA's cached information should
only be updated if:

    "either or both of the max-age and includeSubDomains header field
    value tokens are conveying information different than that already
    maintained by the UA."
2016-04-11 16:44:47 +02:00
Ander Juaristi
33d860e1ef Correct HSTS database file description
* src/hsts.c (hsts_store_dump): s/[:port]/<port>/
2016-04-11 16:44:41 +02:00
moparisthebest
99fc712f21 Implement tests for new pinnedpubkey option
* testenv/Makefile.am: Add new tests
* testenv/Test-pinnedpubkey-der-https.py: New test
* testenv/Test-pinnedpubkey-der-no-check-https.py: New Test
* testenv/Test-pinnedpubkey-hash-https.py: New test
* testenv/Test-pinnedpubkey-hash-no-check-fail-https.py: New test
* testenv/Test-pinnedpubkey-pem-fail-https.py: New test
* testenv/Test-pinnedpubkey-pem-https.py: New test
* testenv/certs/README: How to generate public keys with openssl tool
* testenv/certs/server-pubkey.der: New key file (DER format)
* testenv/certs/server-pubkey.pem: New key file (PEM format)
2016-04-11 16:25:09 +02:00
moparisthebest
54746578e9 Implement --pinnedpubkey option to pin public keys
* doc/wget.texi: Add description for --pinnedpubkey
* src/gnutls.c: New function pkp_pin_peer_pubkey(),
  (ssl_check_certificate): Check pinned cert via pkp_pin_peer_pubkey()
* src/init.c: Add option --pinnedpubkey
* src/main.c: Add option --pinnedpubkey
* src/openssl.c: New function pkp_pin_peer_pubkey(),
  (ssl_check_certificate): Check pinned cert via pkp_pin_peer_pubkey()
* src/options.h: Add new option variable 'pinnedpubkey'
* src/utils.c: New functions wg_pubkey_pem_to_der(), wg_pin_peer_pubkey()
* src/utils.h: Add prototype for wg_pin_peer_pubkey()
2016-04-11 16:18:05 +02:00
Tim Rühsen
926e42d467 Use test file name for temp working directory name
* testenv/test/base_test.py (__init__): Use test file name for name,
  remove 'name' parameter
* testenv/test/http_test.py (__init__): Remove 'name' parameter
* testenv/*.py: Remove TEST_NAME

Using a fixed string (TEST_NAME) to build the working directory
for testing caused random failures (or successes) when tests
share the same TEST_NAME value. Not easy to find without digging
into the python test suite code.
We now use the test file name, which is unique within the test
environment.
2016-04-11 15:35:05 +02:00
Tim Rühsen
d286d5408b Fix testenv/Test--rejected-log.py
* testenv/Test--rejected-log.py: Add missing tabs in expected output
2016-04-11 15:24:04 +02:00
Tim Rühsen
9883f9fb10 Fail python tests when post_hook errors
* testenv/test/base_test.py (__exit__): Return self.tests_passed
  (__test_cleanup): Set self.tests_passed to False on exception
2016-04-11 15:23:38 +02:00
Darshit Shah
d26377053d Print the fingerprint instead of the raw pointer in debugging message
* src/metalink.c (retrieve_from_metalink): Fix debug message to print the
fingerprint instead of a pointer.

* Do not delete the ChangeLog file since it is required by the Makefile
and breaks compilation
2016-03-29 15:09:04 +02:00
Darshit Shah
722675553c Revert "Print the fingerprint instead of the raw pointer in debugging message"
This reverts commit b916595168.
2016-03-29 15:07:29 +02:00
Tim Rühsen
281ad7dfb9 Fixed URLs and references in wget.texi
* wget.texi: Replace server.com by example.com,
  replace ftp://wuarchive.wustl.edu by https://example.com,
  use HTTPS instead of HTTP where possible,
  fix list archive reference,
  remove reference to wget-notify@addictivecode.org,
  change bugtracker URL to bugtracker on Savannah,
  replace yoyodyne.com by example.com,
  fix URL to VMS port
2016-03-28 18:33:33 +02:00
Giuseppe Scrivano
f3e63f0071 * metalink.c (retrieve_from_metalink): Fix typo 2016-03-25 16:46:39 +01:00
Giuseppe Scrivano
b916595168 Print the fingerprint instead of the raw pointer in debugging message
* src/metalink.c (retrieve_from_metalink): Fix debug message to print the
fingerprint instead of a pointer.
2016-03-25 16:23:19 +01:00
Tim Rühsen
76ef65b23c Add options --bind-dns-address and --dns-servers
* README.checkout: Add description for libares
* configure.ac: Add check for libares
* doc/wget.texi: Add docs for the new options
* src/build_info.c.in: Add +/-cares for --version output
* src/host.c:
  (merge_address_lists): New static function
  (address_list_from_hostent): New static function
  (wait_ares): New static function
  (callback): New static function
  (lookup_host): Add libares resolver code
* src/init.c: Add new options,
  (cleanup): Add cleanup code
* src/main.c: Add global libares channel variable
  (cmdline_option option_data): Add new options
  (print_help): Add short descriptions
  (main): Add libares init code
* src/options.h (struct options): Add option members

The new options allow to specify alternative DNS servers and
an alternate packet route for the resolver packets.
Wget has to built with libares, enabled at configure time by
./configure --with-cares.
2016-03-23 09:26:22 +01:00
Tim Rühsen
d7726f8a13 Fix SNI server names with trailing dot(s)
* src/gnutls.c (ssl_connect_wget, ssl_check_certificate): Fix SNI server name
* src/openssl.c (ssl_connect_wget, ssl_check_certificate): Fix SNI server name

Fixes #47408
2016-03-16 11:23:51 +01:00
Tim Rühsen
598445ebd1 Fix links to original Robots Exclusion Standard
* doc/wget.texi: Fix links
2016-03-10 16:20:05 +01:00
Darshit Shah
7cb9efa668 Fix assertion in Progress bar
* src/progress.c (create_image): Fix off-by-one error in assert()
    statement for progress bar width.
    Reported-By: Gisle Vanem <gvanem@yahoo.no>
2016-03-05 13:27:46 +01:00
Giuseppe Scrivano
44aedd8321 src/url.c: fix make syntax-check 2016-03-03 09:40:39 +01:00
Maks Orlovich
c28f51aadf Parse <img srcset> attributes, they have image URLs.
* src/convert.h: Add link_noquote_html_p to permit rewriting URLs deep
                 inside attributes without adding extraneous quoting
* src/convert.c (convert_links): Honor link_noquote_html_p
* src/html_url.c (tag_handle_img): New function. Add srcset parsing.
2016-03-03 09:38:45 +01:00
Darshit Shah
7099f48998 Sanitize value sent to memset to prevent SEGFAULT 2016-03-01 08:11:13 +01:00
Darshit Shah
75e5be7aad Update documentation about bahviour of -c
* docs/wget.texi: -c will restart download from scratch if server
    does not support RANGE.

    Reported-By: David Chavez
    http://stackoverflow.com/questions/30147332/unexpected-behavior-of-wget
2016-03-01 08:10:59 +01:00
Tim Rühsen
100da11312 Fix writing WARC-Target-URI value
src/warc.c: Add function warc_write_header_uri(),
            Use it for creating WARC-Target-URI

Fixes #47281
2016-02-27 23:08:28 +01:00
Darshit Shah
cceb5932b4 Remove pointer to unused Mailing List
* MAILING-LISTS: Remove pointer to old, unused mailing list for bug
    reports
2016-02-13 01:39:03 +01:00
Tim Rühsen
cacac6f996 Retain value of errno in logprintf(), logputs() even better
* src/log.c (logprintf,logputs): Save&Restore value of errno

Reported-by: Gisle Vanem <gvanem@yahoo.no>
2016-02-11 10:53:02 +01:00
Tim Rühsen
3056617e9c Retain value of errno in logprintf()
* src/log.c (logprintf): Save&Restore value of errno

Reported-by: Gisle Vanem <gvanem@yahoo.no>
2016-02-10 15:28:10 +01:00
Tim Rühsen
c190677cab Set AM_SILENT_RULES to yes by default
* configure.ac: Set AM_SILENT_RULES to yes by default
2016-02-01 21:10:33 +01:00
Ander Juaristi
4c2dc5010f Enforce 'RejectHeader' rule in tests
* server/http/http_server.py (_Handler.RejectHeader): enforce
   'RejectHeader' rule.
2016-02-01 20:48:00 +01:00
Tim Rühsen
b30500f0f4 Fix Test-iri-forced-remote
* tests/Test-iri-forced-remote.px: Fix encodings
2015-12-20 21:32:06 +01:00
Eli Zaretskii
59b920874d Support non-ASCII URLs
* src/url.c [HAVE_ICONV]: Include iconv.h and langinfo.h.
(convert_fname): New function.
[HAVE_ICONV]: Convert file name from remote encoding to local
encoding.
(url_file_name): Call convert_fname.
(filechr_table): Don't consider bytes in 128..159 as control
characters.

* tests/Test-ftp-iri.px: Fix the expected file name to match the
new file-name recoding.  State the remote encoding explicitly on
the Wget command line.

* NEWS: Mention the URI recoding when built with libiconv.
2015-12-18 20:54:39 +01:00
Giuseppe Scrivano
9a6e63bee9 * NEWS: Prepare new development cycle 2015-12-18 11:29:59 +01:00
Tim Rühsen
cbbeca2af4 Cleanup code
* src/iri.c (do_conversion): Code cleanup
2015-12-17 21:01:50 +01:00
Eli Zaretskii
93c1517c40 Set URI encoding when redirected
* src/retr.c (retrieve_url): Set URI on redirection
2015-12-17 15:27:43 +01:00
Tim Rühsen
bf5d7e9236 Remove requesting X/Open 5, POSIX 1995
* src/sysdep.h: Remove #define _XOPEN_SOURCE 500
2015-12-17 12:11:53 +01:00
Eli Zaretskii
94d9b68db9 Avoid hanging on MS-Windows when invoked with --connect-timeout
* src/connect.c (connect_to_ip) [WIN32]: Don't call fd_close if
the connection timed out, to avoid hanging.
2015-12-16 15:06:45 +01:00
Tim Rühsen
be7d19f478 Fix iconv conversion
* src/iri.c: Kick out the last converted character from iconv()

Thanks to Eli Zaretskii <eliz@gnu.org> for suggesting the fix.
Reported-by: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
2015-12-15 10:55:41 +01:00
Tim Rühsen
358a3c330f Let Test-k survive on CygWin and Windows
* tests/Test-k.px: Use --restrict-file-names for CygWin/Windows
  filename requirements.
2015-12-14 09:36:40 +01:00
Ander Juaristi
478a584609 Fix leak in HSTS code
* src/hsts.c (hsts_store_open): close fp if open.
2015-12-13 16:10:16 +01:00
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
15139 changed files with 82164 additions and 5198 deletions

21
.gitignore vendored
View File

@@ -1,6 +1,6 @@
/ABOUT-NLS~
# Project Root
/.sc-start-sc_bindtextdomain
/.sc-start-sc_prohibit_HAVE_MBRTOWC
/.sc-start-*
/.version
/ABOUT-NLS
/GNUmakefile
@@ -14,7 +14,10 @@
/config.status
/configure
/lib/
!/lib/Makefile.am
/maint.mk
/gnulib_po/
/aminclude_static.am
# Wildcard Ignores
*~
po/*.gmo*
@@ -24,6 +27,11 @@ tests/*.log
tests/*.trs
testenv/*.log
testenv/*.trs
fuzz/*
!fuzz/*.*
fuzz/*.o
fuzz/*.log
fuzz/*.trs
# build-aux/
build-aux/.gitignore
build-aux/ar-lib
@@ -46,6 +54,7 @@ doc/version.texi
doc/wget.1
doc/wget.info
doc/wget.pod
doc/.gitignore
# m4/
m4/.gitignore
m4/gnulib-cache.m4
@@ -59,6 +68,7 @@ po/Makevars
po/POTFILES
po/wget.pot
po/stamp-po
po/remove-potcdate.sed
# src/
src/.deps/
src/Makefile
@@ -87,9 +97,16 @@ testenv/Makefile.in
tests/Makefile
tests/Makefile.in
tests/unit-tests
tests/unit-tests.o
tests/.deps/
tests/certs/interca.conf
tests/certs/rootca.conf
# util/
util/Makefile
util/Makefile.in
# fuzz/
fuzz/.deps/
fuzz/Makefile.in
# others
/tags
/cscope.out

507
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,507 @@
# we utilize the images generated by the build-images project, to
# speed up CI runs. We also use ccache and store config.cache
# to speed up compilation.
stages:
- test-from-git
- test-from-tarball
- deploy
cache:
key: "$CI_JOB_NAME"
paths:
- cache/
before_script:
# CCache Config
- mkdir -p cache
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/cache
- echo $CCACHE_DIR
- export CC="ccache gcc"
after_script:
# somehow after_script loses environment
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/cache
- if type -p ccache >/dev/null; then ccache -s; fi
variables:
BUILD_IMAGES_PROJECT: gnuwget/build-images
CI_BASE_PATH: $CI_REGISTRY/$BUILD_IMAGES_PROJECT/wget
DEBIAN_OLDSTABLE_BUILD: buildenv-debian-oldstable
DEBIAN_TESTING_BUILD: buildenv-debian-testing
DEBIAN_STABLE_BUILD: buildenv-debian-stable
CENTOS_OLDLTS_BUILD: buildenv-centos7
FEDORA_BUILD: buildenv-fedora
MINGW_BUILD: buildenv-mingw
ARCH_BUILD: buildenv-arch
GET_SOURCES_ATTEMPTS: "3"
GIT_DEPTH: "5"
CONFIGURE_BASE_FLAGS: --enable-assert --cache-file cache/config.cache
CFLAGS_DEFAULT: -O0 -g -ggdb3
CommitCheck:
stage: test-from-git
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
script:
- ./contrib/commit-check
allow_failure: true
cache:
paths:
policy: push
# Create the tarball in a separate build directory (VPATH).
Build-Tarball:
stage: test-from-git
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
script:
- export CFLAGS=$CFLAGS_DEFAULT
- ./bootstrap
- autoreconf -fi
- mkdir vpath && cd vpath
- ../configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
--without-ssl --enable-ipv6 --without-zlib --without-libiconv-prefix
--disable-iri --disable-ntlm --disable-pcre --without-libpsl --without-libuuid
--without-libintl-prefix
- make -j$(nproc)
- make -j$(nproc) syntax-check
- make -j$(nproc) dist
- mv wget-*.gz ..
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- ./*.log
- vpath/*.log
- vpath/fuzz/*.log
- vpath/tests/*.log
- vpath/testenv/*.log
artifacts:
expire_in: 2 weeks
when: on_success
paths:
- wget-*.gz
Valgrind:
stage: test-from-tarball
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
- make check-valgrind
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
Minimal:
stage: test-from-tarball
image: $CI_BASE_PATH/debian:testing-minimal
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
--disable-nls --without-ssl --enable-ipv6 --without-zlib --without-libiconv-prefix
--disable-iri --disable-ntlm --disable-pcre --without-libpsl --without-libuuid
--without-libintl-prefix
- make -j$(nproc) check-valgrind
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/./*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
Debian-OldStable:
stage: test-from-tarball
image: $CI_BASE_PATH/debian:oldstable
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
- make
- make -j$(nproc) check
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/./*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
Debian-Stable:
stage: test-from-tarball
image: $CI_BASE_PATH/debian:stable
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
- make -j$(nproc) check
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/./*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
CentOS-OldLTS:
stage: test-from-tarball
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$CENTOS_OLDLTS_BUILD
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
- make -j$(nproc)
- make -j$(nproc) check
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/./*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
# The test suite is currently broken, so a temporary allowance
allow_failure: true
TLS/OpenSSL:
stage: test-from-tarball
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- echo "127.0.0.1 wgettestingserver" >>/etc/hosts
- cat /etc/hosts
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache --with-ssl=openssl
- make -j$(nproc)
- make -j$(nproc) check-valgrind
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/./*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
TLS/GnuTLS:
stage: test-from-tarball
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- echo "127.0.0.1 wgettestingserver" >>/etc/hosts
- cat /etc/hosts
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache --with-ssl=gnutls
- make -j$(nproc)
- make -j$(nproc) check-valgrind
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/./*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
Sanitizers:
stage: test-from-tarball
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
# - export CFLAGS="$CFLAGS_DEFAULT -Werror"
- export CFLAGS="$CFLAGS_DEFAULT"
- export CC="ccache clang"
- export UBSAN_OPTIONS=print_stacktrace=1
- export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
# - export LSAN_OPTIONS=suppressions="$PWD/tests/clang-asan-suppressions"
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
--enable-fsanitize-asan --enable-fsanitize-ubsan
- make -j$(nproc) check
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/./*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
Scan-Build:
stage: test-from-tarball
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- scan-build ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
- make -C lib -j$(nproc)
- make -C src css_.o
- scan-build -v -enable-checker nullability --keep-empty --status-bugs -o ../scan-build make -j$(nproc)
tags:
- shared
- linux
except:
- tags
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- scan-build/
# scan-build reports two false positives that we can't suppress
allow_failure: true
CoverageReports:
stage: test-from-tarball
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
- make -j$(nproc) check-coverage
- mv lcov ../test-coverage
- make -C doc html
- make -j$(nproc) fuzz-coverage
- mv lcov ../fuzz-coverage
- make dist
tags:
- shared
- linux
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
when: on_success
paths:
- test-coverage/
- fuzz-coverage/
only:
- master
MinGW64:
stage: test-from-tarball
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$MINGW_BUILD
variables:
GIT_STRATEGY: none
script:
- export CFLAGS=$CFLAGS_DEFAULT
- tar xvf wget-*.gz
- cd wget-*/
- mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
- echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
- export CC="ccache $PREFIX-gcc"
- export GCCLIB=$(dirname $(find /usr/lib/gcc/$PREFIX -name libgcc_s_seh-1.dll|grep posix))
- export WINEPATH="$WINEPATH;/usr/$PREFIX/bin;/usr/$PREFIX/lib;$PWD/libwget/.libs;$GCCLIB"
- echo "WINEPATH=$WINEPATH"
- LIBS="-ldl -lpsapi" ./configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
--build=x86_64-pc-linux-gnu --host=$PREFIX --enable-shared
- make -j$(nproc)
- cp -p src/wget.exe src/wget
- make check -j$(nproc) LOG_COMPILER=wine
tags:
- shared
- linux
except:
- tags
- coverity-scan@gnuwget/wget
dependencies:
- Build-Tarball
needs: ["Build-Tarball"]
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- wget-*/./config.h
- wget-*/./*.log
- wget-*/fuzz/*.log
- wget-*/tests/*.log
- wget-*/testenv/*.log
# The MinGW64 build breaks quite often, mostly due to dependencies.
allow_failure: true
# Build from git should work on Arch.
ArchLinux:
stage: test-from-git
image: $CI_BASE_PATH/archlinux
script:
- export CFLAGS="$CFLAGS_DEFAULT"
- ./bootstrap
- autoreconf -fi
- touch .manywarnings
- ./configure $CONFIGURE_BASE_FLAGS
- make -j$(nproc)
- make check -j$(nproc)
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
needs: []
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- ./*.log
- fuzz/*.log
- tests/*.log
- testenv/*.log
# Build from git should work on Fedora.
Fedora:
stage: test-from-git
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- export CFLAGS="$CFLAGS_DEFAULT"
- ./bootstrap
- autoreconf -fi
- touch .manywarnings
- ./configure $CONFIGURE_BASE_FLAGS
- make -j$(nproc) check
tags:
- shared
- linux
except:
- coverity-scan@gnuwget/wget
needs: []
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- ./*.log
- fuzz/*.log
- tests/*.log
- testenv/*.log
pages:
stage: deploy
script:
- mkdir -p public
- rm -rf public/reference public/coverage public/fuzz-coverage
- mv wget-*.gz public/wget-latest.tar.gz
- mv test-coverage public/coverage
- mv fuzz-coverage public/fuzz-coverage
dependencies:
- CoverageReports
- Build-Tarball
artifacts:
when: on_success
paths:
- public
only:
- master

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "gnulib"]
path = gnulib
url = git://git.sv.gnu.org/gnulib.git
url = https://git.savannah.gnu.org/git/gnulib.git

8
.lgtm.yml Normal file
View File

@@ -0,0 +1,8 @@
extraction:
cpp:
prepare:
packages:
- libgpgme11-dev
- autoconf-archive
configure:
command: ./bootstrap && autoreconf -ivf && ./configure

13
.mailmap Normal file
View File

@@ -0,0 +1,13 @@
Tim Rühsen <tim.ruehsen@gmx.de> Tim Ruehsen <tim.ruehsen@gmx.de>
Tim Rühsen <tim.ruehsen@gmx.de> rockdaboot <tim.ruehsen@gmx.de>
Darshit Shah <darnir@gnu.org> <darnir@gmail.com>
Darshit Shah <darnir@gnu.org> <darnir@reniac.com>
Ander Juaristi <ajuaristi@gmx.es> <a@juaristi.eus>
Ander Juaristi <ajuaristi@gmx.es> Ander Juaristi Alamos <ajuaristi@gmx.es>
Micah Cowan <micah@cowan.name> micah <devnull@localhost>
Steven Schubiger <stsc@members.fsf.org> Steven Schubiger <stsc@member.fsf.org>
Steven Schubiger <stsc@members.fsf.org> <schubiger@gmail.com>
Giuseppe Scrivano <gscrivano@gnu.org> <gscrivan@redhat.com>
Gisle Vanem <gisle.vanem@gmail.com> <gvanem@yahoo.no>
Gisle Vanem <gisle.vanem@gmail.com> <gvanem@broadpark.no>
Gisle Vanem <gisle.vanem@gmail.com> <giva@bgnett.no>

1
.prev-version Normal file
View File

@@ -0,0 +1 @@
1.24.5

View File

@@ -1,50 +0,0 @@
sudo: no
language: c
compiler:
- gcc
notifications:
email:
recipients:
- darnir@gmail.com
- bug-wget@gnu.org
on_success: change
on_failure: always
env:
global:
- PERLLIB=$PERLLIB:../../tests
- PERL5LIB=$PERL5LIB:../../tests
matrix:
- SSL=""
- SSL="openssl"
- SSL="gnutls"
addons:
apt:
packages:
- automake
- autoconf
- autopoint
- flex
- texinfo
- pkg-config
- libgnutls-dev
- libssl-dev
- make
- libhttp-daemon-perl
- libio-socket-ssl-perl
- libidn11-dev
- gettext
- texlive
- python3
- valgrind
- language-pack-tr
- language-pack-ru
script:
- make distclean || true
- ./bootstrap
- ./contrib/travis-ci $SSL

406
AUTHORS
View File

@@ -1,58 +1,366 @@
Authors of GNU Wget.
Thank you very much for spending your time !
[ Note that this file does not attempt to list all the contributors to
Wget; look at the ChangeLogs for that. This is a list of people who
contributed sizeable amounts of code and assigned the copyright to
the FSF. ]
Hrvoje Niksic. Designed and implemented Wget.
This list of contributors is maintained in
(more or less) the order of date of first commit.
Those with the "ASSGN" tag have assigned the copyrights
of their patches to the FSF.
Gordon Matzigkeit. Wrote netrc.c and netrc.h.
The list was generated on 14.05.23 by parsing the ChangeLog
file until 2014 and the git commit history after that.
Darko Budor. Wrote initial support for Windows, wrote wsstartup.c,
wsstartup.h and windecl.h. (The files were later renamed, but his
code and ideas remained present.)
Current Maintainers:
Junio Hamano. Added support for FTP Opie and HTTP digest
authentication.
[ASSGN] Darshit Shah *darnir [at] gnu.org*
[ASSGN] Tim Rühsen *tim.ruehsen [at] gmx.de*
Dan Harkless. Added --backup-converted, --follow-tags, --html-extension,
--ignore-tags, and --page-requisites; improved documentation; etc. Was
the principle maintainer of GNU Wget for some time.
Contributors:
Christian Fraenkel. Initially implemented SSL support.
Thomas Lussnig. Initially implemented IPv6 support.
Ian Abbott. Contributed bugfixes, Windows-related fixes, provided a
prototype implementation of the new recursive code, and more.
Co-maintained Wget during the 1.8 release cycle.
Gisle Vanem. Contributed Windows and MS-DOS improvements, including a
port of run_with_timeout to Windows, additions to Makefiles, and many
bug reports and fixes.
Mauro Tortonesi. Improved IPv6 support, adding support for dual
family systems. Refactored and enhanced FTP IPv6 code. Maintained GNU
Wget from 2004-2007.
Nicolas Schodet. Contributed to cookie code and documentation.
Daniel Stenberg. NTLM authentication in http-ntlm.c and http-ntlm.h
originally written for curl donated for use in GNU Wget.
Micah Cowan. Maintained Wget from mid-2007 to mid-2010.
Ralf Wildenhues. Contributed patches to convert Wget to use Automake as
part of its build process, and various bugfixes.
Steven Schubiger. Many helpful patches, bugfixes and improvements.
Notably, conversion of Wget to use the Gnulib quotes and quoteargs
modules, and the addition of password prompts at the console, via the
Gnulib getpasswd-gnu module.
Ted Mielczarek. Support for parsing links from CSS.
Saint Xavier. Support for IRIs (RFC 3987).
Giuseppe Scrivano. Added support for HTTP/1.1. Current Wget maintainer.
[ASSGN] Hrvoje Niksic *hniksic [at] srce.hr*
Designed and implemented Wget.
[ ] Hrvoje Lacko *hlacko [at] fly.cc.fer.hr*
[ ] Antonio Rosella *antonio.rosella [at] agip.it*
[ ] Drazen Kacar *dave [at] fly.cc.fer.hr*
[ ] Tage Stabell-Kulo *tage [at] acm.org*
[ ] Shawn McHorse *riffraff [at] txdirect.net*
[ ] Mark Boyns *boyns [at] sdsu.edu*
[ ] Dieter Baron *dillo [at] danbala.tuwien.ac.at*
[ ] Gregor Hoffleit *flight [at] mathi.uni-heidelberg.DE*
[ ] Kaveh R. Ghazi *ghazi [at] caip.rutgers.edu*
[ASSGN] Gordon Matzigkeit *gord [at] gnu.ai.mit.edu*
Wrote netrc.c and netrc.h.
[ASSGN] Darko Budor *dbudor [at] zems.fer.hr*
Wrote initial support for Windows, wrote wsstartup.c,
wsstartup.h and windecl.h.(The files were later renamed,
but his code and ideas remained present.)
[ ] Roger Beeman *beeman [at] cisco.com*
[ ] Marin Purgar *pmc [at] asgard.hr*
[ ] gilles Cedoc *gilles [at] cedocar.fr*
[ ] Karl Eichwalder *ke [at] ke.Central.DE*
[ ] Fila Kolodny *fila [at] ibi.com*
[ ] Andreas Schwab *schwab [at] issan.informatik.uni-dortmund.de*
[ ] Mike Thomas *mthomas [at] reality.ctron.com*
[ ] Francois Pinard *pinard [at] iro.umontreal.ca*
[ ] Jordan Mendelson *jordy [at] wserv.com*
[ ] Karl Heuer *kwzh [at] gnu.org*
[ ] Andy Eskilsson *andy.eskilsson [at] telelogic.se*
[ ] Karl Eichwalder *ke [at] suse.de*
[ ] Simon Josefsson *jas [at] pdc.kth.se*
[ ] Karl Eichwalder *karl [at] suse.de*
[ASSGN] Junio Hamano *junio [at] twinsun.com*
Added support for FTP Opie and HTTP digest authentication.
[ ] Tim Adam *tma [at] osa.com.au*
[ ] Wanderlei Cavassin *cavassin [at] conectiva.com.br*
[ASSGN] Jan Prikryl *prikryl [at] cg.tuwien.ac.at*
[ ] John *john [at] futuresguide.com*
[ ] Tim Charron *tcharron [at] interlog.com*
[ ] Robert Schmidt *rsc [at] vingmed.no*
[ ] Stefan Hornburg *racke [at] gundel.han.de*
[ ] Giovanni Bortolozzo *borto [at] dei.unipd.it*
[ ] Gregor Hoffleit *flight [at] mathi.uni-heidelberg.de*
[ ] Douglas E. Wegscheid *wegscd [at] whirlpool.com*
[ ] Toomas Soome *tsoome [at] ut.ee*
[ ] Simos KSenitellis *simos [at] teiath.gr*
[ ] Juan Jose Rodriguez *jcnsoft [at] jal1.telmex.net.mx*
[ ] Dominique Delamarre *dominique.delamarre [at] hol.fr*
[ ] Martin Kraemer *Martin.Kraemer [at] mch.sni.de*
[ ] Mathieu Guillaume *mat [at] cythere.com*
[ ] Alexander Kourakos *awk [at] bnt.com*
[ ] Dave Love *d.love [at] dl.ac.uk*
[ ] Heinz Salzmann *heinz.salzmann [at] intermetall.de*
[ ] Adam D. Moss *adam [at] foxbox.org*
[ ] Howard Gayle *howard [at] fjst.com*
[ ] Hans Grobler *grobh [at] conde.ee.sun.ac.za*
[ ] Szakacsits Szabolcs *szaka [at] sienet.hu*
[ ] Simon Munton *simonm [at] m4data.co.uk*
[ ] Edward J. Sabol *sabol [at] alderaan.gsfc.nasa.gov*
[ ] "R. K. Owen" *rkowen [at] Nersc.GOV*
[ ] Alexander V. Lukyanov *lav [at] yars.free.net*
[ ] andrew deryabin *djsf [at] softhome.net*
[ ] Heiko Herold *Heiko.Herold [at] previnet.it*
[ ] Dan Berger *dberger [at] ix.netcom.com*
[ ] Charles G Waldman *cgw [at] fnal.gov*
[ ] Damir Dzeko *ddzeko [at] zesoi.fer.hr*
[ASSGN] Dan Harkless *wget [at] harkless.org*
Added --backup-converted, --follow-tags, --html-extension,
--ignore-tags, and --page-requisites;
improved documentation; etc. Was the principle maintainer
of GNU Wget for some time.
[ ] Daniel S. Lewart *d-lewart [at] uiuc.edu*
[ ] HIROSE Masaaki *hirose31 [at] t3.rim.or.jp*
[ ] Const Kaplinsky *const [at] ce.cctpu.edu.ru*
[ ] John Daily *jdaily [at] cyberdude.com*
[ ] Adrian Aichner *adrian [at] xemacs.org*
[ ] Matthew Seaman *m.seaman [at] inpharmatica.co.uk*
[ ] Tyler Riddle *triddle [at] liquidmarket.com*
[ ] John Summerfield *summer [at] OS2.ami.com.au*
[ ] Csaba Raduly *csaba.raduly [at] sophos.com*
[ ] Igor Khristophorov *igor [at] atdot.org*
[ ] Adrian Aichner *Adrian.Aichner [at] t-online.de*
[ ] Jonas Jensen *bones [at] huleboer.dk*
[ ] Tim Mooney *mooney [at] dogbert.cc.ndsu.NoDak.edu*
[ ] Hack Kampbjørn *hack [at] hackdata.com*
[ ] Philipp Thomas *pthomas [at] suse.de*
[ ] Nicolas Lichtmaier *nick [at] debian.org*
[ ] KOJIMA Hajime *kjm [at] rins.ryukoku.ac.jp*
[ ] Paul Bludov *paul [at] ozero.net*
[ ] Trond Eivind Glomsrod *teg [at] redhat.com*
[ASSGN] Ian Abbott *abbotti [at] mev.co.uk*
Contributed bugfixes, Windows-related fixes, provided a
prototype implementation of the new recursive code, and more.
Co-maintained Wget during the 1.8 release cycle.
[ASSGN] Maciej W. Rozycki *macro [at] ds2.pg.gda.pl*
[ ] R.I.P. Deaddog *maddog [at] linuxhall.org*
[ ] Adam J. Richter *adam [at] yggdrasil.com*
[ ] Dave Turner *dct25 [at] hermes.cam.ac.uk*
[ASSGN] Christian Fraenkel *c.fraenkel [at] gmx.net*
Initially implemented SSL support.
[ ] Daniel BODEA *dali [at] dali-designs.com*
[ ] Alan Eldridge *alane [at] geeksrus.net*
[ ] Chris Seawood *cls [at] seawood.org*
[ ] Peter Farmer *peter.farmer [at] zveno.com*
[ ] Jochen Hein *jochen [at] jochen.org*
[ ] Lemble Gregory *gregory.lemble [at] st.com*
[ ] Ingo T. Storm *tux-sparc [at] computerbild.de*
[ ] T. Bharath *TBharath [at] responsenetworks.com*
[ ] Andre Majorel *amajorel [at] teaser.fr*
[ ] Christian Lackas *delta [at] lackas.net*
[ ] Andreas Damm *andreas-sourceforge [at] radab.org*
[ ] Chin-yuan Kuo *sr1111111 [at] yahoo.com.tw*
[ASSGN] Thomas Lussnig *thomas.lussnig [at] bewegungsmelder.de*
Initially implemented IPv6 support.
[ ] Bill Richardson *bill [at] riverstonenet.com*
[ASSGN] Nicolas Schodet *contact [at] ni.fr.eu.org*
Contributed to cookie code and documentation.
[ ] Ahmon Dancy *dancy [at] dancysoft.com*
[ ] Noel Kothe *noel [at] debian.org*
[ ] Aurelien Marchand *artaxerxes [at] users.sf.net*
[ ] Aaron S. Hawley *Aaron.Hawley [at] uvm.edu*
[ ] Bertrand Demiddelaer *bert [at] b3rt.org*
[ ] Matthew J. Mellon *mellon [at] tymenet.com*
[ASSGN] Gisle Vanem *giva [at] bgnett.no*
Contributed Windows and MS-DOS improvements, including a
port of run_with_timeout to Windows, additions to Makefiles,
and many bug reports and fixes.
[ ] Philip Stadermann *philip.stadermann [at] credativ.de*
[ ] Dennis Smit *ds [at] nerds-incorporated.org*
[ ] Christian Biere *christianbiere [at] gmx.de*
[ ] David Fritz *zeroxdf [at] att.net*
[ ] Jens Roesner *jens.roesner [at] gmx.de*
[ ] Nico R. *n-roeser [at] gmx.net*
[ ] Larry Jones *lawrence.jones [at] ugsplm.com*
[ ] YAMAZAKI Makoto *Yamazaki.Makoto [at] fujixerox.co.jp*
[ ] Hans-Andreas Engel *engel [at] node.ch*
[ ] Leonid Petrov *nouser [at] lpetrov.net*
[ ] Ulf Harnhammar *ulf.harnhammar.9485 [at] student.uu.se*
[ASSGN] Mauro Tortonesi *mauro [at] ferrara.linux.it*
Improved IPv6 support, adding support for dual
family systems. Refactored and enhanced FTP IPv6 code.
Maintained GNU Wget from 2004-2007.
[ ] Marco Colombo *m.colombo [at] ed.ac.uk*
[ ] Joseph Caretto *jcaretto [at] pitt.edu*
[ ] FUJISHIMA Satsuki *sf [at] FreeBSD.org*
[ ] Charles C.Fu *ccwf [at] bacchus.com*
[ ] Andreas Beckmann *debian [at] abeckmann.de*
[ ] Keith Moore *keithmo [at] exmsft.com*
[ ] Benno Schulenberg *benno [at] nietvergeten.nl*
[ ] Giuseppe Bonacci *g.bonacci [at] libero.it*
[ ] Vasil Dimov *vd [at] datamax.bg*
[ ] Albert Chin *wget [at] mlists.thewrittenword.com*
[ ] Jeremy Shapiro *jnshapiro [at] gmail.com*
[ ] Stepan Kasal *kasal [at] ucw.cz*
[ ] Russ Allbery *rra [at] stanford.edu*
[ASSGN] Daniel Stenberg *daniel [at] haxx.se*
NTLM authentication in http-ntlm.c and http-ntlm.h
originally written for curl donated for use in GNU Wget.
[ ] Lawrence Jones *lawrence.jones [at] ugs.com*
[ ] CHEN Peng *chenpeng [at] alumni.nus.edu.sg*
[ASSGN] Tony Lewis *tlewis [at] exelana.com*
[ ] KJKHyperion *hackbunny [at] reactos.com*
[ ] Daniel Richard G. *skunk [at] iSKUNK.ORG*
[ ] Mike Grant *mggr [at] pml.ac.uk*
[ASSGN] Micah Cowan *micah [at] cowan.name*
Maintained Wget from mid-2007 to mid-2010.
[ASSGN] Joshua David Williams *yurimxpxman [at] gmail.com*
[ASSGN] Ralf Wildenhues *Ralf.Wildenhues [at] gmx.de*
Contributed patches to convert Wget to use Automake as
part of its build process, and various bugfixes.
[ ] Jochen Roderburg *roderburg [at] uni-koeln.de*
[ ] Stephen Gildea *stepheng+wget [at] gildea.com*
[ ] Benno Schulenberg *bensberg [at] justemail.net*
[ ] Alexander Dergachev *cy6erbr4in [at] gmail.com*
[ASSGN] Rabin Vincent *rabin [at] rab.in*
[ASSGN] Steven Schubiger *schubiger [at] gmail.com*
Many helpful patches, bugfixes and improvements.
Notably, conversion of Wget to use the Gnulib quotes and
quoteargs modules, and the addition of password prompts
at the console, via the Gnulib getpasswd-gnu module.
[ ] Alain Guibert *alguibert+bts [at] free.fr*
[ ] Jim Paris *jim [at] jtan.com*
[ASSGN] Mike Frysinger *vapier [at] gentoo.org*
[ ] Pranab Shenoy *pranab.loosinit.shenoy [at] gmail.com*
[ASSGN] Ted Mielczarek *ted.mielczarek [at] gmail.com*
Support for parsing links from CSS.
[ASSGN] Joao Ferreira *joao [at] joaoff.com*
[ ] Kenny Parnell *k.parnell [at] gmail.com*
[ ] Henri Häkkinen *henux [at] users.sourceforge.net*
[ASSGN] Madhusudan Hosaagrahara *com.gmail.hrmadhu*
[ASSGN] Xavier Saint *wget [at] sxav.eu*
Support for IRIs (RFC 3987).
[ ] Michael Kessler *kessler.michael [at] aon.at*
[ ] Alexander Drozdov *dzal_mail [at] mtu-net.ru*
[ ] Alexander Belopolsky *alexander.belopolsky [at] gmail.com*
[ASSGN] Gerardo E. Gidoni *gerel [at] gnu.org*
[ ] Benjamin Wolsey *bwy [at] benjaminwolsey.de*
[ ] Xin Zou *zouxin2008 [at] gmail.com*
[ ] Julien Pichon *julienpichon7 [at] gmail.com*
[ ] Phil Pennock *mutt-dev [at] spodhuis.org*
[ ] Jay Krell *jay.krell [at] cornell.edu*
[ASSGN] Steven Schweda *sms [at] antinode.info*
[ASSGN] Petr Pisar *petr.pisar [at] atlas.cz*
[ ] Marcel Telka *marcel [at] telka.sk*
[ ] Michael Baeuerle *michael.baeuerle [at] gmx.net*
[ASSGN] Arvind Jamuna Dixit *ardsrk [at] gmail.com*
[ ] Peter Rosin *peda [at] lysator.liu.se*
[ ] David Holman *holman.david [at] gmail.com*
[ ] Jeremy Olexa *darkside [at] gentoo.org*
[ ] Paul Townsend *aab [at] purdue.edu*
[ASSGN] Giuseppe Scrivano *gscrivano [at] gnu.org*
Added support for HTTP/1.1.
Active Wget Maintainer from 2010-2015.
[ ] Muthu Subramanian K *muthusuba [at] gmail.com*
[ ] Alan Jenkins *alan-jenkins [at] tuffmail.co.uk*
[ ] John Trengrove *jtrengrove [at] gmail.com*
[ ] Alon Bar-Lev *alon.barlev [at] gmail.com*
[ASSGN] Reza Snowdon *vivi [at] mage.me.uk*
[ASSGN] Dennis, CHENG Renquan *crquan [at] fedoraproject.org*
[ASSGN] Merinov Nikolay *kim.roader [at] gmail.com*
[ ] Ivanov Anton *x86mail [at] gmail.com*
[ ] Manfred Koizar *mkoi-pg [at] aon.at*
[ASSGN] Jessica McKellar *jesstess [at] mit.edu*
[ ] Filipe Brandenburger *filbranden [at] gmail.com*
[ ] Evgeniy Philippov *egphilippov [at] googlemail.com*
[ ] Adrien Nader *adrien [at] notk.org*
[ ] Gilles Carry *gilles.carry [at] st.com*
[ ] Tomasz Buchert *tomek.buchert [at] gmail.com*
[ASSGN] Ray Satiro *raysatiro [at] yahoo.com*
[ ] Cristian Rodríguez *crrodriguez [at] opensuse.org*
[ASSGN] Daniel Manrique *roadmr [at] tomechangosubanana.com*
[ ] Carlos Martín Nieto *carlos [at] cmartin.tk*
[ ] Jochen Roderburg *Roderburg [at] Uni-Koeln.DE*
[ ] Mojca Miklavec *mojca.miklavec.lists [at] gmail.com*
[ ] Alan Hourihane *alanh [at] fairlite.co.uk*
[ ] Christian Jullien *eligis [at] orange.fr*
[ ] Jakob Matthes *jakob.matthes [at] gmail.com*
[ ] Karl Berry *karl [at] freefriends.org*
[ ] Henrik Holst *henrik.holst [at] millistream.com*
[ASSGN] Gijs van Tulder *gvtulder [at] gmail.com*
[ASSGN] Sasikantha Babu *sasikanth.v19 [at] gmail.com*
[ ] Ángel González *keisial [at] gmail.com*
[ ] Daniel Kahn Gillmor *dkg [at] fifthhorseman.net*
[ ] illusionoflife *illusion.of.life92 [at] gmail.com*
[ ] mancha *mancha [at] mac.hush.com*
[ ] *y-iida [at] secom.co.jp*
[ ] Rohit Mathulla *rohit_mathulla [at] yahoo.com*
[ ] Nguyễn Thái Ngọc Duy *pclouds [at] gmail.com*
[ ] Stefano Lattarini *stefano.lattarini [at] gmail.com*
[ ] Michael Stapelberg *michael [at] stapelberg.de*
[ ] Pavel Mateja *pavel [at] netsafe.cz*
[ASSGN] Darshit Shah *darnir [at] gnu.org*
[ ] Tomas Hozza *thozza [at] redhat.com*
[ ] mancha *mancha1 [at] hush.com*
[ASSGN] Bykov Aleksey *gnfalex [at] rambler.ru*
[ ] Dave Reisner *dreisner [at] archlinux.org*
[ ] Ciprian Vieru *devel.php [at] gmail.com*
[ ] Karsten Hopp *karsten [at] redhat.com*
[ ] Will Dietz *w [at] wdtz.org*
[ ] Andrea Urbani *matfanjol [at] mail.com*
[ ] Håkon Vågsether *hauk142 [at] gmail.com*
[ ] Lars Wendler *polynomial-c [at] gentoo.org*
[ASSGN] Yousong Zhou *yszhou4tech [at] gmail.com*
[ ] Vladimír Pýcha *vpycha [at] gmail.com*
[ASSGN] Zihang Chen *chsc4698 [at] gmail.com*
[ ] Benjamin Goose *gans+wget [at] tngtech.com*
[ ] Nikita Vetrov *admin [at] kanaria.ru*
[ ] Nikolay Morozov *n.morozov [at] securitycode.ru*
[ ] Matthew Atkinson *mutley456 [at] ntlworld.com*
[ ] Peter Meiser *meiser [at] gmx-topmail.de*
[ ] Pär Karlsson *feinorgh [at] gmail.com*
[ ] Jakub Čajka *jcajka [at] redhat.com*
[ ] Witchakorn Kamolpornwijit *witchakk [at] mit.edu*
[ ] Tom Li *biergaizi2009 [at] gmail.com*
[ ] Jérémie Courrèges-Anglas *jca [at] wxcvbn.org*
[ ] Cong Ma *cma [at] pmo.ac.cn*
[ ] Yuriy M. Kaminskiy *yumkam [at] gmail.com*
[ASSGN] Eli Zaretskii *eliz [at] gnu.org*
[ ] Mathieu Parent *math.parent [at] gmail.com*
[ ] Dagobert Michelsen *dam [at] opencsw.org*
[ ] Gisle Vanem *gvanem [at] yahoo.no*
[ ] Anderson Goulart *global [at] kokre.com*
[ASSGN] Ander Juaristi Alamos *ajuaristi [at] gmx.es*
[ ] Rohan Prinja *rohan.prinja [at] gmail.com*
[ASSGN] Hubert Tarasiuk *hubert.tarasiuk [at] gmail.com*
[ASSGN] Miquel Llobet *mllobet.cm [at] gmail.com*
[ ] Romain Bentz *romain.bentz [at] dataiku.com*
[ ] Alex Henrie *alexhenrie24 [at] gmail.com*
[ASSGN] Jookia *166291 [at] gmail.com*
[ ] Daniele Calore *daniele.calore [at] tin.it*
[ ] Christian Neukirchen *chneukirchen [at] gmail.com*
[ ] christian fafard *cfaf [at] hotmail.com*
[ ] Ikey Doherty *michael.i.doherty [at] intel.com*
[ ] Ygal Blum *ygal.blum [at] technicolor.com*
[ ] Jernej Simončič *jernej|s-wget [at] eternallybored.org*
[ ] Maks Orlovich *morlovich [at] google.com*
[ASSGN] moparisthebest *admin [at] moparisthebest.com*
[ ] Sergio Gelato *sergio.gelato [at] astro.su.se*
[ ] Sean Burford *sburford [at] google.com*
[ASSGN] Matthew White *mehw.is.me [at] inventati.org*
[ ] Jeffery To *jeffery.to [at] gmail.com*
[ ] Tobias Stoeckmann *tobias [at] stoeckmann.org*
[ASSGN] Dale R. Worley *worley [at] ariadne.com*
[ ] Liam R. Howlett *Liam.Howlett [at] WindRiver.com*
[ ] losgrandes *pwajda [at] gmail.net.pl*
[ ] Rahul Bedarkar *rahul.bedarkar [at] imgtec.com*
[ ] Nikos Mavrogiannopoulos *nmav [at] gnutls.org*
[ASSGN] vijeth-aradhya *vijthaaa [at] gmail.com*
[ASSGN] Tom Szilagyi *tomszilagyi [at] gmail.com*
[ASSGN] YX Hao *lifenjoiner [at] 163.com*
[ ] Benjamin Esham *benjamin [at] esham.io*
[ ] Christof Horschitz *christof [at] nimbusec.com*
[ASSGN] Vijo Cherian *codervijo [at] gmail.com*
[ ] klemens *ka7 [at] github.com*
[ ] Anton Yuzhaninov *citrin+github [at] citrin.ru*
[ASSGN] Tim Schlueter *schlueter.tim [at] linux.com*
[ASSGN] Josef Moellers *jmoellers [at] suse.de*
[ ] Peter Wu *peter [at] lekensteyn.nl*
[ ] Reiji *gey3dr [at] gmail.com*
[ ] Loganaden Velvindron *logan [at] hackers.mu*
[ ] ethus3h *kolubat [at] gmail.com*
[ ] Tomas Korbar *tkorbar [at] redhat.com*
[ ] Nikos Mavrogiannopoulos *nmav [at] redhat.com*
[ ] Luiz Angelo Daros de Luca *luizluca [at] gmail.com*
[ ] Kapus, Timotej *timotej.kapus13 [at] imperial.ac.uk*
[ ] Rosen Penev *rosenp [at] gmail.com*
[ ] André Wolski *andre [at] dena-design.de*
[ ] Leon Klingele *git [at] leonklingele.de*
[ASSGN] Jeffrey Walton *noloader [at] gmail.com*
[ ] raminfp *ramin.blackhat [at] gmail.com*
[ ] Leif Ryge *leif [at] synthesize.us*
[ ] Eneas U de Queiroz *cote2004-github [at] yahoo.com*
[ ] AviSoomirtee *avi [at] cyberstorm.mu*
[ASSGN] sulfastor *torresmoisesa [at] gmail.com*
[ ] Lauri Nurmi *lanurmi [at] iki.fi*
[ASSGN] Вячеслав Петрищев *vyachemail [at] gmail.com*
[ ] Matt Whitlock *gentoo [at] mattwhitlock.name*
[ ] Shamil Gumirov *shamil [at] gumirov.com*
[ ] Nils *nils [at] nilsand.re*
[ ] Nekun *nekokun [at] firemail.cc*
[ ] jmoellers *josef.moellers [at] suse.com*
[ ] WB *3572564-wadersgeek [at] users.noreply.gitlab.com*
[ ] Thomas Niederberger *thomas [at] niederb.ch*
[ ] Nik Soggia *wget [at] niksoggia.it*
[ ] Aarni Koskela *akx [at] iki.fi*
[ ] jinfuchiang *jinfuchiang [at] outlook.com*
[ ] Jan-Michael Brummer *jan-michael.brummer1 [at] volkswagen.de*

65
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,65 @@
# Wget Contribution Guidelines
1. [Guidelines For Patch
Submissions](#Guidelines_For_Patch_Submissions)
1. [What is a patch ?](#What_is_a_patch.3F)
2. [Where to send the patches](#Where_to_send_the_patches)
3. [Standards and coding style](#Standards_and_coding_style)
Guidelines For Patch Submissions {#Guidelines_For_Patch_Submissions}
================================
What is a patch ? {#What_is_a_patch.3F}
-----------------
A patch file, also known as a \"diff\", is a textual representation of
changes to source code. Patches are readable enough
to be reviewed by []{#line-9 .anchor}humans and at the same time regular
enough to be processed by programs. The `patch`
utility is used to change the source code in the
manner that the patch describes, this being called \"applying\" the
patch. Patches work even on files that have been
modified independently of the modifications in the
patch, as long as those other changes do not
conflict with the patch.
Because of these properties, patches are the preferred means of
distributing the changes to a free software project.
If you have made a change to Wget and would like to
contribute it, you will need to create a patch and
send it to the developers; please read on.
Where to send the patches {#Where_to_send_the_patches}
-------------------------
Patches intended to be applied to Wget should be mailed to
bug-wget@gnu.org. Each patch will be reviewed by the
developers, and will be acked and added to the
distribution, or rejected with an explanation.
Unfortunately, the developers are often busy with
their day jobs, so the review process can take a while.
*Every* patch should be accompanied by an explanation of what the patch
changes, and why the change is desirable or
necessary. The explanation need not be long, but
please don\'t just send a patch without any
accompanying text.
Please send your patches as email attachments. It is important that the
patch survives the travel unchanged so that we can feed it to
the `patch` utility or `git am/apply` after or while reviewing it.
Standards and coding style {#Standards_and_coding_style}
--------------------------
Wget abides by the GNU coding standards, available at:
- https://www.gnu.org/prep/standards.html
But maybe even better is to stay with the surrounding coding style.
When working with git: The commit messages needs a certain GNU style
format. Please check `git log` for examples. The maintainers might
correct small issues here before pushing / applying without asking.

View File

@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007, 2023 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -729,7 +729,7 @@
* testenv/Makefile.am: Run the tests in Python's Optimizedmode
* testenv/conf/__init__.py (gen_hook): Use try..except instead of if..else
* testenv/misc/color_terminal.py: System and check will not change while a test is
run. Do not test for them on every invokation of printer()
run. Do not test for them on every invocation of printer()
* testenv/server/http/http_server.py: The ssl and re modules are required by
specific functions. Load them lazily
(HTTPSServer.__init__): Lazy load ssl module here

View File

@@ -7,30 +7,14 @@ Primary List
The primary mailinglist for discussion, bug-reports, or questions about
GNU Wget is at <bug-wget@gnu.org>. To subscribe, send an email to
<bug-wget-join@gnu.org>, or visit
`http://lists.gnu.org/mailman/listinfo/bug-wget'.
`https://lists.gnu.org/mailman/listinfo/bug-wget'.
You do not need to subscribe to send a message to the list; however,
please note that unsubscribed messages are moderated, and may take a
while before they hit the list--*usually around a day*. If you want
your message to show up immediately, please subscribe to the list
before posting. Archives for the list may be found at
`http://lists.gnu.org/pipermail/bug-wget/'.
An NNTP/Usenettish gateway is also available via Gmane
(http://gmane.org/about.php). You can see the Gmane archives at
`http://news.gmane.org/gmane.comp.web.wget.general'. Note that the
Gmane archives conveniently include messages from both the current
list, and the previous one. Messages also show up in the Gmane archives
sooner than they do at `lists.gnu.org'.
Bug Notices List
----------------
Additionally, there is the <wget-notify@addictivecode.org> mailing
list. This is a non-discussion list that receives bug report
notifications from the bug-tracker. To subscribe to this list, send an
email to <wget-notify-join@addictivecode.org>, or visit
`http://addictivecode.org/mailman/listinfo/wget-notify'.
`https://lists.gnu.org/pipermail/bug-wget/'.
Obsolete Lists
--------------
@@ -40,10 +24,7 @@ discussion list, and another list, <wget-patches@sunsite.dk> was used
for submitting and discussing patches to GNU Wget.
Messages from <wget@sunsite.dk> are archived at
`http://www.mail-archive.com/wget%40sunsite.dk/' and at
`http://news.gmane.org/gmane.comp.web.wget.general' (which also
continues to archive the current list, <bug-wget@gnu.org>).
`https://www.mail-archive.com/wget%40sunsite.dk/' and at
Messages from <wget-patches@sunsite.dk> are archived at
`http://news.gmane.org/gmane.comp.web.wget.patches'.
`https://news.gmane.org/gmane.comp.web.wget.patches'.

View File

@@ -1,6 +1,5 @@
# Makefile for `Wget' utility
# Copyright (C) 1995, 1996, 1997, 2006, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation, Inc.
# Copyright (C) 1995-1997, 2006-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Additional permission under GNU GPL version 3 section 7
@@ -41,7 +40,7 @@ distuninstallcheck_listfiles = find . -type f | \
ACLOCAL_AMFLAGS = -I m4
# subdirectories in the distribution
SUBDIRS = lib src doc po tests util testenv
SUBDIRS = lib src doc po gnulib_po util fuzz tests testenv
EXTRA_DIST = MAILING-LIST \
msdos/config.h msdos/Makefile.DJ \
@@ -49,6 +48,7 @@ EXTRA_DIST = MAILING-LIST \
build-aux/build_info.pl build-aux/git-version-gen .version
CLEANFILES = *~ *.bak $(DISTNAME).tar.gz
DISTCLEANFILES = po/stamp-po gnulib_po/stamp-po
BUILT_SOURCES = .version
@@ -77,3 +77,33 @@ gen-ChangeLog:
{ rm -f $(distdir)/ChangeLog && \
mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
fi
check-valgrind:
TESTS_ENVIRONMENT="VALGRIND_TESTS=1" $(MAKE) check
LCOV_INFO=wget.info
clean-lcov:
rm -rf $(LCOV_INFO) */*.gc?? */.libs/*.gc?? lcov/
lcov --zerocounters --directory src/
check-coverage: clean clean-lcov
$(MAKE) CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
lcov --capture --initial --directory src/ --output-file $(LCOV_INFO)
$(MAKE) CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage" VALGRIND_TESTS=0 check
lcov --capture --directory src/ --output-file $(LCOV_INFO)
lcov --remove $(LCOV_INFO) --ignore-errors unused '/usr/include/*' '*/lib/*' -o $(LCOV_INFO)
genhtml --prefix . --ignore-errors source --ignore-errors unmapped $(LCOV_INFO) --legend --title "Wget" --output-directory=lcov
@echo
@echo "You can now view the coverage report with 'xdg-open lcov/index.html'"
fuzz-coverage: clean clean-lcov
$(MAKE) -C lib
$(MAKE) -C src CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
$(MAKE) -C fuzz check CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
lcov --capture --initial --directory fuzz --directory src --output-file $(LCOV_INFO)
lcov --capture --directory fuzz --directory src --output-file $(LCOV_INFO)
lcov --remove $(LCOV_INFO) '/usr/include/*' '*/lib/*' -o $(LCOV_INFO)
genhtml --prefix . --ignore-errors source $(LCOV_INFO) --legend --title "Wget-fuzz" --output-directory=lcov
@echo
@echo "You can now view the coverage report with 'xdg-open lcov/index.html'"

289
NEWS
View File

@@ -1,11 +1,282 @@
GNU Wget NEWS -- history of user-visible changes.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free
Software Foundation, Inc.
See the end for copying conditions.
* Noteworthy changes in release ?.? (????-??-??) [?]
Please send GNU Wget bug reports to <bug-wget@gnu.org>.
* Noteworthy changes in release 1.24.5 (2024-03-10) [stable]
** Fix how subdomain matches are checked for HSTS.
Fixes a minor issue where cookies may be leaked to the wrong domain
** Wget will now also parse the srcset attribute in <source> HTML tags
** Support reading fetchmail style "user" and "passwd" fields from netrc
** In some cases, prevent the confusing "Cannot write to... (success)" error messages
** Support extremely fast download speeds (TB/s).
Previously this would cause Wget to crash when printing the speed
** Improve portability on OpenBSD to run the test suite
** Ensure that CSS URLs are corectly quoted (Bug: 64082)
* Noteworthy changes in release 1.21.4 (2023-05-11)
** Document --retry-on-host-error in help text
** Increase read buffer size to 64k. This should speed up downloads on gigabit and faster connections
** Update deprecated option '--html-extension' to '--adjust-extension' in documentation
** Update gnulib compatibility layer.
Fixes HSTS test failures on i686. (Thanks to Andreas Enge for ponting it out)
* Noteworthy changes in release 1.21.3 (2022-02-26)
** Fix computation of total bytes downloaded during FTP trasnfers (#61277)
** Add option to select TLS 1.3 on the command line
** Fix HSTS build issues on some 64-bit big-endian systems
** Hide password during status report in --no-verbose
** Remove a sprurious print statement that showed up even during --quiet
** Some more cleanups and bug-fixes
* Noteworthy changes in release 1.21.2 (2021-09-07)
** Support for autoconf 2.71
** Fix a double free in FTP when using an absolute path
** Release tarballs no longer have a dependency on Python.
** --page-requisites will now also download links marked as "alternate
stylesheet" or "icon"
* Noteworthy changes in release 1.21.1 (2021-01-09)
** Fix compilation on MacOS and Solaris 9
** Resove bashism from configure.ac
** Fix a compilation warning on 32-bit systems
* Changes in Wget 1.21
** Improve the number of translated strings
** Remove all uses of alloca
In some places the length of untrusted strings has been used, e.g.
strings from the command line or from remote.
** Fix buffer overflows in progress bar code in some locales
** Fix two null pointer accesses
** Amend cookie file header to be recognized by the 'file' command
** Post Handshake Authentication for OpenSSL
** Require gettext version 0.19.3+
** Add configure flags --enable-fsanitize-ubsan, --enable-fsanitize-asan
and --enable-fsanitize-msan for gcc and clang
** Make several smaller fixes, enhance fuzzing, enhance building
* Changes in Wget 1.20.3
** Fixed a buffer overflow vulnerability
* Changes in Wget 1.20.2
** NTLM authentication will retry under certain cases
* Changes in Wget 1.20.1
** --xattr is no longer default since it introduces privacy issues.
** --xattr saves the Referer as scheme/host/port, user/pw/path/query/fragment
are no longer saved to prevent privacy issues.
** --xattr saves the Original URL without user/password to prevent
privacy issues.
* Changes in Wget 1.20
** Add new option `--retry-on-host-error` to treat local errors as transient
and hence Wget will retry to download the file after a brief waiting period.
** Fixed multiple potential resource leaks as found by static analysis
** Wget will now not create an empty wget-log file when running with -q and -b
switches together
** When compiled using the GnuTLS >= 3.6.3, Wget now has support for TLSv1.3
** Now there is support for using libpcre2 for regex pattern matching
** When downloading over FTP recursively, one can now use the
--{accept,reject}-regex switches to fine-tune the downloaded files
** Building Wget from the git sources now requires autoconf 2.63 or above.
Building from the Tarballs works as it used to.
* Changes in Wget 1.19.5
* Fix cookie injection (CVE-2018-0494)
* Enable TLS1.3 with recent OpenSSL environment
* New option --ciphers to set GnuTLS / OpenSSL ciphers directly
* Updated CSS grammar to CSS 2.2
* Fixed several memleaks found by OSS-Fuzz
* Fixed several buffer overflows found by OSS-Fuzz
* Fixed several integer overflows found by OSS-Fuzz
* Several minor bug fixes
* Changes in Wget 1.19.4
* A major bug that caused GZip'ed pages to never be decompressed has been fixed
* Support for Content-Encoding and Transfer-Encoding have been marked as
experimental and disabled by default
* Changes in Wget 1.19.3
* Prevent erroneous decompression of .gz and .tgz files with broken servers
* Added support for HTTP 308 Permanent Redirect response
* Fix a segfault in some cases where the Content-Type header is not sent
* Support OpenSSL 1.1 builds without using deprecated features
* Fix netrc file detection on Windows
* Several minor bug fixes
* Changes in Wget 1.19.2
* Fix CVE-2017-13089 (Stack overflow in HTTP protocol handling)
* Fix CVE-2017-13090 (Heap overflow in HTTP protocol handling)
* New option --compression for gzip Content-Encoding
* New option --[no]-netrc to control .netrc parsing
* Added GNU extensions to .netrc parsing
* Improved IDNA 2003 compatibility
* Fix VPATH issues
* Improved and extended the test suite
* Support Wayback Machine's X-Archive-Orig-last-modified
* Several bug fixes
* Changes in Wget 1.19.1
* Fix bugs, a regression, portability/build issues
* Add new option --retry-on-http-error
* Changes in Wget 1.19
* New option --use-askpass=COMMAND. Fetch user/password by calling
an external program.
* Use IDNA2008 (+ TR46 if available) through libidn2
* When processing a Metalink header, --metalink-index=<number> allows
to process the header's application/metalink4+xml files.
* When processing a Metalink file, --trust-server-names enables the
use of the destination file names specified in the Metalink file,
otherwise a safe destination file name is computed.
* When processing a Metalink file, enforce a safe destination path.
Remove any drive letter prefix under w32, i.e. 'C:D:file'. Call
libmetalink's metalink_check_safe_path() to prevent absolute,
relative, or home paths:
https://tools.ietf.org/html/rfc5854#section-4.1.2.1
https://tools.ietf.org/html/rfc5854#section-4.2.8.3
* When processing a Metalink file, --directory-prefix=<prefix> sets
the top of the retrieval tree to prefix for Metalink downloads.
* When processing a Metalink file, reject downloaded files which don't
agree with their own metalink:size value:
https://tools.ietf.org/html/rfc5854#section-4.2.16
* When processing a Metalink file, with --continue resume partially
downloaded files and keep fully downloaded files even if they fail
the verification.
* When processing a Metalink file, create the parent directories of a
"path/file" destination file name:
https://tools.ietf.org/html/rfc5854#section-4.1.2.1
https://tools.ietf.org/html/rfc5854#section-4.2.8.3
* On a recursive download, append a .tmp suffix to temporary files
that will be deleted after being parsed, and create them
readable/writable only by the owner.
* New make target 'check-valgrind'
* Fix several bugs
* Fix compatibility issues
* Changes in Wget 1.18
* By default, on server redirects to a FTP resource, use the original
URL to get the local file name. Close CVE-2016-4971. This
introduces a backward-incompatibility for HTTP->FTP redirects and
any script that relies on the old behaviour must use
--trust-server-names.
* Check the HSTS file is not world-writable before using it.
* Parse <img srcset> attributes on a recursive download.
* Fix problem with SNI server names having trailing dot(s)
* New options --bind-dns-address and --dns-servers.
* When Wget is built with libiconv, it now converts non-ASCII URIs to
the locale's codeset when it creates files. The encoding of the
remote files and URIs is taken from --remote-encoding, defaulting to
UTF-8. The result is that non-ASCII URIs and files downloaded via
HTTP/HTTPS and FTP will have names on the local filesystem that
correspond to their remote names.
* Changes in Wget 1.17.1
@@ -209,7 +480,7 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
backward-incompatibility; any script that relies on the old
behaviour must use --trust-server-names.
** Fix a problem when -k is used and some URLs are specified trough
** Fix a problem when -k is used and some URLs are specified through
CSS.
** Convert correctly URLs that need to be encoded to local files when following
@@ -219,7 +490,7 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
** Print the total download time as part of the summary for recursive downloads.
** Now it is possible to specify a different startup configuration file trough
** Now it is possible to specify a different startup configuration file through
the --config option.
** Fix an infinite loop with the error '<filename> has sprung into existence'
@@ -623,7 +894,7 @@ addresses when accessing the first one fails.
non-standard port.
** Wget now supports the robots.txt directives specified in
<http://www.robotstxt.org/wc/norobots-rfc.txt>.
<http://www.robotstxt.org/norobots-rfc.txt>.
** URL parser has been fixed, especially the infamous overzealous
quoting. Wget no longer dequotes reserved characters, e.g. `%3F' is
@@ -947,7 +1218,7 @@ geturl -vo log http://fly.cc.fer.hr/
----------------------------------------------------------------------
Copyright information:
Copyright (C) 1997-2005 Free Software Foundation, Inc.
Copyright (C) 1997-2024 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim
copies of this document as received, in any medium, provided that

14
README
View File

@@ -1,7 +1,7 @@
-*- text -*-
GNU Wget
========
Current Web home: http://www.gnu.org/software/wget/
Current Web home: https://www.gnu.org/software/wget/
GNU Wget is a free utility for non-interactive download of files from
the Web. It supports HTTP, HTTPS, and FTP protocols, as well as
@@ -14,7 +14,7 @@ While doing that, Wget respects the Robot Exclusion Standard
(/robots.txt). Wget can be instructed to convert the links in
downloaded HTML files to the local files for offline viewing.
Recursive downloading also works with FTP, where Wget can retrieves a
Recursive downloading also works with FTP, where Wget can retrieve a
hierarchy of directories and files.
With both HTTP and FTP, Wget can check whether a remote file has
@@ -50,18 +50,20 @@ resides at <ftp://ftp.gnu.org/pub/gnu/wget/>.
Please report bugs in Wget to <bug-wget@gnu.org>.
See the file `MAILING-LIST' for information about Wget mailing lists.
Wget's home page is at <http://www.gnu.org/software/wget/>.
Wget's home page is at <https://www.gnu.org/software/wget/>.
If you would like to contribute code for Wget, please read
http://wget.addictivecode.org/PatchGuidelines.
CONTRIBUTING.md.
Wget is offered under the terms of the GNU GPLv3 license. Please see the
COPYING file for a full text of the license terms.
Wget was originally written and mainained by Hrvoje Niksic. Please see
the file AUTHORS for a list of major contributors, and the ChangeLogs
for a detailed listing of all contributions.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (C) 1995-2024 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -4,11 +4,11 @@ Compiling From Repository Sources
does not contain automatically-generated files, even when these are
normally present in the distribution tarballs. Therefore, to build GNU
Wget from the sources in the repository, you'll need to have one or
more of the following (note that gettext, OpenSSL, GnuTLS, libidn,
more of the following (note that gettext, OpenSSL, GnuTLS, libidn2,
libiconv, libpsl, libpcre, pkg-config, libmetalink and GnuPG are not
absolutely required):
* [20]autoconf (currently, GNU Wget requires version 2.61). This is
* [20]autoconf (currently, GNU Wget requires version 2.64). This is
needed to generate the configure script from configure.in. This is
not required when building from a tarball distribution; only when
building from repository sources.
@@ -25,14 +25,15 @@ Compiling From Repository Sources
tests in the tests/ sub directory. Tarball distributions include an
already-generated wget.1 manual. The command "make check" runs the
test suite written in perl and python (see below). To execute all the tests
you need [24]libwww-perl and libio-socket-ssl-perl perl library. If
"perl -MCPAN -e 'install Bundle::LWP'" fails then you most likely don't
have cpan module installed. First download [25]CPAN and [26]install it.
Then execute "perl -MCPAN -e 'install Bundle::LWP'".
you need libwww-perl and libio-socket-ssl-perl perl library.
GNU/Linux distros likely have these two libraries packaged.
If not, install them directly with "perl -MCPAN -e 'install Bundle::LWP'"[24].
If that fails then you most likely don't have the CPAN module installed.
First download [25]CPAN and [26]install it, then try again the above command.
Now "make check" should pass most of the tests in the test suite.
* [45]Python, if you want to run the tests in the testenv/ subdirectory.
Keep in mind that "make check" will try to run all the perl and python
* [45]Python3, if you want to run the tests in the testenv/ subdirectory.
Keep in mind that "make check" will try to run all the Perl and Python3
tests. More information about the test suite below in the section
"Testing and development".
@@ -68,14 +69,14 @@ Compiling From Repository Sources
If you want to compile+link a non-system library version use
--with-libssl-prefix (or if having pkg-config: see description below).
* [31]libidn is required for IDN/IRI support (non-ASCII characters
* [31]libidn2 is required for IDN/IRI support (non-ASCII characters
within what would otherwise be URLs).
* [32]libiconv is required on non-GNU systems, for IDN/IRI support.
On GNU systems, the functionality provided by libiconv is already
present in the system libraries.
* [33]git is used to fetch gnulib files trough the bootstrap.sh script.
* [33]git is used to fetch gnulib files through the bootstrap.sh script.
* [34]libpsl is required for using a public suffix list to check for valid
cookie domains. You need the header files and the library installed.
@@ -99,6 +100,13 @@ Compiling From Repository Sources
* [47]GnuPG with GPGME is used to verify GPG-signed Metalink resources.
* [48]libcares is needed to bind DNS resolving to a given IP address.
The command line options --dns-servers and --bind-dns-address are
only available when configured with --with-cares.
* [49]gperf is required by some gnulib modules, most notably "unicase". You
need the application installed on the machine to compile Wget from git.
For those who might be confused as to what to do once they check out
the source code, considering configure and Makefile do not yet exist at
@@ -112,7 +120,7 @@ Compiling From Repository Sources
$ cd wget # assumes you've cloned a repository to "./wget"
2. Generate all the automatically-generated files required prior to
configuring the package:
$ ./bootstrap
$ ./bootstrap (or: bash ./bootstrap)
3. Configure the package and compile it:
$ ./configure --enable-assert [some_parameters]
$ make
@@ -153,9 +161,10 @@ Testing and development
that bug, which might be tedious. Tests should only be run through GDB for that purpose.
Copyright (C) 2008,2010,2014,2015 Free Software Foundation, Inc.
Copyright (C) 2008, 2010, 2014-2015, 2018-2024 Free Software
Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
<https://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@@ -179,31 +188,33 @@ Testing and development
References
20. http://www.gnu.org/software/autoconf/
21. http://www.gnu.org/software/automake/
22. http://flex.sourceforge.net/
23. http://www.perl.org/
20. https://www.gnu.org/software/autoconf/
21. https://www.gnu.org/software/automake/
22. https://github.com/westes/flex
23. https://www.perl.org/
24. http://search.cpan.org/dist/libwww-perl/lib/Bundle/LWP.pm
25. http://search.cpan.org/CPAN/authors/id/A/AN/ANDK/CPAN-1.9402.tar.gz
26. http://apthorpe.cynistar.net/code/configuring_cpan.html
27. http://www.gnu.org/software/texinfo/
28. http://www.gnu.org/software/gettext/
29. http://www.gnu.org/software/gnutls/
30. http://www.openssl.org/
31. http://www.gnu.org/software/libidn/
32. http://www.gnu.org/software/libiconv/
33. http://git-scm.com/
27. https://www.gnu.org/software/texinfo/
28. https://www.gnu.org/software/gettext/
29. https://www.gnu.org/software/gnutls/
30. https://www.openssl.org/
31. https://www.gnu.org/software/libidn/#libidn2
32. https://www.gnu.org/software/libiconv/
33. https://git-scm.com/
34. https://github.com/rockdaboot/libpsl
35. http://www.pcre.org
35. https://www.pcre.org
36. http://wget.addictivecode.org/CompilingRepoSources?action=edit&editor=text
37. http://wget.addictivecode.org/CompilingRepoSources
38. http://wget.addictivecode.org/CompilingRepoSources?action=info
39. http://wget.addictivecode.org/CompilingRepoSources?action=AttachFile
40. http://moinmo.in/
41. http://moinmo.in/Python
42. http://moinmo.in/GPL
43. http://validator.w3.org/check?uri=referer
40. https://moinmo.in/
41. https://moinmo.in/Python
42. https://moinmo.in/GPL
43. https://validator.w3.org/check?uri=referer
44. http://wget.addictivecode.org/WikiLicense
45. https://www.python.org/
46. https://launchpad.net/libmetalink
47. https://www.gnupg.org
48. https://c-ares.haxx.se/
49. https://www.gnu.org/software/gperf/

84
SECURITY.md Normal file
View File

@@ -0,0 +1,84 @@
# Security Policy
## Reporting a Vulnerability
At GNU Wget, we take security seriously and appreciate the efforts of security
researchers in identifying and disclosing vulnerabilities responsibly. If you
believe you've discovered a security vulnerability in GNU Wget, we encourage you
to disclose it to us privately and work with us to ensure it is addressed
promptly and appropriately.
To report a vulnerability, please contact the maintainers directly via email.
The names and contact details of the current maintainers is always available via
the AUTHORS file in this repository. In order to send an encrypted email,
please use the keyring available at the following URL:
https://savannah.gnu.org/project/release-gpgkeys.php?group=wget
Please include the following information in your report:
- A detailed description of the vulnerability
- The version(s) of GNU Wget that are affected.
- Steps to reproduce the vulnerability.
- Any proof-of-concept or exploit code, if applicable.
- Your contact information for coordination and follow-up.
Once we receive your report, we will acknowledge receipt and work with you to
investigate the issue. We work on GNU Wget on a volunteer basis and as such may
face delays in responding immediately. We aim to respond to initial reports
within 5 working days and will keep you informed of our progress throughout the
resolution process.
Please refrain from disclosing the vulnerability publicly until we have had an
opportunity to investigate and address it. We appreciate your cooperation in
helping to keep GNU Wget and its users secure.
## Vulnerability Disclosure Policy
Once a security vulnerability has been identified and confirmed, we will take
the following steps:
1. **Investigation**: We will promptly investigate the reported vulnerability to
verify its authenticity and determine its scope and impact.
2. **Resolution**: Once validated, we will develop and test a fix for the
vulnerability. We will strive to address the issue as quickly as possible and
prepare a patch for release.
3. **Coordination**: We will work with the reporter to ensure that the
vulnerability is disclosed responsibly and coordinated with the release of
the fix.
4. **Release**: Upon completion of the fix and any necessary testing, we will
release a new version of GNU Wget that addresses the vulnerability. We will
provide appropriate credit to the reporter in the release notes, unless
otherwise requested.
5. **Public Disclosure**: We will coordinate the public disclosure of the
vulnerability with the reporter and other relevant stakeholders. Once the fix
is widely available, we will publish an advisory detailing the vulnerability
and its resolution.
We strive to follow these steps in a timely and transparent manner, while
prioritizing the security and stability of GNU Wget and its users.
## Responsible Disclosure Guidelines
In order to protect our users and systems, we ask that security researchers
adhere to the following guidelines when reporting vulnerabilities to GNU Wget:
- **Responsible Disclosure**: Please disclose vulnerabilities to us privately
and allow us a reasonable amount of time to investigate and address them
before disclosing them publicly.
- **Cooperation**: We appreciate your cooperation and collaboration throughout
the disclosure process. We will do our best to keep you informed of our
progress and coordinate the release of information with you.
- **Respect**: Please respect our users' privacy and refrain from any actions
that could cause harm or disrupt our systems. We ask that you do not exploit
or disclose vulnerabilities before they have been resolved.
By following these guidelines, you can help us maintain the security and
integrity of GNU Wget for the benefit of all users. We thank you for your
contributions to our project and for helping to make the internet a safer place.

1908
bootstrap

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,5 @@
# bootstrap.conf - Bootstrap configuration.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation,
# Inc.
# Copyright (C) 2007-2012, 2018-2024 Free Software Foundation, Inc.
#
# This file is part of GNU Wget.
#
@@ -9,24 +8,25 @@
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# GNU Wgt is distributed in the hope that it will be useful, but
# GNU Wget is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see `http://www.gnu.org/licenses/'.
# along with this program. If not, see `https://www.gnu.org/licenses/'.
# gnulib library name
source_base=lib
tests_base=lib/tests
gnulib_name=libgnu
gnulib_tool_option_extras=
gnulib_tool_option_extras="--makefile-name=gnulib.mk --po-base=gnulib_po --po-domain=wget"
use_libtool=0
checkout_only_file=
# gnulib modules used by this package.
gnulib_modules="
accept
alloca
announce-gen
base32
bind
@@ -36,86 +36,133 @@ c-strcasestr
clock-time
close
connect
crypto/md2
crypto/md4
crypto/md5
crypto/sha1
crypto/sha256
crypto/sha512
dirname
do-release-commit-and-tag
fcntl
flock
fnmatch
futimens
fnmatch-gnu
fopen
ftello
futimens
gendocs
getaddrinfo
getline
getopt-gnu
getpass-gnu
getpeername
getsockname
gettext
gitlog-to-changelog
gettext-h
git-version-gen
gitlog-to-changelog
gnu-web-doc-update
gnupload
ioctl
group-member
hostent
iconv
iconv-h
inet_ntop
intprops
inttypes
ioctl
langinfo
libunistring-optional
limits-h
link
listen
maintainer-makefile
mbiter
mbtowc
memrchr
mkdir
mkstemp
mkostemp
crypto/md5
crypto/sha1
crypto/sha256
mkstemp
nanosleep
open
pipe-posix
posix_spawn
quote
quotearg
recv
regex
rename
select
send
setsockopt
sigprocmask
signal-h
sigpipe
sigprocmask
snprintf
socket
spawn-pipe
stat
stdbool
stdint
strcase
strerror_r-posix
strpbrk
strptime
strtok_r
strtol
strtoll
symlink
sys_types
timegm
tmpdir
unicase/u8-tolower
unistr/u8-strlen
unlink
unlocked-io
update-copyright
utime
utimens
vasprintf
vsnprintf
warnings
wcwidth
write
xmemdup0
xstrndup
"
gnulib_extra_files="
$build_aux/install-sh
$build_aux/mdate-sh
$build_aux/texinfo.tex
$build_aux/depcomp
$build_aux/config.guess
$build_aux/config.sub
$build_aux/config.rpath
doc/INSTALL
"
# Build prerequisites
buildreq="\
autoconf 2.62
autoconf 2.64
automake 1.11.1
autopoint -
gettext 0.17
gettext -
git 1.4.4
makeinfo -
perl 5.5
rsync -
tar -
xz -
gzip -
flex -
gperf -
"
bootstrap_post_import_hook ()
{
# We need to patch unicase/special-casing-table.h for gperf < 3.1
GPERF_VER=$(gperf --version | {
IFS=' .' read x y major minor bugfix _
printf "%d%02d%02d" $major $minor $bugfix
})
if [ $GPERF_VER -lt 30100 ]; then
echo "Creating lib/unicase/special-casing-table.h for gperf < 3.1"
gperf -m 10 lib/unicase/special-casing-table.gperf | \
sed -e "s/gl_unicase_special_lookup.*/gl_unicase_special_lookup\ \(const char \*str, size_t len\)/g" \
> lib/unicase/special-casing-table.h
fi
# ./bootstrap calls 'autopoint --force' which will overwrite
# po/Makevars.template. So here we add what we need for a VPATH
# build. ./bootstrap will create po/Makevars from po/Makevars.template
# after our change.
echo 'PACKAGE_GNU = yes' >> po/Makevars.template
}

View File

@@ -2,7 +2,7 @@
# Generate build_info.c.
# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
# Copyright (C) 2009-2011, 2018-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

32
cfg.mk
View File

@@ -1,29 +1,37 @@
export VC_LIST_EXCEPT_DEFAULT=^(lib/.*|m4/.*|md5/.*|build-aux/.*|src/gettext\.h|.*ChangeLog)$$
# Explicit syntax-check exceptions.
exclude_file_name_regexp--sc_trailing_blank = ^doc/annou.*$$
exclude_file_name_regexp--sc_bindtextdomain = ^fuzz/.*.c$$
exclude_file_name_regexp--sc_require_config_h = (fuzz/.*.c|src/decc_ver.c|util/trunc.c)$$
exclude_file_name_regexp--sc_require_config_h_first = (fuzz/.*.c|src/decc_ver.c|src/vms.c|util/trunc.c)$$
exclude_file_name_regexp--sc_file_system = ^(NEWS|testenv/server/ftp/ftp_server.py)$$
export VC_LIST_EXCEPT_DEFAULT=^(lib/.*|m4/.*|md5/.*|build-aux/.*|src/gettext\.h|.*ChangeLog|tests/certs/.*)$$
config_h_header = "wget\.h"
local-checks-to-skip = \
sc_const_long_option \
sc_error_message_uppercase \
sc_file_system \
sc_immutable_NEWS \
sc_copyright_check \
sc_makefile_path_separator_check \
sc_require_config_h \
sc_require_config_h_first \
sc_two_space_separator_in_usage \
sc_useless_cpp_parens \
\
sc_prohibit_atoi_atof \
sc_prohibit_strcmp \
sc_cast_of_alloca_return_value \
sc_cast_of_x_alloc_return_value \
sc_prohibit_S_IS_definition \
\
sc_program_name \
sc_makefile_at_at_check \
sc_cast_of_argument_to_free \
sc_prohibit_gnu_make_extensions \
\
sc_indent
#SHELL=bash -x
show-vc-list-except:
@$(VC_LIST_EXCEPT)
VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ABOUT-NLS|((msdos|vms)/.*)|ChangeLog-2014-12-10$$
VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ABOUT-NLS|((msdos|vms)/.*)|ChangeLog-2014-12-10|/.*\.der|^tests/certs/.*|^fuzz/.*\.(in|repro)/.*$$
update-copyright-env = UPDATE_COPYRIGHT_USE_INTERVALS=1
generated_files =
old_NEWS_hash = b80dbf02602654e200d7cbce7aeda8d2
manual_title = $(VERSION)

View File

@@ -1,6 +1,6 @@
dnl Template file for GNU Autoconf
dnl Copyright (C) 1995, 1996, 1997, 2001, 2007, 2008, 2009, 2010, 2011, 2012,
dnl 2013, 2014 Free Software Foundation, Inc.
dnl Copyright (C) 1995-1997, 2001, 2007-2014, 2018-2024 Free Software
dnl Foundation, Inc.
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -30,10 +30,13 @@ dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT([wget],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[bug-wget@gnu.org])
AC_PREREQ(2.61)
dnl Error if AX_CODE_COVERAGE if missing (like on the 1.21 release).
m4_pattern_forbid([^_?AX_])
m4_pattern_allow([AX_CHECK_GNU_MAKE_HEADLINE])
m4_pattern_allow([_AX_CODE_COVERAGE_GCOV_PROG_WITH])
AC_INIT([wget],[m4_esyscmd(build-aux/git-version-gen .tarball-version)],[bug-wget@gnu.org])
AC_PREREQ([2.64])
dnl
dnl What version of Wget are we building?
@@ -48,15 +51,20 @@ AC_CONFIG_SRCDIR([src/wget.h])
dnl
dnl Automake setup
dnl
AM_INIT_AUTOMAKE([1.9])
AM_INIT_AUTOMAKE([subdir-objects dist-lzip])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
dnl
dnl Get cannonical host
dnl Get canonical host
dnl
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([OS_TYPE], "$host_os",
[Define to be the name of the operating system.])
dnl Non-verbose make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl
dnl Process External Libraries
@@ -68,8 +76,7 @@ AC_ARG_WITH([libpsl],
dnl SSL: Configure SSL backend to use
AC_ARG_WITH([ssl],
[AS_HELP_STRING([--with-ssl={gnutls,openssl}], [specify SSL backend. GNU TLS is the default.])])
[AS_HELP_STRING([--with-ssl={gnutls,openssl,no}], [specify SSL backend. GNU TLS is the default.])])
dnl Zlib: Configure use of zlib for compression
AC_ARG_WITH([zlib],
@@ -79,10 +86,82 @@ dnl Metalink: Configure use of the Metalink library
AC_ARG_WITH([metalink],
[AS_HELP_STRING([--with-metalink], [enable support for metalinks.])])
dnl C-Ares: Configure use of the c-ares library for DNS lookup
AC_ARG_WITH(cares, AS_HELP_STRING([--with-cares], [enable support for C-Ares DNS lookup.]), with_cares=$withval, with_cares=no)
dnl
dnl Process features
dnl
AC_ARG_ENABLE([fuzzing],
[AS_HELP_STRING([--enable-fuzzing], [Turn on fuzzing build (for developers)])],
[enable_fuzzing=yes;
AC_SUBST([LIB_FUZZING_ENGINE])
AC_DEFINE([FUZZING], 1, [Define to 1 if this is a fuzzing build])
], [enable_fuzzing=no; LIB_FUZZING_ENGINE=""])
AM_CONDITIONAL([FUZZING], [test "$enable_fuzzing" = "yes"])
dnl needed for some fuzzers
OLD_LIBS="$LIBS"
AC_SEARCH_LIBS([dlopen], [dl dld])
if [[ "${ac_cv_search_dlopen#-l}" != "${ac_cv_search_dlopen}" ]]; then
FUZZ_LIBS="${ac_cv_search_dlopen}"
AC_SUBST([FUZZ_LIBS])
fi
LIBS="$OLD_LIBS"
AC_ARG_ENABLE([fsanitize-ubsan],
[AS_HELP_STRING([--enable-fsanitize-ubsan], [Turn on Undefined Behavior Sanitizer (for developers)])],
[gl_cc_sanitize_ubsan=yes], [gl_cc_sanitize_ubsan=no])
AC_ARG_ENABLE([fsanitize-asan],
[AS_HELP_STRING([--enable-fsanitize-asan], [Turn on Address Sanitizer (for developers) (mutually exclusive with Memory/Thread sanitizer or Valgrind tests)])],
[gl_cc_sanitize_asan=yes], [gl_cc_sanitize_asan=no])
AC_ARG_ENABLE([fsanitize-msan],
[AS_HELP_STRING([--enable-fsanitize-msan], [Turn on Memory Sanitizer (for developers) (mutually exclusive with Address/Thread sanitizer or Valgrind tests)])],
[gl_cc_sanitize_msan=yes], [gl_cc_sanitize_msan=no])
if test "$gl_cc_sanitize_asan" = yes; then
if test "$gl_cc_sanitize_msan" = yes; then
AC_MSG_ERROR([Address Sanitizer and Memory Sanitizer are mutually exclusive])
fi
fi
if test "$gl_cc_sanitize_ubsan" = yes; then
gl_WARN_ADD([-fsanitize=undefined])
gl_WARN_ADD([-fno-sanitize-recover=undefined])
# additional clang options
gl_WARN_ADD([-fsanitize=integer])
gl_WARN_ADD([-fsanitize=nullability])
gl_WARN_ADD([-fno-sanitize-recover=nullability])
fi
if test "$gl_cc_sanitize_asan" = yes; then
gl_WARN_ADD([-fsanitize=address])
gl_WARN_ADD([-fno-omit-frame-pointer])
# additional clang option
gl_WARN_ADD([-fsanitize-address-use-after-scope])
fi
if test "$gl_cc_sanitize_msan" = yes; then
# clang options
gl_WARN_ADD([-fsanitize=memory])
gl_WARN_ADD([-fsanitize-memory-track-origins])
# gcc options
if test "$CCNAME" = "gcc"; then
gl_WARN_ADD([-fsanitize=leak])
fi
gl_WARN_ADD([-fno-omit-frame-pointer])
gl_WARN_ADD([-fPIE])
fi
dnl Opie: Support for opie s/key FTP logins
AC_ARG_ENABLE([opie],
[AS_HELP_STRING([--disable-opie], [disable support for opie or s/key FTP login])],
@@ -135,6 +214,12 @@ AC_ARG_ENABLE(valgrind-tests,
AS_IF([test "x$ENABLE_VALGRIND" != xno], [
AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
AS_IF([test "x$HAVE_VALGRIND" = xyes], [
if test "$gl_cc_sanitize_asan" = yes; then
AC_MSG_ERROR([Valgrind and Address Sanitizer are mutually exclusive])
elif test "$gl_cc_sanitize_msan" = yes; then
AC_MSG_ERROR([Valgrind and Memory Sanitizer are mutually exclusive])
fi
VALGRIND_TESTS="1"
AC_SUBST(VALGRIND_TESTS)
VALGRIND_INFO="Test suite will be run under Valgrind"
@@ -164,10 +249,6 @@ dnl We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS= auto_cflags=1
test -z "$CC" && cc_specified=yes
AC_PROG_CC
AM_PROG_CC_C_O
AC_AIX
gl_EARLY
dnl
@@ -180,11 +261,12 @@ dnl
dnl Gettext
dnl
AM_GNU_GETTEXT([external],[need-ngettext])
AM_GNU_GETTEXT_VERSION([0.18.1])
AM_GNU_GETTEXT_VERSION([0.19.3])
AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.3])
AC_PROG_RANLIB
AC_PROG_LEX
AC_PROG_LEX([noyywrap])
dnl Turn on optimization by default. Specifically:
dnl
@@ -214,13 +296,6 @@ AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
dnl Check for basic headers, even though we expect them to exist and
dnl #include them unconditionally in the code. Their detection is
dnl still needed because test programs used by Autoconf macros check.
dnl Without the checks they will fail to be included in test programs,
dnl which will subsequently fail.
AC_HEADER_STDC
dnl Check for large file support. This check needs to come fairly
dnl early because it could (in principle) affect whether functions and
dnl headers are available, whether they work, etc.
@@ -232,8 +307,8 @@ dnl Checks for system header files that might be missing.
dnl
AC_HEADER_STDBOOL
AC_CHECK_HEADERS(unistd.h sys/time.h)
AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h utime.h sys/utime.h)
AC_CHECK_HEADERS(stdint.h inttypes.h pwd.h wchar.h)
AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h)
AC_CHECK_HEADERS(stdint.h inttypes.h pwd.h wchar.h dlfcn.h)
AC_CHECK_DECLS(h_errno,,,[#include <netdb.h>])
@@ -242,11 +317,7 @@ dnl Check sizes of integer types. These are used to find n-bit
dnl integral types on older systems that fail to provide intN_t and
dnl uintN_t typedefs.
dnl
AC_CHECK_SIZEOF([short])
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([long long])
AC_CHECK_SIZEOF([void *])
dnl
dnl Checks for non-universal or system-specific types.
@@ -261,9 +332,12 @@ AC_CHECK_TYPES(sig_atomic_t, [], [], [
#include <signal.h>
])
# gnulib
# gnulib, AM_ICONV should be placed before gl_INIT
AM_ICONV
gl_INIT
AX_CODE_COVERAGE
dnl
dnl Checks for library functions.
dnl
@@ -271,37 +345,139 @@ AC_FUNC_MMAP
AC_FUNC_FSEEKO
AC_CHECK_FUNCS(strptime timegm vsnprintf vasprintf drand48 pathconf)
AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr wcwidth mbtowc)
AC_CHECK_FUNCS(sleep symlink utime strlcpy random)
if test x"$ENABLE_OPIE" = xyes; then
AC_LIBOBJ([ftp-opie])
fi
AC_CHECK_FUNCS(sleep symlink utime strlcpy random fmemopen)
dnl We expect to have these functions on Unix-like systems configure
dnl runs on. The defines are provided to get them in config.h.in so
dnl Wget can still be ported to non-Unix systems (such as Windows)
dnl that lack some of these functions.
AC_DEFINE([HAVE_STRCASECMP], 1, [Define to 1 if you have the `strcasecmp' function.])
AC_DEFINE([HAVE_STRNCASECMP], 1, [Define to 1 if you have the `strncasecmp' function.])
AC_DEFINE([HAVE_STRDUP], 1, [Define to 1 if you have the `strdup' function.])
AC_DEFINE([HAVE_ISATTY], 1, [Define to 1 if you have the `isatty' function.])
dnl
dnl Call Wget-specific macros defined in aclocal.
dnl
WGET_STRUCT_UTIMBUF
WGET_FNMATCH
WGET_NANOSLEEP
WGET_POSIX_CLOCK
WGET_NSL_SOCKET
AC_DEFINE([HAVE_STRDUP], 1, [Define to 1 if you have the 'strdup' function.])
AC_DEFINE([HAVE_ISATTY], 1, [Define to 1 if you have the 'isatty' function.])
dnl Deal with specific hosts
case $host_os in
*mingw32* )
LIBS+=' -lws2_32'
AC_LIBOBJ([mswindows])
OS_USED="mswindows"
;;
esac
AM_CONDITIONAL([OS_MSWINDOWS], [test x"$OS_USED" = x"mswindows"])
# enable all possible compiler warnings in WARN_FLAGS
#
# to enable by default: create a file '.manywarnings'
# enable explicitly : ./configure --enable-manywarnings
# disable explicitly: ./configure --disable-manywarnings
sanitizer_flags="$WARN_CFLAGS"
wget_MANYWARNINGS(WARN_CFLAGS, C)
WARN_CFLAGS="$WARN_CFLAGS $sanitizer_flags"
if test -n "$WARN_CFLAGS"; then
if test "$CCNAME" = "gcc"; then
# Set up list of unwanted warnings
nw=
nw="$nw -Wsystem-headers" # System headers may trigger lot's of useless warnings
nw="$nw -Wvla" # This project is C99
nw="$nw -Wstack-protector"
nw="$nw -Wmissing-field-initializer"
nw="$nw -Wtraditional"
nw="$nw -Wtraditional-conversion"
nw="$nw -Wc++-compat"
nw="$nw -Wcast-qual"
nw="$nw -Wconversion"
nw="$nw -Wsign-conversion"
nw="$nw -Wunsuffixed-float-constants"
nw="$nw -Wdeclaration-after-statement" # C89 only, messing up gcc < 5
nw="$nw -Wcast-function-type" # gcc 8, very noisy
nw="$nw -Wabi" # gcc 8, very noisy
nw="$nw -Wunused-macros" # triggers in auto-generated lex css parser, #pragma doesn't work, conflicts with -Werror
nw="$nw -Wchkp" # Deprecated option
nw="$nw -Wswitch-enum" # Too noisy
nw="$nw -Wswitch-default" # TODO: Enable someday. Too noisy for now
nw="$nw -Wpedantic" # GCC 11. Too noisy, will never be supported
nw="$nw -Wnested-externs" # Stylistic choice and we do use it in hsts code
nw="$nw -Wc90-c99-compat" # gcc-12, we use C99
nw="$nw -Wlong-long" # gcc-12, we use C99
if test "$cross_compiling" = yes; then
nw="$nw -Wformat"
fi
# remove unwanted warn flags
wget_WORD_REMOVE([WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
WARN_CFLAGS="$WARN_CFLAGS -Wno-undef -Wno-float-equal"
# add more flags as you like
if test $GCC_VERSION -ge 5; then
WARN_CFLAGS="$WARN_CFLAGS -fdiagnostics-color=always"
fi
if test "$cross_compiling" = yes; then
WARN_CFLAGS="$WARN_CFLAGS -Wno-format"
fi
if test $GCC_VERSION -ge 8; then
WARN_CFLAGS="$WARN_CFLAGS -Wno-cast-function-type"
fi
# WARN_CFLAGS="$WARN_CFLAGS -Werror"
# We use a slightly smaller set of warning options for lib/.
# Remove the following and save the result in GNULIB_WARN_CFLAGS.
# Removing is not enough if these switches are implicitly set by other
# flags like -Wall or -Wextra. We have to explicitly unset them
# with -Wno-....
nw=
nw="$nw -Wpedantic"
nw="$nw -Wsign-compare"
nw="$nw -Wunused-parameter"
nw="$nw -Wswitch-default"
nw="$nw -Wformat-nonliteral"
nw="$nw -Wsuggest-attribute=pure"
nw="$nw -Wunsafe-loop-optimizations"
nw="$nw -Wundef"
nw="$nw -Wswitch-enum"
nw="$nw -Wbad-function-cast"
nw="$nw -Wredundant-decls"
nw="$nw -Werror"
wget_WORD_REMOVE([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
wget_WORD_REMOVE([CFLAGS], [$CFLAGS], [-Werror])
# disable options implicitly set by other options
GNULIB_WARN_CFLAGS="-Wno-error $GNULIB_WARN_CFLAGS"
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-sign-compare -Wno-unused-parameter -Wno-alloca"
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-float-conversion -Wno-cast-function-type"
if test "$cross_compiling" = yes; then
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-incompatible-pointer-types"
fi
elif test "$CCNAME" = "clang"; then
# setup flags for this project
WARN_CFLAGS="$WARN_CFLAGS -Wno-system-headers -Wno-vla -Wno-cast-qual -Wno-padded"
WARN_CFLAGS="$WARN_CFLAGS -Wno-reserved-id-macro -Wno-sign-conversion -Wno-disabled-macro-expansion"
WARN_CFLAGS="$WARN_CFLAGS -Wno-documentation -Wno-documentation-unknown-command"
WARN_CFLAGS="$WARN_CFLAGS -Wno-covered-switch-default -Wno-unused-macros"
WARN_CFLAGS="$WARN_CFLAGS -Wno-missing-field-initializers"
# remove all flags from WARN_FLAGS that are already in CFLAGS
# wget_WORD_REMOVE([WARN_CFLAGS], [$WARN_CFLAGS], [$CFLAGS])
wget_WORD_REMOVE([CFLAGS], [$CFLAGS], [-Werror])
# disable verbose options
GNULIB_WARN_CFLAGS="-Wno-error $GNULIB_WARN_CFLAGS"
GNULIB_WARN_CFLAGS="$WARN_CFLAGS -Wno-sign-compare -Wno-unused-parameter -Wno-undef -Wno-format-nonliteral"
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-conversion -Wno-disabled-macro-expansion -Wno-c++98-compat"
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-gnu-statement-expression -Wno-shorten-64-to-32 -Wno-switch-enum"
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-unused-macros -Wno-missing-field-initializers"
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-gnu-zero-variadic-macro-arguments -Wno-conditional-uninitialized"
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-comma -Wno-assign-enum -Wno-unreachable-code -Wno-error"
GNULIB_WARN_CFLAGS="$GNULIB_WARN_CFLAGS -Wno-missing-field-initializers"
# remove all flags from GNULIB_WARN_FLAGS that are already in CFLAGS
# wget_WORD_REMOVE([GNULIB_WARN_CFLAGS], [$GNULIB_WARN_CFLAGS], [$CFLAGS])
fi
AC_SUBST([WARN_CFLAGS])
AC_SUBST([GNULIB_WARN_CFLAGS])
fi
dnl
@@ -325,6 +501,10 @@ AS_IF([test "x$with_libpsl" != xno], [
])
])
AS_IF([test x"$with_libpsl" = xyes], [
AC_CHECK_FUNCS(psl_latest)
])
AS_IF([test x"$with_zlib" != xno], [
with_zlib=yes
PKG_CHECK_MODULES([ZLIB], zlib, [
@@ -340,7 +520,7 @@ AS_IF([test x"$with_ssl" = xopenssl], [
if [test x"$with_libssl_prefix" = x]; then
PKG_CHECK_MODULES([OPENSSL], [openssl], [
AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
AC_LIBOBJ([openssl])
ssl_library="openssl"
LIBS="$OPENSSL_LIBS $LIBS"
CFLAGS="$OPENSSL_CFLAGS -DHAVE_LIBSSL $CFLAGS"
LIBSSL=" " # ntlm check below wants this
@@ -369,9 +549,9 @@ AS_IF([test x"$with_ssl" = xopenssl], [
AC_CHECK_LIB(ssl32, SSL_connect, [
ssl_found=yes
AC_MSG_NOTICE([Enabling support for SSL via OpenSSL (shared)])
AC_LIBOBJ([openssl])
ssl_library="openssl"
LIBS="${LIBS} -lssl32"
AC_DEFINE([HAVE_LIBSSL32], [1], [Define to 1 if you have the `ssl32' library (-lssl32).])
AC_DEFINE([HAVE_LIBSSL32], [1], [Define to 1 if you have the 'ssl32' library (-lssl32).])
],
AC_MSG_ERROR([openssl not found: shared lib eay32 found but ssl32 not found]))
@@ -398,7 +578,7 @@ AS_IF([test x"$with_ssl" = xopenssl], [
then
ssl_found=yes
AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
AC_LIBOBJ([openssl])
ssl_library="openssl"
LIBS="$LIBSSL $LIBS"
AC_CHECK_FUNCS([RAND_egd])
elif test x"$with_ssl" != x
@@ -417,7 +597,7 @@ AS_IF([test x"$with_ssl" = xopenssl], [
if [test x"$with_libgnutls_prefix" = x]; then
PKG_CHECK_MODULES([GNUTLS], [gnutls], [
AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
AC_LIBOBJ([gnutls])
ssl_library="gnutls"
LIBS="$GNUTLS_LIBS $LIBS"
CFLAGS="$GNUTLS_CFLAGS -DHAVE_LIBGNUTLS $CFLAGS"
AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define if using gnutls.])
@@ -432,7 +612,7 @@ AS_IF([test x"$with_ssl" = xopenssl], [
then
ssl_found=yes
AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
AC_LIBOBJ([gnutls])
ssl_library="gnutls"
LIBS="$LIBGNUTLS $LIBS"
else
AC_MSG_ERROR([GnuTLS has not been found. Use --with-ssl=openssl if you explicitly want OpenSSL.])
@@ -444,69 +624,37 @@ AS_IF([test x"$with_ssl" = xopenssl], [
]) # endif: --with-ssl == openssl?
dnl Enable NTLM if requested and if SSL is available.
if test x"$LIBSSL" != x || test "$ac_cv_lib_ssl32_SSL_connect" = yes
if test x"$ENABLE_NTLM" != xno
then
if test x"$ENABLE_NTLM" != xno
if test x"$LIBSSL" != x || test "$ac_cv_lib_ssl32_SSL_connect" = yes
then
ENABLE_NTLM=yes
AC_DEFINE([ENABLE_NTLM], 1,
[Define if you want the NTLM authorization support compiled in.])
AC_LIBOBJ([http-ntlm])
fi
else
AC_CHECK_LIB(nettle, nettle_md4_init, [HAVE_NETTLE=yes], [HAVE_NETTLE=no; AC_MSG_WARN(*** libnettle was not found. You will not be able to use NTLM)])
if test x"$HAVE_NETTLE" = xyes
then
AC_SUBST(NETTLE_LIBS, "-lnettle")
AC_DEFINE([HAVE_NETTLE], [1], [Use libnettle])
if test x"$ENABLE_NTLM" != xno
then
ENABLE_NTLM=yes
AC_DEFINE([ENABLE_NTLM], 1,
[Define if you want the NTLM authorization support compiled in.])
AC_LIBOBJ([http-ntlm])
LIBS="$NETTLE_LIBS $LIBS"
fi
AC_DEFINE([ENABLE_NTLM], 1, [Define if you want the NTLM authorization support compiled in.])
else
dnl If SSL is unavailable and the user explicitly requested NTLM,
dnl abort.
if test x"$ENABLE_NTLM" = xyes
then
AC_MSG_ERROR([NTLM authorization requested and SSL not enabled; aborting])
PKG_CHECK_MODULES([NETTLE], nettle, [
HAVE_NETTLE=yes
LIBS="$NETTLE_LIBS $LIBS"
CFLAGS="$NETTLE_CFLAGS $CFLAGS"
], [
AC_CHECK_LIB(nettle, nettle_md4_init, [HAVE_NETTLE=yes], [HAVE_NETTLE=no; AC_MSG_WARN(*** libnettle was not found. You will not be able to use NTLM)])
if test x"$HAVE_NETTLE" != xyes; then
if test x"$ENABLE_NTLM" = xyes; then
AC_MSG_ERROR([NTLM authorization requested and SSL not enabled; aborting])
fi
else
AC_SUBST(NETTLE_LIBS, "-lnettle")
LIBS="$NETTLE_LIBS $LIBS"
fi
])
if test x"$HAVE_NETTLE" = xyes; then
AC_DEFINE([HAVE_NETTLE], [1], [Use libnettle])
ENABLE_NTLM=yes
AC_DEFINE([ENABLE_NTLM], 1, [Define if you want the NTLM authorization support compiled in.])
fi
fi
fi
dnl
dnl Check for libmetalink
dnl
AS_IF([test x"$with_metalink" != xno], [
PKG_CHECK_MODULES([METALINK], libmetalink, [
LIBS="$METALINK_LIBS $LIBS"
CFLAGS="$METALINK_CFLAGS $CFLAGS"
AC_DEFINE([HAVE_METALINK], [1], [Define if using metalink.])
with_metalink=yes
], [
with_metalink=no
])
have_gpg=no
AS_IF([test x"$with_metalink" = xyes], [
dnl
dnl Check for GPGME
dnl
m4_ifdef([AM_PATH_GPGME], [
AM_PATH_GPGME([], [
LIBS="$GPGME_LIBS $LIBS"
CFLAGS="$GPGME_CFLAGS $CFLAGS"
AC_DEFINE([HAVE_GPGME], [1], [Define if GPGME is available.])
have_gpg=yes
])
])
])
])
dnl **********************************************************************
dnl Checks for IPv6
dnl **********************************************************************
@@ -524,7 +672,7 @@ dnl is to autodetect IPv6 and use it where available.
dnl
AC_ARG_ENABLE(ipv6,
AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
AS_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
[case "${enable_ipv6}" in
no)
AC_MSG_NOTICE([disabling IPv6 at user request])
@@ -541,7 +689,7 @@ AC_ARG_ENABLE(ipv6,
ipv6=yes
;;
*)
AC_MSG_ERROR([Invalid --enable-ipv6 argument \`$enable_ipv6'])
AC_MSG_ERROR([Invalid --enable-ipv6 argument '$enable_ipv6'])
;;
esac
], [
@@ -559,7 +707,7 @@ fi
if test "X$ipv6" = "Xyes"; then
TYPE_STRUCT_SOCKADDR_IN6([],[
AC_MSG_NOTICE([Disabling IPv6 support: your system does not support \`struct sockaddr_in6'])
AC_MSG_NOTICE([Disabling IPv6 support: your system does not support 'struct sockaddr_in6'])
ipv6=no
])
if test "X$ipv6" = "Xyes"; then
@@ -577,9 +725,9 @@ fi
dnl
dnl Find makeinfo. We used to provide support for Emacs processing
dnl Texinfo using `emacs -batch -eval ...' where makeinfo is
dnl Texinfo using 'emacs -batch -eval ...' where makeinfo is
dnl unavailable, but that broke with the addition of makeinfo-specific
dnl command-line options, such as `-I'. Now we depend on makeinfo to
dnl command-line options, such as '-I'. Now we depend on makeinfo to
dnl build the Info documentation.
dnl
@@ -605,7 +753,7 @@ dnl Check for IDN/IRIs
dnl
AC_ARG_ENABLE(iri,
AC_HELP_STRING([--disable-iri],[disable IDN/IRIs support]),
AS_HELP_STRING([--disable-iri],[disable IDN/IRIs support]),
[case "${enable_iri}" in
no)
dnl Disable IRIs checking
@@ -622,7 +770,7 @@ AC_ARG_ENABLE(iri,
iri=yes
;;
*)
AC_MSG_ERROR([Invalid --enable-iri argument \`$enable_iri'])
AC_MSG_ERROR([Invalid --enable-iri argument '$enable_iri'])
;;
esac
], [
@@ -631,12 +779,7 @@ AC_ARG_ENABLE(iri,
]
)
AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=[DIR]],
[Support IDN/IRIs (needs GNU Libidn)]),
libidn=$withval, libidn="")
AS_IF([test "X$iri" != "Xno"],[
AM_ICONV
if test "X$am_cv_func_iconv" != "Xyes"; then
iri=no
if test "X$force_iri" = "Xyes"; then
@@ -645,47 +788,28 @@ AS_IF([test "X$iri" != "Xno"],[
AC_MSG_NOTICE([disabling IRIs because libiconv wasn't found])
fi
fi
],[ # else
# For some reason, this seems to be set even when we don't check.
# Explicitly unset.
LIBICONV=
])
if test "X$iri" != "Xno"; then
if test "$libidn" != ""; then
LDFLAGS="${LDFLAGS} -L$libidn/lib"
CPPFLAGS="${CPPFLAGS} -I$libidn/include"
fi
# If idna.h can't be found, check to see if it was installed under
# /usr/include/idn (OpenSolaris, at least, places it there).
# Check for idn-int.h in that case, because idna.h won't find
# idn-int.h until we've decided to add -I/usr/include/idn.
AC_CHECK_HEADER(idna.h, ,
[AC_CHECK_HEADER(idn/idn-int.h,
[CPPFLAGS="${CPPFLAGS} -I/usr/include/idn"],
[iri=no])]
)
if test "X$iri" != "Xno"; then
AC_CHECK_LIB(idn, stringprep_check_version,
[iri=yes LIBS="${LIBS} -lidn"], iri=no)
fi
if test "X$iri" != "Xno" ; then
AC_DEFINE([ENABLE_IRI], 1, [Define if IRI support is enabled.])
AC_MSG_NOTICE([Enabling support for IRI.])
else
AC_MSG_WARN([Libidn not found])
fi
AS_IF([test "x$with_libidn2" != xno], [
PKG_CHECK_MODULES([LIBIDN2], [libidn2 >= 0.14.0], [
with_libidn2=yes
LIBS="$LIBIDN2_LIBS $LIBS"
CFLAGS="$LIBIDN2_CFLAGS $CFLAGS"
AC_DEFINE([ENABLE_IRI], 1, [Define if IRI support is enabled.])
], [
AC_SEARCH_LIBS(idn2_lookup_u8, idn2,
[with_libidn2=yes; AC_DEFINE([ENABLE_IRI], 1, [Define if IRI support is enabled.])],
[with_libidn2=no; iri=no; AC_MSG_WARN(*** LIBIDN2 was not found. You will not be able to use IDN2008 support)])
])
])
fi
dnl
dnl Check for UUID
dnl
AC_ARG_WITH(libuuid, AC_HELP_STRING([--without-libuuid],
[Generate UUIDs for WARC files via libuuid]))
AC_ARG_WITH(libuuid, AS_HELP_STRING([--without-libuuid],[Generate UUIDs for WARC files via libuuid]))
AS_IF([test "x$with_libuuid" = xyes], [
# libuuid was explicitly requested
@@ -719,18 +843,37 @@ AS_IF([test "x$uuid_mode" = x1], [
])
dnl
dnl Check for PCRE
dnl Check for PCRE2 / PCRE
dnl
AC_ARG_ENABLE(pcre, AC_HELP_STRING([--disable-pcre],
[Disable PCRE style regular expressions]))
AC_ARG_ENABLE(pcre2, AS_HELP_STRING([--disable-pcre2],[Disable PCRE2 style regular expressions]))
AC_ARG_ENABLE(pcre, AS_HELP_STRING([--disable-pcre],[Disable PCRE style regular expressions]))
AS_IF([test "X$enable_pcre" != "Xno"],[
AS_IF([test "X$enable_pcre2" != "Xno"],[
enable_pcre2=no
PKG_CHECK_MODULES([PCRE2], libpcre2-8, [
CFLAGS="$PCRE2_CFLAGS $CFLAGS"
LIBS="$PCRE2_LIBS $LIBS"
AC_DEFINE([HAVE_LIBPCRE2], [1], [Define if libpcre2 is available.])
enable_pcre2=yes
], [
AC_CHECK_HEADER(pcre2.h, [
AC_CHECK_LIB(pcre2-8, pcre2_compile_8, [
LIBS="${LIBS} -lpcre2-8"
AC_DEFINE([HAVE_LIBPCRE2], 1, [Define if libpcre2 is available.])
enable_pcre2=yes
])
])
])
])
AS_IF([test "X$enable_pcre" != "Xno" && test "X$enable_pcre2" != "Xyes"],[
PKG_CHECK_MODULES([PCRE], libpcre, [
CFLAGS="$PCRE_CFLAGS $CFLAGS"
AC_CHECK_HEADER(pcre.h, [
LIBS="$PCRE_LIBS $LIBS"
AC_DEFINE([HAVE_LIBPCRE], [1], [Define if libpcre is available.])
enable_pcre=yes
])
], [
AC_CHECK_HEADER(pcre.h, [
@@ -742,18 +885,130 @@ AS_IF([test "X$enable_pcre" != "Xno"],[
])
])
AS_IF([test "X$enable_pcre2" = Xyes], [PCRE_INFO="yes, via libpcre2"], [test "X$enable_pcre" = Xyes], [PCRE_INFO="yes, via libpcre"], [PCRE_INFO=no])
dnl
dnl Check for libcares (resolver library)
dnl
AS_IF([test "X$with_cares" = "Xyes"],[
PKG_CHECK_MODULES([CARES], libcares, [
CFLAGS="$CARES_CFLAGS $CFLAGS"
AC_CHECK_HEADER(ares.h, [
LIBS="$CARES_LIBS $LIBS"
AC_DEFINE([HAVE_LIBCARES], [1], [Define if libcares is available.])
RESOLVER_INFO="libcares, --bind-dns-address and --dns-servers available"
])
], [
AC_CHECK_HEADER(ares.h, [
AC_CHECK_LIB(cares, ares_set_local_ip4, [
LIBS="-lcares ${LIBS}"
AC_DEFINE([HAVE_LIBCARES], 1, [Define if libcares is available.])
RESOLVER_INFO="libcares, --bind-dns-address and --dns-servers available"
])
])
])
], [
RESOLVER_INFO="libc, --bind-dns-address and --dns-servers not available"
])
dnl
dnl Check for libmetalink
dnl
AS_IF([test x"$with_metalink" != xno], [
PKG_CHECK_MODULES([METALINK], libmetalink, [
LIBS="$METALINK_LIBS $LIBS"
CFLAGS="$METALINK_CFLAGS $CFLAGS"
AC_DEFINE([HAVE_METALINK], [1], [Define if using metalink.])
with_metalink=yes
], [
with_metalink=no
])
have_gpg=no
AS_IF([test x"$with_metalink" = xyes], [
dnl
dnl Check for GPGME
dnl
PKG_CHECK_MODULES([GPGME], gpgme, [
LIBS="$LIBS $GPGME_LIBS"
CFLAGS="$GPGME_CFLAGS $CFLAGS"
AC_DEFINE([HAVE_GPGME], [1], [Define if GPGME is available.])
have_gpg=yes
], [
m4_ifdef([AM_PATH_GPGME], [
AM_PATH_GPGME([], [
# Put libgpgme to the end of the library list since it introduces a -L linker flags.
# That -L might break the build if there are two different version of
# a library (e.g. GnuTLS) in /usr/local and in the system directory.
LIBS="$LIBS $GPGME_LIBS"
CFLAGS="$GPGME_CFLAGS $CFLAGS"
AC_DEFINE([HAVE_GPGME], [1], [Define if GPGME is available.])
have_gpg=yes
])
])
])
])
])
dnl
dnl libproxy support
dnl
with_libproxy=no
AC_ARG_ENABLE(libproxy,
[ --enable-libproxy libproxy support for system wide proxy configuration])
AS_IF([test "${enable_libproxy}" = "yes"], [
with_libproxy=yes
PKG_CHECK_MODULES([LIBPROXY], [libproxy-1.0], [
LIBS="$LIBPROXY_LIBS $LIBS"
CFLAGS="$LIBPROXY_CFLAGS $CFLAGS"
AC_DEFINE([HAVE_LIBPROXY], [1], [Define if using libproxy.])
])
])
dnl
dnl Extended Attribute support
dnl
AC_ARG_ENABLE([xattr],
[AS_HELP_STRING([--disable-xattr], [disable support for POSIX Extended Attributes])],
[ENABLE_XATTR=$enableval],
[ENABLE_XATTR=yes])
case "$host_os" in
*linux* | *darwin*) xattr_syscalls="fsetxattr" ;;
freebsd*) xattr_syscalls="extattr_set_fd" ;;
*) AC_MSG_NOTICE([Disabling Extended Attribute support: your system is not known to support extended attributes.])
ENABLE_XATTR=no
esac
if test "X${ENABLE_XATTR}" = "Xyes"; then
AC_CHECK_FUNCS([$xattr_syscalls], [], [
AC_MSG_NOTICE([Disabling Extended Attribute support: your system does not support $xattr_syscalls])
ENABLE_XATTR=no
])
fi
test "X${ENABLE_XATTR}" = "Xyes" && AC_DEFINE([ENABLE_XATTR], 1,
[Define if you want file meta-data storing into POSIX Extended Attributes compiled in.])
dnl Needed by src/Makefile.am
AM_CONDITIONAL([IRI_IS_ENABLED], [test "X$iri" != "Xno"])
AM_CONDITIONAL([WITH_IRI], [test "X$iri" != "Xno"])
AM_CONDITIONAL([WITH_SSL], [test "X$with_ssl" != "Xno"])
AM_CONDITIONAL([METALINK_IS_ENABLED], [test "X$with_metalink" != "Xno"])
AM_CONDITIONAL([WITH_METALINK], [test "X$with_metalink" != "Xno"])
AM_CONDITIONAL([WITH_XATTR], [test "X$ENABLE_XATTR" != "Xno"])
AM_CONDITIONAL([WITH_NTLM], [test "X$ENABLE_NTLM" = "Xyes"])
AM_CONDITIONAL([WITH_OPIE], [test x"$ENABLE_OPIE" = x"yes"])
AM_CONDITIONAL([WITH_OPENSSL], [test x"$ssl_library" = x"openssl"])
AM_CONDITIONAL([WITH_GNUTLS], [test x"$ssl_library" = x"gnutls"])
dnl
dnl Create output
dnl
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile
po/Makefile.in tests/Makefile
lib/Makefile testenv/Makefile])
po/Makefile.in gnulib_po/Makefile.in tests/Makefile
fuzz/Makefile lib/Makefile testenv/Makefile
tests/certs/interca.conf tests/certs/rootca.conf])
AC_CONFIG_HEADERS([src/config.h])
AC_OUTPUT
@@ -763,18 +1018,24 @@ AC_MSG_NOTICE([Summary of build options:
Host OS: $host_os
Install prefix: $prefix
Compiler: $CC
CFlags: $CFLAGS $CPPFLAGS
CFlags: $CFLAGS $CPPFLAGS $WARN_CFLAGS
LDFlags: $LDFLAGS
Libs: $LIBS
SSL: $with_ssl
Zlib: $with_zlib
PSL: $with_libpsl
PCRE: $PCRE_INFO
Digest: $ENABLE_DIGEST
NTLM: $ENABLE_NTLM
OPIE: $ENABLE_OPIE
POSIX xattr: $ENABLE_XATTR
Debugging: $ENABLE_DEBUG
Assertions: $ENABLE_ASSERTION
Valgrind: $VALGRIND_INFO
Metalink: $with_metalink
Resolver: $RESOLVER_INFO
GPGME: $have_gpg
IRI: $iri
Fuzzing build: $enable_fuzzing, $LIB_FUZZING_ENGINE
libproxy: $with_libproxy
])

View File

@@ -12,7 +12,8 @@ if [ $CORES -lt 1 ]; then CORES=1; fi
echo "Running: make distclean"
make distclean > /dev/null || true
CFLAGS="-std=c89 -pedantic -O2 -g -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition"
#CFLAGS="-std=c89 -pedantic -O0 -g -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition"
CFLAGS="-Wall -Wextra -O2 -g"
CACHEFILE=$PWD/config_check.cache
@@ -30,7 +31,7 @@ for CC in gcc clang; do
# the compiler changed, so we have to remove the cache file here
rm -f $CACHEFILE
for options in "" "--with-ssl=openssl"; do
for options in "" "--with-ssl=openssl" "--disable-iri"; do
export DISTCHECK_CONFIGURE_FLAGS="-C --cache-file=$CACHEFILE $options"
echo " ./configure $DISTCHECK_CONFIGURE_FLAGS"
./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS" > /dev/null

48
contrib/commit-check Executable file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env sh
# Copyright (c) 2018-2022, 2024 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -e
set -u
AUTHOR=$(git log -n1 --format='%aN')
EMAIL=$(git log -n1 --format='%aE')
DOMAIN=$(echo "$EMAIL" | cut -d'@' -f2)
EMAIL_PARSE=$(echo "$EMAIL" | sed 's/@/ \\[at\\] /g')
retval=0
echo "The last commit is made by $AUTHOR: $EMAIL_PARSE"
if git cat-file -p HEAD | grep "^Copyright-paperwork-exempt: Yes"; then
echo "This work is copyright paperwork exempt."
elif ! grep -E -q "^\\[ASSGN\\] .* \\*($EMAIL_PARSE|$DOMAIN)\\*$" AUTHORS; then
if grep -E -q "^\\[ *\\] .* \\*($EMAIL_PARSE|$DOMAIN)\\*$" AUTHORS; then
echo "The author is known, but did not yet complete the FSF Copyright Assignment."
else
echo "The author was not found in the AUTHORS file."
echo "Has the author completed the FSF Copyright Assignment?"
fi
echo
echo "If the commit is minor, please add this to the commit message:"
echo "Copyright-paperwork-exempt: Yes"
retval=1
else
echo "The author or company was found in the AUTHORS file."
echo "This work may be merged into master"
fi
exit $retval

123
contrib/make-release Executable file
View File

@@ -0,0 +1,123 @@
#!/usr/bin/env bash
# GNU Wget: Make a new release
#
# This is a helper script to make a new release of GNU Wget
#
# Author: Darshit Shah <darnir@gnu.org>
set -e
set -o pipefail
set -u
export CFLAGS="-g -O2 -Wall"
export LC_ALL=C
EXTENSIONS="gzip lzip"
ask_continue() {
printf "Continue? [y/N]: "
read -r inp
[ "$inp" != "y" ] && [ "$inp" != "Y" ] && exit 1
# For some completely weird reason, this set +x is required. Else, the test
# *ALWAYS* fails
set +x
}
REQUIRED_PROGRAMS="ncftpput sponge cvs ssh rsync rsh"
for prog in $REQUIRED_PROGRAMS; do
if ! command -v "$prog" >/dev/null 2>&1; then
2>&1 echo "Required program $prog not found. Please install before proceeding"
exit 1
fi
done
if [ ! -d ".git" ]; then
2>&1 echo "Please run this script from the root of the git repository"
exit 1
fi
if [ $# -ne 2 ]; then
2>&1 echo "Usage: $0 [version] [release-type]"
exit 1
fi
readonly VERSION="$1" && shift
readonly REL_TYPE_IN="$1" && shift
REL_TYPE=
case $REL_TYPE_IN in
a|A|alpha|Alpha) REL_TYPE=alpha;;
b|B|beta|Beta) REL_TYPE=beta;;
s|S|stable|Stable) REL_TYPE=stable;;
esac
echo "This script will make a new release and upload it to the GNU FTP Servers"
echo "Will run git clean -dxf to get a clean dir"
ask_continue
# Make sure we have a clean working directory
git clean -dxfq
echo "=> Bootstrap"
./bootstrap > /dev/null 2>&1
autoreconf -ivf
echo "=> Configure"
./configure -q
echo "Building $APP_NAME v$VERSION $REL_TYPE"
ask_continue
LNO_CVER=$(grep -in "Noteworthy changes in release" NEWS | head -1 | tail -1 | cut -f1 -d:)
LNO_PVER=$(grep -in "Noteworthy changes in release" NEWS | head -2 | tail -1 | cut -f1 -d:)
sed -n "${LNO_CVER},${LNO_PVER}p" NEWS
echo "This is the current contents of your NEWS"
ask_continue
export RELEASE="$VERSION $REL_TYPE"
echo "=> Making release-commit"
make -s release-commit
echo "=> Make release"
make -s release
GPG_KEY=
while [ -z $GPG_KEY ]; do
printf "Enter GPG Key ID for Signing: "
read key
gpg --list-keys "$key" || continue
printf "Will use this key to sign releases. Continue? [y/N]: "
read x
[ "$x" = "y" ] || [ "$x" = "Y" ] && GPG_KEY="$key"
done
echo ""
upload_command=$(make -s emit_upload_commands \
| sponge \
| head -n3 \
| tail -1 \
| sed "s/--to/--user $GPG_KEY --symlink-regex --to/g"
)
echo "=> Uploading"
echo "Upload tarballs?"
echo "$upload_command"
ask_continue
$upload_command
if [[ $REL_TYPE == "stable" ]]; then
export CVSROOT=:ext:${CVSUSER:-${USER}}@cvs.savannah.gnu.org:/web/wget
export CVS_RSH=/usr/bin/ssh
export gendocs_options_=-I ../build-aux
make web-manual-update
fi
echo ""
echo "Remaining Release Checklist:
1. Send a mail to coordinator@translationproject.org with the subject
\"Requesting Translations for $APP_NAME-$VERSION.POT\"
2. Announce email template placed at ~/announce-$APP_NAME-$VERSION
Send an announce mail to info-gnu@gnu.org
"

25
contrib/mk_authors Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
prev_tag=`git tag --sort=taggerdate|tail -1`
echo -e "The authors list is autogenerated from the git history; sorted by number of commits\n"
(
if [ -z $prev_tag ]; then
git shortlog -sen
else
git shortlog -sen ${prev_tag}..
fi
) | cut -f 2 | sed 's/@/ at /g'
#(
#if [ -z $prev_tag ]; then
# git log --reverse|grep -i reported|cut -d':' -f2|cut -d'<' -f1|cut -d' ' -f2-|tr -d '"'
#else
# git log ${prev_tag}.. --reverse|grep -i reported|cut -d':' -f2|cut -d'<' -f1|cut -d' ' -f2-|tr -d '"'
#fi
#) | sort -u
echo -e "\n\nThe translators list is autogenerated from po file history\n"
sed -n 's/.*Last-Translator: *\(.*\) *<.*/\1/p' po/*.po | sort -u

123
contrib/release Executable file
View File

@@ -0,0 +1,123 @@
#!/bin/bash -e
#
# Written 2016 by Tim Ruehsen
#
# To get the version number right: add a signed tag and
# make sure the working dir is clean (git diff).
# If that fails, put the version into '.tarball-version'.
export CFLAGS="-g -O2 -Wall"
echo
echo "* Bootstrap"
#./bootstrap >/dev/null
echo
echo "* Configure"
#./configure -q
extensions="gz lz"
app_name=$(grep "^PACKAGE_NAME='" configure|cut -d "'" -f2)
app_ver=$(grep "^PACKAGE_VERSION='" configure|cut -d "'" -f2)
echo "Current version of $app_name is $app_ver"
echo
echo -n "Is that OK ? [y/N] "
read x
[ "$x" != "y" -a "$x" != "Y" ] && exit 0
echo
grep -i "Changes in $app_name" NEWS|head -1
echo -n "Did you edit the NEWS file ? [y/N] "
read x
[ "$x" != "y" -a "$x" != "Y" ] && exit 0
echo
echo "* Make"
#make -s clean
#make -s
echo
echo "* Make distcheck"
#make -s distcheck >/dev/null
echo
echo "* Make dist"
for ext in $extensions; do
[[ $ext = 'gz' ]] && ext="gzip"
[[ $ext = 'lz' ]] && ext="lzip"
make -s dist-$ext >/dev/null
done
while true; do
echo "Alpha or Regular release ? [R/A] "
read x
if test "$x" = "r" || test "$x" = "R"; then
directory="/incoming/ftp"
break
elif test "$x" = "a" || test "$x" = "A"; then
directory="/incoming/alpha"
break
fi
done
x=$(gpg --list-secret-keys 2>/dev/null|grep ^sec|awk '{ print $2 }')
echo $x
if [ "$x" = "" ]; then
echo No signing key found - please check with 'gpg --list-secret-keys'
exit 1
fi
# arrays just work in Bash
keys=($x)
if [ ${#keys[@]} -eq 1 ]; then
IFS='/' arr=($x)
signing_key=${arr[1]}
else
for ((i=0; i < ${#keys[@]}; i++)); do
echo "$((i+1))) ${keys[i]}"
done
while true; do
echo -n "Enter 1-${#keys[@]}: "
read x
# check for digits only
if [ -n "${i//[0-9]/}" ]; then continue; fi
if test $x -ge 1 || test $x -le ${#keys[@]}; then
IFS='/' arr=(${keys[$((x-1))]})
signing_key=${arr[1]}
break
fi
done
fi
unset IFS
echo
echo -n "Really upload to ftp-upload.gnu.org/$directory ? "
read x
[ "$x" != "y" -a "$x" != "Y" ] && exit 0
for ext in $extensions; do
app_tarball="${app_name}-${app_ver}.tar.$ext"
gpg --default-key $signing_key --yes -b $app_tarball
echo -e "version: 1.2\nfilename: ${app_tarball}\ndirectory: ${app_name}\n" >${app_tarball}.directive
gpg --default-key $signing_key --yes --clearsign ${app_tarball}.directive
ftp -v -n -i -p ftp-upload.gnu.org <<EOF
user anonymous
cd $directory
put ${app_tarball}
put ${app_tarball}.sig
put ${app_tarball}.directive.asc
EOF
done
prev_tag=`git tag|tail -2|head -1`
echo "Don't forget to mention the following contributors in the announcement:"
(
git log ${prev_tag}.. --format="%aN" --reverse
git log ${prev_tag}.. --reverse|grep -i reported|cut -d':' -f2|cut -d'<' -f1|cut -d' ' -f2-|tr -d '"'
) | sort -u

14
contrib/spell-checker Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
#
# see https://github.com/codespell-project/codespell
#
# in short:
# - pip install codespell
# - add ~/.local/bin to PATH
set -e
codespell $* -L "tim,gonna,cas,referer,fpr,vas,msdos,ifset,ba,tage,tolen,files',hist,lightening,wither,parm" `git ls-files|\
egrep -v '_fuzzer.in|_fuzzer.repro|\.der$|\.pem$|gnulib|ChangeLog|tests/gpg|\.png$|\.dat$|contrib/spell-checker|tests/certs/.*\.crt'`
#codespell $* -L "tim,gonna,cas,te,referer,ist,fpr,vas" src/wget.c contrib/spell-checker

View File

@@ -1,60 +0,0 @@
#!/bin/bash
# Set a stricter bash mode
set -e
set -u
# Set up the subset of tests this Matrix instance will run.
# One instance is forked for each of the SSL library possibilities
SSL=${1:-""}
case $SSL in
"") SSL_LIB="--without-ssl";;
"openssl") SSL_LIB="--with-ssl=openssl";;
"gnutls") SSL_LIB="--with-ssl=gnutls";;
esac
# For some reason. /proc/cpuinfo reports 16 cores on Travis, while the docs
# claim that each instance has only 2 cores. We believe the docs and force a
# value of n+1 here.
CORES=3
# Define a large number of Warning flags for the compiler. Hopefully, someone
# will sit and analyze the output to clean the warnings from the codebase.
CFLAGS="-std=c89 -pedantic -O2 -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition"
# A cachefile for ./configure. Saves significant time when reconfiguring
CACHEFILE=$PWD/config_check.cache
# measure time consumed and print it at the end of the script
START=$(date +%s)
# Test different Permutations of Wget. Always under Valgrind
#
# Options:
# - All Features Enabled
# - C [Default Locale]
# - Russian [Multibyte / Multicolumn Locale]
# - Turkish [Special Test due to issues with language]
# - IPv6 Disabled
# - C
for options in "" "--disable-ipv6"; do
export DISTCHECK_CONFIGURE_FLAGS="-C --cache-file=$CACHEFILE --enable-assert --enable-valgrind-tests $SSL_LIB $options"
echo " ./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS=\"$CFLAGS\""
./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS"
if [[ -z $options ]]; then
LANG_ARR=("ru_RU.UTF-8" "tr_TR.UTF-8" "C")
else
LANG_ARR=("C")
fi
for xLCALL in "${LANG_ARR[@]}"; do
export TESTS_ENVIRONMENT="LC_ALL=$xLCALL VALGRIND_TESTS=1"
echo " TESTS_ENVIRONMENT=\"$TESTS_ENVIRONMENT\" make distcheck CFLAGS=$CFLAGS -j$CORES"
make distcheck CFLAGS="$CFLAGS" -j$CORES
done
done
END=$(date +%s)
echo "Duration: $((END-START))"

View File

@@ -1,6 +1,6 @@
# Makefile for `wget' utility
# Copyright (C) 1995, 1996, 1997, 2007, 2008, 2009, 2010, 2011, 2015
# Free Software Foundation, Inc.
# Copyright (C) 1995-1997, 2007-2011, 2015, 2018-2024 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -57,7 +57,8 @@ wget.pod: $(srcdir)/wget.texi version.texi
$(TEXI2POD) -D VERSION="$(VERSION)" $(srcdir)/wget.texi $@
$(MAN): wget.pod
$(POD2MAN) --center="GNU Wget" --release="GNU Wget @VERSION@" --utf8 $? > $@
$(POD2MAN) --center="GNU Wget" --release="GNU Wget @VERSION@" --utf8 $? > $@ || \
$(POD2MAN) --center="GNU Wget" --release="GNU Wget @VERSION@" $? > $@
#wget.cat: $(MAN)
# nroff -man $? > $@

104
doc/announcement_1.19.txt Normal file
View File

@@ -0,0 +1,104 @@
Hello,
we are pleased to announce the new version of GNU wget 1.19.
It comes with major improvements for Metalink, IDNA2008 for
international domain names, an option to call external tools
for fetching user/password, several bugfixes and improvements.
Many thanks go to all the contributors and list activists !
Contributors (from the git log):
Ander Juaristi
Dale R. Worley
Eli Zaretskii
Gisle Vanem
Giuseppe Scrivano
Göran Uddeborg
Jann Horn
Jeffery To
Jérémie Courrèges-Anglas
Liam R. Howlett
losgrandes
Matthew White
Misra, Deapesh
Nikos Mavrogiannopoulos
Noël Köthe
Piotr Wajda
Rahul Bedarkar
Sean Burford
Tim Rühsen
Tobias Stoeckmann
vijeth-aradhya
The new version is available for download here:
https://ftp.gnu.org/gnu/wget/wget-1.19.tar.gz
https://ftp.gnu.org/gnu/wget/wget-1.19.tar.xz
and the GPG detached signatures using the key 0x08302DB6A2670428:
https://ftp.gnu.org/gnu/wget/wget-1.19.tar.gz.sig
https://ftp.gnu.org/gnu/wget/wget-1.19.tar.xz.sig
To reduce load on the main server, you can use this redirector service
which automatically redirects you to a mirror:
http://ftpmirror.gnu.org/wget/wget-1.19.tar.gz
http://ftpmirror.gnu.org/wget/wget-1.19.tar.xz
Noteworthy changes:
* New option --use-askpass=COMMAND. Fetch user/password by calling
an external program.
* Use IDNA2008 (+ TR46 if available) through libidn2
* When processing a Metalink header, --metalink-index=<number> allows
to process the header's application/metalink4+xml files.
* When processing a Metalink file, --trust-server-names enables the
use of the destination file names specified in the Metalink file,
otherwise a safe destination file name is computed.
* When processing a Metalink file, enforce a safe destination path.
Remove any drive letter prefix under w32, i.e. 'C:D:file'. Call
libmetalink's metalink_check_safe_path() to prevent absolute,
relative, or home paths:
https://tools.ietf.org/html/rfc5854#section-4.1.2.1
https://tools.ietf.org/html/rfc5854#section-4.2.8.3
* When processing a Metalink file, --directory-prefix=<prefix> sets
the top of the retrieval tree to prefix for Metalink downloads.
* When processing a Metalink file, reject downloaded files which don't
agree with their own metalink:size value:
https://tools.ietf.org/html/rfc5854#section-4.2.16
* When processing a Metalink file, with --continue resume partially
downloaded files and keep fully downloaded files even if they fail
the verification.
* When processing a Metalink file, create the parent directories of a
"path/file" destination file name:
https://tools.ietf.org/html/rfc5854#section-4.1.2.1
https://tools.ietf.org/html/rfc5854#section-4.2.8.3
* On a recursive download, append a .tmp suffix to temporary files
that will be deleted after being parsed, and create them
readable/writable only by the owner.
* New make target 'check-valgrind'
* Fix several bugs
* Fix compatibility issues
Please report any problem you may experience to the bug-wget@gnu.org
mailing list.
For the maintainers of Wget,
Tim

View File

@@ -5,8 +5,8 @@
@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008, 2015 Free Software
Foundation, Inc.
Copyright @copyright{} 2000--2002, 2007--2008, 2015, 2018--2024 Free
Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies

233
doc/metalink-standard.txt Normal file
View File

@@ -0,0 +1,233 @@
GNU Wget Metalink recommended behaviour
Metalink/XML and Metalink/HTTP standard reference
1. Security features
********************
Only metalink:file elements with safe "name" fields shall be accepted
[1 #section-4.1.2.1]. If unsafe metalink:file elements are saved, any
related test shall fail (see '2. Tests').
By design, libmetalink rejects unsafe metalink:file elements [3]:
* lib/metalink_helper.c (metalink_check_safe_path): Verify path
1.1 Exceptions
==============
The option --directory-prefix could allow to use an absolute, relative
or home path.
2. Tests
********
Saving a file to an unexpected path poses a security problem. We must
ensure that Wget's automated tests never modify the root and the home
paths or descend/escalate to a relative path unexpectedly.
2.1 Metalink/XML implemented tests
==================================
See testenv/Makefile.am (METALINK_TESTS).
2.2 Metalink/HTTP implemented tests
===================================
See testenv/Makefile.am (METALINK_TESTS).
3. Download file name
*********************
The download file name shall be decided by precise rules which prevent
any naming uncertainty and security issues.
3.1 Naming rules
================
The final name of downloaded files is computed starting from a trusted
name, which is then combined with the "Directory Options". The result
is verified and eventually made safer following security rules. If the
final name isn't found safe enough, then the file isn't downloaded.
Depending on the options used, a suffix could be appended to the final
name to not overwrite existing files.
3.1.1 The trusted name
======================
The option --trust-server-names decides what is the trusted name.
Any Metalink/XML element with an unsafe metalink:file "name" field is
ignored, see '1. Security features'.
3.1.1.1 Without --trust-server-names
====================================
When --trust-server-names is off, the basename of the --input-metalink
file, if available, or of the mother URL is trusted. This trusted name
is the radix of any subsequent file name.
When a Metalink/HTTP in encountered, any fetched Metalink/XML file has
its own ordinal number appended as suffix to the trusted name. In this
case scenario, an unique Metalink/XML file is saved each time applying
an additional suffix to the currently computed name when necessary.
The files described by a Metalink/XML file will be named sequentially
applying an additional suffix to the currently trusted/computed name.
3.1.1.2 With --trust-server-names
=================================
When --trust-server-names is on, the metalink:file "name" field parsed
from Metalink/XML files is trusted. When no Metalink/XML is available,
the mother URL is trusted.
Any Metalink/HTTP application/metalink4+xml file is saved using the
basename of its own Link header "name" field, if available.
In conjunction with the option --content-disposition, a 'Content-Type:
application/metalink4+xml' file is saved using the basename of its own
Content-Disposition header "filename" field, if available.
3.1.2 The final name
====================
The "Directory Options" are combined with the trusted name. The result
is evaluated again by the '1. Security features'. If the path is found
unsafe, only the basename of the final name is considered. If this is
found unsafe too, the file is not downloaded.
4. Metalink/XML
***************
4.1 Example files
=================
See [1 #section-1.1].
cat > bogus.meta4 << EOF
<?xml version="1.0" encoding="UTF-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
<file name="/dir/A/File1">
<size>1617</size>
<hash type="sha256">ecb3dff2648667513e31554b3ad054ccd89fce38e33367c9459ac3a285153742</hash>
<url>http://another.url/common_name</url>
<url>http://ftpmirror.gnu.org/bash/bash-4.3-patches/bash43-001</url>
</file>
<file name="dir/B/File2">
<size>1594</size>
<hash type="sha256">eee7cd7062ab29a9e4f02924d9c367264dcb8b162703f74ff6eb8f175a91502b</hash>
<url>http://another.url/again/common_name</url>
<url>http://ftpmirror.gnu.org/bash/bash-4.3-patches/bash43-002</url>
</file>
</metalink>
EOF
4.2 Command line example
========================
$ wget --input-metalink=bogus.meta4
4.3 Metalink/XML file parsing
=============================
The metalink xml file is parsed by one of the following libmetalink's
functions [3], depending upon the library configured to use:
* lib/libexpat_metalink_parser.c (metalink_parse_file): Expat [4]
* lib/libxml2_metalink_parser.c (metalink_parse_file): Libxml2 [5]
The result returned doesn't include unsafe metalink:file elements, as
stated at point '1. Security features'.
An empty result shall not be considered an error. Parsing errors will
be informed to the caller of libmetalink's metalink_parse_file().
4.4 Saving files
================
Fetched metalink:file elements shall be wrote using the unique "name"
field as file name [1 #section-4.1.2.1].
A metalink:file url's file name shall not substitute the "name" field.
Security exceptions are explained in '3. Download file name'.
4.5 Multi-Source download
=========================
Parallel range requests are allowed [1 #section-1].
5. Metalink/HTTP
****************
5.1 HTTP server
===============
The local server http://127.0.0.1 is used as reference in the course
of this chapter. Any server service capable of sending Metalink/HTTP
header answers may be used.
5.2 Command line example
========================
$ wget --metalink-over-http http://127.0.0.1/dir/file.ext
5.3 Metalink/HTTP header answer
===============================
See [2 #section-1.1].
Etag: "thvDyvhfIqlvFe+A9MYgxAfm1q5="
Link: <http://www2.example.com/example.ext>; rel=duplicate
Link: <ftp://ftp.example.com/example.ext>; rel=duplicate
Link: <http://example.com/example.ext.torrent>; rel=describedby;
type="application/x-bittorrent"
Link: <http://example.com/example.ext.meta4>; rel=describedby;
type="application/metalink4+xml"
Link: <http://example.com/example.ext.asc>; rel=describedby;
type="application/pgp-signature"
Digest: SHA-256=MWVkMWQxYTRiMzk5MDQ0MzI3NGU5NDEyZTk5OWY1ZGFmNzgyZTJlO
DYzYjRjYzFhOTlmNTQwYzI2M2QwM2U2MQ==
See [2 #section-4].
Link: <http://example.com/example.ext.torrent>; rel=describedby;
type="application/x-bittorrent"; name="differentname.ext"
Link: <http://example.com/example.ext.meta4>; rel=describedby;
type="application/metalink4+xml"
5.4 Saving files
================
When none of --output-document and/or --content-disposition is used,
the file name to wrote is computed from the cli's url hierarchy. The
purpose of the "Directory Options" is as usual, and the file name is
the cli's url file name, see wget(1).
The url followed to download the file shall not substitute the cli's
url to compute the file name to wrote, except when it redirects to a
Metalink/XML file, following the rules in '3. Download file name'.
5.5 Multi-Source download
=========================
Parallel range requests are allowed [2 #section-7].
4. References
*************
[1] The Metalink Download Description Format
https://tools.ietf.org/html/rfc5854
[2] Metalink/HTTP: Mirrors and Hashes
https://tools.ietf.org/html/rfc6249
[3] Libmetalink
https://github.com/metalink-dev/libmetalink
[4] Expat
http://www.libexpat.org
[5] Libxml2
http://xmlsoft.org

165
doc/metalink.txt Normal file
View File

@@ -0,0 +1,165 @@
GNU Wget Metalink module
Evaluation of the Metalink/XML and Metalink/HTTP implementations
1. Introduction
***************
This document, and the results contained in it, is focused over the
evaluation of the Metalink/XML and Metalink/HTTP implementations.
The "Directory Options" mentioned here are used on the command line in
conjunction with the option '--input-metalink=file' for Metalink/XML,
and '--metalink-over-http' for Metalink/HTTP.
$ wget --input-metalink=<file> [directory options]
$ wget --metalink-over-http [directory options] <url>
2. Notes
********
Tests for metalink:file names beginning with '/', '~/', './', or '../'
(e.g. "/path/file") shall be run manually due to security concerns.
3. Metalink files used as reference
***********************************
3.1 Test: metalink:file with "path/file" name format
====================================================
cat > test.meta4 << EOF
<?xml version="1.0" encoding="UTF-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
<file name="path/file">
<size>543</size>
<hash type="sha256">d37d3965f8e1a7b16504b4273b09c392776b7e4dd17e601256c7b2fd9ce5f56e</hash>
<hash type="md5">0f6ff5cdc15603f1b81227b5a296f001</hash>
<url>http://wrongurl.really/gnu/wget/wget-1.18.tar.xz.sig</url>
<url>http://ftpmirror.gnu.org/wget/wget-1.18.tar.xz.sig</url>
<url>http://ftp.gnu.org/gnu/wget/wget-1.18.tar.xz.sig</url>
<url>http://nl.mirror.babylon.network/gnu/wget/wget-1.18.tar.xz.sig</url>
</file>
</metalink>
EOF
4. `wget --input-metalink=test.meta4`
*************************************
4.1 Implemented safety features
===============================
Any metalink:file name containing an absolute, relative, or home path
(see '2. Notes') parsed from Metalink/XML files is rejected.
This is a libmetalink's design decision implemented in the function
metalink_check_safe_path(). This feature shall not be modified.
All the above conform to the RFC5854 standard.
References:
https://tools.ietf.org/html/rfc5854#section-4.1.2.1
https://tools.ietf.org/html/rfc5854#section-4.2.8.3
4.2 File download behaviour
===========================
When a Metalink/XML file is parsed:
1. create the metalink:file "path/file" tree;
2. download the metalink:url file as "path/file";
3. verify the "path/file" size, if declared;
4. verify the "path/file" checksum.
All the above conform to the RFC5854 standard.
References:
https://tools.ietf.org/html/rfc5854
4.3 Questionable behaviours
===========================
If more metalink:file elements are the same, wget downloads them all.
5. `wget --metalink-over-http`
******************************
5.1 Implemented safety features
===============================
The function url_file_name() is responsible of parsing the url's file
name and mixing in the "Directory Options" wrote on the command line.
The use of libmetalink's metalink_check_safe_path() shouldn't be
necessary (see '4.1 Implemented safety features').
All the above comform to the usual Wget's download behaviour.
References:
wget(1)
5.2 File download behaviour
===========================
When a Metalink/HTTP header is parsed:
1. extract metalink metadata from the header;
2. download the file from the mirror with the highest priority;
3. verify the file's size, if declared;
4. verify the file's checksum.
All the above comform to the usual Wget's download behaviour and to
the RFC6249 standard.
References:
wget(1)
https://tools.ietf.org/html/rfc6249
6. Directory Options
********************
'-nd'
'--no-directories'
Do not apply to Metalink/XML files (aka --input-metalink=<file>).
Apply to Metalink/HTTP urls as described in the Wget's manual, see
wget(1). The target url is the url wrote on the command line.
'-x'
'--force-directories'
Do not apply to Metalink/XML files (aka --input-metalink=<file>).
Apply to Metalink/HTTP urls as described in the Wget's manual, see
wget(1). The target url is the url wrote on the command line.
'-nH'
'--no-host-directories'
Do not apply to Metalink/XML files (aka --input-metalink=<file>).
Apply to Metalink/HTTP urls as described in the Wget's manual, see
wget(1). The target url is the url wrote on the command line.
'--protocol-directories'
Do not apply to Metalink/XML files (aka --input-metalink=<file>).
Apply to Metalink/HTTP urls as described in the Wget's manual, see
wget(1). The target url is the url wrote on the command line.
'--cut-dirs=number'
Do not apply to Metalink/XML files (aka --input-metalink=<file>).
Apply to Metalink/HTTP urls as described in the Wget's manual, see
wget(1). The target url is the url wrote on the command line.
'-P prefix'
'--directory-prefix=prefix'
Set the top of the retrieval tree to prefix for both Metalink/XML
and Metalink/HTTP downloads, see wget(1).
If combining the prefix with the file name results in an absolute,
relative, or home path, the directory components are stripped and
only the basename is used. See '4.1 Implemented safety features'.

View File

@@ -1,7 +1,7 @@
#! /usr/bin/env perl
# Copyright (C) 1999, 2000, 2001, 2003, 2007, 2009, 2010, 2011, 2015
# Free Software Foundation, Inc.
# Copyright (C) 1999-2001, 2003, 2007, 2009-2011, 2015, 2018-2024 Free
# Software Foundation, Inc.
# This file is part of GCC.

View File

@@ -31,8 +31,7 @@ This file documents the GNU Wget utility for downloading network
data.
@c man begin COPYRIGHT
Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2015 Free Software
Copyright @copyright{} 1996--2011, 2015, 2018--2024 Free Software
Foundation, Inc.
@iftex
@@ -65,6 +64,8 @@ Texts. A copy of the license is included in the section entitled
@ignore
@c man begin AUTHOR
Originally written by Hrvoje Nikšić <hniksic@xemacs.org>.
Currently maintained by Darshit Shah <darnir@gnu.org> and
Tim Rühsen <tim.ruehsen@gmx.de>.
@c man end
@c man begin SEEALSO
This is @strong{not} the complete manual for GNU Wget.
@@ -72,6 +73,9 @@ For more complete information, including more detailed explanations of
some of the options, and a number of commands available
for use with @file{.wgetrc} files and the @samp{-e} option, see the GNU
Info entry for @file{wget}.
Also see wget2(1), the updated version of GNU Wget with even better
support for recursive downloading and modern protocols like HTTP/2.
@c man end
@end ignore
@@ -193,6 +197,8 @@ options, or via the initialization file @file{.wgetrc} (@pxref{Startup
File}). Wget allows you to define @dfn{global} startup files
(@file{/usr/local/etc/wgetrc} by default) for site settings. You can also
specify the location of a startup file with the --config option.
To disable the reading of config files, use --no-config.
If both --config and --no-config are given, --no-config is ignored.
@ignore
@@ -378,7 +384,7 @@ and @file{/~somebody}. You can also clear the lists in @file{.wgetrc}
(@pxref{Wgetrc Syntax}).
@example
wget -X '' -X /~nobody,/~somebody
wget -X "" -X /~nobody,/~somebody
@end example
Most options that do not accept arguments are @dfn{boolean} options,
@@ -512,17 +518,41 @@ href if none was specified.
Downloads files covered in local Metalink @var{file}. Metalink version 3
and 4 are supported.
@cindex keep-badhash
@item --keep-badhash
Keeps downloaded Metalink's files with a bad hash. It appends .badhash
to the name of Metalink's files which have a checksum mismatch, except
without overwriting existing files.
@cindex metalink-over-http
@item --metalink-over-http
Issues HTTP HEAD request instead of GET and extracts Metalink metadata
from response headers. Then it switches to Metalink download.
If no valid Metalink metadata is found, it falls back to ordinary HTTP download.
Enables @samp{Content-Type: application/metalink4+xml} files download/processing.
@cindex metalink-index
@item --metalink-index=@var{number}
Set the Metalink @samp{application/metalink4+xml} metaurl ordinal
NUMBER. From 1 to the total number of ``application/metalink4+xml''
available. Specify 0 or @samp{inf} to choose the first good one.
Metaurls, such as those from a @samp{--metalink-over-http}, may have
been sorted by priority key's value; keep this in mind to choose the
right NUMBER.
@cindex preferred-location
@item --preferred-location
Set preferred location for Metalink resources. This has effect if multiple
resources with same priority are available.
@cindex xattr
@item --xattr
Enable use of file system's extended attributes to save the
original URL and the Referer HTTP header value if used.
Be aware that the URL might contain private information like
access tokens or credentials.
@cindex force html
@item -F
@@ -550,7 +580,10 @@ would be resolved to @samp{http://foo/baz/b.html}.
@cindex specify config
@item --config=@var{FILE}
Specify the location of a startup file you wish to use.
Specify the location of a startup file you wish to use instead of the
default one(s). Use --no-config to disable reading of config files.
If both --config and --no-config are given, --no-config is ignored.
@item --rejected-log=@var{logfile}
Logs all URL rejections to @var{logfile} as comma separated values. The values
@@ -571,6 +604,27 @@ the local machine. @var{ADDRESS} may be specified as a hostname or IP
address. This option can be useful if your machine is bound to multiple
IPs.
@cindex bind DNS address
@cindex client DNS address
@cindex DNS IP address, client, DNS
@item --bind-dns-address=@var{ADDRESS}
[libcares only]
This address overrides the route for DNS requests. If you ever need to
circumvent the standard settings from /etc/resolv.conf, this option together
with @samp{--dns-servers} is your friend.
@var{ADDRESS} must be specified either as IPv4 or IPv6 address.
Wget needs to be built with libcares for this option to be available.
@cindex DNS server
@cindex DNS IP address, client, DNS
@item --dns-servers=@var{ADDRESSES}
[libcares only]
The given address(es) override the standard nameserver
addresses, e.g. as configured in /etc/resolv.conf.
@var{ADDRESSES} may be specified either as IPv4 or IPv6 addresses,
comma-separated.
Wget needs to be built with libcares for this option to be available.
@cindex retries
@cindex tries
@cindex number of tries
@@ -666,6 +720,12 @@ Before (over)writing a file, back up an existing file by adding a
files are rotated to @samp{.2}, @samp{.3}, and so on, up to
@var{backups} (and lost beyond that).
@cindex authentication credentials
@item --no-netrc
Do not try to obtain credentials from @file{.netrc} file. By default
@file{.netrc} file is searched for credentials in case none have been
passed on command line and authentication is required.
@cindex continue retrieval
@cindex incomplete downloads
@cindex resume download
@@ -694,13 +754,11 @@ Without @samp{-c}, the previous example would just download the remote
file to @file{ls-lR.Z.1}, leaving the truncated @file{ls-lR.Z} file
alone.
Beginning with Wget 1.7, if you use @samp{-c} on a non-empty file, and
it turns out that the server does not support continued downloading,
Wget will refuse to start the download from scratch, which would
effectively ruin existing contents. If you really want the download to
start from scratch, remove the file.
If you use @samp{-c} on a non-empty file, and the server does not support
continued downloading, Wget will restart the download from scratch and overwrite
the existing file entirely.
Also beginning with Wget 1.7, if you use @samp{-c} on a file which is of
Beginning with Wget 1.7, if you use @samp{-c} on a file which is of
equal size as the one on the server, Wget will refuse to download the
file and print an explanatory message. The same happens when the file
is smaller on the server than locally (presumably because it was changed
@@ -783,7 +841,7 @@ With @samp{--progress=bar}, there are currently two possible parameters,
@var{force} and @var{noscroll}.
When the output is not a TTY, the progress bar always falls back to ``dot'',
even if @samp{--progress=bar} was passed to Wget during invokation. This
even if @samp{--progress=bar} was passed to Wget during invocation. This
behaviour can be overridden and the ``bar'' output forced by using the ``force''
parameter as @samp{--progress=bar:force}.
@@ -810,7 +868,7 @@ files. In such a case, wget could simply be invoked with this parameter to get
a much cleaner output on the screen.
This option will also force the progress bar to be printed to @file{stderr} when
used alongside the @samp{--logfile} option.
used alongside the @samp{--output-file} option.
@item -N
@itemx --timestamping
@@ -983,12 +1041,13 @@ specified in bytes (default), kilobytes (with @samp{k} suffix), or
megabytes (with @samp{m} suffix).
Note that quota will never affect downloading a single file. So if you
specify @samp{wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz}, all of the
specify @samp{wget -Q10k https://example.com/ls-lR.gz}, all of the
@file{ls-lR.gz} will be downloaded. The same goes even when several
@sc{url}s are specified on the command-line. However, quota is
respected when retrieving either recursively, or from an input file.
Thus you may safely type @samp{wget -Q2m -i sites}---download will be
aborted when the quota is exceeded.
@sc{url}s are specified on the command-line. The quota is checked only
at the end of each downloaded file, so it will never result in a partially
downloaded file. Thus you may safely type @samp{wget -Q2m -i sites}---download
will be aborted after the file that exhausts the quota is completely
downloaded.
Setting quota to 0 or to @samp{inf} unlimits the download quota.
@@ -1135,6 +1194,15 @@ options for @sc{http} connections.
Prompt for a password for each connection established. Cannot be specified
when @samp{--password} is being used, because they are mutually exclusive.
@item --use-askpass=@var{command}
Prompt for a user and password using the specified command. If no command is
specified then the command in the environment variable WGET_ASKPASS is used.
If WGET_ASKPASS is not set then the command in the environment variable
SSH_ASKPASS is used.
You can set the default command for use-askpass in the @file{.wgetrc}. That
setting may be overridden from the command line.
@cindex iri support
@cindex idn support
@item --no-iri
@@ -1291,6 +1359,11 @@ renamed from @samp{--html-extension}, to better reflect its new
behavior. The old option name is still acceptable, but should now be
considered deprecated.
As of version 1.19.2, Wget will also ensure that any downloaded files with
a @code{Content-Encoding} of @samp{br}, @samp{compress}, @samp{deflate}
or @samp{gzip} end in the suffix @samp{.br}, @samp{.Z}, @samp{.zlib}
and @samp{.gz} respectively.
At some point in the future, this option may well be expanded to
include suffixes for other types of content, including content types
that are not parsed by Wget.
@@ -1308,10 +1381,10 @@ the @code{digest}, or the Windows @code{NTLM} authentication scheme.
Another way to specify username and password is in the @sc{url} itself
(@pxref{URL Format}). Either method reveals your password to anyone who
bothers to run @code{ps}. To prevent the passwords from being seen,
store them in @file{.wgetrc} or @file{.netrc}, and make sure to protect
those files from other users with @code{chmod}. If the passwords are
really important, do not leave them lying in those files either---edit
the files and delete them after Wget has started the download.
use the @samp{--use-askpass} or store them in @file{.wgetrc} or @file{.netrc},
and make sure to protect those files from other users with @code{chmod}. If
the passwords are really important, do not leave them lying in those files
either---edit the files and delete them after Wget has started the download.
@iftex
@xref{Security Considerations}, for more information about security
@@ -1335,10 +1408,10 @@ to the inability of server-side scripts to cope with the connections.
@cindex cache
@item --no-cache
Disable server-side cache. In this case, Wget will send the remote
server an appropriate directive (@samp{Pragma: no-cache}) to get the
file from the remote service, rather than returning the cached version.
This is especially useful for retrieving and flushing out-of-date
documents on proxy servers.
server appropriate directives (@samp{Cache-Control: no-cache} and
@samp{Pragma: no-cache}) to get the file from the remote service,
rather than returning the cached version. This is especially useful
for retrieving and flushing out-of-date documents on proxy servers.
Caching is allowed by default.
@@ -1475,6 +1548,23 @@ wget --header="Host: foo.bar" http://localhost/
In versions of Wget prior to 1.10 such use of @samp{--header} caused
sending of duplicate headers.
@cindex Content-Encoding, choose
@item --compression=@var{type}
Choose the type of compression to be used. Legal values are
@samp{auto}, @samp{gzip} and @samp{none}.
If @samp{auto} or @samp{gzip} are specified, Wget asks the server to
compress the file using the gzip compression format. If the server
compresses the file and responds with the @code{Content-Encoding}
header field set appropriately, the file will be decompressed
automatically.
If @samp{none} is specified, wget will not ask the server to compress
the file and will not decompress any server responses. This is the default.
Compression support is currently experimental. In case it is turned on,
please report any bugs to @code{bug-wget@@gnu.org}.
@cindex redirect
@item --max-redirect=@var{number}
Specifies the maximum number of redirections to follow for a resource.
@@ -1586,11 +1676,11 @@ users:
# @r{Log in to the server. This can be done only once.}
wget --save-cookies cookies.txt \
--post-data 'user=foo&password=bar' \
http://server.com/auth.php
http://example.com/auth.php
# @r{Now grab the page or pages we care about.}
wget --load-cookies cookies.txt \
-p http://server.com/interesting/article.php
-p http://example.com/interesting/article.php
@end group
@end example
@@ -1643,6 +1733,10 @@ This option is useful for some file-downloading CGI programs that use
@code{Content-Disposition} headers to describe what the name of a
downloaded file should be.
When combined with @samp{--metalink-over-http} and @samp{--trust-server-names},
a @samp{Content-Type: application/metalink4+xml} file is named using the
@code{Content-Disposition} filename field, if available.
@cindex Content On Error
@item --content-on-error
@@ -1652,9 +1746,11 @@ with a http status code that indicates error.
@cindex Trust server names
@item --trust-server-names
If this is set to on, on a redirect the last component of the
redirection URL will be used as the local file name. By default it is
used the last component in the original URL.
If this is set, on a redirect, the local file name will be based
on the redirection URL. By default the local file name is based on
the original URL. When doing recursive retrieving this can be helpful
because in many web sites redirected URLs correspond to an underlying
file structure, while link URLs do not.
@cindex authentication
@item --auth-no-challenge
@@ -1668,6 +1764,25 @@ some few obscure servers, which never send HTTP authentication
challenges, but accept unsolicited auth info, say, in addition to
form-based authentication.
@item --retry-on-host-error
Consider host errors, such as ``Temporary failure in name resolution'',
as non-fatal, transient errors.
@item --retry-on-http-error=@var{code[,code,...]}
Consider given HTTP response codes as non-fatal, transient errors.
Supply a comma-separated list of 3-digit HTTP response codes as
argument. Useful to work around special circumstances where retries
are required, but the server responds with an error code normally not
retried by Wget. Such errors might be 503 (Service Unavailable) and
429 (Too Many Requests). Retries enabled by this option are performed
subject to the normal retry timing and retry count limitations of
Wget.
Using this option is intended to support special use cases only and is
generally not recommended, as it can force retries even in cases where
the server is actually trying to decrease its load. Please use wisely
and only if you know what you are doing.
@end table
@node HTTPS (SSL/TLS) Options, FTP Options, HTTP Options, Invoking
@@ -1683,25 +1798,34 @@ If Wget is compiled without SSL support, none of these options are available.
@cindex SSL protocol, choose
@item --secure-protocol=@var{protocol}
Choose the secure protocol to be used. Legal values are @samp{auto},
@samp{SSLv2}, @samp{SSLv3}, @samp{TLSv1}, @samp{TLSv1_1}, @samp{TLSv1_2}
and @samp{PFS}. If @samp{auto} is used, the SSL library is given the
liberty of choosing the appropriate protocol automatically, which is
@samp{SSLv2}, @samp{SSLv3}, @samp{TLSv1}, @samp{TLSv1_1}, @samp{TLSv1_2},
@samp{TLSv1_3} and @samp{PFS}. If @samp{auto} is used, the SSL library is
given the liberty of choosing the appropriate protocol automatically, which is
achieved by sending a TLSv1 greeting. This is the default.
Specifying @samp{SSLv2}, @samp{SSLv3}, @samp{TLSv1}, @samp{TLSv1_1} or
@samp{TLSv1_2} forces the use of the corresponding protocol. This is
useful when talking to old and buggy SSL server implementations that
make it hard for the underlying SSL library to choose the correct
protocol version. Fortunately, such servers are quite rare.
Specifying @samp{SSLv2}, @samp{SSLv3}, @samp{TLSv1}, @samp{TLSv1_1},
@samp{TLSv1_2} or @samp{TLSv1_3} forces the use of the corresponding
protocol. This is useful when talking to old and buggy SSL server
implementations that make it hard for the underlying SSL library to choose
the correct protocol version. Fortunately, such servers are quite rare.
Specifying @samp{PFS} enforces the use of the so-called Perfect Forward
Security cipher suites. In short, PFS adds security by creating a one-time
key for each SSL connection. It has a bit more CPU impact on client and server.
We use known to be secure ciphers (e.g. no MD4) and the TLS protocol.
We use known to be secure ciphers (e.g. no MD4) and the TLS protocol. This mode
also explicitly excludes non-PFS key exchange methods, such as RSA.
@item --https-only
When in recursive mode, only HTTPS links are followed.
@item --ciphers
Set the cipher list string. Typically this string sets the
cipher suites and other SSL/TLS options that the user wish should be used, in a
set order of preference (GnuTLS calls it 'priority string'). This string
will be fed verbatim to the SSL/TLS engine (OpenSSL or GnuTLS) and hence
its format and syntax is dependent on that. Wget will not process or manipulate it
in any way. Refer to the OpenSSL or GnuTLS documentation for more information.
@cindex SSL certificate, check
@item --no-check-certificate
Don't check the server certificate against the available certificate
@@ -1778,6 +1902,18 @@ system-specified locations, chosen at OpenSSL installation time.
Specifies a CRL file in @var{file}. This is needed for certificates
that have been revocated by the CAs.
@cindex SSL Public Key Pin
@item --pinnedpubkey=file/hashes
Tells wget to use the specified public key file (or hashes) to verify the peer.
This can be a path to a file which contains a single public key in PEM or DER
format, or any number of base64 encoded sha256 hashes preceded by ``sha256//''
and separated by ``;''
When negotiating a TLS or SSL connection, the server sends a certificate
indicating its identity. A public key is extracted from this certificate and if
it does not exactly match the public key(s) provided to this option, wget will
abort the connection before sending or receiving any data.
@cindex entropy, specifying source of
@cindex randomness, specifying source of
@item --random-file=@var{file}
@@ -1861,7 +1997,7 @@ from the database.
If you supply your own HSTS database via @samp{--hsts-file}, be aware that Wget
may modify the provided file if any change occurs between the HSTS policies
requested by the remote servers and those in the file. When Wget exists,
requested by the remote servers and those in the file. When Wget exits,
it effectively updates the HSTS database by rewriting the database file with the new entries.
If the supplied file does not exist, Wget will create one. This file will contain the new HSTS
@@ -1875,7 +2011,7 @@ the same time over the HSTS database. Before dumping the updated HSTS entries
on the file, Wget will re-read it and merge the changes.
Using a custom HSTS database and/or modifying an existing one is discouraged.
For more information about the potential security threats arised from such practice,
For more information about the potential security threats arose from such practice,
see section 14 "Security Considerations" of RFC 6797, specially section 14.9
"Creative Manipulation of HSTS Policy Store".
@end table
@@ -2008,7 +2144,7 @@ download them recursively, though this feature may be added in the future.
When @samp{--retr-symlinks=no} is specified, the linked-to file is not
downloaded. Instead, a matching symbolic link is created on the local
filesystem. The pointed-to file will not be retrieved unless this recursive
file system. The pointed-to file will not be retrieved unless this recursive
retrieval would have encountered it separately and downloaded it anyway. This
option poses a security risk where a malicious FTP Server may cause Wget to
write to files outside of the intended directories through a specially crafted
@@ -2068,8 +2204,21 @@ details. The default maximum depth is 5.
@item -l @var{depth}
@itemx --level=@var{depth}
Specify recursion maximum depth level @var{depth} (@pxref{Recursive
Download}).
Set the maximum number of subdirectories that Wget will recurse into to @var{depth}.
In order to prevent one from accidentally downloading very large websites when using recursion
this is limited to a depth of 5 by default, i.e., it will traverse at most 5 directories deep
starting from the provided URL.
Set @samp{-l 0} or @samp{-l inf} for infinite recursion depth.
@example
wget -r -l 0 http://@var{site}/1.html
@end example
Ideally, one would expect this to download just @file{1.html}.
but unfortunately this is not the case, because @samp{-l 0} is equivalent to
@samp{-l inf}---that is, infinite recursion. To download a single @sc{html}
page (or a handful of them), specify them all on the command line and leave away @samp{-r}
and @samp{-l}. To download the essential items to view a single @sc{html} page, see @samp{page requisites}.
@cindex proxy filling
@cindex delete after retrieval
@@ -2561,11 +2710,11 @@ The @samp{-D} option allows you to specify the domains that will be
followed, thus limiting the recursion only to the hosts that belong to
these domains. Obviously, this makes sense only in conjunction with
@samp{-H}. A typical example would be downloading the contents of
@samp{www.server.com}, but allowing downloads from
@samp{images.server.com}, etc.:
@samp{www.example.com}, but allowing downloads from
@samp{images.example.com}, etc.:
@example
wget -rH -Dserver.com http://www.server.com/
wget -rH -Dexample.com http://www.example.com/
@end example
You can specify more than one address by separating them with a comma,
@@ -2805,7 +2954,7 @@ These links are not relative:
@example
<a href="/foo.gif">
<a href="/foo/bar.gif">
<a href="http://www.server.com/foo/bar.gif">
<a href="http://www.example.com/foo/bar.gif">
@end example
Using this option guarantees that recursive retrieval will not span
@@ -2897,7 +3046,7 @@ file so that it keeps its date of modification.
wget -S http://www.gnu.ai.mit.edu/
@end example
A simple @code{ls -l} shows that the time stamp on the local file equals
A simple @code{ls -l} shows that the timestamp on the local file equals
the state of the @code{Last-Modified} header, as returned by the server.
As you can see, the time-stamping info is preserved locally, even
without @samp{-N} (at least for @sc{http}).
@@ -3168,8 +3317,8 @@ Turn on recognition of the (non-standard) @samp{Content-Disposition}
HTTP header---if set to @samp{on}, the same as @samp{--content-disposition}.
@item trust_server_names = on/off
If set to on, use the last component of a redirection URL for the local
file name.
If set to on, construct the local file name from redirection URLs
rather than original URLs.
@item continue = on/off
If set to on, force continuation of preexistent partially retrieved
@@ -3275,10 +3424,16 @@ Turn globbing on/off---the same as @samp{--glob} and @samp{--no-glob}.
Define a header for HTTP downloads, like using
@samp{--header=@var{string}}.
@item compression = @var{string}
Choose the compression type to be used. Legal values are @samp{auto}
(the default), @samp{gzip}, and @samp{none}. The same as
@samp{--compression=@var{string}}.
@item adjust_extension = on/off
Add a @samp{.html} extension to @samp{text/html} or
@samp{application/xhtml+xml} files that lack one, or a @samp{.css}
extension to @samp{text/css} files that lack one, like
@samp{application/xhtml+xml} files that lack one, a @samp{.css}
extension to @samp{text/css} files that lack one, and a @samp{.br},
@samp{.Z}, @samp{.zlib} or @samp{.gz} to compressed files like
@samp{-E}. Previously named @samp{html_extension} (still acceptable,
but deprecated).
@@ -3675,7 +3830,7 @@ same directory structure the original has, with only one try per
document, saving the log of the activities to @file{gnulog}:
@example
wget -r http://www.gnu.org/ -o gnulog
wget -r https://www.gnu.org/ -o gnulog
@end example
@item
@@ -3683,7 +3838,7 @@ The same as the above, but convert the links in the downloaded files to
point to local files, so you can view the documents off-line:
@example
wget --convert-links -r http://www.gnu.org/ -o gnulog
wget --convert-links -r https://www.gnu.org/ -o gnulog
@end example
@item
@@ -3693,22 +3848,22 @@ sheets, are also downloaded. Also make sure the downloaded page
references the downloaded links.
@example
wget -p --convert-links http://www.server.com/dir/page.html
wget -p --convert-links http://www.example.com/dir/page.html
@end example
The @sc{html} page will be saved to @file{www.server.com/dir/page.html}, and
the images, stylesheets, etc., somewhere under @file{www.server.com/},
The @sc{html} page will be saved to @file{www.example.com/dir/page.html}, and
the images, stylesheets, etc., somewhere under @file{www.example.com/},
depending on where they were on the remote server.
@item
The same as the above, but without the @file{www.server.com/} directory.
The same as the above, but without the @file{www.example.com/} directory.
In fact, I don't want to have all those random server directories
anyway---just save @emph{all} those files under a @file{download/}
subdirectory of the current directory.
@example
wget -p --convert-links -nH -nd -Pdownload \
http://www.server.com/dir/page.html
http://www.example.com/dir/page.html
@end example
@item
@@ -3737,12 +3892,12 @@ wget -r -l2 -P/tmp ftp://wuarchive.wustl.edu/
@item
You want to download all the @sc{gif}s from a directory on an @sc{http}
server. You tried @samp{wget http://www.server.com/dir/*.gif}, but that
server. You tried @samp{wget http://www.example.com/dir/*.gif}, but that
didn't work because @sc{http} retrieval does not support globbing. In
that case, use:
@example
wget -r -l1 --no-parent -A.gif http://www.server.com/dir/
wget -r -l1 --no-parent -A.gif http://www.example.com/dir/
@end example
More verbose, but the effect is the same. @samp{-r -l1} means to
@@ -3758,7 +3913,7 @@ interrupted. Now you do not want to clobber the files already present.
It would be:
@example
wget -nc -r http://www.gnu.org/
wget -nc -r https://www.gnu.org/
@end example
@item
@@ -3766,7 +3921,7 @@ If you want to encode your own username and password to @sc{http} or
@sc{ftp}, use the appropriate @sc{url} syntax (@pxref{URL Format}).
@example
wget ftp://hniksic:mypassword@@unix.server.com/.emacs
wget ftp://hniksic:mypassword@@unix.example.com/.emacs
@end example
Note, however, that this usage is not advisable on multi-user systems
@@ -3803,7 +3958,7 @@ to recheck a site each Sunday:
@example
crontab
0 0 * * 0 wget --mirror http://www.gnu.org/ -o /home/me/weeklog
0 0 * * 0 wget --mirror https://www.gnu.org/ -o /home/me/weeklog
@end example
@item
@@ -3815,7 +3970,7 @@ would look like this:
@example
wget --mirror --convert-links --backup-converted \
http://www.gnu.org/ -o /home/me/weeklog
https://www.gnu.org/ -o /home/me/weeklog
@end example
@item
@@ -3827,14 +3982,14 @@ or @samp{application/xhtml+xml} to @file{@var{name}.html}.
@example
wget --mirror --convert-links --backup-converted \
--html-extension -o /home/me/weeklog \
http://www.gnu.org/
--adjust-extension -o /home/me/weeklog \
https://www.gnu.org/
@end example
Or, with less typing:
@example
wget -m -k -K -E http://www.gnu.org/ -o /home/me/weeklog
wget -m -k -K -E https://www.gnu.org/ -o /home/me/weeklog
@end example
@end itemize
@c man end
@@ -3941,14 +4096,14 @@ username and password.
Like all GNU utilities, the latest version of Wget can be found at the
master GNU archive site ftp.gnu.org, and its mirrors. For example,
Wget @value{VERSION} can be found at
@url{ftp://ftp.gnu.org/pub/gnu/wget/wget-@value{VERSION}.tar.gz}
@url{https://ftp.gnu.org/pub/gnu/wget/wget-@value{VERSION}.tar.gz}
@node Web Site, Mailing Lists, Distribution, Various
@section Web Site
@cindex web site
The official web site for GNU Wget is at
@url{http://www.gnu.org/software/wget/}. However, most useful
@url{https//www.gnu.org/software/wget/}. However, most useful
information resides at ``The Wget Wgiki'',
@url{http://wget.addictivecode.org/}.
@@ -3962,14 +4117,14 @@ information resides at ``The Wget Wgiki'',
The primary mailinglist for discussion, bug-reports, or questions
about GNU Wget is at @email{bug-wget@@gnu.org}. To subscribe, send an
email to @email{bug-wget-join@@gnu.org}, or visit
@url{http://lists.gnu.org/mailman/listinfo/bug-wget}.
@url{https://lists.gnu.org/mailman/listinfo/bug-wget}.
You do not need to subscribe to send a message to the list; however,
please note that unsubscribed messages are moderated, and may take a
while before they hit the list---@strong{usually around a day}. If
you want your message to show up immediately, please subscribe to the
list before posting. Archives for the list may be found at
@url{http://lists.gnu.org/pipermail/bug-wget/}.
@url{https://lists.gnu.org/archive/html/bug-wget/}.
An NNTP/Usenettish gateway is also available via
@uref{http://gmane.org/about.php,Gmane}. You can see the Gmane
@@ -3977,15 +4132,7 @@ archives at
@url{http://news.gmane.org/gmane.comp.web.wget.general}. Note that the
Gmane archives conveniently include messages from both the current
list, and the previous one. Messages also show up in the Gmane
archives sooner than they do at @url{lists.gnu.org}.
@unnumberedsubsec Bug Notices List
Additionally, there is the @email{wget-notify@@addictivecode.org} mailing
list. This is a non-discussion list that receives bug report
notifications from the bug-tracker. To subscribe to this list,
send an email to @email{wget-notify-join@@addictivecode.org},
or visit @url{http://addictivecode.org/mailman/listinfo/wget-notify}.
archives sooner than they do at @url{https://lists.gnu.org}.
@unnumberedsubsec Obsolete Lists
@@ -3997,7 +4144,7 @@ discussing patches to GNU Wget.
Messages from @email{wget@@sunsite.dk} are archived at
@itemize @tie{}
@item
@url{http://www.mail-archive.com/wget%40sunsite.dk/} and at
@url{https://www.mail-archive.com/wget%40sunsite.dk/} and at
@item
@url{http://news.gmane.org/gmane.comp.web.wget.general} (which also
continues to archive the current list, @email{bug-wget@@gnu.org}).
@@ -4026,7 +4173,11 @@ via IRC at @code{irc.freenode.org}, @code{#wget}. Come check it out!
@c man begin BUGS
You are welcome to submit bug reports via the GNU Wget bug tracker (see
@url{http://wget.addictivecode.org/BugTracker}).
@url{https://savannah.gnu.org/bugs/?func=additem&group=wget}) or to our
mailing list @email{bug-wget@@gnu.org}.
Visit @url{https://lists.gnu.org/mailman/listinfo/bug-wget} to
get more info (how to subscribe, list archives, ...).
Before actually submitting a bug report, please try to follow a few
simple guidelines.
@@ -4043,7 +4194,7 @@ Lists}).
@item
Try to repeat the bug in as simple circumstances as possible. E.g. if
Wget crashes while downloading @samp{wget -rl0 -kKE -t5 --no-proxy
http://yoyodyne.com -o /tmp/log}, you should try to see if the crash is
http://example.com -o /tmp/log}, you should try to see if the crash is
repeatable, and if will occur with a simpler set of options. You might
even try to start the download at the page where the crash occurred to
see if that page somehow triggered the crash.
@@ -4066,7 +4217,7 @@ from the debug log before sending it to the bug address. The
@code{-d} won't go out of its way to collect sensitive information,
but the log @emph{will} contain a fairly complete transcript of Wget's
communication with the server, which may include passwords and pieces
of downloaded data. Since the bug address is publically archived, you
of downloaded data. Since the bug address is publicly archived, you
may assume that all bug reports are visible to the public.
@item
@@ -4108,7 +4259,7 @@ Windows-related features might look at them.
Support for building on MS-DOS via DJGPP has been contributed by Gisle
Vanem; a port to VMS is maintained by Steven Schweda, and is available
at @url{http://antinode.org/}.
at @url{https://antinode.info/dec/sw/wget.html}.
@node Signals, , Portability, Various
@section Signals
@@ -4186,23 +4337,23 @@ download an individual page. Because of that, Wget honors RES when
downloading recursively. For instance, when you issue:
@example
wget -r http://www.server.com/
wget -r http://www.example.com/
@end example
First the index of @samp{www.server.com} will be downloaded. If Wget
First the index of @samp{www.example.com} will be downloaded. If Wget
finds that it wants to download more documents from that server, it will
request @samp{http://www.server.com/robots.txt} and, if found, use it
request @samp{http://www.example.com/robots.txt} and, if found, use it
for further downloads. @file{robots.txt} is loaded only once per each
server.
Until version 1.8, Wget supported the first version of the standard,
written by Martijn Koster in 1994 and available at
@url{http://www.robotstxt.org/wc/norobots.html}. As of version 1.8,
@url{http://www.robotstxt.org/orig.html}. As of version 1.8,
Wget has supported the additional directives specified in the internet
draft @samp{<draft-koster-robots-00.txt>} titled ``A Method for Web
Robots Control''. The draft, which has as far as I know never made to
an @sc{rfc}, is available at
@url{http://www.robotstxt.org/wc/norobots-rfc.txt}.
@url{http://www.robotstxt.org/norobots-rfc.txt}.
This manual no longer includes the text of the Robot Exclusion Standard.
@@ -4216,7 +4367,7 @@ this:
@end example
This is explained in some detail at
@url{http://www.robotstxt.org/wc/meta-user.html}. Wget supports this
@url{http://www.robotstxt.org/meta.html}. Wget supports this
method of robot exclusion in addition to the usual @file{/robots.txt}
exclusion.
@@ -4315,7 +4466,7 @@ Tomislav Petrović, Mario Mikočević---many bug reports and
suggestions.
@item
François Pinard---many thorough bug reports and discussions.
Françis Pinard---many thorough bug reports and discussions.
@item
Karl Eichwalder---lots of help with internationalization, Makefile
@@ -4353,6 +4504,14 @@ Ted Mielczarek---donated support for CSS.
@item
Saint Xavier---Support for IRIs (RFC 3987).
@item
Tim Rühsen---Loads of helpful patches, especially fuzzing support and
Continuous Integration. Maintainer since 2014.
@item
Darshit Shah---Many helpful patches. Community support on various platforms.
Maintainer since 2014.
@item
People who provided donations for development---including Brian Gough.
@end itemize

122
fuzz/Makefile.am Normal file
View File

@@ -0,0 +1,122 @@
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) $(CODE_COVERAGE_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) -I$(top_builddir)/lib -I$(top_srcdir)/lib \
$(CODE_COVERAGE_CPPFLAGS) \
-DSRCDIR=\"$(abs_srcdir)\"
LDADD = ../lib/libgnu.a \
$(CLOCK_TIME_LIB) \
$(GETADDRINFO_LIB) \
$(GETRANDOM_LIB) \
$(HARD_LOCALE_LIB) \
$(HOSTENT_LIB) \
$(INET_NTOP_LIB) \
$(LIBSOCKET) \
$(LIBTHREAD) \
$(LIB_CRYPTO) \
$(LIBC32CONV) \
$(LIBICONV) \
$(LIBINTL) \
$(LIBUNISTRING) \
$(MBRTOWC_LIB) \
$(NANOSLEEP_LIB) \
$(POSIX_SPAWN_LIB) \
$(PTHREAD_SIGMASK_LIB) \
$(SELECT_LIB) \
$(SERVENT_LIB) \
$(SETLOCALE_NULL_LIB) \
$(FUZZ_LIBS) $(CODE_COVERAGE_LIBS)
WGET_TESTS = \
wget_cookie_fuzzer$(EXEEXT) \
wget_css_fuzzer$(EXEEXT) \
wget_ftpls_fuzzer$(EXEEXT) \
wget_html_fuzzer$(EXEEXT) \
wget_netrc_fuzzer$(EXEEXT) \
wget_options_fuzzer$(EXEEXT) \
wget_progress_fuzzer$(EXEEXT) \
wget_read_hunk_fuzzer$(EXEEXT) \
wget_robots_fuzzer$(EXEEXT) \
wget_url_fuzzer$(EXEEXT)
EXTRA_DIST = test-runner.sh
if WITH_NTLM
WGET_TESTS += wget_ntlm_fuzzer$(EXEEXT)
endif
if FUZZING
bin_PROGRAMS = $(WGET_TESTS)
LDADD += $(LIB_FUZZING_ENGINE)
MAIN = fuzzer.h
# AM_LDFLAGS = -no-install -all-static
else
AM_CPPFLAGS += -DTEST_RUN
AM_TESTS_ENVIRONMENT = export VALGRIND_TESTS"=@VALGRIND_TESTS@";
LOG_COMPILER = $(top_srcdir)/fuzz/test-runner.sh
TESTS = $(WGET_TESTS)
check_PROGRAMS = $(WGET_TESTS)
MAIN = main.c fuzzer.h
endif
# Make libunittest "PHONY" so we're always sure we're up-to-date.
.PHONY: ../src/libunittest.a
../src/libunittest.a:
$(MAKE) $(AM_MAKEFLAGS) -C ../src libunittest.a
wget_cookie_fuzzer_SOURCES = wget_cookie_fuzzer.c $(MAIN)
wget_cookie_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_css_fuzzer_SOURCES = wget_css_fuzzer.c $(MAIN)
wget_css_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_ftpls_fuzzer_SOURCES = wget_ftpls_fuzzer.c $(MAIN)
wget_ftpls_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_html_fuzzer_SOURCES = wget_html_fuzzer.c $(MAIN)
wget_html_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_netrc_fuzzer_SOURCES = wget_netrc_fuzzer.c $(MAIN)
wget_netrc_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_ntlm_fuzzer_SOURCES = wget_ntlm_fuzzer.c $(MAIN)
wget_ntlm_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_options_fuzzer_SOURCES = wget_options_fuzzer.c $(MAIN)
wget_options_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_progress_fuzzer_SOURCES = wget_progress_fuzzer.c $(MAIN)
wget_progress_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_read_hunk_fuzzer_SOURCES = wget_read_hunk_fuzzer.c $(MAIN)
wget_read_hunk_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_robots_fuzzer_SOURCES = wget_robots_fuzzer.c $(MAIN)
wget_robots_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
wget_url_fuzzer_SOURCES = wget_url_fuzzer.c $(MAIN)
wget_url_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
#EXTRA_DIST = $(wildcard *.options) $(wildcard *.dict) \
# $(wildcard *.in) $(wildcard *.repro)
dist-hook:
find $(srcdir) -name '*.options' -exec cp -v '{}' $(distdir) ';'
find $(srcdir) -name '*.dict' -exec cp -v '{}' $(distdir) ';'
# find $(srcdir) -name '*.in' -exec cp -vr '{}' $(distdir) ';'
find $(srcdir) -name '*.repro' -exec cp -vr '{}' $(distdir) ';'
clean-local:
rm -rf *.gc?? *.log lcov
oss-fuzz:
if test "$$OUT" != ""; then \
XLIBS="-lpsl -lgnutls -lhogweed -lnettle -lgmp -lidn2 -lunistring -lz"; \
for ccfile in wget*_fuzzer.c; do \
fuzzer=$$(basename $$ccfile .c); \
$$CC $$CFLAGS -I$(top_srcdir)/src -I$(top_srcdir) -I$(top_srcdir)/lib \
"$${fuzzer}.c" -o "$${fuzzer}" \
../src/libunittest.a ../lib/libgnu.a $${LIB_FUZZING_ENGINE} \
-Wl,-Bstatic $${XLIBS} -Wl,-Bdynamic; \
done; \
fi
.PHONY: oss-fuzz

83
fuzz/README.md Normal file
View File

@@ -0,0 +1,83 @@
# Fuzzers
These are fuzzers designed for use with `libFuzzer` or `afl`. They can
be used to run on Google's OSS-Fuzz (https://github.com/google/oss-fuzz/).
The convention used here is that the initial values for each parser fuzzer
are taken from the $NAME.in directory.
Crash reproducers from OSS-Fuzz are put into $NAME.repro directory for
regression testing with top dir 'make check' or 'make check-valgrind'.
# Running a fuzzer using clang
Use the following commands on top dir:
```
export CC=clang
# address sanitizer:
#export CFLAGS="-O1 -g -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined,integer,nullability -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp"
export CFLAGS="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link"
# undefined sanitizer;
export CFLAGS="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=bool,array-bounds,float-divide-by-zero,function,integer-divide-by-zero,return,shift,signed-integer-overflow,vla-bound,vptr -fno-sanitize-recover=bool,array-bounds,float-divide-by-zero,function,integer-divide-by-zero,return,shift,signed-integer-overflow,vla-bound,vptr -fsanitize=fuzzer-no-link"
export LIB_FUZZING_ENGINE="-lFuzzer -lstdc++"
./configure --enable-fuzzing --without-metalink --without-zlib --disable-pcre --without-libuuid --enable-assert
make clean
make -j$(nproc)
cd fuzz
# run wget_options_fuzzer
UBSAN_OPTIONS=print_stacktrace=1 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer \
./run-clang.sh wget_options_fuzzer
```
If you see a crash, then a crash corpora is written that can be used for further
investigation. E.g.
```
==2410==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000004e90 at pc 0x00000049cf9c bp 0x7fffb5543f70 sp 0x7fffb5543720
...
Test unit written to ./crash-adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
```
To reproduce the crash:
```
./wget_options_fuzzer < ./crash-adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
```
You can also copy/move that file into wget_options_fuzzer.repro/
and re-build the project without fuzzing for a valgrind run, if you like that better.
Just a `./configure` and a `make check-valgrind` should reproduce it.
# Running a fuzzer using AFL
Use the following commands on top dir:
```
$ export LIB_FUZZING_ENGINE=""
$ CC=afl-clang-fast ./configure --enable-fuzzing
$ make -j$(nproc) clean all
$ cd fuzz
$ ./run-afl.sh wget_options_fuzzer
```
# Fuzz code coverage using the corpus directories *.in/
Code coverage reports currently work best with gcc+lcov+genhtml.
In the top directory:
```
CC=gcc CFLAGS="-O0 -g" ./configure
make fuzz-coverage
xdg-open lcov/index.html
```
To work on corpora for better coverage, `cd fuzz` and use e.g.
`./view-coverage.sh wget_options_fuzzer`.
# Creating wget_options_fuzzer.dict
```
for i in `../src/wget --help|tr ' ' '\n'|grep ^--|cut -c 3-|sort`;do echo \"$i\"; done >wget_options_fuzzer.dict
```

42
fuzz/fuzzer.h Normal file
View File

@@ -0,0 +1,42 @@
/*
* Copyright (c) 2017-2024 Free Software Foundation, Inc.
*
* This file is part of GNU Wget.
*
* GNU Wget is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GNU Wget is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Wget. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stddef.h> // size_t
#include <stdint.h> // uint8_t
#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
#pragma GCC diagnostic ignored "-Wunused"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
#define CLOSE_STDERR \
int bak = dup(STDERR_FILENO); \
int fd = open("/dev/null", O_WRONLY); \
dup2(fd, STDERR_FILENO); \
close(fd);
#define RESTORE_STDERR \
dup2(bak, STDERR_FILENO); \
close(bak);
#ifdef __cplusplus
extern "C"
#endif
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);

11
fuzz/get_all_corpora Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh -eu
if ! grep FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION Makefile >/dev/null; then
echo "The fuzzers haven't been built for fuzzing (maybe for regression testing !?)"
echo "Please built regarding README.md and try again."
exit 1
fi
for fuzzer in *_fuzzer.c; do
./get_ossfuzz_corpora $(basename $fuzzer .c)
done

46
fuzz/get_ossfuzz_corpora Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/sh -eu
# As a first step see README.md and follow the steps under "Running a fuzzer using clang".
# You might need 'gsutil' to download new corpora from the Google cloud:
# Read the docs at https://github.com/google/oss-fuzz/blob/master/docs/corpora.md
# then install 'google-cloud-sdk' and execute 'gcloud init'.
# Now 'gsutil' should be ready to use.
if test -z "$1"; then
echo "Usage: $0 <fuzzer target>"
echo "Example: $0 wget_options_fuzzer"
exit 1
fi
if ! grep FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION Makefile >/dev/null; then
echo "The fuzzers haven't been built for fuzzing (maybe for regression testing !?)"
echo "Please built regarding README.md and try again."
exit 1
fi
fuzzer=$1
project=wget
# sync/copy the OSS-Fuzz corpora into the .new directory
mkdir -p ${fuzzer}.in ${fuzzer}.new
cp -fp ${fuzzer}.in/* ${fuzzer}.new 2>/dev/null || true
gsutil cp $(gsutil ls gs://${project}-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/${fuzzer}|tail -n 1) ${fuzzer}.new/
(cd ${fuzzer}.new && unzip -q -o *.zip && rm *.zip)
# create fuzzer target
BUILD_ONLY=1 ./run-clang.sh ${fuzzer}
# merge the corpora into the .in directory
./${fuzzer} -merge=1 ${fuzzer}.in ${fuzzer}.new
# now clear .new dir and put all corpora there
rm -rf ${fuzzer}.new
mv ${fuzzer}.in ${fuzzer}.new
mkdir ${fuzzer}.in
# now merge again (optimizes number of corpora)
./${fuzzer} -merge=1 ${fuzzer}.in ${fuzzer}.new
echo
echo "If new files have been added, 'git add' and 'git commit' them."

50
fuzz/glob_crash.c Normal file
View File

@@ -0,0 +1,50 @@
/*
* Copyright (c) 2017-2024 Free Software Foundation, Inc.
*
* This file is part of GNU Wget.
*
* GNU Wget is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GNU Wget is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Wget. If not, see <https://www.gnu.org/licenses/>.
* Created 19.10.2017 by Tim Rühsen
*
* Call glob() using data from fuzzer crash file
*
* Build and execute with instrumented gnulib (amend -I paths as needed):
*
* clang build (spills out WRITE heap buffer overflow)
* export CC=clang-6.0
* export CFLAGS="-O1 -g -fno-omit-frame-pointer -fsanitize=address -fsanitize-address-use-after-scope"
* $CC $CFLAGS -I.. -I../lib glob_crash.c -o glob_crash ../lib/.libs/libgnu.a
* ./glob_crash
*
* gcc build (spills out READ heap buffer overflow):
* export CC=gcc
* export CFLAGS="-O1 -g -fno-omit-frame-pointer -fsanitize=address -fsanitize-address-use-after-scope"
* $CC $CFLAGS -I.. -I../lib glob_crash.c -o glob_crash ../lib/.libs/libgnu.a
* ./glob_crash
*/
#include <glob.h>
int main(int argc, char **argv)
{
static unsigned char data[] = "1e";
glob_t pglob;
if (glob(data, GLOB_TILDE|GLOB_ONLYDIR|GLOB_NOCHECK, NULL, &pglob) == 0)
globfree(&pglob);
return 0;
}

140
fuzz/main.c Normal file
View File

@@ -0,0 +1,140 @@
/*
* Copyright (c) 2017-2024 Free Software Foundation, Inc.
*
* This file is part of GNU Wget.
*
* GNU Wget is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GNU Wget is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Wget. If not, see <https://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include "fuzzer.h"
#include "utils.h"
#ifdef TEST_RUN
#include <dirent.h>
#ifdef _WIN32
# define SLASH '\\'
#else
# define SLASH '/'
#endif
static int test_all_from(const char *dirname)
{
DIR *dirp;
if ((dirp = opendir(dirname))) {
struct dirent *dp;
while ((dp = readdir(dirp))) {
if (*dp->d_name == '.') continue;
char fname[strlen(dirname) + strlen(dp->d_name) + 2];
snprintf(fname, sizeof(fname), "%s/%s", dirname, dp->d_name);
struct file_memory *fmem;
if ((fmem = wget_read_file(fname))) {
printf("testing %ld bytes from '%s'\n", fmem->length, fname);
fflush(stdout);
LLVMFuzzerTestOneInput((uint8_t *)fmem->content, fmem->length);
wget_read_file_free(fmem);
}
}
closedir(dirp);
return 0;
}
return 1;
}
int main(int argc, char **argv)
{
const char *target;
size_t target_len;
if ((target = strrchr(argv[0], SLASH))) {
if (strrchr(target, '/'))
target = strrchr(target, '/');
} else
target = strrchr(argv[0], '/');
target = target ? target + 1 : argv[0];
if (strncmp(target, "lt-", 3) == 0)
target += 3;
target_len = strlen(target);
#ifdef _WIN32
target_len -= 4; // ignore .exe
#endif
{
int rc;
char corporadir[sizeof(SRCDIR) + 1 + target_len + 8];
snprintf(corporadir, sizeof(corporadir), SRCDIR "/%.*s.in", (int) target_len, target);
rc = test_all_from(corporadir);
if (rc)
fprintf(stderr, "Failed to find %s\n", corporadir);
snprintf(corporadir, sizeof(corporadir), SRCDIR "/%.*s.repro", (int) target_len, target);
if (test_all_from(corporadir) && rc)
return 77; // SKIP
}
return 0;
}
#else
#ifndef __AFL_LOOP
static int __AFL_LOOP(int n)
{
static int first = 1;
if (first) {
first = 0;
return n && --n > 0;
}
return 0;
}
#endif
int main(int argc, char **argv)
{
int ret;
unsigned char buf[64 * 1024];
while (__AFL_LOOP(10000)) { // only works with clang - we have to use 1 because static/global vars in wget
ret = fread(buf, 1, sizeof(buf), stdin);
if (ret < 0)
return 0;
LLVMFuzzerTestOneInput(buf, ret);
}
return 0;
}
#endif /* #ifdef TEST_RUN */

59
fuzz/run-afl.sh Executable file
View File

@@ -0,0 +1,59 @@
#!/bin/sh -eu
# Copyright (c) 2017, 2019-2024 Free Software Foundation, Inc.
#
# This file is part of GNU Wget.
#
# GNU Wget is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNU Wget is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with GNU Wget. If not, see <https://www.gnu.org/licenses/>.
if ! grep '^CC=.afl-clang-fast' ../config.log >/dev/null; then
echo "compile first library as:"
echo "CC=afl-clang-fast ./configure"
exit 1
fi
if test -z "$1"; then
echo "Usage: $0 test-case"
echo "Example: $0 wget_options_fuzzer"
exit 1
fi
fuzzer=$1
#rm -f $fuzzer
#afl-clang-fast -O2 -g -I.. main.c "${fuzzer}.c" -o "${fuzzer}"
### minimize test corpora
if test -d ${fuzzer}.in; then
mkdir -p ${fuzzer}.min
for i in `ls ${fuzzer}.in`; do
fin="${fuzzer}.in/$i"
fmin="${fuzzer}.min/$i"
if ! test -e $fmin || test $fin -nt $fmin; then
afl-tmin -m 500 -i $fin -o $fmin -- ./${fuzzer}
fi
done
fi
TMPOUT=${fuzzer}.out
mkdir -p ${TMPOUT}
if test -f ${fuzzer}.dict; then
afl-fuzz -m 500 -i ${fuzzer}.min -o ${TMPOUT} -x ${fuzzer}.dict -- ./${fuzzer}
else
afl-fuzz -m 500 -i ${fuzzer}.min -o ${TMPOUT} -- ./${fuzzer}
fi
echo "output was stored in $TMPOUT"
exit 0

57
fuzz/run-clang.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash -e
#
# Copyright (c) 2017, 2019-2024 Free Software Foundation, Inc.
#
# This file is part of GNU Wget.
#
# GNU Wget is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNU Wget is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with GNU Wget. If not, see <https://www.gnu.org/licenses/>.
trap ctrl_c INT
ctrl_c() {
./${fuzzer} -merge=1 ${fuzzer}.in ${fuzzer}.new
rm -rf ${fuzzer}.new
}
if test -z "$1"; then
echo "Usage: $0 <fuzzer target>"
echo "Example: $0 wget_options_fuzzer"
exit 1
fi
if ! grep FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION Makefile >/dev/null; then
echo "The fuzzers haven't been built for fuzzing (maybe for regression testing !?)"
echo "Please built regarding README.md and try again."
exit 1
fi
# you'll need ~2GB free memory per worker !
fuzzer=$1
workers=$(($(nproc) - 0))
jobs=$workers
if test -n "$BUILD_ONLY"; then
exit 0
fi
# create directory for NEW test corpora (covering new areas of code)
mkdir -p ${fuzzer}.new
if test -f ${fuzzer}.dict; then
./${fuzzer} -dict=${fuzzer}.dict ${fuzzer}.new ${fuzzer}.in -jobs=$jobs -workers=$workers
else
./${fuzzer} ${fuzzer}.new ${fuzzer}.in -jobs=$jobs -workers=$workers
fi
exit 0

9
fuzz/test-runner.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env sh
WRAPPER=""
if [ -n "$VALGRIND_TESTS" ]; then
WRAPPER="valgrind --error-exitcode=301 --leak-check=yes --show-reachable=yes --track-origins=yes"
fi
exec $WRAPPER "$@"

37
fuzz/view-coverage.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash -eu
#
# (C)2017 Tim Ruehsen tim.ruehsen@gmx.de
#
# View the coverage report for one or more fuzzers.
# 1. execute 'make fuzz-coverage' in the top directory
# 2. execute './view-coverage.sh <fuzz target(s)>
# Example with single fuzzer:
# ./view-coverage.sh wget_options_fuzzer
# Example with two fuzzers:
# ./view-coverage.sh wget_options_fuzzer wget_html_parse_fuzzer
if test -z "$1"; then
echo "Usage: $0 <fuzz target(s)>"
echo "Example: $0 wget_options_fuzzer"
exit 1
fi
#fuzzer="./"$1
LCOV_INFO=coverage.info
#./coverage.sh $fuzzer
#lcov --capture --initial --directory ../src/.libs --directory . --output-file $LCOV_INFO
#lcov --capture --directory ../src/.libs --output-file $LCOV_INFO
#lcov --remove $LCOV_INFO '*/test_linking.c' '*/css_tokenizer.lex' '*/<stdout>' '*/*.h' -o $LCOV_INFO
#genhtml --prefix . --ignore-errors source $LCOV_INFO --legend --title "$1" --output-directory=lcov
lcov --zerocounters --directory ../src/
lcov --capture --initial --directory ../src/.libs --directory . --output-file $LCOV_INFO
make check TESTS="$*" CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
lcov --capture --directory ../src/.libs --output-file $LCOV_INFO
lcov --remove $LCOV_INFO '*/css_tokenizer.lex' '*/*.h' -o $LCOV_INFO
genhtml --prefix . --ignore-errors source $LCOV_INFO --legend --title "$*" --output-directory=lcov
xdg-open lcov/index.html

92
fuzz/wget_cookie_fuzzer.c Normal file
View File

@@ -0,0 +1,92 @@
/*
* Copyright (c) 2017-2024 Free Software Foundation, Inc.
*
* This file is part of GNU Wget.
*
* GNU Wget is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GNU Wget is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Wget. If not, see <https://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <sys/types.h>
#include <dirent.h> // opendir, readdir
#include <stdint.h> // uint8_t
#include <stdio.h> // fmemopen
#include <string.h> // strncmp
#include <stdlib.h> // free
#include <fcntl.h> // open flags
#include <unistd.h> // close
#include "wget.h"
#undef fopen_wgetrc
#ifdef __cplusplus
extern "C" {
#endif
#include "cookies.h"
// declarations for wget internal functions
int main_wget(int argc, const char **argv);
void cleanup(void);
FILE *fopen_wget(const char *pathname, const char *mode);
FILE *fopen_wgetrc(const char *pathname, const char *mode);
void exit_wget(int status);
#ifdef __cplusplus
}
#endif
#include "fuzzer.h"
FILE *fopen_wget(const char *pathname, const char *mode)
{
return fopen("/dev/null", mode);
}
FILE *fopen_wgetrc(const char *pathname, const char *mode)
{
return NULL;
}
#ifdef FUZZING
void exit_wget(int status)
{
}
#endif
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
struct cookie_jar *cookie_jar;
char *set_cookie;
if (size > 1024) // same as max_len = ... in .options file
return 0;
set_cookie = (char *) malloc(size + 1);
memcpy(set_cookie, data, size);
set_cookie[size] = 0;
CLOSE_STDERR
cookie_jar = cookie_jar_new();
cookie_handle_set_cookie(cookie_jar, "x", 81, "p", set_cookie);
cookie_handle_set_cookie(cookie_jar, "x", 81, "p", set_cookie);
cookie_handle_set_cookie(cookie_jar, "x", 80, "p/d/", set_cookie);
cookie_jar_delete(cookie_jar);
RESTORE_STDERR
free(set_cookie);
return 0;
}

View File

@@ -0,0 +1,6 @@
tag1="expires="
tag2="path="
tag3="domain="
tag4="httponly"
tag5="secure"
tag6="max-age"

View File

@@ -0,0 +1 @@
??????

View File

@@ -0,0 +1 @@
AAAAAAAAAAA

View File

@@ -0,0 +1 @@
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

View File

@@ -0,0 +1 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@@ -0,0 +1 @@
¦=;e;x;Õ;e;e;r;s;„;A;r;y

View File

@@ -0,0 +1 @@
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@@ -0,0 +1 @@
]=;max-age=3;max-age=4;max-age=8;max-age=3;max-age=4;max-age=8

View File

@@ -0,0 +1 @@
xxxxxx

View File

@@ -0,0 +1 @@
```````````````````````````````````````````

View File

@@ -0,0 +1 @@
***************************************************************************************************************************************************************************

View File

@@ -0,0 +1 @@
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

View File

@@ -0,0 +1 @@
*=;*=;*!=;*#=;*_=;*_=;*!=;*#=;*_=;*ヒ=;*_=;*_=;*ヒ=;*ェ=;*_=;*!=;*#=;*#=;*_=;*=;*ヒ=;*_=;*!=;*#=;*_=;*@=;*W=;*!=;*#=;*_=;*ヒ=;*_=;*_=;*p=;*_=;*レ=;*@=;*_=;*!=;*#=;*_=;*ヒ=;*_=;*_=;*p=;*_=;*レ=;*_=;*!=;*#=;*_=;*ヒ=;*_=;*_=;*p=;*_=;*_=;*ヒ=;*_=;*p=;*_=;*_=;*ヒ=;*_=;*ヒ=;*_=;*!=;*_=;*ヒ=;*_=;*!=;*#=;*_=;*レ=;*_=;*!=;*#=;*_=;*ヒ=;*_=;*_=;*p=;*_=;*_=;*#=;*ス=

View File

@@ -0,0 +1 @@
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@@ -0,0 +1 @@
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

View File

@@ -0,0 +1 @@
(=;expires==;expires=i;expires=M;expires=*;expires=*;expires==;expires=M;expires=M;expires=3;expires==;expires=M;expires=*;expires=*;expires==;expires=M;expires=M;expires=MonFeB1 7:4:83¹;expires==;expires=M;expires=*;expires=*;expires=x;expires=M;expires=ª;expires=*;expires==;expires=M;expires=M;expires=3;expires==;expires=M;expires=*;expires=*;expires==;expires=*;expires=M;expires=M;expires=4;expires=<;expires=M;expires=M;expires=E;expires=e

View File

@@ -0,0 +1 @@
PPP

View File

@@ -0,0 +1 @@
4444444444444444444444444444444444444444444

View File

@@ -0,0 +1 @@
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222

View File

@@ -0,0 +1 @@
:=;domain=';path=/p/

View File

@@ -0,0 +1 @@
RRRRRRRRRRR

View File

@@ -0,0 +1 @@
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII

View File

@@ -0,0 +1 @@
.=;max-age=˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙=-˛

View File

@@ -0,0 +1,24 @@
J="/ path=pires=
Jpath=

View File

@@ -0,0 +1 @@
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

View File

@@ -0,0 +1 @@
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

View File

@@ -0,0 +1 @@
ggg

View File

@@ -0,0 +1 @@
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

View File

@@ -0,0 +1 @@
@=;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-5 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-5 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-;expireS=Mon,2-FeB-0 7:4:9-

View File

@@ -0,0 +1 @@
ggggggggggg

View File

@@ -0,0 +1,2 @@
<01><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󠁳<EFBFBD><F3A081B3><EFBFBD><EFBFBD><EFBFBD>󽠀<EFBFBD><0F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʨ<EFBFBD><CAA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʨ<0F><><EFBFBD><EFBFBD><1A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʨ<0F><><EFBFBD><EFBFBD><1A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʨ<0F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

Some files were not shown because too many files have changed in this diff Show More