Commit Graph

7164 Commits

Author SHA1 Message Date
Patrick
e110bf7c7f Merge branch 'main' into appstreamcli-compose 2023-01-07 18:48:28 -06:00
Phaedrus Leeds
523cedc275 trivial: Trim some long lines, etc. 2023-01-02 20:45:19 -06:00
Phaedrus Leeds
8ca1604a94 repair: Fix off-by-one error in fancy output
Fixes https://github.com/flatpak/flatpak/issues/5204
2023-01-02 20:45:19 -06:00
Sabri Ünal
1e8cb14281 Update Turkish translation 2022-12-31 18:12:10 -06:00
Simon McVittie
7a99c82900 dir: Use consistent FlatpakRunFlags everywhere
In principle either of these functions might read any of the flags.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-19 19:15:23 +00:00
Simon McVittie
e69afb1986 portal: Factor out flatpak_bwrap_is_unprivileged()
We can use this for other features that rely on having a non-setuid
version of bubblewrap.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-19 19:15:23 +00:00
Simon McVittie
60e2cceb8c common: Replace all flatpak_debug2() with g_debug()
They are now equivalent.

Resolves: https://github.com/flatpak/flatpak/issues/5001
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-15 16:45:35 +00:00
Simon McVittie
c2c034733e common: Make flatpak_debug2() use the same domain as g_debug()
Now that we are logging `flatpak -v` messages with log level INFO,
and printing INFO messages in the same way as DEBUG, we can reserve
log level DEBUG for `flatpak -v -v` messages. This means we no longer
need a weird secondary debug domain.

There is a very small behaviour change here: G_MESSAGES_DEBUG=flatpak
is now similar to `flatpak -v -v` (previously `flatpak -v`), and
G_MESSAGES_DEBUG=flatpak2 no longer has any effect. This seems more in
line with what would be expected from a GLib-based application.

In flatpak(1) and the system helper, this does not change behaviour
other than that: the same messages are logged by `-v` and by `-v -v`
as before.

In daemons that do not implement `-v -v` (the OCI authenticator, portal
and session helper), it continues to be necessary to use
G_MESSAGES_DEBUG to see flatpak_debug2() messages.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-15 16:45:35 +00:00
Simon McVittie
86c9d7d4c7 daemons, etc.: Use g_info() for messages that are enabled by -v
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-15 16:45:35 +00:00
Simon McVittie
522a933bc9 app: Use g_info() for messages that will be shown by flatpak -v
This brings us one step closer to being able to stop using the flatpak2
log domain for messages that are exclusive to `flatpak -v -v`.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-15 16:45:35 +00:00
Simon McVittie
07a6541f06 common: Use g_info() for messages that will be shown by flatpak -v
This brings us one step closer to being able to stop using the flatpak2
log domain for messages that are exclusive to `flatpak -v -v`.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-15 16:45:35 +00:00
Simon McVittie
ea584acf20 daemons: Treat g_info() as equivalent to g_debug()
Same as the previous commit, but for anything that runs in the
background.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-14 20:02:35 +00:00
Simon McVittie
ac4e322629 main: Treat g_info() as equivalent to g_debug()
This makes us consistent with the default behaviour of GLib, and
its behaviour with G_MESSAGES_DEBUG=all. g_debug() and g_info() are
the two lowest priority levels, and GLib normally silences them by
default.

At the moment, Flatpak uses G_LOG_LEVEL_DEBUG in the flatpak2 domain
as its lowest-priority log level (only shown with flatpak -v -v), and
G_LOG_LEVEL_DEBUG in the flatpak domain as its second-lowest
(shown with flatpak -v or higher). I want to move towards using
G_LOG_LEVEL_INFO for flatpak -v messages, and G_LOG_LEVEL_DEBUG for
flapak -v -v, so that we don't need a second log domain: this is a
policy I've used successfully in Flatpak-derived Steam Runtime code.

This change does not fully implement that policy, but gives us a
migration path towards it, by allowing us to start using g_info() for
flatpak -v messages.

Helps: https://github.com/flatpak/flatpak/issues/5001
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-14 20:02:35 +00:00
David King
87c9fccdb2 selinux: Install to previous location
Install flatpak.if to the same location for Autotools and meson.
2022-12-14 20:00:48 +00:00
David King
13c5326122 selinux: Install when using meson
With custom_target, providing build_by_default is not enough to install
the output, which must be explicitly requested.
2022-12-14 20:00:48 +00:00
Simon McVittie
f3c79b2974 Update submodule: bubblewrap 0.7.0
- Better error messages on various failure modes

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-12 19:16:22 +00:00
Simon McVittie
1eed25617c Replace calls to g_memdup() with g_memdup2()
g_memdup() is subject to an integer overflow on 64-bit machines if the
object being copied is larger than UINT_MAX bytes. I suspect none of
these objects can actually be that large in practice, but it's easier
to replace all the calls than it is to assess whether we need to
replace them.

