diff mbox series

[3/4] package/bluez5_utils: install datafiles with correct permissions

Message ID 20241205143650.3262372-3-fiona.klute@gmx.de
State Superseded
Headers show
Series [1/4] package/bluez5_utils{, -headers}: bump version to 5.79 | expand

Commit Message

Fiona Klute Dec. 5, 2024, 2:36 p.m. UTC
From: "Fiona Klute (WIWA)" <fiona.klute@gmx.de>

The datafiles include the dbus policy, without which bluetoothd fails
to start (unless it is provided by other means):

# /usr/libexec/bluetooth/bluetoothd -n
bluetoothd[1011]: Bluetooth daemon 5.78
D-Bus setup failed: Connection ":1.7" is not allowed to own the service "org.bluez" due to security policies in the configuration file
bluetoothd[1011]: src/main.c:main() Unable to get on D-Bus

The installation issue 1a8676aa6e4b0e372a1a744eac6e53c90c03bf0e was
meant to fix is the result of upstream incorrectly installing
/etc/bluetooth with 0555 (strictly read-only) permissions.

Fixes: 1a8676aa6e4b0e372a1a744eac6e53c90c03bf0e

Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
---
 ...eave-config-files-writable-for-owner.patch | 35 +++++++++++++++++++
 package/bluez5_utils/bluez5_utils.mk          |  4 ++-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 package/bluez5_utils/0002-Leave-config-files-writable-for-owner.patch

Comments

Peter Korsgaard Jan. 6, 2025, 4:11 p.m. UTC | #1
>>>>> "Fiona" == Fiona Klute via buildroot <buildroot@buildroot.org> writes:

 > From: "Fiona Klute (WIWA)" <fiona.klute@gmx.de>
 > The datafiles include the dbus policy, without which bluetoothd fails
 > to start (unless it is provided by other means):

 > # /usr/libexec/bluetooth/bluetoothd -n
 > bluetoothd[1011]: Bluetooth daemon 5.78
 > D-Bus setup failed: Connection ":1.7" is not allowed to own the
 > service "org.bluez" due to security policies in the configuration file
 > bluetoothd[1011]: src/main.c:main() Unable to get on D-Bus

 > The installation issue 1a8676aa6e4b0e372a1a744eac6e53c90c03bf0e was
 > meant to fix is the result of upstream incorrectly installing
 > /etc/bluetooth with 0555 (strictly read-only) permissions.

 > Fixes: 1a8676aa6e4b0e372a1a744eac6e53c90c03bf0e

 > Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>

Committed to 2024.11.x, thanks.
diff mbox series

Patch

diff --git a/package/bluez5_utils/0002-Leave-config-files-writable-for-owner.patch b/package/bluez5_utils/0002-Leave-config-files-writable-for-owner.patch
new file mode 100644
index 0000000000..30dec0c47e
--- /dev/null
+++ b/package/bluez5_utils/0002-Leave-config-files-writable-for-owner.patch
@@ -0,0 +1,35 @@ 
+From e94cb1a53bab1a3888d3576d0d5d23c2001acee4 Mon Sep 17 00:00:00 2001
+From: Fiona Klute <fiona.klute@gmx.de>
+Date: Thu, 5 Dec 2024 13:39:39 +0100
+Subject: [PATCH] Leave config files writable for owner
+
+This is needed both so the owner can adjust config as needed, and for
+distribution builds to be able to move/delete files as part of the
+build without adjusting permissions themselves. Limiting writes from
+the running service needs to be done in the systemd unit (already the
+case) or init script.
+
+See also: https://lore.kernel.org/linux-bluetooth/4d1206df-598b-4a68-8655-74981b62ecca@gmx.de/T/
+
+Upstream: https://lore.kernel.org/linux-bluetooth/20241205133233.1738092-1-fiona.klute@gmx.de/T/
+Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 297d0774c..29018a91c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -32,7 +32,7 @@ confdir = $(sysconfdir)/bluetooth
+ statedir = $(localstatedir)/lib/bluetooth
+ 
+ bluetoothd-fix-permissions:
+-	install -dm555 $(DESTDIR)$(confdir)
++	install -dm755 $(DESTDIR)$(confdir)
+ 	install -dm700 $(DESTDIR)$(statedir)
+ 
+ if DATAFILES
+-- 
+2.45.2
+
diff --git a/package/bluez5_utils/bluez5_utils.mk b/package/bluez5_utils/bluez5_utils.mk
index 7725fb94bf..e3b47e1e80 100644
--- a/package/bluez5_utils/bluez5_utils.mk
+++ b/package/bluez5_utils/bluez5_utils.mk
@@ -13,6 +13,9 @@  BLUEZ5_UTILS_LICENSE = GPL-2.0+, LGPL-2.1+
 BLUEZ5_UTILS_LICENSE_FILES = COPYING COPYING.LIB
 BLUEZ5_UTILS_CPE_ID_VENDOR = bluez
 BLUEZ5_UTILS_CPE_ID_PRODUCT = bluez
+# required because 0002-Leave-config-files-writable-for-owner.patch
+# modifies Makefile.am
+BLUEZ5_UTILS_AUTORECONF = YES
 
 BLUEZ5_UTILS_DEPENDENCIES = \
 	$(if $(BR2_PACKAGE_BLUEZ5_UTILS_HEADERS),bluez5_utils-headers) \
@@ -22,7 +25,6 @@  BLUEZ5_UTILS_DEPENDENCIES = \
 BLUEZ5_UTILS_CONF_OPTS = \
 	--enable-library \
 	--disable-cups \
-	--disable-datafiles \
 	--disable-manpages \
 	--disable-asan \
 	--disable-lsan \