Commit Graph
8690 Commits
Author SHA1 Message Date
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
Sebastian Wick f637529fc9 glnx_file_copy_at: Use O_PATH fd for xattr and ownership operations
After creating the symlink, open it with O_PATH to pin the inode and
verify the target matches. All subsequent operations (xattrs, chown) go
through the pinned fd instead of path-based operations.
2026-08-19 14:57:39 +00:00
Sebastian Wick 8699d67a48 xattrs: Drop fd-based code paths from get_xattrs_impl
All callers now go through /proc/self/fd paths, so the flistxattr,
fgetxattr branches and the fd parameter are dead code.
2026-08-19 14:57:39 +00:00
Sebastian Wick b30c4ad983 xattrs: Use /proc/self/fd path in glnx_fd_set_all_xattrs
This allows it to work on O_PATH file descriptors, which is needed for
operating on symlinks.
2026-08-19 14:57:39 +00:00
Sebastian Wick 7339e32080 xattrs: Use /proc/self/fd path in glnx_fd_get_all_xattrs
This allows it to work on O_PATH file descriptors, which is needed for
operating on symlinks.
2026-08-19 14:57:39 +00:00
Sebastian Wick 6020dbf7f6 chase: Handle EAGAIN from openat2
From openat2(2):

  EAGAIN how.resolve contains either RESOLVE_IN_ROOT or
    RESOLVE_BENEATH, and the kernel could not ensure that a
    ".." component didn't escape (due to a race condition or
    potential attack).  The caller may choose to retry the
    openat2() call.

We should handle this by simply retrying the syscall.
2026-08-19 14:57:39 +00:00
Sebastian Wick 5a6c442c05 dir: Validate GVariant structure before using generated variant readers
Reject summaries, subsummaries, and summary indexes that are not in
GVariant normal form before passing them to the generated variant
accessor framework, which performs direct pointer arithmetic without
structural validation.
2026-08-19 14:31:47 +00:00
Sebastian Wick a7bf3fbf29 system-helper: Handle NULL entries in cache_dirs_in_use iteration
The cache_dirs_in_use tracks the cache dirs, and which pull it is
associated with. It can also be associated with no pull anymore in which
case the value is NULL.

The iteration over cache_dirs_in_use thus needs to handle NULL values.
2026-08-19 14:18:27 +00:00
Sebastian Wick 076391b856 README: Document the required kernel and conservative dependencies
Closes: #6774
2026-08-19 13:37:33 +00:00
Sebastian Wick 22eec07b5a portal: Account for source fds in fd_map_remap_fd max_fd tracking
fd_map_remap_fd assigns a temporary fd number (++max_fd) that may later
be used as a conflict resolution target. If the source fd passed to
fd_map_remap_fd is higher than max_fd, conflict resolution can assign
a replacement value that collides with that source fd. In
child_setup_func, the dup2 for the conflicting entry then overwrites
the source fd before it is remapped, delivering the wrong fd to the
child process.

In practice this manifests as sandbox-expose-fd-ro passing a random fd
(e.g. a socket) instead of the intended O_PATH fd to flatpak run via
--ro-bind-fd, producing errors like:

  error: /proc/self/fd/21 resolves to non-absolute path socket:[423446]

Similar error have been observed in Epiphany/WebKit:
https://bugs.webkit.org/show_bug.cgi?id=305344
2026-08-19 11:15:56 +00:00
luming zh 098c34b0b0 po: Update Chinese (China) translation 2026-08-19 10:34:21 +00:00
Sebastian Wick 476b8591e9 subprojects: Update dbus-proxy.wrap to v0.1.8
Version 0.1.7 contains a security vulnerability, so let's bump it to a
version which does not.
2026-08-18 11:49:26 +00:00
Sebastian Wick 100b450034 system-helper: Track the right unique sender name for pulls
The code used the connection name, which is the unique sender name of
the system-helper itself. Fix this and use the sender name of the
invocation.
2026-08-18 10:00:53 +00:00
Sebastian Wick 507d4b7df6 context: Drop g_hash_table_new_similar usage which requires glib 2.72
We require glib 2.46, so we can't rely on g_hash_table_new_similar.

Fixes: 17cb1135 ("context: Keep fallback-x11 separate from x11 conditionals")
Closes: #6775
2026-08-17 16:43:26 +00:00
Sebastian Wick 04d0046e14 run: Fix seccomp socket family filtering on i386
On architectures like i386, socket operations were historically
multiplexed through the socketcall syscall. The seccomp socket family
filter only applied to the direct socket syscall, so a binary using
socketcall could bypass it entirely.

Switch from seccomp_rule_add_exact to seccomp_rule_add, which lets
libseccomp also block socketcall. Since libseccomp cannot inspect
socketcall arguments (they are behind a userspace pointer), this
blocks all of socketcall, forcing userspace to use the direct socket
syscalls that have been available on i386 since Linux 4.3.
2026-08-14 12:22:17 +00:00
Simon McVittie 242e9893e7 tests: Avoid Meson's strict TAP parsing for now
Older versions of Meson parsed TAP output very strictly, and would fail
the test when a `g_test_message()` mentions non-UTF-8, which results
in GLib adding a prefix on stdout that is not valid TAP syntax.

Ideally our error messages should all be valid UTF-8 even if the input
is not, but that's a larger refactor that shouldn't block security fix
releases, so for now just tell Meson to get the tests' pass/fail status
from their exit status rather than parsing their stdout.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-08-11 15:29:16 +00:00