Commit Graph

669 Commits

Author SHA1 Message Date
Tim Rühsen 9d064cace8 Update to latest Public Suffix List 2018-10-07 21:15:07 +02:00
Don 02648135c9 Use __has_declspec_attribute for shared builds
Clang compilation targets may support `__declspec` attributes. Because of that it has a `__has_declspec_attribute` [check](https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute).

Currently libpsl just assumes that `__declspec` is Windows only. This adds a compatibility macro and checks whether `dllimport` and `dllexport` are available.
2018-10-07 11:32:45 +02:00
Tim Rühsen a3bd08fbf2 Add script to build with MinGW 2018-10-05 20:49:21 +02:00
Tim Rühsen d691a3b941 Add Windows compatibility to fopen 2018-10-05 20:47:26 +02:00
Tim Rühsen 523397fb83 psl tool: Fix possible crashes with printf %s, NULL
Reported-by: Mike Schiffman
2018-07-04 09:37:25 +02:00
Tim Rühsen 4c68696eb1 Add -b/--batch to suppress printing the domain 2018-05-18 15:37:53 +02:00
Tim Rühsen b77d54469e Fix and cleanup build 2018-04-30 15:14:17 +02:00
Tim Rühsen b7f5c1414d Release V0.20.2 2018-04-26 20:18:39 +02:00
Tim Rühsen 3695113cf6 Add msvc/ autogen files to .gitignore 2018-04-26 19:27:15 +02:00
Tim Rühsen 5fd44f138b Fix several configure --enable options 2018-04-26 19:20:46 +02:00
Tim Rühsen a6397a0d62 Remove _HIDDEN from src/lookup_string_in_fixed_set.c 2018-04-26 16:45:15 +02:00
Tim Rühsen c93175c32d
Merge pull request #99 from fanc999/build.win
Add NMake Makefiles for Visual Studio builds
2018-04-26 10:46:50 +00:00
Chun-wei Fan 6a5da68ccf Add NMake Makefiles for Visual Studio builds
This adds a set of Visual Studio NMake Makefiles that can be used to
build libpsl, either as a DLL or as a static .lib.  Building of the psl
tool and the tests in tests/ (but not fuzz, since those tests use
fmemopen(), that is not supported on Windows) are also supported.

A simplified "install" target is provided that copies the build
results to a default or set prefix with the pkg-config file so that
other packages (such as libsoup) with build systems that depend on this
.pc file can be built.

These files make use of autotools stuff so that they have the up-to-date
version info upon a release.

Currently, only builds using the ICU runtime/builtin or with no
runtime/builtin are supported with Visual Studio builds.
2018-04-26 17:09:28 +08:00
Tim Rühsen 724fbd0098 Fix make distcheck 2018-04-25 17:06:44 +02:00
Tim Rühsen 7cb146765e Fix when built as a projects subdir 2018-04-25 16:50:42 +02:00
Tim Rühsen 1a59430862 Add LTLIBICONV and LTLIBINTL to libpsl build 2018-04-25 16:00:12 +02:00
Tim Rühsen 64db5a57da Add support for native Win32 builds 2018-04-25 15:56:00 +02:00
Tim Rühsen b220ffb0b9 Fix MinGW cros build on Linux 2018-04-21 11:30:22 +02:00
Tim Rühsen 8595ebb0ce Fix previous commit 2018-04-21 11:26:20 +02:00
Tim Rühsen 1a8e3e01f5 Fallbacks for IDN library detection
When not explictly given --enable-runtime/--enable-builtin,
./configure tries to first detect libidn2, then libicu, then
libidn. If none found, it fals back to --disable-runtime and
--disable-builtin.

Reported-by: Chun-wei Fan
2018-04-20 15:36:36 +02:00
Chun-wei Fan 5f85085d76 src/psl.c: Fix build on Visual Studio
Visual Studio does not come with unistd.h, so only include it when we
have HAVE_UNISTD_H.  It also does not like including locale.h within
main() for some reason, so include that with the other system headers.
2018-04-20 14:46:26 +02:00
Chun-wei Fan 9620b13374 fuzz: Skip the tests if fmemopen() is not found
fmemopen() is a function that is only provided with *NIX systems, so we
ought to check for its presence in order to build and run the tests
in fuzz/ fully, otherwise, we just skip the tests.

