Commit Graph

7444 Commits

Author SHA1 Message Date
Simon McVittie
c98a7c024f utils: Move OstreeRepo configuration accessors to a new translation unit
This is a step towards removing the libostree dependency from
flatpak-utils, which should be one of the lowest-level components.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
485f6bc5c5 common: Explicitly include ostree.h where needed
A subsequent commit will remove it from flatpak-utils-private.h.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
14db9d48cf common: Break out the parts of flatpak-utils that deal with FlatpakDir
This breaks the circular dependency between flatpak-utils and flatpak-dir.
There is still a circular dependency between flatpak-dir and
flatpak-dir-utils, but I don't want to make flatpak-dir even larger.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
3c82620bab repo-utils: New header for some implementation details of a repository
This will reduce circular dependencies involving FlatpakDir.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
89f8f3767a common: Move OCI registry manipulation into FlatpakOciRegistry
This is a step towards making flatpak-utils conceptually "smaller"
than all other translation units, with no dependencies beyond GLib and
libglnx. In particular, consolidating all the OCI registry manipulation
into one place means we can build other translation units without
libarchive.

This would also be a step towards being able to provide a build-time
option to build a libostree-only version of Flatpak without the OCI
feature or the direct libarchive dependency, if someone wanted to
implement that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
722fec4581 utils: Include flatpak-metadata-private.h instead of -run-private.h
This avoids a circular dependency between -run and -utils.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Chris Williams
7c63731349 doc: Correct special value for flatpak config
To include all languages, the languages key must be set to `*all*`, not
`all`. That was apparently intended to provide symmetry with how the
value is represented in the output of `flatpak config`.
2024-07-09 20:48:07 +01:00
Simon McVittie
fd5c0b1f37 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 20:33:46 +01:00
Georges Basile Stavracas Neto
1b4ff8d526 flatpak-run-dbus: Allow two AT-SPI Registry signals in
These signals can be used by apps to monitor whether they need to emit
signals on the a11y bus or not. This can very significantly reduce
chattery on the a11y bus, and at least WebKit relies on these signals
to be broadcasted in.

The PR https://github.com/flatpak/xdg-dbus-proxy/pull/61 is required
for this changeset to work as expected, but it can land independently
as `--broadcast` is supported by xdg-dbus-proxy.
2024-07-09 09:23:32 -03:00
Hubert Figuière
92d7f9ec49 flatpak-permissions: Fix a memory leak
This occur by just running flatpak permission <SOME APP>

Signed-off-by: Hubert Figuière <hub@figuiere.net>
2024-06-27 20:55:50 -04:00
Scrambled777
cee83455e6 Hindi Translation Update
Fixes and update for Hindi translation.
2024-06-27 15:39:47 -03:00
lumingzh
1dbaa59a85 Update Chinese translation 2024-06-27 15:12:57 -03:00
Sebastian Wick
24a4c2464e dir: Free the returned GVariant of g_dbus_connection_call_sync
Closes: https://github.com/flatpak/flatpak/issues/5856
Fixes: 9532c8d3 ("dir: Reload DBus daemon config to ensure services get picked up")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-06-26 11:47:53 +01:00
Sebastian Wick
c12a5da619 run: Support zoneinfo dirs from $TZDIR env 2024-06-21 11:12:57 -03:00
Sebastian Wick
36b6c86065 common: Simplify tzdir logic in flatpak_get_timezone 2024-06-21 11:12:57 -03:00
Sebastian Wick
da71c451fc common: Add flatpak_get_tzdir() helper 2024-06-21 11:12:57 -03:00
Chris Williams
cfb143bfc7 profile: Install flatpak.csh 2024-06-04 17:23:32 +01:00
Hubert Figuière
ef575a40da Fix a memory leak in flatpak-update
Close https://github.com/flatpak/flatpak/issues/5816

