8263 Commits

Author SHA1 Message Date
Sebastian Wick
40640819d4 tests/asan: Update the asan suppression file
If gdk-pixbuf uses glycin, there might be a leak.
2025-11-21 14:21:13 +00:00
Sebastian Wick
76cb5c793e validate-icon: Do not leak a GError instance 2025-11-21 14:21:13 +00:00
Sebastian Wick
f9d5c5cba9 dir: Free result of polkit_subject_to_string
Fixes: 1372e16d ("dir: Check parental control authorization via system bus name")
2025-11-21 14:21:13 +00:00
Sebastian Wick
e9e713fa0d tests: Add test-extra-data.sh to test extra-data installation
There are two sub-tests, one testing it with a ostree remote and one
with a OCI remote.
2025-11-20 23:14:18 +00:00
Sebastian Wick
d4751443f5 dir, system-helper: Add support for installing extra-data from OCI
Extra-data usually is downloaded on the user side into an ostree repo.
For system installs, a temporary ostree repo is used on the user side
and then imported on the system side. This doesn't work for OCI images
because importing the image into an ostree repo makes it impossible for
the system side to verify the data.

So instead, the OCI image is first mirrored into a local OCI repo and
then gets imported on the system side, which can verify the image from
the index by the digest.

Closes: https://github.com/flatpak/flatpak/issues/3790
2025-11-20 23:14:18 +00:00
Sebastian Wick
ac0b61a0f1 dir: Refactor compute_extra_data_download_size to not depend on ostree
It took in a ostree commit before, but it really only needs the detached
metadata. The single caller now converts it correctly.

This will become useful when we want to know the size of the extra data
when the metadata is coming from an OCI image.
2025-11-20 23:14:18 +00:00
Sebastian Wick
5640e5bf59 dir: Refactor flatpak_dir_pull_extra_data to make it useful for OCI
This cleans up flatpak_dir_pull_extra_data in a way that it is only
responsible for downloading the extra-data. In has no dependencies on
ostree concepts any more.

The new flatpak_dir_pull_ostree_extra_data now takes care of extracing
the extra data sources and saving it in the detached metadata.
2025-11-20 23:14:18 +00:00
Sebastian Wick
d0fdac8854 dir: Pull out the downloading of extra-data into its own function 2025-11-20 23:14:18 +00:00
Sebastian Wick
f28d92da06 oci-registry: Return NULL instead of FALSE in function returning char* 2025-11-20 23:14:18 +00:00
Chris Williams
8bcba92042 dir: Remove unused parameter from flatpak_dir_setup_extra_data() 2025-11-20 23:14:18 +00:00
Kolja Lampe
4dca9efea0 utils-http: Replace g_assert_cmpint with g_assert for CURL error checks 2025-11-20 18:11:15 +00:00
Kolja Lampe
1434448f2d utils-http: Fix incorrect CURLM_OK comparison in curl_easy_setopt checks
CURLcode return values from curl_easy_setopt() were being compared
with CURLM_OK (a CURLMcode constant) instead of CURLE_OK. This is
incorrect as CURLM_OK is for multi interface functions, not easy
interface functions.
2025-11-20 18:11:15 +00:00
Sebastian Wick
e4edecdef5 utils-http: Drop libsoup2 support in favor of libcurl
A few years ago there was a very painful attempt at porting from
libsoup2 to libsoup3. Flatpak libsoup3 support never landed and it seems
like a large amount of distros have switched over to libcurl instead.

This commit removes libsoup2 support completely instead of growing
libsoup3 support.

Closes #5915
Closes #4582
2025-11-20 17:40:57 +00:00
Sebastian Wick
1c2c80b8c9 zstd-decompressor: Replace boilerplate with G_DECLARE_FINAL_TYPE macro 2025-11-20 17:30:07 +00:00
Owen W. Taylor
c8e73a0993 test-oci-registry.sh: add a test for zstd layers 2025-11-20 17:30:07 +00:00
Owen W. Taylor
e6b584f85c flatpak-build-bundle: Add --oci-layer-compress=zstd
Add an option to build OCI bundles with zstd compressed layers.

gzip is kept as the default for maximum compatibility:

Ecosystem support:

 distribution/distribution: no explicit support, but works
 quay.io: sinc 2021
 Amazon ECR: supported
 pulp_container: since 2022
 flatpak: since first-OCI supporting version
 tardiff: since first version