A backport in libglnx is used on systems where GLib is older than 2.68.x.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-12 19:15:52 +00:00
Simon McVittie
7a144248f2 Update submodule: libglnx
- Backport g_memdup2

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-12 19:15:52 +00:00
Leorize
df0b9d98b5 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.
2022-12-07 16:20:51 -06:00
Patrick
8daa975ab3 CI: Disable Valgrind test for now
This test has consistently failed for months as it takes too long.

While it should be looked into its not helpful to show CI as always failing either.
2022-12-05 14:33:51 +00:00
Martin Kühl
16707a1937 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`
2022-12-04 11:43:30 -06:00
Leorize
751ff11d3a 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.
2022-12-01 20:01:14 -06:00
Jan Macku
668fc7d514 ci(lint): add shell linter - Differential ShellCheck
It performs differential ShellCheck scans and report results directly in pull request.

documentation: https://github.com/redhat-plumbers-in-action/differential-shellcheck

Signed-off-by: Jan Macku <jamacku@redhat.com>
2022-11-22 10:58:52 -06:00
Simon McVittie
4e7bb4bfef Revert ".gitmodules: Temporarily fetch from Github mirror of libglnx"
This reverts commit 7cb9eb3ebc.
2022-11-18 12:42:33 +00:00
Simon McVittie
e8728f7f91 Revert ".gitmodules: Temporarily fetch from my Github fork of v-s-c"
This reverts commit bdfebb44da.
2022-11-18 12:42:27 +00:00
Simon McVittie
47ea3934c0 Update translation files for release
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.15.1
2022-11-17 18:34:12 +00:00
Simon McVittie
7db1db0673 Prepare v1.15.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-17 18:25:15 +00:00
Simon McVittie
bdfebb44da .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>
2022-11-17 18:24:57 +00:00
Simon McVittie
7cb9eb3ebc .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>
2022-11-17 18:24:41 +00:00
Simon McVittie
f9a7d12014 .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>
2022-11-17 18:24:23 +00:00
Simon McVittie
cad1bf63c6 Update NEWS for #5168
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-17 18:02:31 +00:00
Simon McVittie
db77992b28 doc: Update flatpak-metadata(5) for #5155
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-17 17:57:43 +00:00
Simon McVittie
6096159e2b NEWS: Update
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-17 17:51:35 +00:00
Simon McVittie
26fbf692cd doc: Update flatpak-run(1) for #5168
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-17 17:44:18 +00:00
Philip Withnall
9ec783f029 flatpak-dir: Clean up old leaked deploy dirs at start of deploy
Following on from commit 85a83a06f9, add some code to clean up old
leaked deploy tmpdirs when we next try to deploy the same app
(successfully or not).

This should free up disk space leaked by failed deploys pre-85a83a06f95.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-11-16 18:46:01 +00:00
Philip Withnall
6c7eb34dd6 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>
2022-11-16 18:46:01 +00:00
Simon McVittie
d28495d54f build: Simplify detection of GPGME when using Meson
In theory we could have ended up linking a non-threadsafe version of
GPGME, since the version without the -pthread suffix has only been
thread-safe since 1.8.0.

In practice we require version 0.53 of Meson (available in Ubuntu 20.04,
Debian 11, etc.) so it seems reasonable to require a contemporary
version of GPGME (1.8.0 is available in Ubuntu 18.04, Debian 10, etc.)
and drop the complexity of handling this in a fully-backwards-compatible
way. Users of older LTS distributions like Ubuntu 16.04 should continue
to build Flatpak with Autotools.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-10 15:23:58 +00:00
Simon McVittie
9b87e4c0d4 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>
2022-11-10 15:23:58 +00:00
Simon McVittie
751d2b110b workflows: Enable CI for flatpak-1.14.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-10 13:13:22 +00:00
Erick555
d8695f3071 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.
2022-11-10 12:34:01 +00:00
Jan Alexander Steffens (heftig)
d83b262ded app/meson.build: Add missing dep
Since we include the base private headers, we need the common base
sources to be generated.
2022-11-03 15:27:58 -05:00
Philip Withnall
ce1829a703 flatpak-dir: Use FD-relative operations in a few more places
These are the easy places to use the new `deploy_base_dfd` from to make
some more operations relative to an already-open dirfd in
`flatpak_dir_deploy()`.

This should introduce no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-11-01 14:29:28 +00:00
Philip Withnall
85a83a06f9 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>
2022-11-01 14:29:28 +00:00
Gaël Donval
397c97de9f 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.
2022-11-01 10:06:05 +00:00
Simon McVittie
61566a9337 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-28 10:26:45 +01:00
Simon McVittie
de4de4dc44 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>
2022-10-27 09:59:43 +01:00
Simon McVittie
190bad06d2 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>
2022-10-27 09:59:43 +01:00
Simon McVittie
959910f933 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>
2022-10-25 10:32:50 +02:00
Simon McVittie
e084a4f14b Update translation files for release
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.15.0
2022-10-24 19:27:23 +01:00
Simon McVittie
b30f5b96ac Release v1.15.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 19:27:23 +01:00