Commit Graph

4447 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