4970 Commits

Author SHA1 Message Date
Alexander Larsson
a5eebf73d2 distclean the selinux module 1.3.2 2019-04-12 13:18:15 +02:00
Alexander Larsson
774bd6656b Update pofiles 2019-04-12 13:17:54 +02:00
Alexander Larsson
fb4a8dda21 tests: Add gnutls valgrind suppression 2019-04-12 13:01:08 +02:00
Alexander Larsson
f904193a28 Update NEWS for release 2019-04-12 12:00:13 +02:00
Matthias Clasen
d65ebf19f3 list: Add a runtime column
This is useful information, so we should allow showing it.

Closes: #2815
Approved by: alexlarsson
2019-04-12 09:13:34 +00:00
Alexander Larsson
03492dfc28 tests: Add test of eol-rebase
This tests that we pick a new version, that the old is uninstalled
and that when running it old data is migrated.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Will Thompson
113ee117c0 tests: Test preserving previous-ids and X-Flatpak-RenamedFrom
This copy-pastes a lot of internal code from flatpak-dir.c to mess with
the deploy file. It could be made a lot shorter...

https://phabricator.endlessm.com/T23845

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Umang Jain
e17b2635d6 run: Support migration from old app-ids to new app-id
flatpak run checks if there is any previous-ids for the app and
sees if there is a corresponding app-dir in ~/.var/app/ .
If so, it renames that app-dir to the new app-id and provides
a symlink from old app-id dir to new app-id dir, and exposes
these symlinks to the sandbox. The symlink is needed because even
though the XDG_DATA_DIR and other environment variables are set
to the new ID by flatpak run, the app itself could've stored
(eg in GSettings, or other files) paths which contained the old ID.

https://phabricator.endlessm.com/T23532

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Umang Jain
3c55320539 context: Add support forexposing extra app id dirs
This will be used to export old app id dirs after a rebase.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Ryan Gonzalez
7357b2bc63 cli-transaction: Use the new rebase support
Switch to the new eol signal and call flatpak_transaction_add_rebase()
if a rebase was requested.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Ryan Gonzalez
7185a00c85 transaction: Add end-of-lifed-with-rebase signal and add_rebase()
end-of-lifed-with-rebase runs earlier in the transaction system than end-of-lifed, meaning it can modify the transaction for rebasing.
The new flatpak_transaction_add_rebase() function can then be used to apply the rebase if wanted.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
6059a1ae3a transaction: Loop resolve until no longer necessary
With the new eol signal the list of ops can change during a resolve
operation, in which case we need to loop until things are stable.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Will Thompson
a9462d80c8 dir: add previous-ids to exported .desktop files when deploying
When migrating an installed app from eos-apps to Flathub, it may have
had a different app ID (com.example.App) in eos-apps to the Flathub ID
(net.example.app). The migration logic arranges for previous-ids to be
set in the deploy file, and flatpak-dir.c preserves this across app
updates.

A user may have the app on their desktop or pinned to the taskbar under
its old ID, and the Shell uses X-Flatpak-RenamedFrom to update these to
the new ID. The migration logic arranges for the old ID to be added to
X-Flatpak-RenamedFrom at migration time; we need to also preserve this
across app updates.

Note that the Flathub version of the app may well have its own entries
in X-Flatpak-RenamedFrom. It is unlikely that these will overlap with
ours, but for neatness we take care to avoid adding duplicates.

https://phabricator.endlessm.com/T23845

Rebase 1.1.3 (T25194): Fix some minor merge conflicts

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
6f1243190f dir: Add and track previous ids in the deply data
Nothing sets this yet, but when it does it gets inherited across
updates, etc.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
6d757f865e dir: Tweak flatpak_ensure_data_dir() function
Instead of returning the data dir it now takes it as an argument
This will help us later avoid recomputing it.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
b01a52e7c6 build-commit-from: Add support for--end-of-life-rebase=OLD=NEW
This lets you rebase an app, as well as other matching refs (OLD is
used as a prefix match) such as locale and debug extensions.

