forked from flatpak/flatpak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out permission store from session helper
This is now available as org.freedesktop.impl.portal.PermissionStore
- Loading branch information
1 parent
605b3f4
commit 28b5491
Showing
16 changed files
with
270 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
introspectiondir = $(datadir)/dbus-1/interfaces | ||
introspection_DATA = \ | ||
data/org.freedesktop.impl.portal.PermissionStore.xml \ | ||
data/org.freedesktop.portal.Documents.xml \ | ||
data/org.freedesktop.Flatpak.xml \ | ||
$(NULL) | ||
|
||
EXTRA_DIST += \ | ||
data/org.freedesktop.portal.Documents.xml \ | ||
data/org.freedesktop.impl.portal.PermissionStore.xml \ | ||
data/org.freedesktop.systemd1.xml \ | ||
data/org.freedesktop.Flatpak.xml \ | ||
$(NULL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!DOCTYPE node PUBLIC | ||
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
|
||
<!-- | ||
Copyright (C) 2015 Red Hat, Inc. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General | ||
Public License along with this library; if not, write to the | ||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
Boston, MA 02110-1301, USA. | ||
Author: Alexander Larsson <[email protected]> | ||
--> | ||
|
||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
<interface name='org.freedesktop.impl.portal.PermissionStore'> | ||
|
||
<method name="Lookup"> | ||
<arg name='table' type='s' direction='in'/> | ||
<arg name='id' type='s' direction='in'/> | ||
<arg name='permissions' type='a{sas}' direction='out'/> | ||
<arg name='data' type='v' direction='out'/> | ||
</method> | ||
|
||
<method name="Set"> | ||
<arg name='table' type='s' direction='in'/> | ||
<arg name='create' type='b' direction='in'/> | ||
<arg name='id' type='s' direction='in'/> | ||
<arg name='app_permissions' type='a{sas}' direction='in'/> | ||
<arg name='data' type='v' direction='in'/> | ||
</method> | ||
|
||
<method name="Delete"> | ||
<arg name='table' type='s' direction='in'/> | ||
<arg name='id' type='s' direction='in'/> | ||
</method> | ||
|
||
<method name="SetValue"> | ||
<arg name='table' type='s' direction='in'/> | ||
<arg name='create' type='b' direction='in'/> | ||
<arg name='id' type='s' direction='in'/> | ||
<arg name='data' type='v' direction='in'/> | ||
</method> | ||
|
||
<method name="SetPermission"> | ||
<arg name='table' type='s' direction='in'/> | ||
<arg name='create' type='b' direction='in'/> | ||
<arg name='id' type='s' direction='in'/> | ||
<arg name='app' type='s' direction='in'/> | ||
<arg name='permissions' type='as' direction='in'/> | ||
</method> | ||
|
||
<method name="List"> | ||
<arg name='table' type='s' direction='in'/> | ||
<arg name='ids' type='as' direction='out'/> | ||
</method> | ||
|
||
<signal name="Changed"> | ||
<arg name='table' type='s' direction='out'/> | ||
<arg name='id' type='s' direction='out'/> | ||
<arg name='deleted' type='b' direction='out'/> | ||
<arg name='data' type='v' direction='out'/> | ||
<arg name='permissions' type='a{sas}' direction='out'/> | ||
</signal> | ||
</interface> | ||
|
||
</node> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
libexec_PROGRAMS += \ | ||
xdg-permission-store \ | ||
$(NULL) | ||
|
||
service_in_files += permission-store/xdg-permission-store.service.in | ||
systemduserunit_DATA += permission-store/xdg-permission-store.service | ||
|
||
service_in_files += permission-store/org.freedesktop.impl.portal.PermissionStore.service.in | ||
dbus_service_DATA += permission-store/org.freedesktop.impl.portal.PermissionStore.service | ||
|
||
ps_dbus_built_sources = permission-store/permission-store-dbus.c permission-store/permission-store-dbus.h | ||
BUILT_SOURCES += $(ps_dbus_built_sources) | ||
|
||
$(ps_dbus_built_sources) : data/org.freedesktop.impl.portal.PermissionStore.xml | ||
$(AM_V_GEN) $(GDBUS_CODEGEN) \ | ||
--interface-prefix org.freedesktop.impl.portal. \ | ||
--c-namespace Xdg \ | ||
--generate-c-code $(builddir)/permission-store/permission-store-dbus \ | ||
$(srcdir)/data/org.freedesktop.impl.portal.PermissionStore.xml \ | ||
$(NULL) | ||
|
||
xdg_permission_store_SOURCES = \ | ||
$(ps_dbus_built_sources) \ | ||
permission-store/permission-store.c \ | ||
permission-store/xdg-permission-store.c \ | ||
permission-store/xdg-permission-store.h \ | ||
$(NULL) | ||
|
||
xdg_permission_store_LDADD = $(BASE_LIBS) libflatpak-common.la | ||
xdg_permission_store_CFLAGS = $(BASE_CFLAGS) $(SOUP_CFLAGS) $(OSTREE_CFLAGS) $(GSYSTEM_CFLAGS) |
4 changes: 4 additions & 0 deletions
4
permission-store/org.freedesktop.impl.portal.PermissionStore.service.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[D-BUS Service] | ||
Name=org.freedesktop.impl.portal.PermissionStore | ||
Exec=@libexecdir@/xdg-permission-store | ||
SystemdService=xdg-permission-store.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright © 2014 Red Hat, Inc | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Authors: | ||
* Alexander Larsson <[email protected]> | ||
*/ | ||
|
||
#include "config.h" | ||
|
||
#include <locale.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <gio/gio.h> | ||
#include "permission-store-dbus.h" | ||
#include "xdg-permission-store.h" | ||
#include "flatpak-utils.h" | ||
|
||
static void | ||
on_bus_acquired (GDBusConnection *connection, | ||
const gchar *name, | ||
gpointer user_data) | ||
{ | ||
xdg_permission_store_start (connection); | ||
} | ||
|
||
static void | ||
on_name_acquired (GDBusConnection *connection, | ||
const gchar *name, | ||
gpointer user_data) | ||
{ | ||
} | ||
|
||
static void | ||
on_name_lost (GDBusConnection *connection, | ||
const gchar *name, | ||
gpointer user_data) | ||
{ | ||
exit (1); | ||
} | ||
|
||
int | ||
main (int argc, | ||
char **argv) | ||
{ | ||
guint owner_id; | ||
GMainLoop *loop; | ||
|
||
setlocale (LC_ALL, ""); | ||
|
||
g_setenv ("GIO_USE_VFS", "local", TRUE); | ||
|
||
g_set_prgname (argv[0]); | ||
|
||
flatpak_migrate_from_xdg_app (); | ||
|
||
owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, | ||
"org.freedesktop.impl.portal.PermissionStore", | ||
G_BUS_NAME_OWNER_FLAGS_NONE, | ||
on_bus_acquired, | ||
on_name_acquired, | ||
on_name_lost, | ||
NULL, | ||
NULL); | ||
|
||
loop = g_main_loop_new (NULL, FALSE); | ||
g_main_loop_run (loop); | ||
|
||
g_bus_unown_name (owner_id); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.