SHA256
1
0
forked from pool/bluez
bluez/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
Stefan Seyfried 0dd2d3e636 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
2021-11-23 11:05:54 +00:00

39 lines
1.2 KiB
Diff

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