summaryrefslogtreecommitdiff
path: root/document-portal
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-09 14:07:22 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-09 14:07:22 +0200
commit28b549156ac26b183c07822a657e41d284075a0b (patch)
tree1957d3621daa6770acee6706661aa0cc1e550b25 /document-portal
parent605b3f4e09f87e3bccb432e1e225d856e47bffaa (diff)
downloadxdg-app-28b549156ac26b183c07822a657e41d284075a0b.tar.gz
Split out permission store from session helper
This is now available as org.freedesktop.impl.portal.PermissionStore
Diffstat (limited to 'document-portal')
-rw-r--r--document-portal/Makefile.am.inc3
-rw-r--r--document-portal/xdp-main.c45
2 files changed, 25 insertions, 23 deletions
diff --git a/document-portal/Makefile.am.inc b/document-portal/Makefile.am.inc
index f3dd0ba..26c3b5e 100644
--- a/document-portal/Makefile.am.inc
+++ b/document-portal/Makefile.am.inc
@@ -22,7 +22,8 @@ dbus_service_DATA += document-portal/org.freedesktop.portal.Documents.service
xdg_document_portal_SOURCES = \
document-portal/xdp-main.c \
document-portal/xdp-enums.h \
- $(xdp_dbus_built_sources) \
+ $(xdp_dbus_built_sources) \
+ $(ps_dbus_built_sources) \
document-portal/xdp-util.h \
document-portal/xdp-util.c \
document-portal/xdp-fuse.h \
diff --git a/document-portal/xdp-main.c b/document-portal/xdp-main.c
index a8a61f4..575ac90 100644
--- a/document-portal/xdp-main.c
+++ b/document-portal/xdp-main.c
@@ -17,6 +17,7 @@
#include "flatpak-dbus.h"
#include "flatpak-utils.h"
#include "flatpak-portal-error.h"
+#include "permission-store/permission-store-dbus.h"
#include "xdp-fuse.h"
#include <sys/eventfd.h>
@@ -36,7 +37,7 @@ typedef struct
static GMainLoop *loop = NULL;
static FlatpakDb *db = NULL;
-static FlatpakPermissionStore *permission_store;
+static XdgPermissionStore *permission_store;
static int daemon_event_fd = -1;
static int final_exit_status = 0;
static dev_t fuse_dev = 0;
@@ -89,14 +90,14 @@ do_set_permissions (FlatpakDbEntry *entry,
if (persist_entry (new_entry))
{
- flatpak_permission_store_call_set_permission (permission_store,
- TABLE_NAME,
- FALSE,
- doc_id,
- app_id,
- perms_s,
- NULL,
- NULL, NULL);
+ xdg_permission_store_call_set_permission (permission_store,
+ TABLE_NAME,
+ FALSE,
+ doc_id,
+ app_id,
+ perms_s,
+ NULL,
+ NULL, NULL);
}
}
@@ -243,8 +244,8 @@ portal_delete (GDBusMethodInvocation *invocation,
flatpak_db_set_entry (db, id, NULL);
if (persist_entry (entry))
- flatpak_permission_store_call_delete (permission_store, TABLE_NAME,
- id, NULL, NULL, NULL);
+ xdg_permission_store_call_delete (permission_store, TABLE_NAME,
+ id, NULL, NULL, NULL);
}
/* All i/o is done now, so drop the lock so we can invalidate the fuse caches */
@@ -303,13 +304,13 @@ do_create_doc (struct stat *parent_st_buf, const char *path, gboolean reuse_exis
if (persistent)
{
- flatpak_permission_store_call_set (permission_store,
- TABLE_NAME,
- TRUE,
- id,
- g_variant_new_array (G_VARIANT_TYPE ("{sas}"), NULL, 0),
- g_variant_new_variant (data),
- NULL, NULL, NULL);
+ xdg_permission_store_call_set (permission_store,
+ TABLE_NAME,
+ TRUE,
+ id,
+ g_variant_new_array (G_VARIANT_TYPE ("{sas}"), NULL, 0),
+ g_variant_new_variant (data),
+ NULL, NULL, NULL);
}
return id;
@@ -823,10 +824,10 @@ main (int argc,
do_exit (3);
}
- permission_store = flatpak_permission_store_proxy_new_sync (session_bus, G_DBUS_PROXY_FLAGS_NONE,
- "org.freedesktop.Flatpak",
- "/org/freedesktop/Flatpak/PermissionStore",
- NULL, &error);
+ permission_store = xdg_permission_store_proxy_new_sync (session_bus, G_DBUS_PROXY_FLAGS_NONE,
+ "org.freedesktop.impl.portal.PermissionStore",
+ "/org/freedesktop/impl/portal/PermissionStore",
+ NULL, &error);
if (permission_store == NULL)
{
g_print ("No permission store: %s\n", error->message);