Commit Graph

8328 Commits

Author SHA1 Message Date
Debarshi Ray
ab69f8ef7e dir, system-helper: Don't ignore errors when getting a remote's URL
Of the 27 instances where ostree_repo_remote_get_url() is used, these
are the only ones where the return value is ignored.  This triggers
Coverity.

It might not always be strictly necessary to handle the errors, but
doing so can only help with debugging.  However, in the case of
flatpak_dir_get_remote_disabled() this clarifies the subtle difference
between an empty URL (ie., ""), and a NULL URL caused by a corrupt
configuration file or a missing "url" key.
2026-03-19 23:40:29 +00:00
lumingzh
74501ad08a update Chinese translation 2026-03-19 21:22:39 +05:30
Simon McVittie
0c9a818f8d tests: Mention [systemd-]localed in debug messages, not "located"
This was not a typo for "located": the daemon is systemd-localed,
or localed for short.

Fixes: bb549168 "fix: cross typos, detail below"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-03-19 21:16:19 +05:30
Sebastian Wick
0a0e9faa04 context: Fix make-sandboxed with multiarch by owning the old permission
We would get a reference to the old permission, then free it, and then
insert the freed pointer into the new hashtable again.

Closes: #6524
Fixes: 6667e1d3 ("context: Use the new permission system for shares and features")
2026-03-19 15:06:24 +00:00
Georges Basile Stavracas Neto
e3b6c4b92f Post-release version bump 2026-03-15 11:13:11 +00:00
Georges Basile Stavracas Neto
13b26a94a3 1.17.3 1.17.3 2026-03-15 11:13:11 +00:00
Georges Basile Stavracas Neto
d25bae1779 Update translation files for 1.17.3 2026-03-15 11:13:11 +00:00
Debarshi Ray
48e7bf32ec builtins-utils: Remove unused function
Fallout from 0221f5a1fa
2026-03-12 19:20:55 +05:30
Debarshi Ray
d7f83c0db1 document-unexport: Fix a -Wanalyzer-null-dereference warning
OpenScanHub [1] triggered this and flagged it as CWE-476 [2]:
  app/flatpak-builtins-document-unexport.c:90:7:
      warning[-Wanalyzer-null-dereference]: dereference of NULL ‘doc_id’
  app/flatpak-builtins-document-unexport.c:48:1: enter_function: entry
      to ‘flatpak_builtin_document_unexport’
  app/flatpak-builtins-document-unexport.c:56:20: release_memory:
      ‘doc_id’ is NULL
  app/flatpak-builtins-document-unexport.c:61:6: branch_false: following
      ‘false’ branch...
  app/flatpak-builtins-document-unexport.c:66:7: branch_false: ...to
      here
  app/flatpak-builtins-document-unexport.c:66:6: branch_false: following
      ‘false’ branch...
  app/flatpak-builtins-document-unexport.c:69:6: branch_false: ...to
      here
  app/flatpak-builtins-document-unexport.c:69:6: branch_false: following
      ‘false’ branch...
  app/flatpak-builtins-document-unexport.c:72:3: branch_false: ...to
      here
  app/flatpak-builtins-document-unexport.c:75:6: branch_false: following
      ‘false’ branch...
  app/flatpak-builtins-document-unexport.c:78:15: branch_false: ...to
      here
  app/flatpak-builtins-document-unexport.c:82:6: branch_false: following
      ‘false’ branch...
  app/flatpak-builtins-document-unexport.c:85:7: branch_false: ...to
      here
  app/flatpak-builtins-document-unexport.c:85:6: branch_true: following
      ‘true’ branch...
  app/flatpak-builtins-document-unexport.c:86:14: call_function: inlined
      call to ‘g_strdup_inline’ from ‘flatpak_builtin_document_unexport’
  app/flatpak-builtins-document-unexport.c:90:7: release_memory:
      ‘doc_id’ is NULL
  app/flatpak-builtins-document-unexport.c:90:7: danger: dereference of
      NULL ‘doc_id’
  #   88|       return FALSE;
  #   89|
  #   90|->   if (strcmp (doc_id, "") == 0)
  #   91|       {
  #   92|         g_print (_("Not exported\n"));

Add an assertion to express that 'doc_id' can't be NULL unless there's a
programmer error.

Spotted by Siteshwar Vashisht.

[1] https://openscanhub.dev/

