Commit Graph

7125 Commits

Author SHA1 Message Date
Phaedrus Leeds
6929db2cb7 repair: Fix off-by-one error in fancy output
Fixes https://github.com/flatpak/flatpak/issues/5204

(cherry picked from commit 8ca1604a94)
2023-01-30 11:50:25 +00:00
Leorize
99329d0cf5 flatpak-run: unset GIO_EXTRA_MODULES
This variable contains paths to load GIO modules from. For the most
part, they refer to paths outside of the sandbox or if they happen
to be in the sandbox, would contain modules that are incompatible with
the sandbox runtime (ie. different libc).

While I've not found programs that would crash outright, it may cause
unexpected behaviors (eg. Apostrophe not being able to render math in
preview panel).

This variable is set by NixOS for its dependency boxing.

(cherry picked from commit df0b9d98b5)
2023-01-30 11:46:07 +00:00
Leorize
1e14a1fd30 flatpak-run: unset XKB_CONFIG_ROOT
This variable is typically used to configure the use of a custom
set of XKB definitions. In those cases, it's mostly meant for the
X11 server or Wayland compositor. NixOS is known to employ this
variable for their custom XKB layout implementation.

When the path it points to is unreachable (due to the sandbox),
most GTK+/Qt applications will crash on Wayland.

Unsetting this does not seem to negatively impact the use of custom
XKB layouts with Flatpak applications.

(cherry picked from commit 751ff11d3a)
2023-01-30 11:45:57 +00:00
Michael Catanzaro
e853fb4cdb 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.

(cherry picked from commit 1c32317841)
2023-01-30 11:45:49 +00:00
Martin Kühl
e14247f0a9 profile.d: Only add new directories to XDG_DATA_DIRS in fish
Previously in a0505f52d9
the profile script was modified to preserve XDG_DATA_DIRS.
This had the side-effect of making the script not idempotent,
adding duplicate entries for every installation every time it's sourced.

On my current system  that results in this value:

    /home/mkhl/.local/share/flatpak/exports/share /var/lib/flatpak/exports/share /home/mkhl/.local/share/flatpak/exports/share /var/lib/flatpak/exports/share /usr/local/share /usr/share

which in turn has the side-effect of the GNOME search settings showing two entries
for every application installed via flatpak.

This change makes the script check that an entry is new before adding it.
It also uses `set -p` (short for `--prepend`) to add them.

N.B.
`set -p VAR val` is equivalent to `set VAR val $VAR`
`$var[-1..1]` reverses the order of elements
so after iterating the first element of `$installations`
becomes the first element of `$XDG_DATA_DIRS`

(cherry picked from commit 16707a1937)
2023-01-30 11:44:29 +00:00
Forest
0f77c6a6f5 utils: Unmap the old summary.idx file before trying to replace it
Exporting to an existing repo on a Samba filesystem failed with EACCES
when libglnx called renameat() to replace the old summary.idx file.

    error: renameat: Permission denied

This occurred even when the user had appropriate permissions to the file
and its ancestor directories. The problem was that flatpak had mapped the
old file into memory for reading, and still held a reference to that mapping
when attempting to replace the underlying file. Apparently this works on some
filesystems, but not on cifs.

We therefore release the memory mapping before replacing the underlying file.

Fixes #5257

Co-authored-by: Patrick <tingping@tingping.se>
(cherry picked from commit 01910ad12f)
2023-01-30 11:43:38 +00:00
Simon McVittie
f9a768721e Update translation files for v1.14.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.14.1
2022-11-18 13:41:08 +00:00
Simon McVittie
62a31e90b3 Prepare v1.14.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-18 13:33:32 +00:00
Simon McVittie
078c4cd98a Revert ".gitmodules: Temporarily fetch from Github mirror of libglnx"
This reverts commit 7cb9eb3ebc.
2022-11-18 13:32:33 +00:00
Simon McVittie
4568de61f5 Revert ".gitmodules: Temporarily fetch from my Github fork of v-s-c"
This reverts commit bdfebb44da.
2022-11-18 13:32:29 +00:00
Simon McVittie
ff75036545 .gitmodules: Temporarily fetch from my Github fork of v-s-c
gitlab.gnome.org is currently down, so use a mirror.
The specific commit we are using has not changed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit bdfebb44da)
2022-11-17 19:00:30 +00:00
Simon McVittie
1fc97aaf02 .gitmodules: Temporarily fetch from Github mirror of libglnx
gitlab.gnome.org is currently down, so use a mirror.
The specific commit we are using has not changed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 7cb9eb3ebc)
2022-11-17 19:00:27 +00:00
Simon McVittie
61fb373b88 .gitmodules: Canonicalize URL of bubblewrap
The project was moved to a new namespace a while ago, and is now using
the main branch rather than master.

