Commit Graph

7111 Commits

Author SHA1 Message Date
Simon McVittie
861d2b41e6 build: Require Meson 0.53.0
This lets us drop some fallback code paths.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:12:14 +01:00
Simon McVittie
12140e9a8a meson: Depend on Meson 0.51.0
This lets us drop the complicated fallback logic for libgpgme.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:12:14 +01:00
Simon McVittie
435be4da14 meson: Depend on Meson 0.50.0
This sacrifices compatibility with Debian 10 to let us simplify how
tests are set up.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:12:14 +01:00
Simon McVittie
d98b745d43 workflows: Use Meson for the main build
This is somewhat faster than Autotools. We still use Autotools for
the alt, clang and valgrind builds, to make sure we cover both.

As a bonus, the use of undefined behaviour and address sanitizers here
actually works (unlike in Autotools, see #4844) so we're getting test
coverage with detection of common issues like use-after-free.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:12:14 +01:00
Simon McVittie
f85097a427 Run a Meson build during distcheck
This verifies that all the necessary files for the Meson build are in
the Autotools-built tarball.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:12:14 +01:00
Simon McVittie
9eb824f863 Add a Meson build system
Resolves: https://github.com/flatpak/flatpak/issues/2241
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:12:14 +01:00
Simon McVittie
ad1dc62f26 testlib: Remove local backport of g_assert_no_errno()
libglnx now provides this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:10:49 +01:00
Simon McVittie
b0580b79b7 Update libglnx to commit e701578c
In particular, this version has more gtestutils backports, including a
version of g_test_message() that preserves correct TAP syntax for
multi-line messages.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:10:49 +01:00
Jan Tojnar
a0505f52d9 profile.d: Do not destroy XDG_DATA_DIRS in fish
The profile script previously nuked `XDG_DATA_DIRS` and then
“helpfully” re-populated it with FHS paths. This was especially
bad for systems like NixOS, which do not have `/usr`
and rely on `XDG_DATA_DIRS` heavily.

Quoting from https://fishshell.com/docs/current/cmds/set.html

> If a variable is set to zero elements, it will become a list with zero elements.

And indeed, that is what the `set -x --path XDG_DATA_DIRS` command does.
We need to list the value explicitly, if we want to preserve it
while setting variable options.
2022-10-14 12:24:21 +01:00
Rafael Fontenelle
e5bb9af250 Update Brazilian Portuguese translation 2022-10-14 12:22:01 +01:00
Piotr Drąg
9d44a27d79 Update Polish translation 2022-10-14 12:21:18 +01:00
Kukuh Syafaat
b26e9efb1d Update Indonesian translation 2022-10-14 12:20:39 +01:00
AsciiWolf
ea57deb891 Update Czech translation 2022-10-14 12:19:41 +01:00
Alberto Garcia
c1f0370958 session-helper: Run default signal handler after handle_sigterm()
Exiting the process with a custom exit status (1) after systemctl stop
(SIGTERM) makes systemd treat the flatpak-session-helper service as if
it had failed.

Signed-off-by: Alberto Garcia <berto@igalia.com>
2022-10-06 13:48:31 +01:00
Jakub Steiner
a88d971792 README: update logo
See https://github.com/flatpak/flatpak.github.io/issues/537
2022-09-26 14:35:40 +01:00
Michael Catanzaro
1c32317841 Block KRB5CCNAME from inheriting into sandbox
If this environment variable is set on the host, it's going to mess up
authentication in the sandbox. For example, if the host has:

KRB5CCNAME=KCM:

then the sandboxed process will try to use the host KCM socket, which is
not available in the sandboxed environment, rather than the gssproxy
socket that we want it to use. We need to unset it to ensure that
whatever configuration we ship in the runtime gets used instead. We have
switched the GNOME runtime to use an empty krb5.conf and it works as
long as we don't break it with this environment variable meant for the
host.
2022-09-19 09:03:48 +02:00
Michael Catanzaro
0184e542c5 Bind gssproxy socket into sandbox environment
We're using a directory rather than binding a socket directly for
increased robustness. In theory, if gssproxy crashes on the host, a new
socket that a new gssproxy process creates should be immediately visible
inside the sandbox. Nifty.

Previously, applications that wanted to use Kerberos authentication
would have to punch a sandbox hole for the host's KCM socket. In
contrast, this gssproxy socket is designed for use by sandboxed apps.

See also: https://github.com/gssapi/gssproxy/issues/45
2022-09-19 09:03:48 +02:00
Simon McVittie
3a93ef4842 enum-types: Make generated files more reproducible
`@filename@` expands to the relative or absolute path to the source
file, which varies between build systems and build directories.
`@basename@` expands to the basename of the file, which stays constant
across more build configurations.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-07 09:21:58 +02:00
Simon McVittie
8a52187145 workflows: Compile with Ubuntu 18.04's GLib, but use 2.60 to run tests
This avoids a race condition in versions older than 2.60, while still
verifying that we can compile successfully with GLib 2.56.

Not having GLib 2.60 means we can't compile libmalcontent on Ubuntu 18.04,
so move the libmalcontent dependency to the main build job (on Ubuntu
22.04, which is new enough). This also means we don't have to compile
it from source every time.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-07 09:21:19 +02:00
Simon McVittie
3591ba08f6 uri: Don't rely on g_time_zone_new_offset()
g_time_zone_new_offset() was new in GLib 2.58, but Ubuntu 18.04 'bionic'
only has GLib 2.56, and in theory we still claim to support versions
all the way back to GLib 2.46. If that function isn't available,
reimplement it in terms of the deprecated g_time_zone_new().

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-07 09:21:19 +02:00
Simon McVittie
3b37d69226 build: Bump version to 1.14.99 for 1.15.0 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-06 14:32:31 +01:00
Simon McVittie
8c51650662 uri: Don't do scheme-based normalization with GLib 2.66.x
GLib 2.66.x is present in Debian 11, and didn't support scheme-based
normalization. This has two effects:

1. URIs containing an explicit port, like https://example.com:443/,
   don't get normalized to https://example.com/
2. URIs with an empty path, like https://example.com, don't get
   normalized to https://example.com/

Neither of these normalizations seems particularly critical for Flatpak.

Resolves: https://github.com/flatpak/flatpak/issues/5062
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-06 13:20:05 +02:00
Patrick Griffis
f1dda39e80 flatpak.pc: Add httpbackend variable for curl/libsoup detection
Some projects such as GNOME-Software need this information to know
if its safe to build against (libsoup2 vs libsoup3 conflicts).
2022-09-06 13:18:55 +02:00
Robert Ancell
b204ed2466 app: Fix warning when listing a document with no permissions.
(flatpak documents:2965757): GLib-CRITICAL **: 11:27:35.128: g_variant_iter_next_value: must not be called again after NULL has already been returned.

This is due to the applications iterator being checked twice even though it is empty.
2022-09-06 13:18:09 +02:00
Alex
a0c6848ccf Update check.yml
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
2022-09-06 13:08:06 +02:00
git-bruh
83b881cdc2 flatpak-utils-http: check for HTTP2 support before trying to use it 2022-09-06 12:47:16 +02:00
Joaquim Monteiro
bd53d40962 Allow the modify_ldt syscall when using multiarch
Some patches for Wine, as well as old 16-bit programs,
require this syscall to work.

As the only programs that need it are using --allow=multiarch,
this commit keeps it disabled when it isn't used,
as a security hardening measure.

For more information, see issue #4297.
2022-09-06 12:34:17 +02:00
Alberto Garcia
8b39921933 Stop flatpak-session-helper and flatpak-portal when the session ends
Fixes #5068
2022-09-01 20:12:04 +01:00
Phaedrus Leeds
75640e2461 SECURITY.md: Update for 1.14.0 release
1.15.x doesn't exist yet but I don't think it hurts to add it here.
2022-08-23 15:36:33 +01:00
Phaedrus Leeds
488038eed4 Update pofiles for release 1.14.0 2022-08-22 21:57:20 -07:00
Phaedrus Leeds
b448e3b527 Prepare v1.14.0 2022-08-22 21:57:20 -07:00
Phaedrus Leeds
600e18567c Add a vim modeline and .editorconfig
To make indentation work with less effort. The modeline was copied from
libostree with minor modification and the .editorconfig from GLib.

The advantage of having both a modeline and an editorconfig is we can
work out of the box on more editor setups, and the modeline allows us to
specify the style with a lot more fine grained control.
2022-08-22 19:48:10 -07:00
Milan Crha
dc82a19dc5 common: Add thread safety on libcurl usage
There can happen a race condition between internal libcurl structure
content when two threads set the `data` structure for the callbacks
from two threads, which can cause access of already freed stack-allocated
`data`, resulting in a memory corruption.

Closes https://github.com/flatpak/flatpak/issues/3701
2022-08-22 10:36:30 +02:00
Nick Reiley
764e5a4d0c Add --socket=gpg-agent 2022-08-16 13:29:06 +02:00
Simon McVittie
061102df30 workflows: Build with FUSE 3 on Ubuntu 22.04
This ensures we exercise both code paths.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 13:27:04 +02:00
Simon McVittie
022be7b6db tests: Add valgrind suppression for ostreedev/ostree#2592
This is fixed in v2022.3, but that version missed the boat for Ubuntu
22.04.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 13:27:04 +02:00
Simon McVittie
4018419b15 revokefs: Use FUSE version 3 if possible
Based on a change contributed by Léo Stefanesco; but instead of
unconditionally using FUSE 3, leave a fallback code path for FUSE 2 for
older distros.

Co-authored-by: Léo Stefanesco <leo.lveb@gmail.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 13:27:04 +02:00
Yuri Chornoivan
0ff4e6aaae Update Ukrainian translation 2022-08-16 10:53:02 +02:00
Simon McVittie
092d30c777 exports: Add logging at a finer granularity
This helps to figure out what is going on if the expected paths are not
being exported.

The general design principle here is that I've used flatpak_debug2()
(which appears in `flatpak -v -v` but not `flatpak -v`) for situations
which occur under normal circumstances, and g_debug() (which appears
in `flatpak -v` or higher) for situations which are expected to be
uncommon.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 10:52:37 +02:00
Phaedrus Leeds
ff8490a91e app: Add -u alias for --user
Save folks a few keystrokes. There is a command which already has a '-u'
option, document-export, but it doesn't support --user so there should
be no conflict. However '-s' is used by the info command among others,
so we can't use that for --system.
2022-08-16 10:50:29 +02:00
Patrick Griffis
6540f85511 Allow sub-sandboxes to own MPRIS names
We already allow normal apps to own MPRIS names but subsandboxes could not.

This allows them with the same dbus restrictions that they must be
prefixed by $app_id.Sandboxed.

This will be used by WebKitGTK.
2022-08-16 10:48:00 +02:00
Anders Jonsson
ac792c1426 Update Swedish translation 2022-08-16 10:45:52 +02:00
Ettore Atalan
a86489ae4e Update German translation 2022-08-16 10:45:36 +02:00
Simon McVittie
a03111a3d1 enter: Don't overwrite the DISPLAY
Now that we're using the same display number in the sandbox as on the
host, we can forget about overwriting it with :99.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 10:45:08 +02:00
Simon McVittie
ca992c7862 run: Preserve X11 display number instead of redirecting it to :99
Suppose the user's "real" X11 display on the host is Xorg or Xwayland
listening on :42, but they also have an Xvfb server listening on :99.

If we change the X11 display number to the arbitrary value :99, and
the Flatpak sandbox shares its network namespace with the host, then
clients inside the Flatpak sandbox will prefer to connect to the
abstract socket @/tmp/.X11-unix/X99 (which is Xvfb), rather than the
filesystem-backed socket /tmp/.X11-unix/X99 in the sandbox (which is
really /tmp/.X11-unix/X42 on the host, i.e. Xorg or Xwayland).

If they're relying on Xauthority (MIT-MAGIC-COOKIE-1) for access
control (as many display managers do), then this will fail, because
we gave the sandboxed app access to the cookies for Xorg/Xwayland
(rewriting their display number from 42 to 99 as we did so), but
Xvfb does not accept those cookies.

If we're relying on `xhost +"si:localuser:$(id -nu)"` for access control
(as gdm does), then the Flatpak app will successfully (!) connect to
whatever is on :99, for example Xvfb or Xephyr, which is rarely what
anyone wants either.

Resolves: https://github.com/flatpak/flatpak/issues/3357
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 10:45:08 +02:00
Phaedrus Leeds
60005cfcc2 build-export: Don't warn on missing Exec= if DBusActivatable=true
The Desktop Entry spec says that Exec= is only required if
DBusActivatable= is not set to true, so don't emit a warning when Exec=
is missing but not required.
2022-08-16 10:42:06 +02:00
Danilo Bargen
298286be2d build-export: Explicitly allow empty Exec values in desktop file 2022-08-16 10:42:06 +02:00
Danilo Bargen
6dbc097ac5 build-export: Avoid segfault if Exec line is missing from desktop file 2022-08-16 10:42:06 +02:00
Phaedrus Leeds
53a0b528bf Add DeploySideloadCollectionID flatpakref/flatpakrepo key
When Flatpak's P2P updates support was replaced with the "sideloading"
implementation in 1.7.1, a new server side repo config key
"deploy-sideload-collection-id" was added which gets set when you pass
"--deploy-sideload-collection-id" to "flatpak build-update-repo", and
has the effect of setting "xa.deploy-collection-id" in the repo metadata
that is pulled by clients, which itself causes a collection id to be set
on the remote for clients using Flatpak >= 1.7.1.

This commit adds an analogous key in flatpakref and flatpakrepo files,
so the collection id can be set when the remote is configured, rather
than later on when the repo metadata is pulled and acted upon. As before
with DeployCollectionID, it has no difference in function compared to
DeployCollectionID or CollectionID and the only difference is which
Flatpak versions are affected.

It would've been better if this were added in 1.7.1 when the sideload
support was added, but alas here we are.

(Also update the docs and unit tests)
2022-08-16 10:37:36 +02:00
Phaedrus Leeds
bf37034663 common: Add missing error codes to GDBusErrorEntry array
These were mistakenly only added to flatpak-error.h
2022-07-25 16:58:32 -04:00