Commit Graph

35 Commits

Author SHA1 Message Date
b3fb1a3758 * cfg.mk: Skip sc_indent in 'make syntax-check' 2022-02-25 19:17:39 +01:00
3dc7f71098 Update copyright year 2022-02-25 17:46:43 +01:00
040f6cc378 contrib: Remove unused libtool patch
After the previous commit it now uses -Wl,--no-whole-archive
instead of patching libtool in the build system. This is more
portable for other libtool implementations other than the one
by GNU.
2021-10-24 17:33:26 +02:00
22162f82b2 Update copyright year 2021-01-22 21:58:38 +01:00
1375815325 Patch libtool to add -no-whole-archive
* cfg.mk: Exclude contrib/libtool.patch from 'make syntax-check'
* configure.ac: Patch libtool
* contrib/libtool.patch: New file
* lib/Makefile.am: Unset $LIBS
* libwget/Makefile.am: Use -no-whole-archive

This patch keeps the libwget libraries short by not adding
*everything* from lib/libgnu.a.
2020-02-15 20:23:04 +01:00
59d9ecd9c0 * Update copyright year to 2020 2020-01-10 00:33:02 +01:00
e9d6cb3d08 Add license text to files 2019-11-02 16:10:19 +01:00
5645e709a2 Add unit test test-decompress.c
* unit-tests/Makefile.am: Add test-decompress.c
* unit-tests/test-decompress.c: New file
2019-09-21 22:16:25 +02:00
32c393a456 Fix for reproducible builds
* .gitignore: Remove src/version-text.h
* cfg.mk: Add rule to update copyright in src/options.c
* configure.ac: Remove YEAR
* src/Makefile.am: Remove version-text.h.in
* src/options.c: Add version text
* src/version-text.h.in: Deleted

Reported-by: Bernhard M. Wiedemann
2019-09-16 15:46:47 +02:00
c80e2381e5 Use gnulib's update-copyright module
* bootstrap.conf: Add update-copyright module
* cfg.mk: Setup environment for update-copyright
* contrib/update_copyright: Remove script no longer used
* libwget/ssl_openssl: Fix copyright year
* tests/test-post-handshare-auth.c: Fix copyright years
* contrib/commit-check: Add copyright and license
* contrib/mail.sh: Same
* src/version-text.h.in: Same
2019-09-11 00:03:04 +02:00
a4dac96cf3 Update cfg.mk. Add comments for future
* cfg.mk: Multiple changes.
  (sc_GPL_version): Don't exclude all files when only one has a parsing
  issue
  (sc_po_check): Tests should always output English. Their output is for
  developers, not users
  (sc_prohibit_magic_number_exit): tests/test-plugin.c has a parsing
  issue that has been reported to gnulib. Others should be checked.
  (sc_trailing_blank): Fixed the relevant files instead of ignoring them
  (sc_two_space_separator_in_usage): Doesn't seem to trigger on removal
  (sc_prohibit_empty_lines_at_EOF): Same
  (sc_prohibit_sprintf): Same
  (sc_prohibit_printf): Re-arrange within file
  (sc_prohibit_free): Same
  (sc_prohibit_alloc): Same
  (sc_gettext_printf): Same
* docs/DoxygenLayout.xml: Remove trailing whitespaces
* docs/libwget.doxy.in: Same
* tests/libtest.c: Don't internationalize test suite strings
* tests/test-*.c: Use EXIT_FAILURE and EXIT_SUCCESS instead of 1 and 0
2019-09-10 23:02:05 +02:00
186c610830 * cfg.mk: We don't cast arguments to free anywhere 2019-09-10 22:58:36 +02:00
4458ef6bb9 Revert "* cfg.mk: We don't need to exclude gnulib from syntax-check" [ci skip]
This reverts commit 074983606b.

