Commit Graph
8705 Commits
Author SHA1 Message Date
Razze dcfc1368fe tests: Cover document export reply formats
Exercise existing files, directories and nonexistent files against a real
document portal on the private test bus. Verify that --noexist returns a
usable export after the origin is created and preserves its read grant.

The regression fails on the AddNamed reply type mismatch without the fix.
All four checks pass with it.
2026-09-25 11:56:15 +00:00
Razze 09d787cf0d document-export: Parse the AddNamed reply for --noexist
With --noexist, the opened file descriptor refers to the parent directory.
The request correctly uses AddNamed, but is_directory makes the reply
parser expect AddFull's array reply instead of AddNamed's single string.
This produces a GVariant type mismatch and crashes the command.

Only select the AddFull reply parser for directory exports without
--noexist, matching the method used for the request.
2026-09-25 11:56:15 +00:00
Roy-Magne Mo 491294f041 po: Add Norwegian Nynorsk translation 2026-09-24 12:04:55 +00:00
Kolja Lampe 5f19424bd6 run: Forward documents using the sandbox mount path
The document portal is mounted at /run/flatpak/doc inside the sandbox,
but forwarded arguments used its host mount path. With a nonstandard
host runtime directory, that path is inaccessible to the application.

Keep the host path local to mount setup and return the sandbox destination
to argument forwarding. Preserve NULL when the portal is unavailable.

Add real-portal regression tests for user and isolated system installs.
Check file read/write, escaped URIs, directories and passthrough controls.
Skip the directory subtest on portal interfaces older than version 4.
2026-09-24 12:04:14 +00:00
Simon McVittie e38a25dbc0 subprojects: Update xdg-dbus-proxy to 0.1.9
This version addresses CVE-2026-94422, which is a sandbox escape for
Flatpak apps.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-23 14:52:31 +00:00
Razze dec343a0ea user-data: Expose app data deletion in libflatpak
Applications using libflatpak currently have to duplicate the CLI's
private cleanup logic to offer the equivalent of uninstall --delete-data.

Add a standalone API that removes ~/.var/app data and resets permission
store entries without requiring the app to be installed. Keep it separate
from transactions so callers can retry partial failures or reset data for
an installed app.

Validate app IDs before constructing paths, propagate cancellation and
permission table errors, and document partial failure behavior.
2026-09-23 09:28:18 +00:00
Kolja Lampe d7fc1e352e permission: Remove unused permission store argument
Permission table discovery reads the on-disk database directory and does
not use the D-Bus permission store proxy. Remove the unused argument and
update callers.
2026-09-23 09:28:18 +00:00
Kolja Lampe 1b4a7a0750 permission: Automatically free permission table lists
Use GLib's automatic string-vector cleanup for permission table lists.
This makes ownership explicit and ensures early returns release the list.
2026-09-23 09:28:18 +00:00
Razze c4d953f088 user-data: Simplify delete result handling
Return the permission reset result directly after app data removal. This
keeps the success and error paths equivalent while removing an unnecessary
conditional.
2026-09-23 09:28:18 +00:00
Razze baf3d2f61c user-data: Move cleanup helpers into common
Libflatpak needs to reuse user-data deletion and permission reset logic
that was previously private to the command-line builtins. This will let
software stores offer the equivalent of uninstall --delete-data.

Move each concern into a separate common module without changing behavior
so a public API can be added in a later commit. Name the user-data module
and its helper consistently here, and keep them distinct from the
existing appdata metadata code.
2026-09-23 09:28:18 +00:00
liweinan da78476438 transaction, remote-info: Include extra-data in download size estimate
flatpak update --commit and flatpak remote-info read the download size
from xa.download-size in the commit metadata, which only covers the
ostree file objects and not extra-data. The summary cache path used by
a regular flatpak update does add extra-data sizes, so the two differed:
extra-data apps like com.jetbrains.Rider showed 1.3 MB instead of 1.6 GB.

Add flatpak_commit_add_extra_data_sizes() to sum the extra-data sizes
from a commit variant, and use it in resolve_op_from_commit() and
remote-info so they match the summary path. The existing
flatpak_repo_collect_extra_data_sizes() is changed to reuse it.

Fixes: https://github.com/flatpak/flatpak/issues/5947
2026-09-22 10:23:32 +00:00
liweinan 9c9c9d302c table-printer: Fix left boundary check in comma-unique cell dedup
In flatpak_table_printer_append_cell_with_comma_unique, the duplicate
check only verified the right boundary (match[len] == 0 or comma).
This caused false positives: searching for "all" in "superall" matched
because the character after "all" happened to be a comma, even though
"all" was a substring of "superall", not a separate comma-delimited
entry.

Calculate the position of each match via pointer arithmetic
(match - cell->text) and use cell->text[pos - 1] to check the left
boundary, so that a match is only treated as duplicate when it is at
the start of the cell or preceded by a comma.
2026-09-22 10:21:47 +00:00
liweinan 1088efa00b appdata: Fix sscanf format mismatch for date parsing
The variables d, m, y are declared as 'int', but the format string
used '%u' which expects 'unsigned int *'. Change to '%d' to match
the actual argument type.

Detected by GCC -Wformat when building with warning_level=3.
2026-09-22 10:21:15 +00:00
liweinan ca63290fea remote-info, remote-ls: Refresh AppStream cache before showing data
flatpak remote-info and remote-ls --updates load version information
from a locally cached AppStream XML file that only gets refreshed during
'flatpak update'. This causes remote-info to show stale version numbers
when a new version has been published.

Fix this by calling update_appstream() before loading cached AppStream
data, unless --cached is specified. Use FLATPAK_APPSTREAM_TTL (1 day)
to avoid re-downloading on every invocation.

Closes: #5974
Signed-off-by: liweinan <liweinan@kylinos.cn>
2026-09-22 10:20:25 +00:00
Martin ed2641b9b5 po: Update Slovenian translation 2026-09-21 20:36:28 +00:00
Razze 5a37cab4b5 remote: Fix redirect option spelling and boolean flags
remote-add registers --no-follow_redirect instead of the documented
--no-follow-redirect. Its reversed flag and both remote-modify redirect
flags set initially false booleans to false, so the policy is not applied.

Correct the option spelling and remove G_OPTION_FLAG_REVERSE so these
switches enable the corresponding configuration updates.
2026-09-21 17:56:08 +00:00
liweinan 1191ac03a0 doc: Fix broken arg choice attribute in install manpage
The LOCATION arg's choice attribute value was "plan>" instead of
"plain" — a stray ">" was glued onto the value, breaking the DocBook
XML element. The same arg on the line above already used "plain"
correctly; this makes the two occurrences consistent.
2026-09-21 17:56:03 +00:00
Simon McVittie 0142e9fedb Update NEWS with 1.19.1 changes so far
I intentionally didn't mention #6818 here, because that regressed
after 1.19.0 and then was fixed before 1.19.1, so there was no release
from this branch that had the bug.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-21 17:00:06 +00:00
Razze 95b70b71e3 transaction: Release bundle GPG data as GBytes
BundleData retains explicit GPG key data with g_bytes_ref(), but its
cleanup treats the data as a GObject. This crashes transaction cleanup
when a bundle is installed with explicit key bytes.

Use g_clear_pointer() with g_bytes_unref() to release the retained data.
2026-09-21 15:53:57 +00:00
Kolja Lampe db7830e049 completion: Validate cursor position
Parse the cursor as a long before narrowing it to the completion
structure's integer field. This lets malformed, negative, and overflowing
positions fail before they can index outside the command-line buffer, while
preserving the existing behavior of clamping positive positions beyond the
line length.
2026-09-21 15:18:35 +00:00
Ekaterine Papava def3e60498 po: Update Georgian translation 2026-09-21 15:13:52 +00:00
luming zh 95c1b1374d po: Update Chinese (China) translation 2026-09-21 11:20:03 +00:00
Simon McVittie a1bcecfc6c Update libglnx subproject to 2026-09-18
libglnx v2017.2-255-g2ed30d8