Signed-off-by: Hubert Figuière <hub@figuiere.net>
2024-05-23 22:47:04 -05:00
triallax
c9cdfb4265 tests: improve shell portability
I was trying to get the `flatpak` for Chimera Linux template to run
tests. However, due to Chimera Linux using core utilities based on
FreeBSD's, some stuff used in the test shell scripts didn't work there
and caused issues. While I eventually gave that endeavour up, I wanted
to upstream the upstreamable changes I had anyway.
2024-05-13 14:10:14 -05:00
Hubert Figuière
9d60df4d0c flatpak-dir: Fix a memory leak when installing a package
The path was clobbered make the g_autoptr no work

Signed-off-by: Hubert Figuière <hub@figuiere.net>
2024-05-13 13:44:26 +01:00
vgdaut
739065e432 dir: Uniformize two similar strings
Related to issue #4746. Unnecessary end whitespaces were removed. Write "remote %s" instead of "remote '%s'".
2024-05-05 13:03:11 -05:00
Simon McVittie
363fffcb08 xml-utils: Don't expose symbols that don't need to be visble
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-03 13:21:29 +01:00
Simon McVittie
6e81bc6f28 common: Move functions for dealing with AppStream XML to their own file
This seems like an obvious set of functionality to be grouped together
in service of the wider goal of making flatpak-utils smaller and more
manageable.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-03 13:21:29 +01:00
Simon McVittie
ad0aa467d0 common: Don't depend on generated D-Bus code in utils module
Each of these is only needed in one place, so move them there. This is
another step towards the utils module being the lowest-level.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-03 13:21:29 +01:00
Simon McVittie
a01371ce02 common: Move flatpak_context_get_allowed_exports to FlatpakContext
This allows us to break a circular dependency between utils and context.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-03 13:21:29 +01:00
Simon McVittie
74abbbebfd exports: Remove unused headers
The exports module doesn't actually need these, and this removes a
circular dependency: previously, exports both depended on and was
depended on by dir.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-03 13:21:29 +01:00
Eitan Isaacson
ffa0f14ae8 Add devcontainer file for GitHub Codespaces support.
This allows a developer to quickly open a remote container set up for
Flatpak development by using GitHub's Codespaces feature.
2024-04-30 20:10:55 -05:00
Simon McVittie
6e1a110037 NEWS: Fix a copy/paste error in 1.15.7 release notes
It's xdg-dbus-proxy, not bubblewrap, that was updated to 0.1.5 in that
release.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-30 15:23:15 +01:00
Georges Basile Stavracas Neto
dd9b85a976 ci: Run CodeQL job in Ubuntu 22.04
No meaningful difference, except it's newer.
2024-04-28 13:23:40 -05:00
Georges Basile Stavracas Neto
ff066e0439 ci: Update to codeql-action v3
Silences a harmless deprecation warning.
2024-04-28 13:23:40 -05:00
Simon McVittie
07522238d9 testlibrary: Make use of assert_cmpstr_free_lhs(), etc.
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-25 17:23:25 +01:00
Simon McVittie
ba367cb659 tests: Add macros to assert that a copied string has a desired value
Suggested by Patrick during review of #5691.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-25 17:23:25 +01:00
Simon McVittie
0de4f693d0 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-24 18:19:29 +01:00
Daniel Stone
18b85083b9 run: Unset more Vulkan layer/driver paths
Following on from b8d8d80c61, add more environment variables used by
the Vulkan loader which expect paths to be provided.

These paths are typically referencing the host filesystem; if the user
is referencing paths only available in the sandbox, they can use --env
or overrides for them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2024-04-24 18:13:17 +01:00
Daniel Stone
0f2661045d run: Unset EGL driver paths
Similar to how b8d8d80c61 inhibited passthrough of environment
variables pointing the Vulkan loader towards a specific ICD, do the same
for the EGL paths used by libglvnd to discover the GL driver to use, as
well as for NVIDIA's EGLStream shim.

These paths are typically referencing the host filesystem; if the user
is referencing paths only available in the sandbox, they can use --env
or overrides for them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2024-04-24 18:13:17 +01:00
Patrick Griffis
abcc001da8 run: Don't inherit LD_PRELOAD/LD_AUDIT from the host
I don't think this env var makes much sense to pass into the sandbox
for similar reasons to LD_LIBRARY_PATH. Libraries from the host
just aren't relevant.

Users can still pass `--env=LD_PRELOAD=/foo` to use this functionality.
2024-04-24 10:03:59 -05:00
Simon McVittie
d828116a12 workflows: Disable Microsoft-specific apt repository
We don't need anything from here, and its secure-apt signing is
currently broken.

Workaround-for: https://github.com/orgs/community/discussions/120966
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-24 13:03:05 +01:00
Simon McVittie
510da9e3b5 NEWS: Retroactively add 1.15.8 release date
The release was prepared under embargo and it wasn't immediately obvious
which day it was going to be released, so I left out the release date
at the time.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-19 11:05:35 +01:00
Simon McVittie
0982a4a93f tests: Fix a misleading comment
Arguably bwrap should exit with status 127 if it can't find the
executable, but right now it exits 1, so we accept any nonzero status.
The implementation was correct, but the comment was wrong.

Fixes: 84984e49 "test-run: Add a reproducer for CVE-2024-32462"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-18 20:06:35 -03:00
Simon McVittie
925c80f913 Update translation files for 1.15.8 release
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.15.8
2024-04-17 19:08:17 +01:00
Simon McVittie
6273c375d2 Prepare v1.15.8
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-17 18:25:38 +01:00
Simon McVittie
4e54394cd2 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-17 18:11:24 +01:00
Simon McVittie
84984e4948 test-run: Add a reproducer for CVE-2024-32462
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-17 18:11:22 +01:00
Simon McVittie
c777f818b9 validate-icon: For completeness, always add "--" to bwrap arguments
This particular bwrap invocation cannot cause a sandbox escape because
the command to run is hard-coded, but it's more clearly correct if we
pass "--" to every bwrap invocation.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-17 18:10:46 +01:00
Simon McVittie
c95214b62b flatpak-dir: For completeness, always add "--" to bwrap arguments
This particular bwrap invocation cannot cause a sandbox escape because
the command to run is hard-coded, but it's more clearly correct if we
pass "--" to every bwrap invocation.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-17 18:10:43 +01:00
Alexander Larsson
bbab7ed1e6 When starting non-static command using bwrap use "--"
This ensures that the command is not taken to be a bwrap option.

Resolves: CVE-2024-32462
Resolves: GHSA-phv6-cpc2-2fgj
Signed-off-by: Alexander Larsson <alexl@redhat.com>
[smcv: Fix DISABLE_SANDBOXED_TRIGGERS code path]
[smcv: Make flatpak_run_maybe_start_dbus_proxy() more obviously correct]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-17 18:10:31 +01:00
Simon McVittie
f16e064fd9 tests: Make sure FUSERMOUNT gets set for "as-installed" tests
Otherwise, tests for OCI and the update portal fail with:

    /usr/libexec/installed-tests/Flatpak/libtest.sh: line 611: FUSERMOUNT: unbound variable

Fixes: 2cb17b4e "Do not hard-code fusermount, add option or auto-detect instead"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-04-08 15:55:20 +01:00
Virtuti Militari
1f770f3d92 Fix export dynamic linker option
As of LLVM/Clang 18 and LLD18 linker with the -export-dynamic option compilation ends with an error:
cc: error: unknown argument: '-export-dynamic'

For GCC and the default compiler this is not a problem. The problem occurs in Clang/LLD 18.

Fix tested on Mandriva via 39f1c03e91
2024-04-08 14:44:08 +01:00
Sabri Ünal
9c059ebdd2 Update Turkish translation
Use Kapı translation for Portal strings.
2024-04-04 15:06:31 -03:00
Rafael Fontenelle
f94370e10c Update Brazilian Portuguese translation 2024-04-04 14:57:52 -03:00