Also added a comment in cfg.mk to explain why
2019-09-10 16:19:23 +02:00
074983606b * cfg.mk: We don't need to exclude gnulib from syntax-check 2019-09-07 23:49:27 +02:00
8843b8f23e Added support for ax_code_coverage version 32
* Makefile.am: Add code coverage rules as documented in ax_code_coverage.m4
* cfg.mk: Exclude m4 files from sc_GPL_version
* configure.ac: Add AX_CODE_COVERAGE
* fuzz/Makefile.am: Add coverage flags
* libwget/Makefile.am: Likewise
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
* m4/ax_ac_append_to_file.m4: New file
* m4/ax_ac_print_to_file.m4: New file
* m4/ax_add_am_macro_static.m4: New file
* m4/ax_am_macros_static.m4: New file
* m4/ax_check_gnu_make.m4: New file
* m4/ax_code_coverage.m4: New file
* m4/ax_file_escapes.m4: New file
2019-08-06 15:38:47 +02:00
084b7d1054 * cfg.mk: Add new syntax-check rule 'sc_gettext_printf' 2019-07-09 11:12:30 +02:00
4249a45465 * cfg.mk: Add new syntax-check rule 'sc_prohibit_gettext_debug' 2019-07-08 19:13:56 +02:00
14b1ffbed3 Add sc_prohibit_alloc to 'make syntax-check'
* cfg.mk: Add sc_prohibit_alloc rule plus exceptions
* src/options.c: Tag exceptions
* unit-tests/test.c: Likewise

This rule checks for calling malloc()/calloc()/realloc(). Instead, either
use wget_malloc(), wget_calloc() or wget_realloc().
2019-06-24 16:04:39 +02:00
baa5ef562f Add sc_prohibit_free to 'make syntax-check'
* cfg.mk: Add sc_prohibit_free rule plus exceptions
* examples/print_css_urls3.c: Remove unneeded comment
* fuzz/libwget_base64_fuzzer.c: Use wget_free() instead of free()
* fuzz/libwget_cookie_fuzzer.c: Likewise
* fuzz/libwget_css_url_fuzzer.c: Likewise
* fuzz/libwget_http_client_fuzzer.c: Likewise
* fuzz/libwget_utils_fuzzer.c: Likewise
* libwget/vector.c: Likewise
* src/options.c: Likewise
* src/wget_main.h: Likewise
* tests/test-compression.c: Likewise
* tests/test-cookies-http_state.c: Likewise
* tests/test-metalink.c: Likewise
* unit-tests/stringmap_perf.c: Likewise

This rule checks for calling free(). Instead, either use wget_free() or
the convenience macro xfree().
2019-06-24 16:04:23 +02:00
e2bf7c1c18 * cfg.mk: Fix syntax-check (bindtextdomain) 2019-06-19 16:10:05 +02:00
b4e81e1b3e Don't check for always true headers
* cfg.mk: Enable checking for always_true_header_tests
* libwget/http.c,net.c,ssl_gnutls.c: Don't check for HAVE_SYS_SOCKET_H.
  The gnulib module always provides it.
* libwget/ssl_gnutls.c: Don't check for HAVE_SYS_UIO_H. The gnulib
  module always provides it.
* bootstrap.conf: Add header sys_uio
* configure.ac: Remove check for sys/uio.h
2019-06-19 10:07:35 +02:00
aa2b8f400f Add sc_prohibit_sprintf and sc_prohibit_printf and fix code
* cfg.mk: New syntax rules sc_prohibit_sprintf and sc_prohibit_printf
* fuzz/*.c: Apply rules
* libwget/*.c: Likewise
* src/*.c: Likewise
* tests/*.[ch]: Likewise
* unit-tests/*.c: Likewise
2019-06-17 16:39:24 +02:00
bad65e99ed * cfg.mk: Our makefiles make judicious use of $<, skip the check 2019-06-17 14:41:13 +02:00
623c59b88a * cfg.mk: Escape dots in path components 2018-05-07 12:30:31 +02:00
693183f499 * cfg.mk: Exclude tests/gpg and tests/certs from any syntax checks 2018-03-23 15:19:28 +01:00
a13aa2c352 Add new scripts to send Copyright assignment mails
* contrib/assignment_template.txt: Template header text for email
    * contrib/mail.sh: Script that composes and sends an email to a new
    contributor for Copyright Assignment
    * cfg.mk: Add exceptions for assignment_template.txt to syntax-check
2018-03-22 23:53:57 +01:00
dbc5a231a1 * cfg.mk: Exclude .gitlab-ci.yml from sc_two_space_separator_in_usage 2018-02-06 16:35:00 +01:00
39dfeec1ae Fixed problems pointed out in MR. Added tests and doxygen documentation.
* bootstrap.conf: Add canonicalize module.
* cfg.mk: Added exclusions to no new line at EOF for binary files used in tests.
* configure.ac: Check for libgpgme
* docs/wget2_manual.md: Added manual entries for --verify-sig, --gnupg-homedir, and new exit codes.
* fuzz/Makefile.am: Amend linker options
* include/wget/wget.h: Add error codes for GPG signature verification.
* po/POTFILES.in: Add new files.
* src/Makefile.am: Add src/gpgme.c and src/wget_gpgme.h
* src/gpgme.c: Using new error codes, and better signature verification failure detection.
* src/job.c (job_free): Free sig_filename
* src/options.c: Add new options --gnupg-homedir and --verify-sig
* src/wget.c: Verify the signature if possible, exit with the proper status code,
  print error messages
* src/wget_gpgme.h: Add documentation.
* src/wget_job.h: Extend struct JOB
* src/wget_options.h: Add new status codes, add new members to struct config
* tests/Makefile.am: Added new tests.
* tests/gpg-test-util.h: Common GPG testing functionality (tries to verify a signature, expects exit code ... etc).
* tests/gpg/helloworld.txt: Text that has been signed in the .sig files.
* tests/gpg/helloworld.txt.{invalid,no-pub,missing,trusted}.sig: Signatures on helloworld.txt with properties described by their names.
* tests/gpg/openpgp-revocs.d/*: Revocation certs for the fake "homedir"
* tests/gpg/private-keys-v1.d/*: The not-so-private private keys used to sign the test file.
* tests/gpg/pubring.kbx: Fake gnupg homedir public key ring.
* tests/gpg/test-gpg-*.c: Tests.
* tests/valgrind-supressions: Supress failures due to oddness with GPGME.
* unit-tests/Makefile.am: Add src/gpgme.o to BASE_OBJS
2018-01-01 13:28:43 +01:00
27a3b58cac * cfg.mk: Exclude *gnulib/*.c from sc_copyright_check 2018-01-01 13:27:49 +01:00
5612f76377 Add OSS-Fuzz reproducers to test suite
* cfg.mk: Exclude *.repro/* from syntax-check
* fuzz/Makefile.am: Add *.repro/* to EXTRA_DIST
* fuzz/libwget_metalink_parse_fuzzer.repro/clusterfuzz-testcase-minimized-5103826937839616:
    Reproducer for OSS-Fuzz issue #1915
* fuzz/libwget_xml_parse_buffer_fuzzer.repro/clusterfuzz-testcase-minimized-4704516446355456:
    Reproducer for OSS-Fuzz issue #2041
* fuzz/main.c: Scan and test all files from *.repro/
2017-06-04 21:10:17 +02:00
fa600c4f04 Move unit tests from tests/ to unit-tests/
* Makefile.am: Add unit-tests
* cfg.mk: Make syntax-check work with unit-tests/
* configure.ac: Add unit-tests/Makefile
* tests/Makefile.am: Remove unit tests
* unit-tests/Makefile.am: New file with unit test rules
* unit-tests/*.c: Moved from tests/
* unit-tests/files: Moved from tests/

unit-tests/ is for library/API unit testing.
tests/ is for testing wget2 utility.
2017-05-31 20:51:10 +02:00
1868fa0311 Enhance fuzzing
* cfg.mk: Let make-syntax-check survive
* fuzz/libwget_metalink_parse.dict: New dictionary
* fuzz/libwget_robots_parse.dict: New dictionary
* fuzz/libwget_xml_parse_buffer.dict: New dictionary
* fuzz/libwget_robots_parse.in/disallowed1: Obsolete by afl-cmin
* fuzz/libwget_robots_parse.in/user_agent3: Likewise
* fuzz/libwget_xml_parse_buffer.in/index.html: Removed redundant HTML tags
* fuzz/run-afl.sh: Auto-optimize corpora with afl-tmin
2017-05-29 12:41:03 +02:00
c6ee3d79ad Fix syntax-check 'sc_prohibit_have_config_h'
* cfg.mk: Remove sc_prohibit_have_config_h from local-checks-to-skip
* libwget/*.c: Include <config.h> unconditionally
* src/*.c: Likewise
* tests/*.c: Likewise
2017-04-30 22:01:34 +02:00
b3aede0e57 Remove gnulib dependencies from examples and wget.h
* cfg.mk: Add examples as excludes for config.h
* examples/Makefile.am: Remove -I to srcdir and builddir
* examples/*.c: Remove #include <config.h>
* include/wget/wget.h: Remove gettext include and defines
* libwget/private.h: Add gettext include and defines
* src/wget_main.h: Likewise
* tests/libtest.h: Likewise
* src/log.c: Add #include <string.h>
2017-04-30 21:37:39 +02:00
2acb041355 * cfg.mk: New file with rules for 'make syntax-check' 2017-04-29 21:00:04 +02:00