Commit Graph
8760 Commits
Author SHA1 Message Date
Razze 1370d3d863 update: remove ineffective --force-remove option
The update command documented --force-remove, but it had no effect.
Remove the option and its documentation.
2026-10-19 11:11:39 +00:00
Razze 9f1aa883b8 search: Speed up searches with many matches
Look up duplicate matches in a hash table instead of scanning the result
list for every component. Key entries by kind, ID and branch, ignoring
architecture as before.

Collect matches before sorting them for output. Record discovery order
to keep newer matches first when scores are equal. Preserve first-match
data and the remote list.

In a warm-cache synthetic test with 8,000 matches, search took 184 ms
instead of 1.87 s.
2026-10-19 10:55:34 +00:00
Razze 7035099708 transaction: Clarify rebase previous IDs nullability 2026-10-19 10:13:40 +00:00
Razze bffe4ab048 installation: Document remote tie ordering 2026-10-19 10:11:06 +00:00
luming zh fa2fef48f4 po: Update Chinese (China) translation 2026-10-19 10:04:59 +00:00
liweinan 54548e7820 remote-ls: Load AppStream data for the requested architecture
AppStream data is stored per architecture, but `flatpak remote-ls`
always loaded it for the host architecture by passing NULL to
update_appstream() and flatpak_dir_load_appstream_data(). As a result,
columns sourced from AppStream (name, description, version) were empty
when listing a foreign architecture with --arch.

Pass the architecture provided with --arch through instead. "--arch=*"
still falls back to the host architecture, as before.

Closes: https://github.com/flatpak/flatpak/issues/3805
2026-10-19 10:02:06 +00:00
Franklin-Qi ed564f7cce cli: Do not ellipsize application IDs by default
Name and description can shrink in narrow terminals, but the
application ID is usually what users need to copy for install/run.
Prefer showing the full ID in list, search and remote-ls; other
columns still ellipsize when space is tight.

Closes: #4719
2026-10-16 14:00:49 +00:00
Franklin-Qi a4354fc0a6 docs: Document clearing a remote subset filter
Users who enabled a named subset (for example verified-only) had no
documented way to undo it. --subset= with an empty value clears the
filter; mention that in flatpak-remote-modify(1).

Closes: #5637
2026-10-16 13:58:34 +00:00
Franklin-Qi aa67702bfa search: Add --app and --runtime filters
flatpak list already supports filtering by application vs runtime,
but search always mixed both. Add matching flags so users can e.g.
search for games without runtime noise, or list GNOME runtimes.

Closes: #6718
2026-10-16 13:54:26 +00:00
Franklin-Qi 08b66f658c docs: Clarify flatpak override merge order and scope
The override man page mentioned global vs per-application files but did
not say how the system and user layers combine, whether system-wide
overrides affect apps from a per-user installation, or how conflicting
settings such as share/unshare resolve.

Describe the storage layout and the command-line selection of the
target file separately, document the merge order implemented by the
deployment code, and note that system-wide overrides only apply to
applications in a system-wide installation.

Closes: #6478
2026-10-16 13:39:21 +00:00
luming zh ddbee83f46 po: Update Chinese (China) translation 2026-10-15 00:28:00 +00:00
Sebastian Wick 1dedc7e763 doc: Port API reference from gtk-doc to gi-docgen
gtk-doc cross-references to GLib/GIO types have been broken since GLib
migrated to gi-docgen and stopped shipping devhelp index files.

Replace gtk-doc with gi-docgen, which generates docs from GIR data and
resolves cross-references via a URL map. Rename the build option from
'gtkdoc' to 'api_docs' and update CI workflows accordingly.
2026-10-14 16:35:29 +00:00
Sebastian Wick 06b4345bcc doc: Fix gtk-doc warnings and missing symbols
Fix XML parse error caused by unescaped <path> in
flatpak_transaction_add_sideload_image_collection doc comment.
Add missing public API symbols to flatpak-sections.txt and remove
private flatpak_related_ref_new. Add ignore lists for private headers
and source files to prevent gtkdoc-mkdb from scanning them.
2026-10-14 16:35:29 +00:00
liweinan 84f5777b74 search: Flatten line breaks in summaries
AppStream summaries are allowed to contain embedded newlines and tabs,
which break the fixed-width table layout used by `flatpak search`.

Replace embedded newlines and tabs with spaces before adding the summary
as a table column.

Fixes: https://github.com/flatpak/flatpak/issues/6132
2026-10-14 12:11:05 +00:00
Razze cbe1f2939b pin: Show matching runtime counts
Show how many installed runtimes match each pin when listing interactively.
2026-10-13 16:01:13 +00:00
Razze 347aecefdb pin: Complete patterns for removal
Offer configured pin patterns as completions after --remove.
2026-10-13 16:01:13 +00:00
liweinan 187a960170 dir: Don't read symlink-target from non-symlinks
GIO only sets standard::symlink-target on the GFileInfo when the queried
path actually is a symlink. Several helpers blindly queried "active" /
"current" with AT_SYMLINK_NOFOLLOW and then called
g_file_info_get_symlink_target(), which emits

  GLib-GIO-CRITICAL: GFileInfo created without standard::symlink-target

whenever the entry exists but is not a symlink. This is reproducible
with `flatpak --system remote-ls --updates`, which probes every
deployed ref.

Check g_file_info_get_is_symlink() before reading the target, keeping
the existing "not deployed" result while avoiding the spurious
criticals.

Fixes: https://github.com/flatpak/flatpak/issues/6766
Fixes: https://github.com/flatpak/flatpak/issues/6413
2026-10-13 15:58:37 +00:00
Shengjing Zhu 36f3ba1210 enter: pick smallest child pid when matching by app name
Electron apps often spawn two instances; pick the main one.

Updates: #5923
Assisted-by: Trae:DeepSeek-V4-Pro
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2026-10-12 12:03:47 +00:00
Razze 3a26b16761 http: Retry dropped and truncated responses
Curl's partial-file, empty-reply and send/receive errors were mapped to
G_IO_ERROR_FAILED, so the existing transient-error retry policy skipped
connection losses. Map them to partial-input and connection-closed errors
without changing the retry limit or retrying streams already written to.

Test recovery from empty and truncated replies, including compressed
cache output, and verify no partial contents survive the retry.
2026-10-12 10:52:23 +00:00
Franklin-Qi a3c67c8347 run: Mount both XDG and legacy ~/.fonts directories
When ~/.local/share/fonts existed, Flatpak only bind-mounted that
directory into the sandbox and ignored ~/.fonts. Users who still have
fonts under the legacy path (common after desktop environments changed
the default install location) therefore lost those fonts in Flatpak
apps.

Mount both directories when present: keep XDG fonts at
/run/host/user-fonts, and expose ~/.fonts at /run/host/user-fonts-legacy
with a matching fontconfig remap. If only ~/.fonts exists, keep the
historical /run/host/user-fonts destination.

Closes: #6869
2026-10-12 10:42:05 +00:00
re:fi.64 35b818b901 run: Write to --instance-id-fd after the pid is written
In commit 21f413f1, flatpak_instance_new was changed to require the pid
file to be written in order to succeed. This causes problems when
calling Spawn with NOTIFY_START, however, because portal expects to be
able to call flatpak_instance_new once the instance ID is retrieved. As
per the comments in the code that writes said instance ID, the idea was
that the instance would be *usable* at the point where the write takes
place (hence it being positioned *after* saving `bwrapinfo.json`), so it
makes sense to now move the write to *after* after the pid file is
written.

Since the pid file write and the instance ID write now go hand-in-hand,
both actions now take place in a separate function, so the logic can be
in one place. Additionally, the write itself is migrated to
`glnx_loop_write`, to shorten the code.

Assisted-by: DeepSeek-V4.1-Flash
2026-10-10 22:43:46 +00:00
re:fi.64 2c3f94f733 tests: Add a new test-spawn for testing spawning via the portal
The only tests for this before were the mocks, which are testing
slightly more specific things.

Assisted-by: DeepSeek-V4.1-Flash
2026-10-10 22:43:46 +00:00
re:fi.64 33ed7f21bb tests: Set FLATPAK to a wrapper script
Including CMD_PREFIX here causes problems for any subcommand that reads
`$FLATPAK` to find the binary path, since then it's no longer actually a
binary path. Instead, we can use a wrapper script, which will then run
flatpak w/ the prefix itself.
2026-10-10 22:43:46 +00:00
Kolja Lampe 9a032b2468 cli: Estimate install ETA from remaining bytes
Flatpak's progress percentage is a heuristic that includes metadata
discovery and write phases. Using it as a time base can produce
misleading remaining times or reach 00:00 while downloads are still
active.

Track the computed transfer total in FlatpakProgress. Use the remaining
bytes and measured transfer rate to calculate the CLI ETA.
2026-10-09 18:03:08 +00:00
Ashley Wulber b1e3083dc6 dir: Add COSMIC applet DE keys
COSMIC applets use these keys, and they are harmless.
X-CosmicApplet marks them as an applet for the settings app and the
panel.
X-CosmicHoverPopup marks an applet that it wants a popup on hover if a
popup is open already in another applet.
X-CosmicOverflowPriority marks the priority of an applet for overflow
behavior in the panel.
X-CosmicOverflowMinSize marks the min size of the shrinkable applet in
applet size units.
X-CosmicShrinkable marks a window as having padding that can be
shrinkable in the panel so that it takes up less space.
2026-10-09 14:48:57 +00:00
Joao Kouznetz Bresser a819741d13 remote-ls: Check deployed alternative IDs when listing updates
OCI remote checksums identify images rather than imported OSTree commits.
Compare against the deployed alternative ID as well, matching the update
transaction's identity check and avoiding false pending updates.

Test OCI update listings after install, after publishing a real update,
and after applying it, using the existing user/system HTTP/HTTPS tests.
2026-10-09 13:14:20 +00:00
Razze f2df7b090b uncrustify: Update renamed options
Uncrustify renamed align_number_left to align_number_right in
https://github.com/uncrustify/uncrustify/pull/1393.

Remove sp_balance_nested_parens, which Uncrustify reports as replaced by
sp_paren_paren.
2026-10-06 16:01:20 +00:00
liweinan acb9dc7959 oci-signatures: Fix GPGME context leak in signature verification
gpgme_ctx_t was not wrapped with g_auto(), so gpgme_new() allocated
contexts were never released by gpgme_release() on any return path.
All other GPGME types in the same function already use g_auto().
2026-09-29 14:22:02 +00:00
Rafael Fontenelle 9bd406f25b po: Update Brazilian Portuguese translation 2026-09-29 11:47:03 +00:00
luming zh f4d2ba1658 po: Update Chinese (China) translation 2026-09-29 11:46:58 +00:00
Martin 31c60beba9 po: Update Slovenian translation 2026-09-29 11:46:54 +00:00
Simon McVittie 10b5972dfe Prepare v1.19.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.19.2
2026-09-28 14:18:41 +01:00
Simon McVittie e8b4f1ed71 workflows: Use the bubblewrap from our PPA when building the release
Github's ubuntu-latest is currently 24.04, and the bubblewrap in
Ubuntu 24.04 doesn't have everything that we need.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 14:16:04 +01:00
Simon McVittie 75bdf1449b Prepare v1.19.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.19.1
2026-09-28 12:49:40 +01:00
Simon McVittie 9b54043a00 Update translation files for 1.19.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 12:48:02 +01:00
Simon McVittie 04b18e1048 NEWS: Mention improved hardening as a separate change
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 12:44:13 +01:00
Simon McVittie 486e6298af NEWS: Also mention internal changes to older NEWS entries
This is a security release, we don't want anyone getting excited about
undocumented changes.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:15:36 +01:00
Simon McVittie a9aabe6c75 NEWS: Add details of security fixes in 1.19.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:08:54 +01:00
Simon McVittie 415a3fc858 NEWS: Make more consistent with previous items
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:08:40 +01:00
Simon McVittie a7f457b0a0 NEWS: Remove some unnecessary U+200E LEFT-TO-RIGHT MARK
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:05:44 +01:00
Simon McVittie 5e5d0de632 NEWS: Add CVE IDs and reporter credits for the security fixes in 1.19.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:05:20 +01:00
Sebastian Wick ab6b2e9fb4 common: Restrict tmpdir permissions from 0777 to 0755
flatpak_allocate_tmpdir created child repo directories (repo- and
child-oci-) with mode 0777, allowing any local user to modify their
contents between the client pull and the system helper deploy.

Use 0755 instead, which prevents other users from writing while
still allowing the revokefs-fuse frontend to read the backing store
directly. The frontend runs as the calling user while the writer
backend runs as the flatpak system user, so the frontend needs
read access to directories created by the backend. Mode 0700 would
break this.