[2] https://cwe.mitre.org/data/definitions/476.html
2026-03-11 22:31:49 +00:00
Debarshi Ray
596ef2fd7a appdata: Fix a -Wanalyzer-null-argument warning
OpenScanHub [1] triggered this and flagged it as CWE-688 [2]:
  common/flatpak-appdata.c:298:7: warning[-Wanalyzer-null-argument]: use
      of NULL ‘parent’ where non-null expected
  common/flatpak-appdata.c:282:6: branch_false: following ‘false’
      branch...
  common/flatpak-appdata.c:285:3: branch_false: ...to here
  common/flatpak-appdata.c:285:3: branch_true: following ‘true’
      branch...
  common/flatpak-appdata.c:287:15: branch_true: ...to here
  common/flatpak-appdata.c:289:6: branch_false: following ‘false’
      branch...
  common/flatpak-appdata.c:297:7: branch_false: ...to here
  common/flatpak-appdata.c:297:6: branch_true: following ‘true’ branch
      (when the strings are equal)...
  common/flatpak-appdata.c:298:7: branch_true: ...to here
  common/flatpak-appdata.c:298:7: danger: argument 1 (‘parent’) NULL
      where non-null expected
  #  296|     /* avoid picking up <id> elements from e.g. <provides> */
  #  297|     if (g_str_equal (element_name, "id") &&
  #  298|->       g_str_equal (parent, "component"))
  #  299|       {
  #  300|         component->id = g_steal_pointer (&text);

The parsing code doesn't throw any errors from G_MARKUP_ERROR.  It
expects the input to be valid, and relies on assertions to express that.
eg., it asserts that a <component> element or tag is encountered before
any other, and particularly <content_attribute>, <content_rating> and
<release>.

In the same vein, an assertion was added to express that an <id> element
or tag always has a parent.

Spotted by Siteshwar Vashisht.

[1] https://openscanhub.dev/

[2] https://cwe.mitre.org/data/definitions/688.html
2026-03-11 22:31:49 +00:00
Sabri Ünal
8e7b3c6829 Update Turkish translation 2026-03-11 21:39:15 +00:00
bbhtt
50d9a2f735 builtins-update: Respect opt_noninteractive in update_appstream()
Use opt_noninteractive instead of hardcoded values so AppStream
refresh is quiet only when --noninteractive is specified. This allows
to show a better messsage instead of repeating and makes the errors
visible as well.

Related: #5716
2026-03-02 16:42:31 +00:00
matt
f256990331 builtins-update: Show a better message when there are no refs to update
Replace the "Nothing to do" message with "Nothing to update." when no
refs have updates available which is slightly clearer.

Fixes: #5716

Co-authored-by: Patrick <github.calorie764@passmail.net>
Co-authored-by: bbhtt <bbhtt.zn0i8@slmail.me>
2026-03-02 16:42:31 +00:00
Manuel Rego Casasnovas
6ae117c250 flatpak-bisect: Use raw string for regular expression
This is showing a SyntaxWarning when using flatpak-bisect
with Python 3.12. Using a raw string fixes it.

See second change listed in:
https://docs.python.org/3/whatsnew/3.12.html#other-language-changes

Closes: #6508
2026-02-25 23:39:15 +05:30
Cathy Hu
b7c1b7e208 selinux: add custom type flatpak_home_t for ~/.local/share/flatpak
The fedora selinux-policy (and therefor also the openSUSE one)
has a named file transition that relabels folders in ~/.local/share/
with the type `systemd_home_t` when they are called "systemd".

This is unfortunate as this means it will also relabel the
directory under `.local/share/flatpak/.*/systemd`, as it matches
the directory name.

As the systemd filetrans looks valid and it is a shortcoming
of SELinux in general, this is the easiest fix that would
make the folders below .local/share/flatpak not be labelled
incorrectly i would say.

Additionally, this will need a fix in the main selinux-policy.

What happens if we don't fix it?
- Users will have some of the files in .local/share/flatpak
  pop up when running `restorecon` which might confuse them
- At least in regular targeted mode, it will likely not make
  an impact in the sense that some access gets denied, so it just
  "looks ugly"

