-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libportal should treat file URIs as paths inside the sandbox namespace #31
Comments
Hmm, I don't think the second point makes sense, because applications do not have access to paths outside the sandbox, so how would an application ever successfully pass such a path? It doesn't make sense. So I would rephrase this bug report as: "libportal should treat file URIs as paths inside the sandbox namespace." In the case of /usr/share, that's going to be mounted in the sandbox, so it should work out the same. |
I agree with you that a file:/// URI should point in the sandbox, not outside. This is however how it reacts for now.
I used a path in /usr/share to not have to install an image in the sandbox in meson.build (but this works with anything in the sandbox as you understanded). But the point is about all files in the sandbox. So I'll rephrase the title and clarify the original post to be clearer. |
it seems that the problem is in xdg-desktop-portal as it crashes when I pass a file:/// URI (but this issue shouldn't be closed for the moment as it might as well be libportal's fault). The errors printed are ** (/usr/libexec/xdg-desktop-portal:13723): DEBUG: 21:37:33.265: No 'wallpaper' permissions found: No entry for wallpaper
(/usr/libexec/xdg-desktop-portal:13723): GLib-CRITICAL **: 21:37:33.265: g_variant_get_type: assertion 'value != NULL' failed
(/usr/libexec/xdg-desktop-portal:13723): GLib-CRITICAL **: 21:37:33.265: g_variant_type_is_subtype_of: assertion 'g_variant_type_check (type)' failed
(/usr/libexec/xdg-desktop-portal:13723): GLib-CRITICAL **: 21:37:33.265: g_variant_get_type_string: assertion 'value != NULL' failed
(/usr/libexec/xdg-desktop-portal:13723): GLib-ERROR **: 21:37:33.265: g_variant_new: expected GVariant of type 'a{sv}' but received value has type '(null)'
Thread 11 "pool-/usr/libex" received signal SIGTRAP, Trace/breakpoint trap. I will debug and obtain a full backtrace from gdb. |
The full backtrace of the crash is as follow.
I couldn't manage to know the symbol names of the two last ones (even after having installed every debuginfo package that appeared as "missing"). This is the what I could find by running xdg-desktop-portal with gdb. In src/wallpaper.c of xdg-desktop-portal, function handle_set_wallpaper_in_thread_func, when the SetWallpaperFile is called (i.e. using the file:/// uri scheme in libportal), I printed the fd variable which was 24 in my case. So looking to /proc//fd/, the file designated by this path is the image that I passed in epiphany (which links to /tmp/epiphany-XXXXXXX/<image_basename>) which means that the problem is not in libportal (it could in fact, if it doesn't use the correct flag to open then pass the fd) nor the code in epiphany but in xdp (xdg-desktop-portal). So in the function previously cited, the code enter in the |
I've added this to my TODO to investigate. |
Thanks ;) (trying) to debug was quite fun actually (though I couldn't fix this) :D |
Had you any time to look at this (no hurry, just so epiphany's MR can be merged) ? |
Nope, still on my TODO, sorry. |
this might get fixed by flatpak/xdg-desktop-portal#515, as it touches how fd and uri are handled (and closed). Let's see once it's merged. |
I haven't looked at flatpak/xdg-desktop-portal#515, just wanted to mention this is still on my TODO. |
I'm looking into this. The problem isn't xdg-desktop-portal, but libportal, because an other wrapper around the dbus api (in rust, ashpd) works on my side. Will look into it. |
So in https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/673#note_925875 we determined that I am not able to reproduce this. We don't know why, but one difference is that I have upgraded to F33 while Vanadiae is still on F32. It's optimistic, but if we're lucky, maybe this fixed itself somehow. |
We can pass multiple types of uri parameter to xdp_portal_set_wallpaper:
https://avatars2.githubusercontent.com/u/48521955?s=60&v=4
which is my avatar icon. This works.However, the third point doesn't work. If I pass a file:/// URI, it thinks it is outside the sandbox and doesn't find it and if I pass a filename (
/tmp/app111/image.png
), there is the loading spinner forever but the image can't be set as wallpaper nor does it appear in the preview window.This is reproducable by applying this patch to a clean master tree (with the path changed to an image installed in the sandbox) and run PortalTest:
This currently blocks my MR for GNOME Web for the time being.
I hope it can be fixed.
Edited to clarify, following mcatanzaro message.
The text was updated successfully, but these errors were encountered: