mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 18:54:36 +00:00
dns-manager: use libpsl directly
...instead of via libsoup. This makes it possible to do gTLD suffix checking even if we're building without libsoup support.
This commit is contained in:
parent
80dfb8cdab
commit
c05befd5aa
|
@ -1034,6 +1034,7 @@ src_cppflags = \
|
|||
$(GUDEV_CFLAGS) \
|
||||
$(LIBNL_CFLAGS) \
|
||||
$(LIBNDP_CFLAGS) \
|
||||
$(LIBPSL_CFLAGS) \
|
||||
$(LIBSOUP_CFLAGS) \
|
||||
$(SELINUX_CFLAGS) \
|
||||
$(LIBAUDIT_CFLAGS) \
|
||||
|
@ -1470,6 +1471,7 @@ src_libNetworkManager_la_LIBADD = \
|
|||
$(LIBM) \
|
||||
$(SELINUX_LIBS) \
|
||||
$(LIBAUDIT_LIBS) \
|
||||
$(LIBPSL_LIBS) \
|
||||
$(LIBSOUP_LIBS)
|
||||
|
||||
###############################################################################
|
||||
|
|
14
configure.ac
14
configure.ac
|
@ -965,6 +965,19 @@ fi
|
|||
AC_DEFINE_UNQUOTED(KERNEL_FIRMWARE_DIR, "$KERNEL_FIRMWARE_DIR", [Define to path of the kernel firmware directory])
|
||||
AC_SUBST(KERNEL_FIRMWARE_DIR)
|
||||
|
||||
PKG_CHECK_MODULES(LIBPSL, [libpsl >= 0.1], [have_libpsl=yes],[have_libpsl=no])
|
||||
AC_ARG_WITH(libpsl, AS_HELP_STRING([--with-libpsl=yes|no], [Link against libpsl]), [], [with_libpsl=${have_libpsl}])
|
||||
if test "$with_libpsl" != "no"; then
|
||||
if test "$have_libpsl" != "yes"; then
|
||||
AC_MSG_ERROR(libpsl library not found)
|
||||
fi
|
||||
with_libpsl='yes'
|
||||
AC_DEFINE(WITH_LIBPSL, 1, [Define if you have libpsl])
|
||||
else
|
||||
AC_DEFINE(WITH_LIBPSL, 0, [Define if you have libpsl])
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_LIBPSL, test "$with_libpsl" != "no")
|
||||
|
||||
PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.40], [have_libsoup=yes],[have_libsoup=no])
|
||||
AC_ARG_WITH(libsoup, AS_HELP_STRING([--with-libsoup=yes|no], [Link against libsoup]), [], [with_libsoup=${have_libsoup}])
|
||||
if test "$with_libsoup" != "no"; then
|
||||
|
@ -1296,4 +1309,5 @@ echo " LTO: $enable_lto"
|
|||
echo " linker garbage collection: $enable_ld_gc"
|
||||
echo " JSON validation for libnm: $enable_json_validation"
|
||||
echo " sanitizers: $sanitizers"
|
||||
echo " Mozilla Public Suffix List: $with_libpsl"
|
||||
echo
|
||||
|
|
|
@ -35,6 +35,7 @@ yum install \
|
|||
dbus-x11 \
|
||||
wireless-tools-devel \
|
||||
polkit-devel \
|
||||
libpsl-devel \
|
||||
libsoup-devel \
|
||||
readline-devel \
|
||||
teamd-devel \
|
||||
|
|
|
@ -137,6 +137,7 @@ BuildRequires: libxslt
|
|||
BuildRequires: bluez-libs-devel
|
||||
%endif
|
||||
BuildRequires: systemd >= 200-3 systemd-devel
|
||||
BuildRequires: libpsl-devel >= 0.1
|
||||
BuildRequires: libsoup-devel
|
||||
BuildRequires: libndp-devel >= 1.0
|
||||
%if 0%{?with_modem_manager_1}
|
||||
|
|
|
@ -52,17 +52,10 @@
|
|||
|
||||
#include "introspection/org.freedesktop.NetworkManager.DnsManager.h"
|
||||
|
||||
#if WITH_LIBSOUP
|
||||
#include <libsoup/soup.h>
|
||||
|
||||
#ifdef SOUP_CHECK_VERSION
|
||||
#if SOUP_CHECK_VERSION (2, 40, 0)
|
||||
#define DOMAIN_IS_VALID(domain) (*(domain) && !soup_tld_domain_is_public_suffix (domain))
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef DOMAIN_IS_VALID
|
||||
#if WITH_LIBPSL
|
||||
#include <libpsl.h>
|
||||
#define DOMAIN_IS_VALID(domain) (*(domain) && !psl_is_public_suffix (psl_builtin (), domain))
|
||||
#else
|
||||
#define DOMAIN_IS_VALID(domain) (*(domain))
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue