Commit Graph

6878 Commits

Author SHA1 Message Date
Alexander Larsson
81d40fc8fa Update the bundled dbus-proxy to 0.1.3
This contains the fix to silence some recent GCC warnings, but also
some other minor cleanines fixes.
2022-02-11 15:01:20 +01:00
Alexander Larsson
c20ce42c4a Change references from "master" branch to "main" in docs and comments 2022-02-11 14:45:32 +01:00
Alexander Larsson
914424cae8 CI: build on "main" branch, not "master" 2022-02-11 14:45:32 +01:00
Simon McVittie
a86963ca1a Update changelog for 1.13.x so far
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-09 17:16:32 +00:00
Simon McVittie
ece3302ea2 NEWS: Correct release date for 1.12.4
(cherry picked from commit 62cc8a4717)
2022-02-09 16:34:04 +00:00
Debarshi Ray
5c59f1b2a8 dir: Use SHA256, not SHA1, to name the cache for a filtered remote
SHA1 hashes are considered weak these days. Some distributions have
static analysis tools to detect the use of such weak hashes, and they
get triggered by flatpak. While this particular use of SHA1 in flatpak
is likely not security sensitive, it's also easy to move to SHA256 to
avoid any debate.

Here, the SHA1 hash of a named remote's filter file is used to generate
the name of the directory where the refs from that remote are cached.
One can reasonably assume that the cache is frequently invalidated
because the list of refs on the remote changes all the time. Hence,
it's not big problem if it gets invalidated once more because of this
change.
2022-02-08 17:56:34 +00:00
Patrick
e017db9c5c gitmodules: Update xdg-dbus-proxy branch 2022-02-07 13:19:07 -06:00
Bastien Nocera
4470bf1425 run: Don't propagate GStreamer variables to the sandbox
Trying to run sandboxed GStreamer applications from within jhbuild, for
example, would make those applications fail to find their plugins.

$ LANG=C flatpak run org.gnome.Totem.Devel
** (totem:2): WARNING **: 19:32:06.406: Element 'gtkglsink' is missing, verify your installation
** (totem:2): WARNING **: 19:32:06.406: Element 'glsinkbin' is missing, verify your installation

Don't propagate those GStreamer environment variables to within the
sandbox to avoid that problem.

See https://gitlab.gnome.org/GNOME/totem/-/issues/504
2022-02-07 07:53:56 -08:00
Kukuh Syafaat
33ce8023b5 Update Indonesian translation 2022-02-05 09:10:43 -08:00
Piotr Drąg
7f4b72c3e1 Update Polish translation 2022-02-05 09:05:01 -08:00
Simon McVittie
1def449850 tests/try-syscall.c: Add a note about keeping this in sync with bubblewrap
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-31 17:13:31 +00:00
Simon McVittie
4735e3ea90 tests: Use type -P in preference to which
which(1) is neither standardized by POSIX nor built-in to bash, and has
different implementations and behaviour on different distributions.
command -v is standardized by POSIX, but it won't return the path to an
executable if the same command is available as a shell builtin, so it
isn't necessarily suitable here either.

The Flatpak test suite uses bash scripts rather than POSIX shell scripts,
so we can safely make use of bash-specific options for builtins, and
in particular type -P, which has the semantics we want here: search PATH,
even if there is a shell builtin of the same name.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-25 10:07:03 +01:00
Simon McVittie
bb307a5f26 triggers: Use command -v in preference to which
which(1) is not standardized by POSIX, and has different implementations
and behaviour on different distributions. The behaviour and exit status
of command -v is standardized by POSIX, and in particular, checking its
exit status is an appropriate way to ask: if I called this command,
would it be found?

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-25 10:07:03 +01:00
Simon McVittie
6fdc9071d0 triggers: Quote more defensively
In the unlikely event that one of these paths contains spaces or other
special characters, we don't want to field splitting to take place.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-25 10:07:03 +01:00
Simon McVittie
dc8227ea8b autogen.sh: Use command -v to check whether commands exist
which(1) is not standardized by POSIX, and has different implementations
and behaviour on different distributions. The behaviour and exit status
of command -v is standardized by POSIX.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-25 10:07:03 +01:00
Philip Withnall
994accceb7 flatpak-transaction: Tidy up property implementation
Remove a redundant `PROP_0` member and add a type for the property IDs
so that the `switch` cases can be checked by `-Wswitch-enum`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-01-25 10:03:41 +01:00
Philip Withnall
bd4a52e959 flatpak-transaction: Add no-interaction property
This bundles up `{get,set}_no_interaction()` in a way which can be bound
or exposed to bindings.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-01-25 10:03:41 +01:00
Philip Withnall
733835d818 flatpak-transaction: Add get_no_interaction() method
This complements `flatpak_transaction_set_no_interaction()` and allows
calling code to see if a given transaction is interactive.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-01-25 10:03:41 +01:00
Patrick Griffis
49a829cc0b Add have-kernel-module conditional
This is useful for extensions that apply to specific hardware.
2022-01-22 07:39:00 -06:00
Alexander Larsson
7bec38c9d1 flatpak-context: Properly flatten filesystem permissions
When generating flattened permissions (i.e. for --show-permissions or
for the /.flatpak-info file) we're currently flattening the permissions
i.e. don't show things that would only affect layering the permissions).

However, the code doesn't currently do this for the filesystem key, so
implement that. This means we only display the permissions that are
in effect, and don't display "negative" permissions like !host which
are not meaningful in this context.
2022-01-21 13:47:33 +01:00
Simon McVittie
924a7d29c5 Merge NEWS from tag '1.12.4', ignoring changes in po/
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-19 12:55:33 +00:00
Simon McVittie
103ed5c02c Regenerate translation files for release
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.12.4
2022-01-18 17:38:36 +00:00
Simon McVittie
d19ed758f9 Release v1.12.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-18 17:34:01 +00:00
Simon McVittie
617494c63f NEWS: Describe what is intended to appear in 1.12.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-18 16:35:28 +00:00
Simon McVittie
61927c7af7 NEWS: Mention CVE-2022-21682
At the time we wrote the NEWS for 1.12.3, this CVE ID had not yet been
issued.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-18 16:35:28 +00:00
Simon McVittie
f9ce3433e0 test-override: Exercise --nofilesystem=host:reset
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Alexander Larsson <alexl@redhat.com>
(cherry picked from commit 4aa70d2d72)
2022-01-18 16:35:28 +00:00
Simon McVittie
a16efca8ec test-context: Exercise some corner cases for merging filesystems
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Alexander Larsson <alexl@redhat.com>
(cherry picked from commit fab0f8ed7c)
2022-01-18 16:35:28 +00:00
Simon McVittie
0e2e9a5583 test-exports: Exercise host:reset and related filesystem tokens
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Alexander Larsson <alexl@redhat.com>
(cherry picked from commit f3d12dc793)
2022-01-18 16:35:28 +00:00
Simon McVittie
4eb3c2addd context: Introduce new --nofilesystem=host:reset
This reintroduces the special case that existed in Flatpak 1.12.3, but
under a different name, so that it will be backwards-compatible. With
this change, flatpak-builder will be able to resolve CVE-2022-21682 by
using --filesystem=host:reset.

We want to implement this as a suffix rather than as a new keyword,
because unknown suffixes are ignored with a warning, rather than causing
a fatal error. This means that the new version of flatpak-builder will
be able to run against older versions of flatpak: it will still be
vulnerable to CVE-2022-21682 in that situation, but at least it will run.

Co-authored-by: Alexander Larsson <alexl@redhat.com>
(cherry picked from commit 5709f1aaed)
2022-01-18 16:35:28 +00:00
Simon McVittie
47247b0987 test-override: Assert that --nofilesystem with suffix yields a warning
This was added as part of implementing the :reset suffix.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit ab0169ee39)
2022-01-18 16:35:28 +00:00
Simon McVittie
ecaabf5e9d test-override: Assert pre-1.12.3 behaviour of --nofilesystem=home, host
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 813e1f0b3b)
2022-01-18 16:35:28 +00:00
Simon McVittie
4a93202fc8 run, override: Clarify the effect of --nofilesystem
There are two reasonable interpretations for --nofilesystem=home:
either it revokes a previous --filesystem=home (as in Flatpak 1.12.2 and
older versions), or it completely forbids access to the home directory
(as in Flatpak 1.12.3). Clarify the man pages to indicate that it only
revokes a previous --filesystem=home. This will hopefully reduce
mismatches between the design and what users expect to happen, as
in flatpak#4654.

A subsequent commit will introduce a way to get the Flatpak 1.12.3
behaviour in a way that is more backwards-compatible with Flatpak 1.12.2
and older versions.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 7bbeed2b87)
2022-01-18 16:35:28 +00:00
Simon McVittie
a4291cd8e0 Revert "Make --nofilesystem=host/home remove access to subdirs of those"
This caused regressions for some previously-working use cases. For
example, some Flatpak users previously used a global
`flatpak override --nofilesystem=home` or
`flatpak override --nofilesystem=host`, but expected that individual apps
would still be able to have finer-grained filesystem access granted by the
app manifest, such as Zoom's `--filesystem=~/Documents/Zoom:create`. With
the changes in 1.12.3, this no longer has the desired result, because
`--nofilesystem=home` was special-cased to disallow inheriting the
finer-grained `--filesystem`.

This reverts commit 445bddeee6.

This reverts the initial solution to CVE-2022-21682, which we intend to
resolve differently, by introducing a new feature in Flatpak and making
use of it in a new flatpak-builder version.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 917a7f5870)
2022-01-18 16:35:28 +00:00
Simon McVittie
59dc5f783e Revert "manpages: Document the new details of --nofilesystem behaviour."
The new behaviour caused regressions in some situations that previously
worked, and will be reverted.

This reverts commit 4d11f77aa7.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit dfe868d628)
2022-01-18 16:35:28 +00:00
Simon McVittie
4aa70d2d72 test-override: Exercise --nofilesystem=host:reset
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Alexander Larsson <alexl@redhat.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
fab0f8ed7c test-context: Exercise some corner cases for merging filesystems
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Alexander Larsson <alexl@redhat.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
f3d12dc793 test-exports: Exercise host:reset and related filesystem tokens
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Alexander Larsson <alexl@redhat.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
5709f1aaed context: Introduce new --nofilesystem=host:reset
This reintroduces the special case that existed in Flatpak 1.12.3, but
under a different name, so that it will be backwards-compatible. With
this change, flatpak-builder will be able to resolve CVE-2022-21682 by
using --filesystem=host:reset.

We want to implement this as a suffix rather than as a new keyword,
because unknown suffixes are ignored with a warning, rather than causing
a fatal error. This means that the new version of flatpak-builder will
be able to run against older versions of flatpak: it will still be
vulnerable to CVE-2022-21682 in that situation, but at least it will run.

Co-authored-by: Alexander Larsson <alexl@redhat.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
ab0169ee39 test-override: Assert that --nofilesystem with suffix yields a warning
This was added as part of implementing the :reset suffix.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
813e1f0b3b test-override: Assert pre-1.12.3 behaviour of --nofilesystem=home, host
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
7bbeed2b87 run, override: Clarify the effect of --nofilesystem
There are two reasonable interpretations for --nofilesystem=home:
either it revokes a previous --filesystem=home (as in Flatpak 1.12.2 and
older versions), or it completely forbids access to the home directory
(as in Flatpak 1.12.3). Clarify the man pages to indicate that it only
revokes a previous --filesystem=home. This will hopefully reduce
mismatches between the design and what users expect to happen, as
in flatpak#4654.

A subsequent commit will introduce a way to get the Flatpak 1.12.3
behaviour in a way that is more backwards-compatible with Flatpak 1.12.2
and older versions.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
917a7f5870 Revert "Make --nofilesystem=host/home remove access to subdirs of those"
This caused regressions for some previously-working use cases. For
example, some Flatpak users previously used a global
`flatpak override --nofilesystem=home` or
`flatpak override --nofilesystem=host`, but expected that individual apps
would still be able to have finer-grained filesystem access granted by the
app manifest, such as Zoom's `--filesystem=~/Documents/Zoom:create`. With
the changes in 1.12.3, this no longer has the desired result, because
`--nofilesystem=home` was special-cased to disallow inheriting the
finer-grained `--filesystem`.

This reverts commit 445bddeee6.

This reverts the initial solution to CVE-2022-21682, which we intend to
resolve differently, by introducing a new feature in Flatpak and making
use of it in a new flatpak-builder version.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
dfe868d628 Revert "manpages: Document the new details of --nofilesystem behaviour."
The new behaviour caused regressions in some situations that previously
worked, and will be reverted.

This reverts commit 4d11f77aa7.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-18 15:30:12 +00:00
Simon McVittie
5dc5b1bb07 test-override: Assert that unimplemented suffix is ignored with a warning
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 8a44df04c8)
2022-01-17 16:03:25 +00:00
Simon McVittie
9bb041f457 test-override: Assert that only the expected term is negated
We weren't distinguishing here between overrides that should have been
negated (xdg-documents) and overrides that should not have been negated
(everything else).

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 4e3d1d8b7b)
2022-01-17 16:03:25 +00:00
Simon McVittie
88a928ea62 run: Avoid execve() when measuring test coverage
Normally, we want to save a process and get better signal handling
by replacing the `flatpak run` process with bubblewrap.

However, when we're doing profiling or measuring coverage, we want to
exit cleanly so that profiling data can be recorded, which is done in
an atexit() hook. In this situation, bypass the execve() optimization;
instead, start bubblewrap in the background, immediately wait for it,
and propagate its exit status.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-17 11:43:21 +01:00
Yuri Chornoivan
d567a1af88 Update Ukrainian translation 2022-01-17 11:40:46 +01:00
Anders Jonsson
32024b38d9 Update Swedish translation 2022-01-17 11:40:27 +01:00
Simon McVittie
8a44df04c8 test-override: Assert that unimplemented suffix is ignored with a warning
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-17 11:39:34 +01:00
Simon McVittie
4e3d1d8b7b test-override: Assert that only the expected term is negated
We weren't distinguishing here between overrides that should have been
negated (xdg-documents) and overrides that should not have been negated
(everything else).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-17 11:39:34 +01:00