Commit Graph

4252 Commits

Author SHA1 Message Date
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