From 0aee7ca3f6d75e54524744cb30515048afb8a4ca Mon Sep 17 00:00:00 2001 From: Davide Caratti Date: Wed, 23 Jun 2021 11:01:03 +0200 Subject: [PATCH] fix 'check_conflicts' on multilib Related: #1967697 Signed-off-by: Davide Caratti --- 0002-issue144.patch | 85 +++++++++++++++++++++++++++++++++ 0003-fix-multilib-install.patch | 24 ++++++++++ mptcpd.spec | 5 +- 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 0002-issue144.patch create mode 100644 0003-fix-multilib-install.patch diff --git a/0002-issue144.patch b/0002-issue144.patch new file mode 100644 index 0000000..310e6df --- /dev/null +++ b/0002-issue144.patch @@ -0,0 +1,85 @@ +From f1207f311ec04aeda07759e04538d65d41d4ea4a Mon Sep 17 00:00:00 2001 +Message-Id: +From: dcaratti +Date: Wed, 23 Jun 2021 18:12:41 +0200 +Subject: [PATCH] Allow empty values of "plugin_dir" in mptcpd.conf. (#145) + +The plugin dirname is $(libdir)/mptcpd/ on standard configurations: +use this value in case the value of plugin_dir is empty in +/etc/mptcpd/mptcpd.conf. +--- + src/Makefile.am | 3 ++- + src/configuration.c | 27 ++++++++++----------------- + 2 files changed, 12 insertions(+), 18 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 09ca74c..4aa5037 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -31,7 +31,8 @@ libpath_manager_la_LIBADD = \ + + libpath_manager_la_CPPFLAGS = \ + $(AM_CPPFLAGS) \ +- -DMPTCPD_CONFIG_FILE='"$(sysconfdir)/@PACKAGE@/@PACKAGE@.conf"' ++ -DMPTCPD_CONFIG_FILE='"$(sysconfdir)/@PACKAGE@/@PACKAGE@.conf"' \ ++ -DMPTCPD_DEFAULT_PLUGINDIR='"$(libdir)/@PACKAGE@"' + + EXTRA_DIST = mptcp.service.in + +diff --git a/src/configuration.c b/src/configuration.c +index 2a48405..70a8e19 100644 +--- a/src/configuration.c ++++ b/src/configuration.c +@@ -304,8 +304,6 @@ static bool check_file_perms(char const *f) + static bool parse_config_file(struct mptcpd_config *config, + char const *filename) + { +- bool parsed = true; +- + assert(filename != NULL); + + if (!check_file_perms(filename)) +@@ -337,22 +335,17 @@ static bool parse_config_file(struct mptcpd_config *config, + group, + "plugin-dir"); + +- if (plugin_dir == NULL) { +- l_error("No plugin directory set in mptcpd " +- "configuration."); ++ set_plugin_dir(config, ++ plugin_dir ? plugin_dir : ++ l_strdup(MPTCPD_DEFAULT_PLUGINDIR)); + +- parsed = false; +- } else { +- set_plugin_dir(config, plugin_dir); +- +- // Default plugin name. Can be NULL. +- char *const default_plugin = +- l_settings_get_string(settings, +- group, +- "path-manager"); ++ // Default plugin name. Can be NULL. ++ char *const default_plugin = ++ l_settings_get_string(settings, ++ group, ++ "path-manager"); + +- set_default_plugin(config, default_plugin); +- } ++ set_default_plugin(config, default_plugin); + } else { + l_debug("Unable to mptcpd load settings from file '%s'", + filename); +@@ -360,7 +353,7 @@ static bool parse_config_file(struct mptcpd_config *config, + + l_settings_free(settings); + +- return parsed; ++ return true; + } + + /** +-- +2.31.1 + diff --git a/0003-fix-multilib-install.patch b/0003-fix-multilib-install.patch new file mode 100644 index 0000000..6915d9a --- /dev/null +++ b/0003-fix-multilib-install.patch @@ -0,0 +1,24 @@ +diff --git a/etc/mptcpd.conf.in b/etc/mptcpd.conf.in +index 615c63b..c6b31ac 100644 +--- a/etc/mptcpd.conf.in ++++ b/etc/mptcpd.conf.in +@@ -19,7 +19,6 @@ log=@mptcpd_logger@ + # ---------------- + # Plugin directory + # ---------------- +-plugin-dir=@pkglibdir@ + + # ------------------- + # Path manager plugin +diff --git a/src/mptcp.service.in b/src/mptcp.service.in +index 89dfe04..738f59f 100644 +--- a/src/mptcp.service.in ++++ b/src/mptcp.service.in +@@ -9,7 +9,6 @@ Documentation=man:mptcpd(8) + [Service] + Type=simple + DynamicUser=yes +-Environment=LD_LIBRARY_PATH=@libdir@ + ExecStart=@libexecdir@/mptcpd --log=journal + CapabilityBoundingSet=CAP_NET_ADMIN + AmbientCapabilities=CAP_NET_ADMIN diff --git a/mptcpd.spec b/mptcpd.spec index 5417006..aa527e5 100644 --- a/mptcpd.spec +++ b/mptcpd.spec @@ -20,6 +20,8 @@ BuildRequires: systemd-rpm-macros Source0: https://github.com/intel/mptcpd/archive/v%{version}/%{name}-%{version}.tar.gz Patch1: 0001-issue125.patch +Patch2: 0002-issue144.patch +Patch3: 0003-fix-multilib-install.patch %description The Multipath TCP Daemon is a daemon for Linux based operating systems that @@ -81,9 +83,10 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %{_libdir}/pkgconfig/mptcpd.pc %changelog -* Tue Jun 22 2021 Davide Caratti - 0.7-2 +* Wed Jun 23 2021 Davide Caratti - 0.7-2 - add a simple sanity test and enable gating. Related: rhbz#1962741 - don't overwrite global build options. Related: rhbz#1967697 +- fix 'check_conflicts' on multilib. Related: rhbz#1967697 * Wed Apr 28 2021 Davide Caratti - 0.7-1 - update to version 0.7