The specific commit we are using has not changed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit f9a7d12014)
2022-11-17 19:00:24 +00:00
Simon McVittie
45ed3b11a6 Update NEWS for 1.14.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-17 18:02:21 +00:00
Philip Withnall
ce9775e450 flatpak-dir: Add a debug message to remove_old_appstream_tmpdirs()
This should make it a bit clearer when `rm -rf` is being used in the
debug logs.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
(cherry picked from commit 6c7eb34dd6)
2022-11-17 17:58:44 +00:00
Simon McVittie
c8f3f0dc1a build: Accept gpgme >= 1.8.0 as equivalent to gpgme-pthread
Before 1.8.0 (2016), gpgme used to have two different thread-safe builds,
one for use with POSIX-style pthread and one for use with GNU Portable
Threads (libpth), plus a non-thread-safe version. Since 1.8.0, this
complexity has gone away and there is only libgpgme, which is thread-safe.

In practice this meant that on modern distros since 2016, we would always
fail to detect gpgme via pkg-config and fall back to calling gpgme-config.

Library-specific -config scripts are generally considered problematic
for multiarch, multilib and cross-compiling, and the gpgme-config script
recently disappeared from GPGME's Debian packaging
(see https://bugs.debian.org/1022348 and https://bugs.debian.org/1023601),
so it's better if we can prefer to use pkg-config.

If gpgme >= 1.8.0 is not found, fall back to gpgme-pthread >= 1.1.8,
either discovered via pkg-config or via gpgme-config.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 9b87e4c0d4)
2022-11-17 17:58:26 +00:00
Simon McVittie
0033d1aae8 doc: Update flatpak-metadata(5) for #5155
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit db77992b28)
2022-11-17 17:58:07 +00:00
Gaël Donval
9bd6fa0f26 Add /efi in the hidding list when (fs=host)
When filesystem=host access is provided, some root folders are hidden, including /boot.

The bootloader specification now recommends mounting the system EFI filesystem in /efi
(currently visible) instead of /boot/efi (currently hidden). This hides /efi for the same
reasons /boot is already hidden.

(cherry picked from commit 397c97de9f)
2022-11-17 17:56:45 +00:00
Simon McVittie
ab698907a8 doc: Update flatpak-run(1) for #5168
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 26fbf692cd)
2022-11-17 17:56:45 +00:00
Erick555
8b0a9791af Clear more temporary file paths from env
This supplements clearing TMPDIR env variable which is only one among variables used for storing temporary files. Any of those leaking from host may confuse flatpak apps which try to save temporary files under non-existing directory in sandbox.

See https://github.com/flathub/com.logseq.Logseq/issues/29 for real world example.

(cherry picked from commit d8695f3071)
2022-11-17 17:56:45 +00:00
Simon McVittie
93c7036118 automake: Consistently include $(AM_CFLAGS) in target-specific CFLAGS
When built for i386 with Autotools, this would have detected the format
string issue fixed in #5148.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit de4de4dc44)
2022-11-17 17:54:47 +00:00
Simon McVittie
414bbfd617 revokefs: Remove incorrect libglnx include directory
revokefs already gets the correct include directory from the AM_CPPFLAGS.
This would also break the build with -Werror=missing-include-dirs.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 190bad06d2)
2022-11-17 17:54:40 +00:00
Simon McVittie
44b9cddeb3 workflows: Enable CI for flatpak-1.14.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 751d2b110b)
2022-11-10 13:13:53 +00:00
Philip Withnall
fdc7287d21 flatpak-dir: Clean up temp deploy dir on failure of flatpak_dir_deploy()
This already happens for installs due to the cleanup path in
`flatpak_dir_deploy_install()`, but it doesn’t happen for other calls to
`flatpak_dir_deploy()`. Notably, during updates of already installed
apps.

