Commit Graph

64 Commits (bc7ebd20e2f68d57b0f88d095fe65aaaaa09d1dd)

Author SHA1 Message Date
Alexander Larsson bda7575e79 Add version property to all dbus interfaces 2017-05-19 14:38:22 +02:00
Matthias Clasen 029a5e38e1 Remove unused variables
clang flags these.
2017-05-11 08:38:32 +02:00
Matthias Clasen 4b5062d344 Drop an unused variable 2017-05-10 11:43:40 +02:00
Alexander Larsson 9896005ad0 remote-modify: Implement --update-metadata as a system-helper method
We download the summary and send it to the system helper, it verifies
the checksum and applies the changes, with the same polkit permissions
required as for an app update (i.e. typically none).

This allows us to update metadata automatically, without permission
requests.
2017-05-09 13:25:21 +02:00
Alexander Larsson 41d9717113 Fix unused variable errors reported by clang 2017-03-30 10:01:24 +02:00
Alexander Larsson 5b0ad227e8 OCI: Verify signatures 2017-03-29 17:14:36 +02:00
Alexander Larsson 11943e7e40 OCI: Support OCI with system-helper by mirroring OCI repo
This allows us (when we later add signatures) to verify
the signatures of the OCI manifest, and can thus support
the system-helper.
2017-03-29 17:14:19 +02:00
Alexander Larsson 260f3df91c system-helper: Add User=root to service file
This is needed for systemd-less activation on the system bus.
2017-01-23 16:30:52 +01:00
Simon McVittie 1d6834db4d flatpak-system-helper: remove dangling reference to EXTERNAL_INSTALL_DIR
If EXTERNAL_INSTALL_DIR wasn't defined (which is likely, since nothing
in the build system does), then we would tell the system helper
to search /exports/share, which is not Flatpak's territory
(but is a semi-commonly-used path for site-specific NFS shares,
which might have contents that are inappropriate to search here).

Installations that do define an external installation directory
(Endless OS?) can easily override the Environment to include it
by placing a drop-in in
/etc/systemd/user/flatpak-system-helper.service.d/external.conf
or similar.
2017-01-20 15:05:28 +01:00
Ikey Doherty 605c7ee87b Fix compiler warnings with uninitialised cleanup pointers
This change fixes GCC compiler warnings where a cleanup function was
specified on an uninitialised pointer, which in the view of GCC could
result in an errornous free of uninitialised memory, if the functions
that initialise them do not return NULL.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-01-19 10:05:13 +01:00
Ikey Doherty ca107ebb16 system-helper: Allow configuration of dbus configuration directory
Newer versions of dbus support stateless directories, and many distributions
now use /usr/share/dbus-1/system.d for the vendor configuration files, as
opposed to the legacy /etc/dbus-1/system.d directory.

To enable this, we add a new --with-dbus-config-dir option to control the
configuration directory, whilst retaining backwards compatibility for those
still using older versions of dbus.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-01-19 10:05:13 +01:00
Cosimo Cecchi 78c3391b78 system-helper: make sure to run with XDG_DATA_DIRS set
Otherwise we can see in the log that update-mime-database will complain
about it not being set when installing an application using the system
helper.
2017-01-16 11:36:48 +01:00
Alexander Larsson f20e5f7823 bundles: Support dependencies and runtime-repo
If the bundle contains an origin link we can now install related
things from it, such as locale data.

You can also build the bundle with --runtime-repo=URL, where the url
points to a flatpakrepo file for a repo with runtimes. This works
similar to the RuntimeRepo= feature in flatpakref files.
2016-12-20 16:27:57 +01:00
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