2025-11-20 17:30:07 +00:00
JakobDev
9b51edf31a portal: Allow passing device permissions to subsandbox 2025-11-20 17:19:42 +00:00
Sebastian Wick
f279929559 portal: Fix generating docs for the Spawn method by indenting correctly 2025-11-20 17:19:42 +00:00
Emir SARI
944c0908e1 cli-transaction: improve i18n
- Make percent values translatable

  Various languages use different ways to format the percentage
  values[1], making it translatable will allow a more coherent way to
  display the information.

- Make remaining time abbreviation translatable

  Making this value translatable will allow languages to display the
  seconds abbreviation in their language. This is particulary an issue
  for Turkish, in which hours and seconds start with the same letter, so
  it's not possible to distinguish which is which. We use a second
  letter (sa, sn) to figure it out.

[1] https://en.wikipedia.org/wiki/Percent_sign#Form_and_spacing

Signed-off-by: Emir SARI <emir_sari@icloud.com>
2025-11-20 15:20:59 +00:00
Chris Williams
b343107c55 portal: Fix potential leak of data buffer in error cases
Closes #4233
2025-11-20 13:39:48 +00:00
Sebastian Wick
947d4a6ce4 flatpak: Enable progress escape sequence by default
In 4febfb59 ("flatpak: Disable progress escape sequence by default") the
escape sequence has been disabled by default, but we want to enable it
again for 1.18.
2025-11-18 01:19:36 +00:00
Milo Ivir
ff80ba5b6c Update Croatian translation
The translation is 95% stranslated.
2025-11-13 03:20:56 +00:00
Sabri Ünal
400232342c Update Turkish translation 2025-11-13 03:20:53 +00:00
Michael Catanzaro
8e038375ba run: Update note on seccomp filter code sharing
This comment needs to be modernized for 2025. It notably fails to
mention the two projects that are actually still using code that looks
like Flatpak's.
2025-11-10 14:01:09 +00:00
Sebastian Wick
7fc47ab0a0 Post-branching version bump 2025-11-03 17:27:07 +01:00
Sebastian Wick
0835c0272f Update translation files for 1.17.0 1.17.0 2025-11-03 16:33:21 +01:00
Sebastian Wick
0085420a90 Update NEWS for 1.17.0 release 2025-11-03 16:33:21 +01:00
Sebastian Wick
4b2e21e0b6 ci: Get rid of paths-ignore to ensure all PRs can be merged
We require jobs to succeed before a PR can be merged. If a PR only
touches files which match `paths-ignore`, the jobs won't run and the PR
can't be merged.

The number of PRs which only touch those files is small, and the extra
CI runs resulting from that can be ignored.
2025-11-03 16:33:21 +01:00
filmsi
2c354352bf Update sl.po (Slovenian)
Due to new/updated English strings here is the update.
2025-10-31 23:58:53 +05:30
Sebastian Wick
c4af112df4 transaction: Handle --include-sdk if SDK is installed in other dir
If an SDK is already installed in a dir that is not targeted with a
flatpak transaction, and the transaction has auto_install_sdk set,
add_new_dep_op returns NULL in dep_op which is not correctly handled in
add_deps.

Fixes #5894
2025-10-31 12:58:39 +00:00
Sebastian Wick
8354ee56cf kill: Do not kill pid 0 and embrace races
There are a number of races, and failure conditions which can lead to a
pid of 0 being returned from flatpak_instance_get_child_pid. This would
lead to a whole bunch of things getting killed.

We will skip the instance in those cases now, and retry a few times. We
also notice when the instance just goes away by itself now.