r your changes. Lines starting

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Ryan Gonzalez
440bee1d51 build-export: Add --end-of-life-rebase
Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
3607e8f7f7 utils: Add flatpak_has_name_prefix helper
Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Ryan Gonzalez
89a6782c55 utils: Add flatpak_strv_merge
Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
f85416ce55 tests: Fix test-app Locale dependency
We were always looking for org.test.Hello.Locale even when the
app id was something else

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Valentin David
8ce289b4c3 Add support for PCSC socket
Closes: #2778
Approved by: alexlarsson
2019-04-12 06:37:44 +00:00
Matthias Clasen
7fdd677b93 tests: Check that removing D-Bus access works
Test that =none entries make it into the overrides file.

Closes: #2818
Approved by: alexlarsson
2019-04-12 06:31:05 +00:00
Matthias Clasen
67b8d19f93 Write out negative D-Bus policy entries
Write out =none lines for D-Bus policy entries.

Closes: #2818
Approved by: alexlarsson
2019-04-12 06:31:05 +00:00
Matthias Clasen
44c540a1c4 Allow overriding bus names to none
flatpak override could set a bus name policy to
talk or own, but not to none. Fix this oversight.

Closes: https://github.com/flatpak/flatpak/issues/2722

Closes: #2818
Approved by: alexlarsson
2019-04-12 06:31:05 +00:00
Alexander Larsson
386e3d4799 When updating a remote, import new values for comment/description/homepage/icon
Closes: #2814
Approved by: alexlarsson
2019-04-10 14:34:32 +00:00
Alexander Larsson
4c9cc48572 build-update: Inject comment/description/homepage/icon into the summary file
This is the same that we do for the title, and will allow clients to
updating its copy of the fields.

Closes: #2814
Approved by: alexlarsson
2019-04-10 14:34:32 +00:00
Alexander Larsson
889e3b862a build-update-repo: Support setting comment/description/homepage/icon
This just sets the option in the "flatpak" group, similar to how
the title works. Nothing uses this yet.

Closes: #2814
Approved by: alexlarsson
2019-04-10 14:34:32 +00:00
Alexander Larsson
69e869c9d2 Support comment/description/homepage/icon in remote-add too
Closes: #2814
Approved by: alexlarsson
2019-04-10 14:34:32 +00:00
Matthias Clasen
720ef6b72f repo: Show new remote config fields
Print out comment, description, homepage and icon if they are set.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:16 +00:00
Matthias Clasen
624099f039 remote-modify: Allow setting the new remote fields
Add --comment, --description, --homepage and --icon options.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:16 +00:00
Matthias Clasen
cd4e58b940 Document new remote config fields
Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:16 +00:00
Matthias Clasen
dc32aae658 remote-add: Add -is-set keys for the new fields
This lets us keep track of which fields have been
explicitly set.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:16 +00:00
Matthias Clasen
f3ca031d00 Add FlatpakRemote api for flatpakrepo fields
This makes the new flatpakrepo fields available
to users of libflatpak.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:16 +00:00
Matthias Clasen
43b58b1b19 remotes: Add columns for flatpakrepo fields
Allow showing all information that we have
about remotes.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:15 +00:00
Matthias Clasen
3761aa5576 dir: Add private api for flatpakrepo fields
These will be used in the following commits.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:15 +00:00
Matthias Clasen
ec9e55f140 remote-add: Store all .flatpakrepo keys
Application installers want to have access to
these fields to present repositories to the user,
so store them in our repo config, using xa.
prefixed keys.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:15 +00:00
Matthias Clasen
11aface66e icon-validator: Add the max size to the error
This helps to explain why an icon was rejected.

Closes: #2813
Approved by: alexlarsson
2019-04-10 06:58:13 +00:00
Alexander Larsson
d85b3cb0e9 Bump release to 1.3.2 (post release) 2019-04-09 14:55:40 +02:00
Alexander Larsson
bb46c1dbd6 Add selinux module to allow system-helper to work with revokefs
Historycally the system helper has been running in a generic
unconfined_service_t domain. However, this caused problems with the
new revokefs support, because passing the revokefs unix domain socket
over the system bus got it kicked of the bus, because to do this
dbus-daemon needs rw rights to the socket.