Reproducer openSUSE Tumbleweed:
```
$ rm -rf ~/.local/share/flatpak
$ flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$ flatpak install --user flathub org.gnome.Builder
$ restorecon -Rvn ~/.local/share/flatpak
...
Would relabel /home/<user>/.local/share/flatpak/app/org.gnome.Builder/x86_64/stable/327753f4701dbb9046bfb0c0c9c05b16edea0fbd8df7f368525c461d8d30b5a4/files/lib/systemd from unconfined_u:object_r:systemd_home_t:s0 to unconfined_u:object_r:data_home_t:s0
...
```
2026-02-24 21:50:06 +00:00
Anders Jonsson
35040e6e58 Update Swedish translation 2026-02-23 12:57:43 +00:00
Qiheng He
f4d3a52d73 doc: Add compilation instructions for Ubuntu 24.04
Clearly, Ubuntu 24.04 does not enable the `deb-src` repo by default, and `meson` is not a build dependency of `flatpak`.
2026-02-16 15:20:41 +00:00
Qiheng He
b37f739721 main: Default to text auth on WSL
Since this bug can be reproduced on Ubuntu, Debian, and Fedora, we should set `FLATPAK_FORCE_TEXT_AUTH=1` for all WSL users instead of ignoring its existence. After all, the so-called `graphical prompt` in the flatpak documentation seems to be something unique to GNOME. `WSL_DISTRO_NAME` and `WSL_INTEROP` are both located at https://github.com/microsoft/WSL/blob/master/src/linux/init/util.h .
2026-02-07 15:17:33 +05:30
Reilly Brogan
9380e0c66c fix: Build with glibc 2.43
Several glibc functions now return a const pointer if the input is a const pointer and a non-const pointer if the input is non-const, causing a build failure.

Fix this by declaring the output pointers as const if they are never modified and for the lone failure where the output is modified instead make the input non-const.
2026-02-02 18:54:08 +05:30
Rafael Fontenelle
c27af8a9d9 Update Brazilian Portuguese translation 2026-01-22 19:08:42 +05:30
rezky_nightky
bb54916814 fix: cross typos, detail below
What I did
Repository rules / “don’t edit” areas
From CONTRIBUTING.md and subprojects/README.md, subprojects/ contains vendored/submodule/copylib code (bubblewrap, libglnx, dbus-proxy, variant-schema-compiler). I treated subprojects/ as third-party and excluded it from typo fixing.

You already skip po/ (translations) and node_modules/, and I kept those exclusions.

Typos fixed (project-owned files only)
I ran codespell with write mode and exclusions, and fixed the reported typos across:

NEWS
app/…
common/…
doc/…
tests/…
session-helper/…
portal/…
data/…
Then I handled the remaining items individually:

NEWS: thse -> these
common/flatpak-utils-private.h: Thse -> These
app/flatpak-polkit-agent-text-listener.c: identies -> identities
tests/test-auth.sh: Propertly -> Properly
tests/testlibrary.c: remore -> remote
common/flatpak-transaction.c: improved wording to avoid the xwindows typo (X11 window ID)
Added .codespellrc
Created .codespellrc:

skip: node_modules,po,subprojects
ignore-regex: .*(ratatui|Affinitized|affinitized).*
ignore-words-list: nd,ot,THUR,IST,fo,hel,bu
(these were confirmed as legitimate tokens/abbreviations/namespace prefix/test strings in this repo, so they should not be “fixed”)
Verification:

codespell --config .codespellrc . now exits clean.

Signed-off-by: rezky_nightky <with.rezky@gmail.com>
2026-01-21 17:58:19 +00:00
lumingzh
7710c78e97 update Chinese translation 2026-01-20 22:21:24 +00:00
filmsi
92b481e246 Update Slovenian translation (sl.po)
Updated sl.po
2026-01-17 03:53:29 +00:00
vgdaut
d38343194b install, uninstall: Fail if non-interactive and multiple refs, remotes or installations match 2026-01-15 17:45:39 +00:00
Sebastian Wick
a6c76d21a2 context: Improve check for --filesystem paths moving up
While the arguments for --filesystem permissions either have to come
from a privileged source, or from the manifest which is supposed to be
checked by the remote, it was decided that paths are not allowed to move
up (..) a directory.

The check for this was both too complicated, and not sufficient, because
the special directories (e.g. xdg-download) might contain only a single
slash (xdg-download/..) and move one directory up.
2026-01-13 17:26:58 +00:00
Christian Hergert
c896faae19 app: be selective about when to map font-dirs.xml
If the command calling `flatpak build` has already specified a
font-dirs.xml to map, then mapping in again may break (as exemplified in
Builder and Foundry).

This checks to see if an argument has already been mapped in before doing
so and resolves the issue with Builder/Foundry.

Follow-up to !6138

Fixes: GNOME/gnome-builder#2387
2026-01-13 16:34:55 +00:00
lumingzh
6a5fa4b8a0 update Chinese translation 2026-01-07 00:57:47 +00:00
filmsi
763874f7ad Update sl.po (Slovenian)
Due to new/updated English strings here is the update.
2026-01-06 20:39:48 +05:30
Sabri Ünal
fa4da960e1 typo: Fix URL usages
Url > URL
url > URL
2026-01-05 21:16:15 +05:30
Sabri Ünal
10cf402ea2 i18n: Update two strings
In the following usages, the "Install:" and "Download:" strings were used as a short form
of the "Download Size" and "Installed Size", which makes translation tricky.

