SHA256
1
0
forked from pool/bluez

Accepting request 933239 from home:iznogood:branches:Base:System

NOTE: For the enabling of obex userservice to default to "on" - we need to sub a change to systemd-presets-common-SUSE.
The question is if we should do that - I'd wager that the number of users actually using bluetooth filetransfer is really low, and we should not enable this for everyone and their siblings.
This is also some of the reason for me to split out the obex service in own sub-package.
However should we want to add obex to default on, we need to push the systemd-preset change first/at the same time.

- Stop nuking the obex service, we support user systemd services
  just fine now. Following this, no longer hack the dbus service,
  leave it as a systemd service as upstream intended.
- Split out obex in own package with it's needed enabledment as a
  systemd user service.
- Add 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch:
  obex: Use GLib helper function to manipulate paths. Instead of
  trying to do it by hand. This also makes sure that relative paths
  aren't used by the agent. Patch from fedora.

OBS-URL: https://build.opensuse.org/request/show/933239
OBS-URL: https://build.opensuse.org/package/show/Base:System/bluez?expand=0&rev=318
This commit is contained in:
Stefan Seyfried 2021-11-23 11:05:54 +00:00 committed by Git OBS Bridge
parent 21cae03eb2
commit 0dd2d3e636
3 changed files with 80 additions and 10 deletions

View File

