From ae542f391b635d1dd6546098e044e5638bb7d4c4 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 6 Jun 2014 00:52:02 -0400 Subject: [PATCH 01/11] actually report the filename in _psl_filename --- src/psl2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/psl2c.c b/src/psl2c.c index a6b5b6c..8b1ec95 100644 --- a/src/psl2c.c +++ b/src/psl2c.c @@ -446,7 +446,7 @@ int main(int argc, const char **argv) fprintf(fpout, "static time_t _psl_file_time = %lu;\n", st.st_mtime); fprintf(fpout, "static time_t _psl_compile_time = %lu;\n", time(NULL)); fprintf(fpout, "static const char _psl_sha1_checksum[] = \"%s\";\n", checksum); - fprintf(fpout, "static const char _psl_filename[] = \"%s\";\n", checksum); + fprintf(fpout, "static const char _psl_filename[] = \"%s\";\n", argv[1]); if (fclose(fpout) != 0) ret = 4; From 9b9c3a35c13ad8a9096891846ced86ac95586d52 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 6 Jun 2014 01:10:21 -0400 Subject: [PATCH 02/11] clean up help output --- tools/psl.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tools/psl.c b/tools/psl.c index 9d684e6..7af00ca 100644 --- a/tools/psl.c +++ b/tools/psl.c @@ -36,22 +36,22 @@ #include #include -static void usage(int err) +static void usage(int err, FILE* f) { - fprintf(stderr, "\n"); - fprintf(stderr, "Usage: psl [options] \n"); - fprintf(stderr, "\n"); - fprintf(stderr, "Options:\n"); - fprintf(stderr, " --version show library version information\n"); - fprintf(stderr, " --use-builtin-data use the builtin PSL data. [default]\n"); - fprintf(stderr, " --load-psl-file load PSL data from file.\n"); - fprintf(stderr, " --is-public-suffix check if domains are public suffixes or not. [default]\n"); - fprintf(stderr, " --is-cookie-domain-acceptable \n"); - fprintf(stderr, " check if cookie-domain is acceptable for domains.\n"); - fprintf(stderr, " --print-unreg-domain print the longest publix suffix part\n"); - fprintf(stderr, " --print-reg-domain print the shortest private suffix part\n"); - fprintf(stderr, " --print-info print info about library builtin data\n"); - fprintf(stderr, "\n"); + fprintf(f, "Usage: psl [options] \n"); + fprintf(f, "\n"); + fprintf(f, "Options:\n"); + fprintf(f, " --version show library version information\n"); + fprintf(f, " --use-builtin-data use the builtin PSL data. [default]\n"); + fprintf(f, " --load-psl-file load PSL data from file.\n"); + fprintf(f, " --is-public-suffix check if domains are public suffixes or not. [default]\n"); + fprintf(f, " --is-cookie-domain-acceptable \n"); + fprintf(f, " check if cookie-domain is acceptable for domains.\n"); + fprintf(f, " --print-unreg-domain print the longest publix suffix part\n"); + fprintf(f, " --print-reg-domain print the shortest private suffix part\n"); + fprintf(f, " --print-info print info about library builtin data\n"); + fprintf(f, "\n"); + fprintf(f, "\n"); exit(err); } @@ -102,12 +102,13 @@ int main(int argc, const char *const *argv) psl_file = NULL; } if (!(psl = psl_load_file(psl_file = *(++arg)))) { - fprintf(stderr, "Failed to load PSL data from %s\n", psl_file); + fprintf(stderr, "Failed to load PSL data from %s\n\n", psl_file); psl_file = NULL; } } else if (!strcmp(*arg, "--help")) { - usage(0); + fprintf(stdout, "`psl' explores the Public Suffix List\n\n"); + usage(0, stdout); } else if (!strcmp(*arg, "--version")) { printf("psl %s\n", PACKAGE_VERSION); @@ -123,7 +124,7 @@ int main(int argc, const char *const *argv) } else { fprintf(stderr, "Unknown option '%s'\n", *arg); - usage(1); + usage(1, stderr); } } else break; From 1addfb07a0a612a8dfa80ab6489f6e4d082fcf9d Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 6 Jun 2014 01:14:40 -0400 Subject: [PATCH 03/11] abort with failure if no domain is passed to psl in a mode where it tries to work with domains --- tools/psl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/psl.c b/tools/psl.c index 7af00ca..3cc5bf2 100644 --- a/tools/psl.c +++ b/tools/psl.c @@ -130,9 +130,15 @@ int main(int argc, const char *const *argv) break; } - if (!psl && mode != 99) { - printf("No PSL data available - aborting\n"); - exit(2); + if (mode != 99) { + if (!psl) { + fprintf(stderr, "No PSL data available - aborting\n"); + exit(2); + } + if (arg >= argv + argc) { + fprintf(stderr, "No domains given - aborting\n"); + exit(3); + } } if (mode == 1) { From 5db3946800403c56a7e38a2d9ed1375e48097da7 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 6 Jun 2014 01:23:48 -0400 Subject: [PATCH 04/11] bin/psl should be dynamically-linked --- tools/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 38d72f5..9f28b4d 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,4 @@ bin_PROGRAMS = psl AM_CPPFLAGS = -I$(top_srcdir)/include -AM_LDFLAGS = -static -LDADD = ../src/libpsl.la +AM_LDFLAGS = -lpsl -L$(top_srcdir)/src From 884d98b61c54d76a5888a97c5dc9f2c9aad45c70 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Fri, 6 Jun 2014 12:10:39 +0200 Subject: [PATCH 05/11] fix distcheck --- tools/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 9f28b4d..d2b973e 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,4 +1,4 @@ bin_PROGRAMS = psl AM_CPPFLAGS = -I$(top_srcdir)/include -AM_LDFLAGS = -lpsl -L$(top_srcdir)/src +LDADD = ../src/libpsl.la From 24a380cb23f227dd66b4c0f2b24346adb9dd34ed Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Fri, 6 Jun 2014 14:15:40 +0200 Subject: [PATCH 06/11] removed check for idn2 from autogen.sh --- autogen.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/autogen.sh b/autogen.sh index d86dce8..14806ea 100755 --- a/autogen.sh +++ b/autogen.sh @@ -5,11 +5,6 @@ if test -z `which autoreconf`; then exit 1 fi -if test -z `which idn2`; then - echo "No 'idn2' found. You must install the idn2 package." - exit 1 -fi - # create m4 before gtkdocize mkdir m4 2>/dev/null From 6e4a73ca5b58f79247776ba2ba4b00658c848eb3 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Fri, 6 Jun 2014 14:28:18 +0200 Subject: [PATCH 07/11] added copyright notice to LICENSE file --- LICENSE | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/LICENSE b/LICENSE index 1c94b98..442e5c8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,17 +1,19 @@ - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. +Copyright (C) 2014 Tm Ruehsen + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. From f077346f86f8e0655d78480d586bb7fb5fcb1cd1 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 6 Jun 2014 10:04:25 -0400 Subject: [PATCH 08/11] clean up psl --help output --- tools/psl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/psl.c b/tools/psl.c index 3cc5bf2..3764599 100644 --- a/tools/psl.c +++ b/tools/psl.c @@ -42,16 +42,15 @@ static void usage(int err, FILE* f) fprintf(f, "\n"); fprintf(f, "Options:\n"); fprintf(f, " --version show library version information\n"); - fprintf(f, " --use-builtin-data use the builtin PSL data. [default]\n"); - fprintf(f, " --load-psl-file load PSL data from file.\n"); - fprintf(f, " --is-public-suffix check if domains are public suffixes or not. [default]\n"); + fprintf(f, " --use-builtin-data use the builtin PSL data [default]\n"); + fprintf(f, " --load-psl-file load PSL data from file\n"); + fprintf(f, " --is-public-suffix check if domains are public suffixes [default]\n"); fprintf(f, " --is-cookie-domain-acceptable \n"); - fprintf(f, " check if cookie-domain is acceptable for domains.\n"); + fprintf(f, " check if cookie-domain is acceptable for domains\n"); fprintf(f, " --print-unreg-domain print the longest publix suffix part\n"); fprintf(f, " --print-reg-domain print the shortest private suffix part\n"); fprintf(f, " --print-info print info about library builtin data\n"); fprintf(f, "\n"); - fprintf(f, "\n"); exit(err); } From b4cc6ace21564d1719b4167e29b97c391a779337 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Fri, 6 Jun 2014 17:07:07 +0200 Subject: [PATCH 09/11] added copyright notice to COPYING file --- COPYING | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/COPYING b/COPYING index 1c94b98..442e5c8 100644 --- a/COPYING +++ b/COPYING @@ -1,17 +1,19 @@ - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. +Copyright (C) 2014 Tm Ruehsen + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. From 66c2ce909ce880917a39690c096c0490409c13c8 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 6 Jun 2014 12:49:23 -0400 Subject: [PATCH 10/11] :) --- COPYING | 2 +- LICENSE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/COPYING b/COPYING index 442e5c8..b6a1570 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (C) 2014 Tm Ruehsen +Copyright (C) 2014 Tim Ruehsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/LICENSE b/LICENSE index 442e5c8..b6a1570 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2014 Tm Ruehsen +Copyright (C) 2014 Tim Ruehsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), From c23cad0dfac58e35372d90a2dd9d10f379f56b4a Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Tue, 10 Jun 2014 14:35:28 +0200 Subject: [PATCH 11/11] Release V0.3.1 --- NEWS | 6 ++++++ configure.ac | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 0e6c51e..8323009 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,11 @@ Copyright (C) 2014 Tim Ruehsen +10.06.2014 Release V0.3.1 + * link psl utility dynamically + * fix output of psl_filename() + * cleanup for psl --help + * removed check for idn2 in autogen.sh + 05.06.2014 Release V0.3.0 * added support for libicu in psl2c (IDNA2008 UTS#46) this needs pkg-config and libicu-dev installed diff --git a/configure.ac b/configure.ac index 970a0b3..95f2df7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ -AC_INIT([libpsl], [0.3.0], [tim.ruehsen@gmx.de], [libpsl], [http://github.com/rockdaboot/libpsl]) +AC_INIT([libpsl], [0.3.1], [tim.ruehsen@gmx.de], [libpsl], [http://github.com/rockdaboot/libpsl]) AC_PREREQ([2.59]) AM_INIT_AUTOMAKE([1.10 -Wall no-define]) @@ -63,7 +63,7 @@ AS_IF([ test "$enable_man" != no ], [ # 4. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0. # 5. If any interfaces have been added since the last public release, then increment age. # 6. If any interfaces have been removed or changed since the last public release, then set age to 0. -AC_SUBST([LIBPSL_SO_VERSION], [1:0:1]) +AC_SUBST([LIBPSL_SO_VERSION], [1:1:1]) AC_SUBST([LIBPSL_VERSION], $VERSION) # Check for enable/disable builtin PSL data