So, this module creates a custom domain flatpak_helper_t, which
allows us to add special permissions to dbus-daemon to allow
access to its sockets.

The domain is otherwise uncontained just like before. I did try
to make it contained, but that is a lot of work as the permissions
it needs are very complex.

Note to packagers on selinux systems, for flatpak to work well
you need to install this module and relabel the system-helper
binary.

In my testing on fedora I used something like this:

%post
%selinux_modules_install %{_datadir}/selinux/packages/flatpak.pp.bz2

%postun
if [ $1 -eq 0 ]; then
    %selinux_modules_uninstall %{_datadir}/selinux/packages/flatpak.pp.bz2
fi

With these new files:
%{_datadir}/selinux/packages/flatpak.pp.bz2
%{_datadir}/selinux/devel/include/contrib/flatpak.if

Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Umang Jain
081c3400b4 utils: Add backported version of g_hash_table_steal_extended
Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Umang Jain
a9cee021b5 dir: Integrate revokefs-fuse for flatpak updates codepath
Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Alexander Larsson
0815f9364a CI: Add fuse-devel
Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Alexander Larsson
04aece20a3 tests: Add system-norevokefs alternative to check fallback paths
Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Alexander Larsson
c6faa78403 revokefs use: Don't delete the repo in the client when using revokefs
It is already removed in the system-helper, and the client doesn't
have permissions to delete it anyway (except for in the tests where
it was breaking things).

Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Alexander Larsson
3f746bc328 tests: Fix test of non-canonical permissions
When installing via the child repo we now strip the permissions early
so the import will fail instead of import and then canonicalize.
Either is ok, as nothing should be non-canonical in real life.

Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Alexander Larsson
cd3028abd0 system-helper: Don't use the system user when running on the session bus
This makes it possible to test the revokefs codepaths with make check
as non-root.

Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Alexander Larsson
42e42ddc86 Pick up the right revokefs-fuse binary
In the normal case, pass the full LIBEXEC path, and in the tests,
pass the path via the env var FLATPAK_REVOKEFS_FUSE.

Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Umang Jain
cd53f71f9e revokefs-fuse: Add --with-exit-fd arg to monitor parent process's exit
This is necessary so as to not leave the revokefs backend around
when the system-helper exits abruptly (e.g. OOM killer). It would
be a vulnerability if revokefs backend continues to live even after
the system-helper is killed as it might lead to write access to the
underlying directory.

Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Umang Jain
c9d0705ae9 system-helper: Add CancelPull helper method
If there is a pull failure in a child repo created on revokefs-fuse
mount, there is no way to go back to the system helper and notify
it to cleanup. Therefore, CancelPull is required on the pull failure
error path, so that the ongoing pull can be cleaned up nicely and
prevent any dangling mounts and subprocesses.

Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00
Umang Jain
cad8d8a599 system-helper: Integrate --system pull with revokefs-fuse
This adds a new helper method "GetRevokefsFd" which is responsible
for spawning the backend part of the revokefs filesystem. It takes care
of creating a cache location for the backing directory in repo/tmp.
This cache location is transferred over D-Bus to the client with the
other end socket fd.

The client on receiving the socket fd creates a mountpoint directory and
spawns the revokefs-fuse filesystem. It then creates a child repo for the
pull. In any case of failure, it fallbacks on the current code path
(which causes temporary duplication of files on disk).

The backing dir itself and all files written to it by the revokefs-fuse
backend process are owned by the "flatpak" user. After the pull in the
child repo is completed, it's ownership is then canoncalized with owner=root
and permissions as per bare-user-only in Deploy().

Now we have fulfilled all the criteria to hardlink the child repo into
the system one and avoid duplication. See [1].

If there is existing cache directory available in repo/tmp, it will be
mounted using revokefs-fuse for the current pull. Hence, it is possible
to recover the previous partial pull which might have failed due to some
error.

[1] https://github.com/ostreedev/ostree/pull/1776

Closes: #2657
Approved by: alexlarsson
2019-04-09 09:18:15 +00:00