Also include headers according to how they are found, and add fallbacks
for Visual Studio that do not have stdint.h yet.
2018-04-20 14:46:02 +02:00
Tim Rühsen 44256b1a3a Make global vars static in test-is-public-all.c 2018-04-19 10:21:25 +02:00
Tim Rühsen 01b6cba78f Remove leading _ from header guard 2018-04-19 10:16:45 +02:00
Tim Rühsen c4a2698e22 Remove unused vars in test-is-public-all.c 2018-04-19 10:15:53 +02:00
Tim Rühsen 6244c731b9 Extend visibility support
Also renamed PSL_PUBLIC -> PSL_API (conforming to other known libraries).
2018-04-19 10:07:10 +02:00
Chun-wei Fan 8e91838fd5 libpsl.h.in: Decorate public symbols for export
Introduce a macro, PSL_PUBLIC, which is defined as nothing by default,
which can be used by the compiler to instruct the linker to export the
public symbols, such as __declspec (dllexport) on Visual Studio.
2018-04-19 09:37:57 +02:00
Chun-wei Fan 859b307593 src/psl.c: Make code compilable on native Windows
Include the Windows/Winsock2 counterparts of the networking headers on
Windows and avoid including *NIX-specific headers on Windows.

Also remove the small bits of C99isms from the code.
2018-04-19 09:37:37 +02:00
Tim Rühsen 84536ee21d
Merge pull request #96 from ebassi/non-srcdir-build
Fix non-srcdir builds
2018-04-06 18:22:59 +00:00
Emmanuele Bassi c9a550e93c Fix non-srcdir builds
We need to modify the various paths we reference to include the build
directory, in the case when the build directory is not the source
directory.
2018-04-06 18:26:07 +01:00
Tim Rühsen 8aba48aa27
Merge pull request #94 from dkg/speling
fix spelling errors
2018-03-23 13:31:26 +00:00
Daniel Kahn Gillmor 2c66c15a99 fix spelling errors 2018-03-23 11:33:55 +00:00
Tim Rühsen fe2042fea8 Fix make distcheck without enabled docs 2018-03-06 10:21:45 +01:00
Tim Rühsen 32f3861216 Don't require xsltproc when not building man pages 2018-03-06 09:40:11 +01:00
Tim Rühsen f7e0d9441a Fix --disable-builtin configure option 2018-03-05 11:25:06 +01:00
Tim Rühsen 6220e02ebd Release V0.20.1 2018-02-26 11:47:27 +01:00
Tim Rühsen e0c1ed0e7a Improve docs for PSL_TYPE_NO_STAR_RULE 2018-02-26 11:45:57 +01:00
Tim Rühsen a9ccf7ab23 Add man page text about effect of --no-star-rule 2018-02-26 11:35:18 +01:00
Tim Rühsen 337e189979 Add --no-star-rule to psl utility 2018-02-26 11:23:01 +01:00
Tim Rühsen 35d96246e7 Release v0.20.1 2018-02-23 14:50:55 +01:00
Tim Rühsen 8fd480584e Fix PSL_TYPE_NO_STAR_RULE and improve test suite
Reported-by: Daniel Kahn Gillmor
2018-02-23 12:09:07 +01:00
Tim Rühsen 9542813a8f Release v0.20.0 2018-02-22 10:04:00 +01:00
Tim Rühsen 43ec750b40 Update copyrights 2018-02-22 10:04:00 +01:00
Tim Rühsen 2e15e597ca Update fuzzer to use PSL_TYPE_NO_STAR_RULE 2018-02-22 09:54:50 +01:00
Tim Rühsen 53326dc098 Update PSL submodule 2018-02-21 20:51:29 +01:00
Tim Rühsen aaacdae977 Add TLDs to (DAFSA) data to allow skipping the star rule 2018-02-21 20:49:26 +01:00
Claudio Saavedra 49707dc3b3 Add tests for PSL_TYPE_NO_STAR_RULE 2018-02-21 20:48:05 +01:00
Claudio Saavedra 9e9341f5b9 psl_is_public_suffix2(): allow checking for suffixes not in the list
Add a PSL_TYPE_NO_STAR_RULE type to check for suffixes without the '*'
rule. This allows checking for suffixes that are not in the PSL.
2018-02-21 17:11:01 +02:00
Tim Rühsen 819486edd1 Remove C99 loop construct 2018-02-21 15:56:58 +01:00
Tim Rühsen 179ca703b2 Limit CPU wasting on large inputs
Large inputs on psl_registrable_domain() and psl_unregistrable_domain()
suffer from a O(N^2) behavior. This change limits N to avoid excessive
CPU usage.

At the same time we limit the fuzz corpora size to 64k which is far more
then we expect any real life domain to be.

Reported-by: OSS-Fuzz
2018-02-13 15:42:17 +01:00