Deleted wrong file

This commit is contained in:
Bastien Nocera 2013-11-18 17:22:34 +01:00
parent 42ca3a0f34
commit 1b5c16bc39
2 changed files with 58 additions and 53 deletions

View File

@ -0,0 +1,58 @@
From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
Date: Sat, 12 Oct 2013 17:45:25 +0200
Subject: [PATCH] Allow using obexd without systemd in the user session
Not all sessions run systemd --user (actually, the majority
doesn't), so the dbus daemon must be able to spawn obexd
directly, and to do so it needs the full path of the daemon.
---
Makefile.obexd | 4 ++--
obexd/src/org.bluez.obex.service | 4 ----
obexd/src/org.bluez.obex.service.in | 4 ++++
3 files changed, 6 insertions(+), 6 deletions(-)
delete mode 100644 obexd/src/org.bluez.obex.service
create mode 100644 obexd/src/org.bluez.obex.service.in
diff --git a/Makefile.obexd b/Makefile.obexd
index 3760867..142e7c3 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -2,12 +2,12 @@
if SYSTEMD
systemduserunitdir = @SYSTEMD_USERUNITDIR@
systemduserunit_DATA = obexd/src/obex.service
+endif
dbussessionbusdir = @DBUS_SESSIONBUSDIR@
dbussessionbus_DATA = obexd/src/org.bluez.obex.service
-endif
-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
obex_plugindir = $(libdir)/obex/plugins
diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
deleted file mode 100644
index a538088..0000000
--- a/obexd/src/org.bluez.obex.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.bluez.obex
-Exec=/bin/false
-SystemdService=dbus-org.bluez.obex.service
diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
new file mode 100644
index 0000000..9c815f2
--- /dev/null
+++ b/obexd/src/org.bluez.obex.service.in
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.bluez.obex
+Exec=@libexecdir@/obexd
+SystemdService=dbus-org.bluez.obex.service
--
1.8.3.1

View File

@ -1,53 +0,0 @@
From 841896ae172c08c1652af88d0994f0349912ed14 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Sun, 10 Nov 2013 15:24:20 +0100
Subject: [PATCH] obex: Use user's cache dir as a default root
It's per-user, so we won't try to overwrite somebody else's
files in /tmp when that happens. It's also (unless we have a
particularly bizarre setup) on the same partition as the destination
folder which means we can atomically move the file to the destination
with a unique filename.
---
obexd/src/main.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/obexd/src/main.c b/obexd/src/main.c
index 61a06b2..80645f8 100644
--- a/obexd/src/main.c
+++ b/obexd/src/main.c
@@ -50,8 +50,6 @@
#include "obexd.h"
#include "server.h"
-#define DEFAULT_ROOT_PATH "/tmp"
-
#define DEFAULT_CAP_FILE CONFIGDIR "/capability.xml"
static GMainLoop *main_loop = NULL;
@@ -167,7 +165,7 @@ static GOptionEntry options[] = {
"Specify root folder location. Both absolute "
"and relative can be used, but relative paths "
"are assumed to be relative to user $HOME "
- "folder", "PATH" },
+ "folder. Default $XDG_CACHE_HOME", "PATH" },
{ "root-setup", 'S', 0, G_OPTION_ARG_STRING, &option_root_setup,
"Root folder setup script", "SCRIPT" },
{ "symlinks", 'l', 0, G_OPTION_ARG_NONE, &option_symlinks,
@@ -285,8 +283,11 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- if (option_root == NULL)
- option_root = g_strdup(DEFAULT_ROOT_PATH);
+ if (option_root == NULL) {
+ option_root = g_build_filename(g_get_user_cache_dir(), "obexd",
+ NULL);
+ g_mkdir_with_parents(option_root, 0700);
+ }
if (option_root[0] != '/') {
char *old_root = option_root, *home = getenv("HOME");
--
1.8.4.2