@ -0,0 +1,38 @@
From 90b72b787a6ae6b9b0bf8ece238e108e8607a433 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Sat, 9 Nov 2013 18:13:43 +0100
Subject: [PATCH 1/2] obex: Use GLib helper function to manipulate paths
Instead of trying to do it by hand. This also makes sure that
relative paths aren't used by the agent.
---
obexd/src/manager.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index f84384ae4..285c07c37 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -650,14 +650,14 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
DBUS_TYPE_STRING, &name,
DBUS_TYPE_INVALID)) {
/* Splits folder and name */
- const char *slash = strrchr(name, '/');
+ gboolean is_relative = !g_path_is_absolute(name);
DBG("Agent replied with %s", name);
- if (!slash) {
- agent->new_name = g_strdup(name);
+ if (is_relative) {
+ agent->new_name = g_path_get_basename(name);
agent->new_folder = NULL;
} else {
- agent->new_name = g_strdup(slash + 1);
- agent->new_folder = g_strndup(name, slash - name);
+ agent->new_name = g_path_get_basename(name);
+ agent->new_folder = g_path_get_dirname(name);
}
}
--
2.14.1

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Nov 23 09:52:32 UTC 2021 - Bjørn Lie <bjorn.lie@gmail.com>
- Stop nuking the obex service, we support user systemd services
just fine now. Following this, no longer hack the dbus service,
leave it as a systemd service as upstream intended.
- Split out obex in own package with it's needed enabledment as a
systemd user service.
- Add 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch:
obex: Use GLib helper function to manipulate paths. Instead of
trying to do it by hand. This also makes sure that relative paths
aren't used by the agent. Patch from fedora.
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Oct 17 07:39:24 UTC 2021 - Stefan Seyfried <seife+obs@b1-systems.com> Sun Oct 17 07:39:24 UTC 2021 - Stefan Seyfried <seife+obs@b1-systems.com>

View File

@ -53,6 +53,9 @@ Patch6: 0002-Use-g_memdup2-everywhere.patch
# #
# Move 43xx firmware path for RPi3 bluetooth support bsc#1140688 # Move 43xx firmware path for RPi3 bluetooth support bsc#1140688
Patch10: RPi-Move-the-43xx-firmware-into-lib-firmware.patch Patch10: RPi-Move-the-43xx-firmware-into-lib-firmware.patch
#
# PATCH-FIX-UPSTREAM 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch -- obex: Use GLib helper function to manipulate paths
Patch11: https://src.fedoraproject.org/rpms/bluez/raw/rawhide/f/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
# Upstream suggests to use btmon instead of hcidump and does not want those patches # Upstream suggests to use btmon instead of hcidump and does not want those patches
# => PATCH-FIX-OPENSUSE for those two :-) # => PATCH-FIX-OPENSUSE for those two :-)
# fix some memory leak with malformed packet (reported upstream but not yet fixed) # fix some memory leak with malformed packet (reported upstream but not yet fixed)
@ -184,15 +187,20 @@ Note that this package will go away before end of 2020, change your code
to use the modern tools instead. to use the modern tools instead.
%endif %endif
%package obexd
Summary: Object Exchange daemon for sharing content
License: GPL-2.0-or-later
Group: Hardware/Mobile
Requires: bluez = %{version}
%description obexd
Object Exchange daemon for sharing content.
%prep %prep
%setup -q %setup -q
%autopatch -p1 %autopatch -p1
mkdir dbus-apis mkdir dbus-apis
cp -a doc/*.txt dbus-apis/ cp -a doc/*.txt dbus-apis/
# FIXME: Change the dbus service to be a real service, not systemd launched
sed -i "s:Exec=/bin/false:Exec=%{_libexecdir}/bluetooth/obexd:g" obexd/src/org.bluez.obex.service
sed -i "/SystemdService=.*/d" obexd/src/org.bluez.obex.service
# END FIXME
# for auto-enable subpackage # for auto-enable subpackage
sed -i '/^#AutoEnable=false/aAutoEnable=true' src/main.conf sed -i '/^#AutoEnable=false/aAutoEnable=true' src/main.conf
@ -242,10 +250,6 @@ install --mode=0644 -D %{SOURCE7} %{buildroot}/%{_sysconfdir}/modprobe.d/50-blue
# no idea why this is suddenly necessary... # no idea why this is suddenly necessary...
install --mode 0755 -d %{buildroot}%{_localstatedir}/lib/bluetooth install --mode 0755 -d %{buildroot}%{_localstatedir}/lib/bluetooth
# FIXME: Do not delete the systemd service once we support systemd user/session services
rm %{buildroot}%{_userunitdir}/obex.service
# end FIXME
## same as in fedora... ## same as in fedora...
# "make install" fails to install gatttool, used with Bluetooth Low Energy # "make install" fails to install gatttool, used with Bluetooth Low Energy
# boo#970628 # boo#970628
@ -318,6 +322,18 @@ touch -r %{SOURCE0} %{buildroot}%{_defaultdocdir}/%{name}/README-mesh.SUSE
%post -n libbluetooth3 -p /sbin/ldconfig %post -n libbluetooth3 -p /sbin/ldconfig
%postun -n libbluetooth3 -p /sbin/ldconfig %postun -n libbluetooth3 -p /sbin/ldconfig
%pre obexd
%systemd_user_pre obex.service
%post obexd
%systemd_user_post obex.service
%preun obexd
%systemd_user_preun obex.service
%postun obexd
%systemd_user_postun obex.service
%files %files
%doc AUTHORS ChangeLog README dbus-apis src/main.conf %doc AUTHORS ChangeLog README dbus-apis src/main.conf
%if %{with mesh} %if %{with mesh}
@ -339,7 +355,6 @@ touch -r %{SOURCE0} %{buildroot}%{_defaultdocdir}/%{name}/README-mesh.SUSE
%{_bindir}/mesh-cfgtest %{_bindir}/mesh-cfgtest
%{_mandir}/man8/bluetooth-meshd.8%{?ext_man} %{_mandir}/man8/bluetooth-meshd.8%{?ext_man}
%endif %endif
%{_libexecdir}/bluetooth/obexd
%{_bindir}/bluetoothctl %{_bindir}/bluetoothctl
%{_bindir}/btmon %{_bindir}/btmon
%if %{with mesh} %if %{with mesh}
@ -364,11 +379,15 @@ touch -r %{SOURCE0} %{buildroot}%{_defaultdocdir}/%{name}/README-mesh.SUSE
%{_unitdir}/bluetooth-mesh.service %{_unitdir}/bluetooth-mesh.service
%endif %endif
%{_datadir}/dbus-1/system-services/org.bluez.service %{_datadir}/dbus-1/system-services/org.bluez.service
%{_datadir}/dbus-1/services/org.bluez.obex.service
# not packaged, boo#1151518 # not packaged, boo#1151518
###%%{_datadir}/dbus-1/system-services/org.bluez.mesh.service ###%%{_datadir}/dbus-1/system-services/org.bluez.mesh.service
%{_datadir}/zsh/site-functions/_bluetoothctl %{_datadir}/zsh/site-functions/_bluetoothctl
%files obexd
%{_libexecdir}/bluetooth/obexd
%{_datadir}/dbus-1/services/org.bluez.obex.service
%{_userunitdir}/obex.service
%if %{with bluez_deprecated} %if %{with bluez_deprecated}
%files deprecated %files deprecated
%{_bindir}/gatttool %{_bindir}/gatttool