diff options
author | Ondrej Holy <oholy@redhat.com> | 2019-05-14 09:31:37 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2019-07-11 11:24:17 +0000 |
commit | e782512ba06374bdc45998a9b7908f5b3c500393 (patch) | |
tree | 0c0d2710556c973a67a2eee8aa33c3da6d0cba50 /daemon/gvfsjobmakesymlink.c | |
parent | 6493083b1d7a839257e7dcec390c6ae20c0f3aa4 (diff) | |
download | gvfs-e782512ba06374bdc45998a9b7908f5b3c500393.tar.gz |
daemon: Handle lockdown option to disable writing
Handle the new mount-removable-storage-devices-as-read-only option of
org.gnome.desktop.lockdown schema and present AFC, MTP, GPhoto2 devices
as read-only if enabled.
Diffstat (limited to 'daemon/gvfsjobmakesymlink.c')
-rw-r--r-- | daemon/gvfsjobmakesymlink.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/daemon/gvfsjobmakesymlink.c b/daemon/gvfsjobmakesymlink.c index 2c55e26b..2684b6fd 100644 --- a/daemon/gvfsjobmakesymlink.c +++ b/daemon/gvfsjobmakesymlink.c @@ -124,6 +124,13 @@ try (GVfsJob *job) GVfsJobMakeSymlink *op_job = G_VFS_JOB_MAKE_SYMLINK (job); GVfsBackendClass *class = G_VFS_BACKEND_GET_CLASS (op_job->backend); + if (g_vfs_backend_get_readonly_lockdown (op_job->backend)) + { + g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, + _("Filesystem is read-only")); + return TRUE; + } + if (class->try_make_symlink == NULL) return FALSE; |