This should make killing more robust, and especially not SIGKILL pid 0.
2025-10-31 12:04:55 +00:00
Sebastian Wick
0fc61c1aff doc: Document the new Conditional Permissions system
The system was introduced in b93b58a4 ("context: Add new
FlatpakPermission(s) type") but we forgot to add documentation.
2025-10-30 11:29:16 +00:00
Sebastian Wick
842472d234 transaction: Preinstall from first remote with ref
We could previously just assume that the first enabled remote
(potentially matching the collection ID) contains the ref, but that
obviously is not always the case.

The change here looks up the remote state of the remotes to figure out
if they actually contain the ref, and adds the first matching remote to
the transaction.
2025-10-30 11:21:35 +00:00
Georgia Garcia
f61d931da8 common: Fix running_under_sudo check by checking euid
Sudo can be used in several ways other than calling a command with the
root user. For example, one can use -u to run the command as the
specified user, or -g to specify a primary group to run the command
as.

Flatpak adds a check when --user is used to prevent an installation in
the root's directory, for example, but it does it by only checking if
sudo was used. As stated previously, it does not necessarily imply
root, so this patch explicitly checks if the command is being run with
the root user.

Fixes: https://github.com/flatpak/flatpak/issues/5979
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-10-28 13:17:13 +00:00
Sebastian Wick
edac357aad builtins/install: Allow flatpak+https URIs in flatpak install --from
Those schemes are in use by flathub, usually to be handled by an app
store, but we can also handle it directly with `flatpak install`.

Base on an idea from user bbb651 in
https://github.com/flatpak/flatpak/pull/6259.
2025-10-28 12:55:59 +00:00
JakobDev
3544de6251 build-finish: Export AppStream external release metainfo
The appstream docs say:

  Release data may be present directly in a component metainfo file, but
  also optionally be split out into an external metadata file.

  The file must be installed as
  /usr/share/metainfo/releases/%{cid}.releases.xml, where cid is the
  component ID of the component the release information belongs to.

This change allows flatpak build-finish to export those external release
files.

Closes #6057
2025-10-28 10:22:45 +00:00
lumingzh
32347168e3 update Chinese translation 2025-10-28 00:53:43 +00:00
Kolja Lampe
b6775dc221 http: Add cancellation support for curl downloads and error handling 2025-10-28 00:21:01 +00:00
Sebastian Wick
1372e16d05 dir: Check parental control authorization via system bus name
PIDs are pretty much always a bad idea because they can be racy. The
authorization did use the PID though. We can replace it by a check via
the system bus name.

Closes: https://github.com/flatpak/flatpak/issues/6212
2025-10-27 13:37:26 +00:00
Sebastian Wick
6fd0930858 system-helper: Take a dbus invocation for dir_get_system
We can internally use it to get the PID instead.
2025-10-27 13:37:26 +00:00
Sebastian Wick
3e9e68cc5d Support sideload repositories for OCI remotes
For OCI remotes, the existing sideload repository system doesn't
work: identity for OCI remotes is done by manifest digest (disguised
as a fake commit ID internally), instead of by ostree commit, so
we have no way of knowing whether a sideloaded image matches the
summary.

Allow specifying a new form of sideload repository with:

  --sideload-repo=oci:<path>

The desired use case for this is preinstalling Flatpaks during OS
install, and for this, binding the entire repository to a single
collection ID is both inconvenient and not useful, so OCI sideload
repostories don't have a defined collection ID - they just apply to
all OCI remotes. (And, because of this, they are restricted to
the command line.)
2025-10-24 16:27:33 +00:00
Sebastian Wick
621790e797 transaction: Support sideloading from OCI repos/archives
This allows adding FlatpakImageCollection sideload repositories to a
transaction.
2025-10-24 16:27:33 +00:00
Sebastian Wick
f7671ebbc9 dir: Support sideloading from OCI repos/archives
This is implemented in a straightforward way by adding GFile
*sideload_path, FlatpakImageSource *image_source.
2025-10-24 16:27:33 +00:00
Sebastian Wick
51bf27c0d9 dir: Add sideload image collections and is_oci helper
They will be used in the next commit to better deal with sideloading OCI
images.
2025-10-24 16:27:33 +00:00
Sebastian Wick
b486437c8e image-source: Add a method to get the summary metadata 2025-10-24 16:27:33 +00:00
Sebastian Wick
feb2220a46 image-collection: Add the new FlatpakImageCollection class
The new FlatpakImageCollection class represents a set of
FlatpakImageSource loaded from the image sideload repository.
2025-10-24 16:27:33 +00:00
Sebastian Wick
9551f7d402 image-source: Make flatpak_image_source_new public
And check that the digest is a sha256 hash.

Will be used in the next commits.
2025-10-24 16:27:33 +00:00
Owen W. Taylor
86b000c34b dir: Don't return a VarRefInfoRef from flatpak_remote_state_lookup_ref()
The memory management of returning a VarRefInfoRef is tricky - it
points to data owned by the summary or the sideload repo. External
consumers were always retrieving a copy of the summary metadata,
so make the public function do that.
2025-10-24 16:27:33 +00:00
Sebastian Wick
bc5c8e65be dir: Handle NULL sideload state in flatpak_remote_state_lookup_ref
Even on success, flatpak_remote_state_resolve_sideloaded_ref might
return a NULL FlatpakSideloadState. Handle it properly.
2025-10-24 16:27:33 +00:00
Kolja Lampe
e069452d7c utils-http: remove duplicate pointer clearing for hdr_last_modified 2025-10-22 00:29:54 +00:00