diff --git a/configure.ac b/configure.ac index 49657762..5b5b6f1a 100644 --- a/configure.ac +++ b/configure.ac @@ -329,10 +329,9 @@ AS_IF([test "x$with_libpsl" != xno], [ ]) ]) -# Check for custom PSL file -AC_ARG_WITH(psl-file, - AC_HELP_STRING([--with-psl-file=[PATH]], [path to PSL file (plain text or DAFSA)]), - PSL_FILE=$withval AC_DEFINE_UNQUOTED([PSL_FILE], ["$PSL_FILE"], [path to PSL file (plain text or DAFSA)])) +AS_IF([test x"$with_libpsl" = xyes], [ + AC_CHECK_FUNCS(psl_latest) +]) AS_IF([test x"$with_zlib" != xno], [ with_zlib=yes @@ -818,7 +817,7 @@ AC_MSG_NOTICE([Summary of build options: Libs: $LIBS SSL: $with_ssl Zlib: $with_zlib - PSL: $with_libpsl $PSL_FILE + PSL: $with_libpsl Digest: $ENABLE_DIGEST NTLM: $ENABLE_NTLM OPIE: $ENABLE_OPIE diff --git a/src/cookies.c b/src/cookies.c index a818b50a..44d025a1 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -538,15 +538,13 @@ check_domain_match (const char *cookie_domain, const char *host) { init_psl = 1; -#ifdef PSL_FILE - /* If PSL_FILE is a DAFSA file, loading is very fast */ - if ((psl = psl_load_file (PSL_FILE))) +#ifdef HAVE_PSL_LATEST + if ((psl = psl_latest (NULL))) goto have_psl; - DEBUGP (("\nPSL: %s not found or not readable. " - "Falling back to built-in data.\n", quote (PSL_FILE))); -#endif - + DEBUGP (("\nPSL: Failed to load any PSL data. " + "Falling back to insecure heuristics.\n")); +#else if ((psl = psl_builtin ()) && !psl_builtin_outdated ()) goto have_psl; @@ -564,9 +562,10 @@ check_domain_match (const char *cookie_domain, const char *host) if (!(psl = psl_builtin ())) { DEBUGP (("\nPSL: libpsl not built with a public suffix list. " - "Falling back to simple heuristics.\n")); + "Falling back to insecure heuristics.\n")); goto no_psl; } +#endif } else if (!psl) goto no_psl;