Therefore, using the normal forms will be good from the translation side.
2026-01-05 13:51:30 +00:00
Sabri Ünal
5136ef48f8 i18n: Add comments for translators
The string "download" can be both a noun and a verb.

Here, "download" is used as a noun.
2026-01-02 14:37:29 +00:00
Simon McVittie
c324778b07 tests: Tell "as-installed" tests where they can find triggers
Since commit d10e1148 "Add initial support for preinstalling flatpaks",
the test suite sets FLATPAK_DATA_DIR to a temporary directory, both
while running uninstalled and as-installed.

While running uninstalled we already set FLATPAK_TRIGGERSDIR to the
trigger scripts in the source tree, but when running "as-installed",
we need to run the triggers that the OS installs as part of the flatpak
package (or equivalent).

Not having this caused autopkgtests (automated as-installed tests) in
Debian to regress with 1.17.x.

Fixes: d10e1148 "Add initial support for preinstalling flatpaks"
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-12-18 14:52:35 +00:00
Sebastian Wick
56dfd306d6 Post-branching version bump 2025-12-15 19:36:46 +01:00
Sebastian Wick
20599618d6 Update NEWS for 1.17.2 release 1.17.2 2025-12-15 19:14:18 +01:00
Sebastian Wick
ef3d619d0e ci: Fix immutable releases
Github supports immutable releases. They can't be changed once
published. This is great, but the release action was broken and created
an immutable release, published it, and then tried to upload the dist
artifacts.

Upgrade to the latest version and explicitly create an immutable
release. In this version, the release action creates a draft release,
uploads the dist artifacts, and then publishes it.
2025-12-15 17:58:23 +00:00
Sebastian Wick
64d6ab4d57 Post-branching version bump 2025-12-15 17:32:24 +01:00
Sebastian Wick
b9c907a29b Update NEWS for 1.17.1 release 1.17.1 2025-12-15 17:27:06 +01:00
Sebastian Wick
d6453336a6 Update translation files for 1.17.1 2025-12-15 16:47:37 +01:00
lumingzh
5dad539335 update Chinese translation 2025-12-10 14:46:27 +00:00
Sebastian Wick
2a4441382f context: Add --share-if and --allow-if context options
Actually make it possible to use the command line to use the new
conditional permission system.
2025-12-08 19:33:09 +00:00
Sebastian Wick
6667e1d361 context: Use the new permission system for shares and features
This gives us conditionals for shares and features. So far we have no
use case for this, but the system already exists, it makes the code
simpler, and when we need this in the future, we don't have to wait for
it to roll out.
2025-12-08 19:33:09 +00:00
Sebastian Wick
e0e1b20ecb context: Pass in the negated permission string
For device and socket the negated versions are nodevice and nosocket,
but for shares, the strings are allow and disallow. Take arguments for
both forms.
2025-12-08 19:33:09 +00:00
Sebastian Wick
2beadfc860 context: Fix typo in --socket-if option 2025-12-08 19:33:09 +00:00
Sebastian Wick
f242199eca tests: Test signed OCI images 2025-12-08 19:09:56 +00:00
Owen W. Taylor
404aa33ce1 common: Check signatures when installing OCI images
Co-authored-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-08 19:09:56 +00:00
Owen W. Taylor
841f33e451 app: Add a "signature lookaside" repository configuration
Allow specifying a lookside URL for downloading signatures for
an OCI remote. This can be specified:

 In a .repofile with the SignatureLookaside key
 As the --signature-lookaside option to remote-add/remote-modify
2025-12-08 19:09:56 +00:00
Owen W. Taylor
0f4ad0e925 json-oci: Make FlatpakOciSignature just a simple signature
FlatpakOciSignature was a Flatpak-specific analog to
the containers/image "simple signatures" - but it wasn't used at
all, and Flatpaks on registry.redhat.io are signed by the
original simple signatures. So modify it correspond to
the original simple signatures.
2025-12-08 19:09:56 +00:00
Owen W. Taylor
d13ae21a8e oci-signatures: Remove vestigal OCI signing code
Remove unused flatpak_oci_sign_data() - we'll leaving signing
OCI images to container ecosystem tools like skopeo and cosign.
2025-12-08 19:09:56 +00:00
Owen W. Taylor
bd846c389f oci-registry: Move some helper functions to flatpak-utils.c
In order to reuse in flatpak-oci-signatures.c, move:

 local_open_file => flatpak_open_file_at
 local_load_file => flatpak_load_file_at
2025-12-08 19:09:56 +00:00
Sebastian Wick
78c97ead65 oci-signatures: Fix return type of flatpak_oci_signatures_verify 2025-12-08 19:09:56 +00:00