Commit Graph

51 Commits (7962d4d14504445b29cd2555be19d89c1808a26b)

Author SHA1 Message Date
Mario Sanchez Prada 719616f086 Add support for multiple installations in the system helper
Allow passing an extra string parameter specifying the ID of a
system installation to refer to it, or an empty string for the
default one.
2016-12-17 00:32:50 +00:00
Mario Sanchez Prada 521c3fcd4b Rename flatpak_dir_get_system() into flatpak_dir_get_system_default()
There will be a way to retrieve the list of all system installations,
not just the default one, so we rename this for backward compatibility.

Note that some (most?) of the places where we will be now using this
renamed function will likely have to migrate to using specific system
installations, but we don't have the necessary APIs yet so we do this
as an initial step to all the incremental changes that will come next.
2016-12-16 19:17:13 +00:00
Joaquim Rocha 1a1ec16a4f system-helper: Do not ask for password when removing apps/runtimes
As it's already done for installing an app or runtime, we shouldn't ask
privileged users to authenticate in order to remove them.
2016-12-07 19:53:51 +01:00
Alexander Larsson 4c77e37960 system-helper: Move option resetting to before using them
This means coverity will not complain about them being always
set to false.
2016-11-11 11:16:01 +01:00
Mario Sanchez Prada 57ac7cb56c Use an allow_active=auth_admin_keep policy default for the configure-remote policy
This will avoid clients such as GNOME Software from asking for the password
repeateadly when configuring different repos one after another.
2016-11-09 15:01:57 +01:00
Alexander Larsson 906b3b5871 dir: When pulling/deploying an app, support xa.extra-data-sources
If the downloaded app has a "xa.extra-data-sources" property in
the commit, then we download these as part of the pull operation
and store the result in the commitmeta object in the repo.

Then during deploy we look at the xa.extra-data-sources properties
again and extract them from the commitmeta into /app/extra
in the app, and afterwards we run /app/bin/apply_extra in a minimal
sandbox that has read-write access to /app/extra, but nowhere else.

There are some complexities:

We need to re-verify when extracting, because the commitmeta is not
really signed, so we could have picked up random stuff there
from the upstream repo, or from an attacker misusing the system-helper
local install codepath.

When using the system-helper the pull will fail if the commitmeta
is to large, so we have some code in this case to manually transfer
the larger commitmeta on the side to the local-pull code.
2016-10-21 08:57:42 +02:00
Alexander Larsson e1527c9347 system-helper: Correctly return ALREADY_INSTALLED error on noop deploy
This was breaking the test suite
2016-10-19 12:41:08 +02:00
Alexander Larsson ef7cf7ac92 Fix tests: Don't try to use policykit during the tests
Creating a policykit proxy was causing timeouts for me for unclear
reasons when running under the tests. But we're not using policykit at
all during the tests, so we can just avoid this call completely.
2016-09-20 05:56:19 +02:00
Sebastian Rasmussen 5fe8566461 system-helper: Fix typo in action description 2016-09-15 01:23:35 +08:00
Matthias Clasen 75218c4a65 Fix license headers
We were referring to the nonexisting "version 2" of the
Lesser GPL. It should be "version 2.1".
2016-07-29 14:27:49 -04:00
Alexander Larsson 764cb91cbe Remove workaround for issue #144 now that ostree is fixed
The fix for this is in ostree 2016.7

