Commit Graph

105 Commits (94d5f0a86e40543917a9ff7c0749b32cc2982d1b)

Author SHA1 Message Date
Alexander Larsson 4fdac9e5d4 document portal: Disable spice_read as it seems broken
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.
2017-02-23 16:55:49 +01:00
Alexander Larsson 84246b6ec5 document-portal: Fix ownership of basic directories
We now report these as the user uid+gid instead of root.
2017-02-14 09:07:15 +01:00
Alexander Larsson 9791268c6b document portal: Support access() on directories 2017-01-18 11:32:44 +01:00
Alexander Larsson 4be202442d document portal: Add some debug spew 2017-01-18 11:32:44 +01:00
Alexander Larsson 8909b5437d document-portal: Treat newly created files (EXCL) as truncated ones
The EXCL pretty much guarantees it is a new file.
2017-01-18 11:32:44 +01:00
Alexander Larsson 13b0c78fe5 document portal: Report right error for setattr 2017-01-18 11:32:44 +01:00
Alexander Larsson 652f64faad Fix document portal add_named
This regressed in d488914614 where
it used to require a dir fd, but then required a regular fd.
2016-12-08 14:09:22 +01:00
Alexander Larsson b744cd2493 Add backport of g_autoptr support for json-glib 2016-11-29 10:14:33 +01:00
Alexander Larsson bd3eae146a document-portal: Fix warnings on 32bit builds
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
2016-11-15 11:32:28 +01:00
Alexander Larsson 5c2d0065db document-portal: Correctly detect truncation and exclusive mode 2016-11-11 11:19:46 +01:00
Alexander Larsson b61259dc79 document-portal: Fix file trucation
We were checking the error return in the wrong way.
2016-11-11 11:00:30 +01:00
Alexander Larsson 786f87fb9c document-portal: Fail fd validation if we can't open directory
We need to check if the open succeeded.
2016-11-11 10:56:25 +01:00
Alexander Larsson 46889979ea document-portal: Fix fd leak 2016-11-11 10:42:29 +01:00
Mario Sanchez Prada 5105027499 document-portal: Removed variables not used since commit 894df2ff 2016-11-03 11:17:54 +00:00
Alexander Larsson c23316cb5d Add FlatpakKinds flag and use instead of booleans 2016-10-14 11:20:53 +02:00
Sebastian Rasmussen b21f4bf542 Prefer g_strerror() to strerror()
It handles encodins better, is thread-safe and more portable.
2016-09-15 01:22:54 +08:00
Matthias Clasen b2b281e485 Make flatpak_is_valid_name set a GError
Return detailed information about the problem with the name in
the GError. Update all callers.
2016-09-12 23:25:54 -04:00
Alexander Larsson d287415150 Merge pull request #287 from smcv/tests
Various test fixes
2016-09-12 08:48:05 +02:00
Alexander Larsson 96f383198d flatpak-info: Move the instance specific data to a separate group
We don't want to confuse whats in the metadata file with this
runtime instance info.
2016-09-08 14:10:18 +02:00
Alexander Larsson 894df2ffb6 document portal: Rewrite sandboxed /app and /usr to the right place
This uses the sandboxed instance flatpak-info to find the actual
real files that are in use.
2016-09-08 12:54:54 +02:00
Alexander Larsson e16ca25a67 utils: Change flatpak_invocation_lookup_app_id to lookup_app_info
This lets you get the entire app info rather than just the id.
For host processes you'll get an empty info with just an empty
name.
2016-09-08 12:37:32 +02:00
Simon McVittie 0160ed937d document portal: cope with multiple events that would cause failure
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>
2016-09-07 17:04:44 +01:00
Juan Pablo Ugarte cd574cfbfe document-portal: Fix the document portal for files outside /app
Strip /newroot prefix from document path since validate_parent_dir()
depends on a system path to get the parent directory stat.
2016-09-05 15:44:02 -03:00
Alexander Larsson d10409cb3e document-portal: Fix the document portal
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.
2016-09-05 17:10:15 +02:00
Alexander Larsson 8475dfeee9 document-portal: Don't link to libflatpak.so 2016-09-05 16:18:26 +02:00
Ismo Puustinen 2d26a7d0a6 Create directories before attempting to generate code into them
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.
2016-08-26 12:36:35 +03:00
Matthias Clasen d245ba3574 fuse: Always fail X_OK in access()
Pointed out by Ray Strode.
2016-07-27 16:00:44 -04:00
Matthias Clasen 0e8faa8c31 document-portal: Implement access()
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.
2016-07-26 14:55:18 -04:00
Matthias Clasen 369eab84e7 Fix a typo
We were trying to check if O_NOFOLLOW was set here.
(flags & BIT_A) == BIT_B never make sense.
2016-07-25 14:28:57 -04:00
Eric Curtin 930a0a04e2 Remove unused variable in this file 2016-07-17 12:18:57 +01:00
Matthias Clasen b6db220f7c document portal: Add --version
It is expected that --version works.
2016-07-14 23:28:53 -04:00
Cosimo Cecchi 90a3522148 document-portal: add support to activate paths inside /app
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.
2016-07-11 15:58:29 -07:00
Cosimo Cecchi d488914614 document-portal: factor out common code to validate FD
We're going to reuse this in another location.
2016-07-11 15:56:59 -07:00
matthiasclasen d1d881edf3 Merge pull request #172 from hadess/origin/wip/glib-reqs
Allow building on GLib 2.40 or older
2016-07-04 21:06:42 -04:00
Bastien Nocera 98356356e6 document-portal: Allow to build on the minimum GLib version
G_IO_ERROR_NOT_CONNECTED is new in 2.44, use the older
G_IO_ERROR_BROKEN_PIPE which is synonymous with the more readable
G_IO_ERROR_CONNECTION_CLOSED.
2016-07-05 01:16:33 +02:00
Alexander Larsson 51663de427 Remove unused variables 2016-07-01 14:45:53 +02:00
Simon McVittie dab1d99c46 document portal: don't reply to GetMountPoint() until ready
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>
2016-06-24 21:07:57 +01:00
Matthias Clasen 5612b5f7c6 Fix the build
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.
2016-06-19 13:42:42 -04:00
Matthias Clasen 89a10ad9b2 document portal: Implement the new api 2016-06-16 15:05:17 -04:00
Alexander Larsson 1abcc8d080 Merge pull request #108 from ximion/master
Silence compiler warning about unused result of write()
2016-06-14 05:25:00 +02:00
Simon McVittie f8f4f530ab Permission store, document portal: do not distribute generated files
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-12 10:35:13 +01:00
Matthias Klumpp 0a90e6ec3e Silence compiler warning about unused result of write()
This way we return a critical warning in the unlikely event of a write
error.
2016-06-10 19:35:49 +02:00
Matthias Clasen f53533ff48 Fix compiler warnings
There are a number of -Wshadow warnings in document-portal/.
Fix them.
2016-06-09 23:47:41 -04:00
Matthias Clasen fbefba695c document portal: Improve logging
Make the error printing more pretty.
2016-06-09 23:30:12 -04:00
Matthias Clasen c5155402b2 document portal: Make -v work
We need to set the log handler for our docmain, not the NULL domain.
2016-06-09 23:19:18 -04:00
Simon McVittie a4641280a7 Fix various spelling mistakes
Mostly detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 11:43:32 +01:00
Alexander Larsson aabcc54db4 document-portal: Yet another attempt to fix the build 2016-05-09 21:21:07 +02:00
Alexander Larsson 28b549156a Split out permission store from session helper
This is now available as org.freedesktop.impl.portal.PermissionStore
2016-05-09 14:07:22 +02:00
Alexander Larsson 4f9ea6bb57 Remove unused variables
This fixes warnings from clang
2016-05-09 12:49:54 +02:00
Alexander Larsson 5e9b247d26 Migrate ~/.local/share/xdg-app to ~/.local/share/flatpak 2016-05-09 12:21:28 +02:00