diff --git a/.bolt.metadata b/.bolt.metadata index e4122b7..8ef09b7 100644 --- a/.bolt.metadata +++ b/.bolt.metadata @@ -1 +1 @@ -7a219fa17f46ce276850d1f067b9f7c92084579b SOURCES/bolt-0.4.tar.bz2 +c87ace8d2405a88cc63a0b11ea54ee0f3842bd41 SOURCES/bolt-0.7.tar.bz2 diff --git a/.gitignore b/.gitignore index 5042e87..a38d810 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/bolt-0.4.tar.bz2 +SOURCES/bolt-0.7.tar.bz2 diff --git a/SOURCES/journal-fix-format.patch b/SOURCES/journal-fix-format.patch new file mode 100644 index 0000000..08cb661 --- /dev/null +++ b/SOURCES/journal-fix-format.patch @@ -0,0 +1,25 @@ +commit cf7387344ca9f78fa5aaaab38f41cf0ab9832568 +Author: Christian Kellner +Date: Fri Jan 4 11:44:53 2019 +0100 + + journal: fix invalid format string in warning + + Remove the erroneous extra string format specifier ('%s') that was + not passed; which of course is a bug and made some architectures + fall over. Should never actually happen in the wild, because bolt + tries very hard to not write invalid journal entries ... but who + knows. + +diff --git a/boltd/bolt-journal.c b/boltd/bolt-journal.c +index 715f862..5edd647 100644 +--- a/boltd/bolt-journal.c ++++ b/boltd/bolt-journal.c +@@ -490,7 +490,7 @@ bolt_journal_list (BoltJournal *journal, + if (err != NULL) + { + bolt_warn_err (err, LOG_TOPIC ("journal"), +- "invalid entry: '%s': %s", l); ++ "skipping entry '%s'", l); + continue; + } + diff --git a/SOURCES/py2-compat.patch b/SOURCES/py2-compat.patch index 119f7d0..96f143b 100644 --- a/SOURCES/py2-compat.patch +++ b/SOURCES/py2-compat.patch @@ -1,80 +1,3 @@ -From 826d887e8c76654e16dab2249b6035b748bdfeeb Mon Sep 17 00:00:00 2001 -From: Christian Kellner -Date: Wed, 6 Jun 2018 20:12:26 +0200 -Subject: [PATCH] test: integration: py2 compatibility - -The integration test was designed to run with python3, but we it -can be made to work with python2 quite easily so do that. ---- - tests/test-integration | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/tests/test-integration b/tests/test-integration -index 40c917d..f24900a 100755 ---- a/tests/test-integration -+++ b/tests/test-integration -@@ -1,4 +1,5 @@ - #!/usr/bin/python3 -+# -*- coding: utf-8 -*- - # - # bolt integration test suite - # -@@ -19,6 +20,8 @@ - # Authors: - # Christian J. Kellner - -+from __future__ import print_function -+ - import binascii - import os - import shutil --- -2.17.1 - -From d8e8920806a9d1afa691e4d5e7f16c67806d110c Mon Sep 17 00:00:00 2001 -From: Christian Kellner -Date: Wed, 6 Jun 2018 20:20:02 +0200 -Subject: [PATCH] test: integration: import configparser globally - -Instead of importing it twice locally in two functions, import it -globally; do so in the checked block because it is not installed -by default and thus might be missing. ---- - tests/test-integration | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tests/test-integration b/tests/test-integration -index f24900a..d2fd7df 100755 ---- a/tests/test-integration -+++ b/tests/test-integration -@@ -45,6 +45,8 @@ try: - - import dbus - import dbusmock -+ -+ import configparser - except ImportError as e: - sys.stderr.write('Skipping integration test due to missing depdendencies: %s\n' % str(e)) - sys.exit(1) -@@ -924,7 +926,6 @@ class BoltTest(dbusmock.DBusTestCase): - self.polkitd = None - - def user_config(self, **kwargs): -- import configparser - cfg = configparser.ConfigParser() - cfg.optionxform = lambda option: option - -@@ -1017,7 +1018,6 @@ class BoltTest(dbusmock.DBusTestCase): - return x[0] - - def store_device(self, dev, policy='auto', key=None): -- import configparser - df = configparser.ConfigParser() - df.optionxform = lambda option: option - --- -2.17.1 - From 4ada3a5ce4aa4cfe7e3f0a066c2b9be7281f8930 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 6 Jun 2018 20:34:56 +0200 diff --git a/SOURCES/restricting-capabilities.patch b/SOURCES/restricting-capabilities.patch deleted file mode 100644 index 0374669..0000000 --- a/SOURCES/restricting-capabilities.patch +++ /dev/null @@ -1,26 +0,0 @@ -From e962b3260a8baa104b2fc914e8e8974c7b70fcd4 Mon Sep 17 00:00:00 2001 -From: Christian Kellner -Date: Fri, 29 Jun 2018 14:03:29 +0300 -Subject: [PATCH] data: tighten sandbox by restricting capabilities - -We only need CAP_NET_ADMIN capability for the udev netlink socket -manipulations. All other capabilities can be dropped, reducing -the damage that can be done. -Thanks to Richard Maciel Costa for hi help on -this. ---- - data/bolt.service.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/data/bolt.service.in b/data/bolt.service.in -index 7cb1dae..5c33d43 100644 ---- a/data/bolt.service.in -+++ b/data/bolt.service.in -@@ -18,3 +18,4 @@ RestrictAddressFamilies=AF_NETLINK AF_UNIX - RestrictRealtime=yes - ReadWritePaths=@dbdir@ - SystemCallFilter=~@mount -+CapabilityBoundingSet=CAP_NET_ADMIN --- -2.17.1 - diff --git a/SOURCES/unsupported-settings.patch b/SOURCES/unsupported-settings.patch new file mode 100644 index 0000000..181f67c --- /dev/null +++ b/SOURCES/unsupported-settings.patch @@ -0,0 +1,38 @@ +From 6b62f6a9c94db39c635215ed4acf48bfe4b99d23 Mon Sep 17 00:00:00 2001 +From: Christian Kellner +Date: Wed, 27 Mar 2019 15:05:40 +0100 +Subject: [PATCH] data: remove unsupported service file settings + +On older systemd (say 219) some of the settings we use in bolt are +not supported and systemd would warn about them, so remove them. +--- + data/bolt.service.in | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/data/bolt.service.in b/data/bolt.service.in +index d17b4c7..a9e7a8a 100644 +--- a/data/bolt.service.in ++++ b/data/bolt.service.in +@@ -11,19 +11,9 @@ ExecStart=@libexecdir@/boltd + Restart=on-failure + NotifyAccess=main + +-MemoryDenyWriteExecute=yes + PrivateTmp=yes +-ProtectControlGroups=yes + ProtectHome=yes +-ProtectKernelModules=yes + ProtectSystem=full + RestrictAddressFamilies=AF_NETLINK AF_UNIX +-RestrictRealtime=yes +-ReadWritePaths=@dbdir@ + SystemCallFilter=~@mount + CapabilityBoundingSet=CAP_NET_ADMIN +- +-#directory management +-RuntimeDirectory=@dbname@ +-RuntimeDirectoryPreserve=yes +-StateDirectory=@dbname@ +-- +2.20.1 + diff --git a/SOURCES/use-sendfile.patch b/SOURCES/use-sendfile.patch new file mode 100644 index 0000000..a81b4cb --- /dev/null +++ b/SOURCES/use-sendfile.patch @@ -0,0 +1,35 @@ +From acda1b0d97fa9e2a3ea3a51619d30d7f2d0f7244 Mon Sep 17 00:00:00 2001 +From: Christian Kellner +Date: Tue, 26 Mar 2019 17:52:28 +0100 +Subject: [PATCH] common: use sendfile instead of copy_file_range + +On older kernels we cannot use copy_file_range so use sendfile +instead. +--- + common/bolt-io.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/common/bolt-io.c b/common/bolt-io.c +index 5e50afa..375f978 100644 +--- a/common/bolt-io.c ++++ b/common/bolt-io.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -831,7 +832,7 @@ bolt_copy_bytes (int fd_from, + { + ssize_t r; + +- r = copy_file_range (fd_from, NULL, fd_to, NULL, len, 0); ++ r = sendfile (fd_to, fd_from, NULL, len); + + if (r == -1) + { +-- +2.20.1 + diff --git a/SPECS/bolt.spec b/SPECS/bolt.spec index 5793759..39849a8 100644 --- a/SPECS/bolt.spec +++ b/SPECS/bolt.spec @@ -1,12 +1,14 @@ Name: bolt -Version: 0.4 -Release: 3%{?dist} +Version: 0.7 +Release: 1%{?dist} Summary: Thunderbolt device manager License: LGPLv2+ URL: https://gitlab.freedesktop.org/bolt/bolt Source0: %{url}/-/archive/%{version}/%{name}-%{version}.tar.bz2 Patch0: py2-compat.patch -Patch1: restricting-capabilities.patch +Patch1: journal-fix-format.patch +Patch2: use-sendfile.patch +Patch3: unsupported-settings.patch BuildRequires: gcc BuildRequires: asciidoc @@ -41,12 +43,10 @@ boltctl, can be used to control the daemon and perform all the above mentioned tasks. %prep -%setup -q -%patch0 -p1 -%patch1 -p1 +%autosetup -p1 %build -%meson -Ddb-path=%{_localstatedir}/lib/boltd +%meson -Ddb-name=boltd %meson_build %check @@ -83,6 +83,14 @@ install -m0755 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/boltd %dir %{_localstatedir}/lib/boltd %changelog +* Tue Mar 26 2019 Christian Kellner - 0.7-1 +- bolt 0.7 release with pre-bootacl support. + Resolves: #1629713 +- Patch to fix a format string bug in the 0.7 +- Drop restricting-capabilities.patch (included in 0.7) +- Patch to not use unsuppported unit file settings. + Resolves: #1631050 + * Wed Jul 18 2018 Christian Kellner - 0.4-3 - Include patch to tighten sandbox by restricting capabilities - Resolves: #1559611