https://github.com/flatpak/flatpak/issues/144
2016-07-29 01:20:40 +02:00
Matthias Clasen 3c52321a40 Use upstream gettext
Drop the intltool dependency that was recently added, and use
upstream gettext and its its features for the same purpose.
Note that polkit currently does not install .its files (I've
sent a patch). Until that is in place, this change has the
effect of installing the untranslated policy file.
2016-07-15 11:58:46 -04:00
Alexander Larsson 9915e3740b Disable static deltas for system-helper updates
Due to an issue with ostree (https://github.com/ostreedev/ostree/pull/362)
applying non-from-scratch deltas fail when using parent_repo such as
in the system-helper case. We fix this temporarily by disabling the
use of deltas for that case.
2016-06-23 12:16:02 +02:00
Jan Alexander Steffens (heftig) 599f8b963d system-handler: Don't leak path string
Without &, ^ay dups the string.
2016-06-20 23:42:22 +02:00
Jan Alexander Steffens (heftig) 55e26c296f system-helper: Reorder flatpak_authorize_method_handler
Reduces code duplication.
2016-06-20 23:42:01 +02:00
Alexander Larsson 0fffc8ec4c system-helper: Use org.freedesktop.DBus.Error.AccessDenied on polkit auth fail
This makes more sense than some unmapped permission error.
2016-06-20 11:16:10 +02:00
Alexander Larsson cfef57e343 Properly handle subpaths on update 2016-06-07 22:12:51 +02:00
Alexander Larsson f9e171a618 Merge pull request #92 from matthiasclasen/optional-system-helper
library-only build
2016-06-07 09:38:37 +02:00
Matthias Clasen 9b22b1f167 Make system helper build optional
This lets us avoid the polkit dependency when just building
flatpak for its library.
2016-06-04 14:56:59 -04:00
Alexander Larsson e769af8661 system-helper: Handle installing bundles 2016-06-03 16:04:10 +02:00
Alexander Larsson 13707f6b18 system-helper: Support directly pulling local remotes
For a local (file:// uri) remote, do an (untrusted) direct pull instead
of pulling into the users cached repo first. This way we do less copies,
as well as guaranteeing the source of the data. The later means its
mostly safe to also allow this for non-gpg signed remotes.
2016-06-02 15:30:08 +02:00
Alexander Larsson cb41e1bdba Correctly handle --with-privileged-group 2016-05-24 14:13:34 +02:00
Alexander Larsson 2b6f4f1bcf Add --with-privileged-group options
This allows distros to change the wheel group into something else,
for instance admin (ubuntu) or sudo (debian).
2016-05-24 10:13:23 +02:00
Alexander Larsson 910328e535 Support no-deploy and no-pull via system helper 2016-05-20 13:30:50 +02:00
Alexander Larsson 4af71aae7b Fix distcheck: clean up some more generated files 2016-05-18 10:30:47 +02:00
Alexander Larsson 3d232bbe15 Merge pull request #161 from smcv/spelling
Fix various spelling mistakes
2016-05-17 17:51:20 +02:00
Alexander Larsson aa11387031 tests: Add test-run-system.sh 2016-05-17 17:49:55 +02:00
Alexander Larsson b697a78dd3 system-helper: Support running unprivileged on session bus
This is only useful for testing.
2016-05-17 13:06:59 +02: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 f916e87d74 system-helper: Add --no-idle-exit commandline argument
This is useful for tests and debugging, where we don't want it to
accidentally idle.
2016-05-17 11:56:58 +02:00
Alexander Larsson 251dcdb680 system-helper: Never use a system helper recursively 2016-05-17 11:54:44 +02:00
Alexander Larsson 1504f7bd7f system-helper: Support add/modify/delete of remotes 2016-05-13 16:23:43 +02:00
Alexander Larsson 5407b8efc6 system-helper: Support uninstall 2016-05-12 21:23:36 +02:00
Alexander Larsson 96da8b7524 system-helper: Exit on idle, name lost or if binary is replaced 2016-05-12 11:06:41 +02:00
Alexander Larsson 1877f0be8d system-helper: Add support for updating appstream branch 2016-05-11 10:35:24 +02:00
Alexander Larsson 4f9ea6bb57 Remove unused variables
This fixes warnings from clang
2016-05-09 12:49:54 +02:00
Alexander Larsson 8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson ba37b22d78 Rename library to libflatpak 2016-05-09 09:46:26 +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 ce20be26f8 system-helper: Work around upstream polkit adding autoptr support
This fixes issues reported in
https://bugs.freedesktop.org/show_bug.cgi?id=95065
2016-05-09 08:41:12 +02:00
Alexander Larsson 1ffdf27d92 uncruftify: Initial run, all non-problematic changes 2016-05-06 16:03:27 +02:00
Alexander Larsson 1df3e4845b Fix various distcheck issues 2016-05-03 09:36:33 +02:00
Alexander Larsson 64669a9a96 common: Write and use the new deploydata file
Instead of separate "origin", "subpaths" and eventually "installed-size"
files we store a single (extensible) gvariant with all this info, which
means we need to seek less to get it.

Also, we move this file into the deploy dir as some of the data
differs for each deploy, and that way we can rely on the the active
symlink to make the update atomic.
2016-04-27 12:41:41 +02:00
Alexander Larsson 990127fe11 system-helper: Use g_strcmp0 to simplify some code
Pointed out by cosimo
2016-04-26 12:09:28 +02:00
Alexander Larsson 913bae4726 system-helper: Actually return on unsupported flags
Otherwise we continue even though there was an error.
Pointed out by cosimo
2016-04-26 12:08:37 +02:00
Alexander Larsson 4734eb95df system-helper: Minor cleanup 2016-04-26 11:58:29 +02:00
Alexander Larsson 49d84aed94 We don't actually need the introspection data in the resource
All the required  stuff are in the generated code anyway.
2016-04-26 11:50:16 +02:00
Alexander Larsson dc60f02716 system-helper: Add PolicyKit authentication for system helper 2016-04-25 18:59:17 +02:00
Alexander Larsson b2b05e1175 update/install: Handle deploy using the system service 2016-04-25 18:59:17 +02:00