Specifically, this means that if an app update is cancelled due to being
blocked by a parental controls policy, the temp deploy dir for that app
(such as
`~/.local/share/flatpak/app/com.corp.App/x86_64/stable/.somehex-XXXXXX`)
will be leaked. It will never be automatically cleaned up, as it’s not
in `/var/tmp` either.

Fix that by using `glnx_mkdtempat()` to create a scoped temporary
directory.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
(cherry picked from commit ce1829a703)
2022-11-10 12:42:40 +00:00
Simon McVittie
6948b1c3db Update NEWS for 1.14.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-28 13:07:15 +01:00
Simon McVittie
5633ae11dd revokefs: Use correct format string for a ssize_t
This fixes the build on ILP32 architectures such as i386 with the Meson
build system. The Autotools build system accidentally didn't build
revokefs with -Werror=format, because it sets the target-specific CFLAGS
for revokefs but does not include the $(AM_CFLAGS) in them.

Fixes: aeecbb7d "revokefs: Split out the writing part from the fuse implementation"
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 959910f933)
2022-10-28 13:07:15 +01:00
Jan Tojnar
075482d2b7 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.

(cherry picked from commit a0505f52d9)
2022-10-28 13:07:15 +01:00
Rafael Fontenelle
39a0c470a9 Update Brazilian Portuguese translation
(cherry picked from commit e5bb9af250)
2022-10-28 13:07:15 +01:00
Piotr Drąg
202d40c6f9 Update Polish translation
(cherry picked from commit 9d44a27d79)
2022-10-28 13:07:15 +01:00
Kukuh Syafaat
ed450226de Update Indonesian translation
(cherry picked from commit b26e9efb1d)
2022-10-28 13:07:15 +01:00
Alberto Garcia
2dad36ede6 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>
(cherry picked from commit c1f0370958)
2022-10-28 13:07:15 +01:00
Jakub Steiner
a6b431b1c0 README: update logo
See https://github.com/flatpak/flatpak.github.io/issues/537

(cherry picked from commit a88d971792)
2022-10-28 13:07:15 +01:00
Simon McVittie
188e7494a2 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>
(cherry picked from commit 3a93ef4842)
2022-10-28 13:07:15 +01:00
Simon McVittie
c570d95598 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>
(cherry picked from commit 8a52187145)
2022-10-28 13:07:15 +01:00
Simon McVittie
cf1517a4db 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>
(cherry picked from commit 3591ba08f6)
2022-10-28 13:07:15 +01:00
Simon McVittie
e6db467c2f 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>
(cherry picked from commit 8c51650662)
2022-10-28 13:07:15 +01:00
Patrick Griffis
43a25deba0 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).

(cherry picked from commit f1dda39e80)
2022-10-28 13:07:15 +01:00
Robert Ancell
90b15f916a 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.

(cherry picked from commit b204ed2466)
2022-10-28 13:07:15 +01:00
Alex
8fbe795699 Update check.yml
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
(cherry picked from commit a0c6848ccf)
2022-10-28 13:07:15 +01:00
git-bruh
6e3f778a4a flatpak-utils-http: check for HTTP2 support before trying to use it
(cherry picked from commit 83b881cdc2)
2022-10-28 13:07:15 +01:00
Alberto Garcia
8305ff2732 Stop flatpak-session-helper and flatpak-portal when the session ends
Fixes #5068
2022-10-28 13:07:15 +01:00
Phaedrus Leeds
1089769f7a 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-10-28 13:07:15 +01:00
AsciiWolf
53106eaded Update Czech translation 2022-10-14 12:25:02 +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