summaryrefslogtreecommitdiffstats
path: root/binding/bluetooth-map-common.h
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-07-29 18:05:28 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-07-31 09:28:25 -0700
commitd1d197e5a134db00ce26a65b8d79cfbe2bee9fac (patch)
tree62fe6b29b3e717e67da955cb5d84618d387db65e /binding/bluetooth-map-common.h
parent8b9c25f4546d190d9cf5851c5b88f50db2f8cda2 (diff)
Data transfers needs to be stored in /run/user/UID/usrshr to get the User::App-Shared Smack label on creation from obexd Bug-AGL: SPEC-2695 Change-Id: Ia482234fe7356cb0965c1ed7e4065e72543514bd Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/bluetooth-map-common.h')
-rw-r--r--binding/bluetooth-map-common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/binding/bluetooth-map-common.h b/binding/bluetooth-map-common.h
index f154c91..6e93b9f 100644
--- a/binding/bluetooth-map-common.h
+++ b/binding/bluetooth-map-common.h
@@ -177,4 +177,21 @@ json_object *get_named_property(const struct property_info *pi,
json_object *bmessage_parse(const gchar *bmessage);
GString *bmessage_encoder(afb_req_t request);
+
+/* helper defines */
+
+#define OBEX_USRSHR_PATH "/run/user/%d/usrshr"
+
+#define get_obex_tmpdir() \
+ ({ \
+ uid_t __uid = getuid(); \
+ size_t __len; \
+ __len = sizeof(uid_t) + 1 + sizeof(OBEX_USRSHR_PATH) + 1; \
+ char *__tpath; \
+ __tpath = alloca(__len + 1); \
+ snprintf(__tpath, __len, \
+ OBEX_USRSHR_PATH, __uid); \
+ __tpath; \
+ })
+
#endif /* BLUETOOTH_MAP_COMMON_H */