gvfs-set-attribute not working from sandbox
hbons opened this issue · 12 comments
I didn't want to hijack #143, so opening a new issue.
I'm trying to run gvfs-set-attribute
on a file from a sandbox, but it's not working. The app has access to /home and the command succeeds (changing a folder icon) when run outside the sandbox. Exit code is 0 for both scenarios.
Not sure if I'm doing something wrong or that this is not (yet) supported. Here's my spec file: https://github.com/hbons/org.sparkleshare.SparkleShare/blob/master/org.sparkleshare.SparkleShare.json
It seems to work here:
$ xdg-app run --nofilesystem=host --filesystem=home --talk-name=org.gtk.vfs.* --command=sh org.gnome.gedit
sh-4.3$ touch foo
sh-4.3$ gvfs-info -a "metadata::foobar" foo
uri: file:///home/alex/foo
attributes:
sh-4.3$ gvfs-set-attribute foo metadata::foobar test
sh-4.3$ gvfs-info -a "metadata::foobar" foo
uri: file:///home/alex/foo
attributes:
metadata::foobar: test
@hadess after. I'll try again from the shell like Alex did to see if there's a clue.
Tested again with a shell in the sandbox: I can set an attribute, but it stays contained in the sandbox. When I run gvfs-info outside the sandbox I get the older value.
This is with xdg-app run --nofilesystem=host --command=sh --talk-name=org.gtk.vfs.* org.sparkleshare.SparkleShare
.
Ah, i see, the app gets:
export XDG_DATA_HOME="/home/alex/.var/app/org.gnome.gedit/data"
And this causes gvfs to look for metadata there. So, everything works, but its per-app metadata.
Which is right for some things, but not always.
i.e. for me it stored the setting in ~/.var/app/org.gnome.gedit/data/gvfs-metadata/home
@alexlarsson ah, so what do I do to fix it? :)
Its tricky. An obvious "fix" is to just set --env in your app so that XDG_DATA_HOME is the regular value (~/.local/share), but then a bunch of other things that you might want to be per-app will be stored in a global location.
I can set that in the local Process.StartInfo, so it won't affect anything else. Thanks, I'll try that. :)
Oh, it will affect all kinds of things...
I'm only changing the env var for that one command: hbons/SparkleShare@5bfea7e
It works now. :)