We're getting "fuse: copy from pipe: short read" from
libfuse and a broken filesystem with this. See
https://github.com/flatpak/flatpak/issues/570
I've tried to look into if this is fixable, but I can't
really find any way we could do things differently that
may help, so the fix is to disable spice_read.
fi->fh is a uint64, and if we cast that directly to a pointer
on a 32bit arch then we get a warning, so lets first cast
to gsize, and then to pointer.
Should fix https://github.com/flatpak/flatpak/issues/173
If the name is lost *and* the session bus is closed, we would
crash with an assertion failure when the GError is overwritten.
Signed-off-by: Simon McVittie <smcv@debian.org>
This was using libflatpak which is the public API, instead of the internal
library, so it was breaking in all sorts of mysterious ways. This is fixed
by just directly calling the lowlevel common/* APIs.
Also, it didn't properly handle the case where the sandboxed app passed a
path that was not in /app, this should be allowed if the fd validation
passes, that is the whole point of the checks after all.
If flatpak is built from a separate build directory, code generation
fails because the directory structure is not in place. Create the
necessary directories before code generation.
In testing readonly exports, I noticed that gedit is does not believe
the mode it gets from stat()ing a file a million times. Instead
it calls access() to determine whether to treat it as readonly.
Since the document portal fuse file system did not implement
access(), gedit treated my file as writable and then failed when
I clicked "Save". With this patch, gedit treats the file as read-only
from the get-go.
When the document portal is called from within the sandbox with an
app-private file path, translate the path to a document portal URI in
order to make it available to other applications.
As soon as we get our D-Bus name, we can start receiving method calls. If
we reply immediately, callers will think our mount point is ready.
In particular, if FUSE is unavailable, we want "flatpak run" to proceed
with no document portal; it currently tries and fails to bind-mount the
nonexistent document portal mount-point into the container.
Signed-off-by: Simon McVittie <smcv@debian.org>
The xdp-impl-dbus.h header no longer exists - it came from an
earlier version of the document commands branch where I introduced
a separate interface. Just drop the include, it is not needed.