Commit Graph

79 Commits (642a5a81a180dc0bfb7d2e2b7759eb03d4b87e70)

Author SHA1 Message Date
Matthias Clasen 261ff03b63 Merge pull request #907 from smcv/metadata
Document all metadata groups and keys
2017-07-07 17:50:15 -04:00
Simon McVittie 489bfddfb3 common: Add and use constants for flatpak-metadata(5) groups and keys
This makes it easier to avoid typos, and also makes it easier to see
what groups and keys are in use. In the header file, they are
clustered according to the group in which the keys are used.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:06:21 +01:00
Philip Withnall 548f60ebc0 general: Add missing `static` modifier to various local methods
The compiler warning flag which was supposed to warn about this was not
being included in the CFLAGS for these targets. That will be fixed in an
upcoming commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:21 +01:00
Philip Withnall 95106a34d5 xdp-main: Fix a typo in a comparison
This was almost certainly meant to be a logical AND, not a bitwise one.
As spotted from compiler warnings.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-06 19:43:09 +01:00
Alexander Larsson 4a54450400 documents: paths in the apps dir ar always accessible
When using the as-needed flag in AddFull, we need to consider
the files in the target apps app-specific dir also accessible.

Fixes https://github.com/flatpak/flatpak/issues/815
2017-05-26 13:05:43 +02:00
Alexander Larsson dfaf925dd0 document-portal: Add XDP_ADD_FLAGS_AS_NEEDED_BY_APP to AddFull
If this is set, we only rewrite paths that are needed for the
target application. I.e. the ones that are *not* accessible by
that application.
2017-05-22 13:12:13 +02:00
Alexander Larsson c08dff31a9 document-portal: Lock just once in AddFull for many paths 2017-05-22 13:12:01 +02:00
Matthias Clasen ea0f97efe7 Correct mountpoint handling
As a file path, the mountpoint should probably be sent
as ay. Also, remove an extra level of gvariant wrapping.
2017-05-22 09:26:23 +02:00
Alexander Larsson e63d089435 Remove unused variable
Fixes clang warning
2017-05-22 09:25:00 +02:00
Alexander Larsson 77a7aa6adb document-portal: Bump version to 2 due to new AddFull method 2017-05-19 17:03:15 +02:00
Alexander Larsson 6ce8521b64 document-portal: Add AddFull() operation
This allows you to add multiple paths at the same time, plus
grant an app access to it, plus it returns the fuse mount path.

This allows you to avoid a lot of roundtrip in common cases.
2017-05-19 17:01:46 +02:00
Alexander Larsson bda7575e79 Add version property to all dbus interfaces 2017-05-19 14:38:22 +02:00
Alexander Larsson fb6695e9a4 Add macros for common ANSI tty escape codes 2017-05-03 11:17:41 +02:00
Matthias Clasen b07240f525 Use the new output helper
Instead of open-coding isatty(), use flatpak_fancy_output().
2017-05-03 11:06:43 +02: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 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
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
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 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 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 5e9b247d26 Migrate ~/.local/share/xdg-app to ~/.local/share/flatpak 2016-05-09 12:21:28 +02:00
Alexander Larsson 8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 6a613d1fab Rename all non-autogenerated symbols to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 1ffdf27d92 uncruftify: Initial run, all non-problematic changes 2016-05-06 16:03:27 +02:00
Alexander Larsson 4f4b8c536b No need to put introspection xml in resources
This is already built in to the gdbus codegen code.
2016-04-26 11:54:59 +02:00