diff options
author | Alexander Larsson <alexl@redhat.com> | 2015-09-03 17:53:32 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2015-09-03 17:53:32 +0200 |
commit | 59325dfbe1f855434f87b7791d11175bfdfb9766 (patch) | |
tree | 77827f15377eb7d82aa6f7889962d5397ed37a15 /daemon | |
parent | 7fd91dfb7c48ed31688bcfcdc2dd5ab3f37a7377 (diff) | |
download | gvfs-59325dfbe1f855434f87b7791d11175bfdfb9766.tar.gz |
Make all gvfs daemons own a name under org.gtk.vfs.*
This allows you to easily allow access to gvfs from a sandbox.
Just give it talk access to org.gtk.vfs.* and everything will work.
This change does three things:
Change the existing mountpoint dbus names from
org.gtk.vfs.mountpoint.foo
to
org.gtk.vfs.mountpoint_foo
For other mountpoints, always own:
org.gtk.vfs.mountpoint_$pid
Change the dbus name of the volume monitors from
org.gtk.Private.fooMonitor
to
org.gtk.vfs.fooMonitor
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/Makefile.am | 4 | ||||
-rw-r--r-- | daemon/daemon-main.c | 28 | ||||
-rw-r--r-- | daemon/http.mount.in | 2 | ||||
-rw-r--r-- | daemon/smb-browse.mount.in | 2 |
4 files changed, 17 insertions, 19 deletions
diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 59f4a55d..a970bff6 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -261,7 +261,7 @@ gvfsd_smb_browse_SOURCES = \ gvfsd_smb_browse_CPPFLAGS = \ $(flags) \ -DBACKEND_HEADER=gvfsbackendsmbbrowse.h \ - -DMOUNTABLE_DBUS_NAME=org.gtk.vfs.mountpoint.smb_browse \ + -DMOUNTABLE_DBUS_NAME=org.gtk.vfs.mountpoint_smb_browse \ -DMAX_JOB_THREADS=1 \ -DBACKEND_TYPES='"smb-network", G_VFS_TYPE_BACKEND_SMB_BROWSE,"smb-server", G_VFS_TYPE_BACKEND_SMB_BROWSE,' @@ -486,7 +486,7 @@ gvfsd_http_SOURCES = \ gvfsd_http_CPPFLAGS = \ $(flags) \ -DBACKEND_HEADER=gvfsbackendhttp.h \ - -DMOUNTABLE_DBUS_NAME=org.gtk.vfs.mountpoint.http \ + -DMOUNTABLE_DBUS_NAME=org.gtk.vfs.mountpoint_http \ -DDEFAULT_BACKEND_TYPE=http \ -DMAX_JOB_THREADS=1 \ $(HTTP_CFLAGS) \ diff --git a/daemon/daemon-main.c b/daemon/daemon-main.c index 4b2d5419..d72ea52c 100644 --- a/daemon/daemon-main.c +++ b/daemon/daemon-main.c @@ -386,21 +386,19 @@ daemon_main (int argc, loop = g_main_loop_new (NULL, FALSE); name_owner_id = 0; - if (mountable_name) - { - name_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, - mountable_name, - G_BUS_NAME_OWNER_FLAGS_NONE, - NULL, - on_name_acquired, - on_name_lost, - data, - NULL); - } - else - { - g_idle_add (do_name_acquired, data); - } + /* We want to own *some* name on the org.gtk.vfs.* namespace so that + filtering for us works from a sandbox */ + if (mountable_name == NULL) + mountable_name = g_strdup_printf ("org.gtk.vfs.mountpoint_%d", getpid ()); + + name_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, + mountable_name, + G_BUS_NAME_OWNER_FLAGS_NONE, + NULL, + on_name_acquired, + on_name_lost, + data, + NULL); g_main_loop_run (loop); diff --git a/daemon/http.mount.in b/daemon/http.mount.in index 21b7930b..db0309ca 100644 --- a/daemon/http.mount.in +++ b/daemon/http.mount.in @@ -2,4 +2,4 @@ Type=http Exec=@libexecdir@/gvfsd-http AutoMount=true -DBusName=org.gtk.vfs.mountpoint.http +DBusName=org.gtk.vfs.mountpoint_http diff --git a/daemon/smb-browse.mount.in b/daemon/smb-browse.mount.in index e3b267f9..a2970d08 100644 --- a/daemon/smb-browse.mount.in +++ b/daemon/smb-browse.mount.in @@ -1,6 +1,6 @@ [Mount] Type=smb-network;smb-server Exec=@libexecdir@/gvfsd-smb-browse -DBusName=org.gtk.vfs.mountpoint.smb_browse +DBusName=org.gtk.vfs.mountpoint_smb_browse AutoMount=false Scheme=smb |