* chase: Pass NO_AUTOMOUNT to chase_open_tree in shortcut path
* chase: Fix incorrect comment
* build: Suppress `-Wmissing-field-initializers`
* fdio: Don't change ownership of symlinks if not requested
  (Resolves: https://github.com/flatpak/flatpak-builder/issues/770)
* fdio: Don't try to use fd-relative operations to set symlink xattrs
  (Resolves: https://github.com/flatpak/flatpak/issues/6818)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-18 16:55:49 +00:00
Bruno b4d57ffdce list: Add --bytes for sizes in bytes
g_format_size() output is unit-suffixed and locale-dependent, which
makes it awkward to sort or parse in scripts.

-b/--bytes prints a plain byte count; human-readable remains the
default. Also update the man page, the completion test and the tests.
2026-09-18 15:48:49 +00:00
Ekaterine Papava 01909035ce po: Update Georgian translation 2026-09-18 15:41:55 +00:00
abhinavmir 7c764d2984 context: Emit valid option names for D-Bus name policies
flatpak_context_to_args() built the D-Bus name options from
flatpak_policy_to_string(). That function gives the values used in the
[Session Bus Policy] and [System Bus Policy] metadata groups. Two of
them, "none" and "see", are not command-line options. A context that
contained such a policy gave --none-name= and --system-none-name=.

flatpak-run(1) writes these arguments to the [Instance] extra-args of
/.flatpak-info. flatpak-portal gives them back to flatpak(1) when a
sandboxed app calls flatpak-spawn(1). flatpak(1) then rejected the whole
command line with "Unknown option --none-name=...", so --no-talk-name
and --system-no-talk-name broke flatpak-spawn(1).

Map each policy to the option that sets it: --no-talk-name for
FLATPAK_POLICY_NONE, --talk-name for FLATPAK_POLICY_TALK, and --own-name
for FLATPAK_POLICY_OWN. FLATPAK_POLICY_SEE has no command-line option,
so emit nothing for it. It cannot occur here: the only caller serializes
a context that comes from the command line.
2026-09-18 14:47:43 +00:00
abhinavmir 915c5917c5 table-printer: Fix alignment of columns next to a decimal column
A decimal-aligned cell padded itself to widths[j], the natural column
width, while the title row and left-aligned cells padded themselves to
len, the width after expansion and ellipsization. In a table with an
expanding decimal column the title row and the cells therefore ended at
different offsets, and every column after the decimal one lost its
alignment. A cell with no decimal point in it used the left-aligned path,
so it stayed with the title row while its neighbours in the same column
moved.

The natural width of a decimal column is also not the width of its widest
cell: the cells split at the decimal point, so the column needs
lwidths[i] characters before the point and rwidths[i] after it. Take that
into account, so the trailing padding can no longer go negative and push
the rest of the row to the right.
2026-09-18 13:30:55 +00:00
Rafael Coelho Costa a48881c01f po: Update Brazilian Portuguese translation
Co-authored-by: Rafael Coelho Costa <coelho38r@proton.me>
Reviewed-by: Juliano de Souza Camargo <julianosc@protonmail.com>
2026-09-18 13:14:46 +00:00
razzeee e382cbeb80 docs: Add contributing hints about commit message expectations 2026-09-02 11:01:03 +00:00
Sebastian Wick 1a6ec6a1f7 Revert "run: Fix seccomp socket family filtering on i386"
It turns out that at least Steam currently crashes because the
socketcall syscall is not available to it anymore.

This reverts commit 04d0046e14.
2026-08-27 19:12:39 +00:00
Sebastian Wick 540a487ed1 subprojects: Update bubblewrap to v0.12.0
It contains a crucial security fix for mount destination path
resolution.
2026-08-26 14:29:17 +00:00
Bart Piotrowski 70011ab5d4 Switch CoC to Contributor Covenant, update contact info 2026-08-25 09:35:50 +02:00
luming zh e182111ad0 po: Update Chinese (China) translation 2026-08-24 10:37:34 +00:00
Simon McVittie 55ec5bd592 libtest: Fix undefined variable reference if all test-cases are skipped
Fixes: f0ce1311 "tests: Drop plan_tests function, no longer used"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 16:08:07 +00:00
Simon McVittie 86d10f5f7a Revert "tests: Avoid Meson's strict TAP parsing for now"
Now that our error messages are valid UTF-8, we should no longer need to
do this.

This reverts commit 242e9893e7.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 16:07:48 +00:00
Simon McVittie 5f3f7a8b98 ref-utils: Always produce valid UTF-8 in validation error messages
While I'm changing the translatable string anyway, this also
incorporates a suggestion from #6753 to quote the invalid character, so
that output is clearer in the case where the invalid character is
whitespace.

Thanks: Christian Stadelmann
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 16:07:48 +00:00
Simon McVittie 00457f29f3 po: Update translations for "Invalid glob character" where obvious
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 16:07:48 +00:00
Simon McVittie 9cd0ef4b0b utils: Avoid corrupting our output if an invalid glob is not UTF-8
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 16:07:48 +00:00
Simon McVittie ffcb20f781 utils: Add a function to describe invalid characters in strings
Until now we have been using `%c` to show invalid characters, but in
general that will corrupt our output if the input is non-ASCII,
because the individual bytes of a UTF-8 string are not valid UTF-8 alone.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 16:07:48 +00:00
Simon McVittie f0ce1311af tests: Drop plan_tests function, no longer used
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 15:34:20 +00:00
Simon McVittie eb240aa067 tests: Consistently Use the "no plan" style for TAP tests
Instead of announcing ahead of time how many tests will be run, just
log 1..32 or similar at the end, from the done_testing function.

This should go some way towards preventing unnecessary cherry-pick
conflicts when tests added to this script get backported.

Resolves: https://github.com/flatpak/flatpak/issues/6793
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 15:34:20 +00:00
Simon McVittie f7a88aca00 tests: At the end of each test, explicitly log that we have finished
This is the equivalent of the function of the same name in Perl's
Test::More. If we already emitted a test plan, it asserts that the
number of tests we planned to do equals the number we actually did.

If not, it assumes that however many tests we have done, that's all of
the tests that we intend to do - this can be useful in test scripts
that routinely increase in length, like test-run.sh which is becoming
rather long (and has frequent conflicts for the "plan" line when we
cherry-pick new test coverage to older branches).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 15:34:20 +00:00
Simon McVittie 724ac88751 tests: Add a function to declare the "plan", instead of direct echo
This is approximately the equivalent of 'plan' in Perl Test::More:
it announces how many tests we plan to run.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 15:34:20 +00:00
Simon McVittie ea4321912b tests: Track and emit TAP test numbers in shell script tests
This will help us to emit correct TAP syntax, without having to always
declare up-front how many tests we are going to run.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-21 15:34:20 +00:00
Sebastian Wick 3a5b50e93a README: Point translation contributions to GNOME's l10n platform
We just made it possible to create PRs through damned-lies, and might
want to switch to direct pushes. Let's point translators to this
workflow.
2026-08-21 13:28:47 +00:00
Sebastian Wick eb974af4b0 ci: Release with vendored libglnx and variant-schema-compiler
We now have subprojects for a few dependencies. libglnx and
variant-schema-compiler used to be git subtrees and we recommend
distributions to use those vendored dependencies. We turned them into
meson wraps, which means they are no longer vendored in. We can include
them with --include-subprojects, but then we have to make sure that the
subprojects we recommend to use from the system (bwrap and
xdg-dbus-proxy) are disabled.
2026-08-21 12:55:37 +00:00
Sebastian Wick 49040df5f2 build: Use a meson .wrap file for the variant-schema-compiler subproject
It is not a meson project, but we can use the patch_directory key to
overlay a meson.build file over the git checkout. It uses
meson.override_find_program so that in flatpak, a call to
find_program('variant-schema-compiler') will find the program.
2026-08-21 12:55:37 +00:00
Sebastian Wick db7f12b4c8 build: Use a meson .wrap file for the libglnx subproject
And make libglnx a static library dependency.
2026-08-21 12:55:37 +00:00
luming zh c1ddb66f85 po: Update Chinese (China) translation 2026-08-20 08:28:56 +00:00
Sebastian Wick 06f43a572e tests: Add test for copying symlinks 2026-08-19 14:57:39 +00:00