Resolves: CVE-2026-97026
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-r9w3-qx54-qvc8
2026-09-28 09:44:36 +01:00
Sebastian Wick 30faeb539b oci: Stop persisting bearer token to child repo on disk
The .token file was written into the child-oci directory so the
system helper could read it back for remote registry verification.
However, the system helper only ever opens the child-oci registry
as a local source (dfd != -1), and every code path that uses
self->token for HTTP requests is gated behind dfd == -1. The token
was never reachable since it was introduced in commit 5d8fd2d1b.

Persisting credentials to a world-traversable directory in /var/tmp
is a security risk on multi-user systems. Remove the file write
from set_token and the file read from ensure_local. The token
remains available in memory for the client process that actually
needs it for remote access.

Resolves: CVE-2026-97025
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-7rvf-rqr3-43j4
2026-09-28 09:44:36 +01:00
Sebastian Wick c5e82197fc dir: Use deploy helpers in apply_extra_data and flatpak_dir_deploy
Convert remaining call sites to use flatpak_deploy_get_files_fd and
flatpak_deploy_get_metadata_fd.

In flatpak_dir_deploy, metadata was read via GFile with no symlink
protection and all errors silently ignored. Use the metadata helper
which rejects symlinks and only tolerates ENOENT.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick 9f2f3fd5d5 dir: Reuse app_files_dfd for .ref write during deploy
The previous code built a path from checkoutdir_basename + "files" and
opened it via glnx_opendirat(deploy_base_dfd, ...). Since O_NOFOLLOW
only applies to the last path component, a symlink at the intermediate
checkoutdir_basename component would be followed. Reuse the
already-open app_files_dfd instead.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick b24b3b2485 run: Use deploy helper to open runtime files directory
The runtime files directory was opened with open() using O_PATH but
without symlink protection, unlike the app files path which used
O_NOFOLLOW. Since "files" is validated as a non-symlink during deploy,
this is not exploitable through normal install flow. However, the open
should still use safe fd-relative operations as defense-in-depth.

Use flatpak_deploy_get_files_fd which validates the path with
glnx_chaseat(GLNX_CHASE_RESOLVE_NO_SYMLINKS), rejecting any symlink
at the directory boundary.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick 66b8c2c5eb dir: Use fd-relative operations in deploy_dir_is_locked
dir_is_locked() used g_file_resolve_relative_path to construct the
path to files/.ref, then open() without O_NOFOLLOW. Since "files" is
validated as a non-symlink during deploy and ".ref" is atomically
created as a regular file, this is not exploitable through normal
install flow. However, the function should still use safe fd-relative
operations as defense-in-depth.

Rename dir_is_locked to deploy_dir_is_locked to reflect that it
operates specifically on deploy directories, not arbitrary ones.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick 1000c71d40 dir: Use fd-relative operations for files/etc during runtime deploy
The runtime deploy path used GFile operations to manipulate files
inside files/etc (passwd, group, machine-id, resolv.conf). While
the "files" directory is validated with glnx_chaseat using
GLNX_CHASE_RESOLVE_NO_SYMLINKS, "etc" inside it is not checked.
A malicious runtime with files/etc as a symlink causes the GFile
operations (g_file_delete, g_file_replace_contents,
g_file_make_symbolic_link) to follow it and modify files at the
symlink target. On system installs (running as root), this modifies
arbitrary files — e.g. replacing /etc/resolv.conf.

This commit uses fd-based operations to prevent to prevent the symlink
attack.

Resolves: CVE-2026-97024
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick 273ff1728e dir: Use fd-relative operations for app export during deploy
The app branch in flatpak_dir_deploy() used GFile operations to
create directories and write wrapper scripts under the export
directory. While the export symlink is already rejected by the
common-path bin removal, convert the app branch to fd-relative
operations as defense-in-depth.

Use fd-relative operations in export_dir and flatpak_rewrite_export_dir
to reject symlinks.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick f9f16a3e53 dir: Use fd-relative operations for export/bin removal during deploy
The export directory cleanup during deploy used flatpak_rm_rf which
wraps glnx_shutil_rm_rf_at(AT_FDCWD, path). The kernel resolves
intermediate symlinks in the path, so a malicious ostree commit with
"export" as a symlink causes flatpak_rm_rf(export/bin) to delete files
at the symlink target. On system installs (running as root), this is
arbitrary file deletion.

This commit uses fd-based operations to prevent to prevent the symlink
attack.

Resolves: CVE-2026-97023
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
2026-09-28 09:44:36 +01:00