Commit Graph

7214 Commits

Author SHA1 Message Date
Ryan Gonzalez
7fe63f2e8f Reject paths given to --filesystem/--persist with special characters
There isn't much in the way of legit reasons for this, but it's a
potential security footgun when displaying the text.

CVE-2023-28101, GHSA-h43h-fwqx-mpp8

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Co-authored-by: Simon McVittie <smcv@collabora.com>
2023-03-16 09:54:14 +00:00
Ryan Gonzalez
6cac99dafe Ensure special characters in permissions and metadata are escaped
This prevents someone from placing special characters in order to
manipulate the appearance of the permissions list.

CVE-2023-28101, GHSA-h43h-fwqx-mpp8

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2023-03-16 09:54:14 +00:00
Sabri Ünal
3abfddba92 Update Turkish Translation
- Translate new strings.
- To ensure consistency with Git terminology, use "İşleme" as a translation for "Commit".
2023-03-16 09:34:52 +00:00
Anders Jonsson
47d522acd0 Update Swedish translation 2023-03-16 09:34:18 +00:00
Mejans
da6c7e66eb Occitan translations updated 2023-03-16 09:33:12 +00:00
Fabio Pagnotta
fc05e818f0 Document path used for flatpak-override 2023-03-06 13:02:51 -06:00
Piotr Drąg
2e633bd7fa Update Polish translation 2023-03-06 15:47:19 +00:00
Philip Withnall
209d4bba0d transaction: Remove unused error argument from flatpak_transaction_add_op()
Introduces no functional changes, but simplifies the code a little.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-02-23 18:57:50 +00:00
Philip Withnall
0b106a992f transaction: Fix a minor typo in a documentation comment
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-02-21 19:59:30 +00:00
Dmitry
9db4cc7d7b Russian translation update 2023-02-21 19:59:01 +00:00
Simon McVittie
756994b5c4 Prepare v1.15.3
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.15.3
2023-02-21 10:03:49 +00:00
Simon McVittie
09d6adcb78 Update i18n files for release
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-21 10:03:49 +00:00
Simon McVittie
26be72d070 meson: Use flatpak in all-lower-case as the machine-readable project name
The Meson project name is more like Autotools PACKAGE_TARNAME, and in
particular is used in the name of the dist tarball.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-21 10:03:49 +00:00
Simon McVittie
0a4ce23448 README: Signpost https://flatpak.org/setup/ as a good way to install
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-21 09:55:10 +00:00
Simon McVittie
cf2a4f2b59 CONTRIBUTING: Recommend building this branch with Meson
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-21 09:54:46 +00:00
Simon McVittie
cb7f17b1d2 release-checklist: Describe how to do releases with Meson
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-21 09:20:02 +00:00
Simon McVittie
9fa89a9587 meson: Include the same i18n bug reporting address as for Autotools
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-21 09:19:37 +00:00
Simon McVittie
30c6b7dbf2 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-21 09:09:56 +00:00
Rodhos
88c187e44a update es.po 2023-02-21 09:07:51 +00:00
Dmitry
473a5e1f9d Update ru.po 2023-02-21 09:03:05 +00:00
Simon McVittie
28f4f71545 Update NEWS
[skip ci]

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-18 14:53:01 +00:00
Dan Nicholson
fba3a7d35e transaction: Ignore uninstall operations for no deploy
If `no_deploy` has been set to `TRUE` in a transaction, then the
intention is that no changes will be made to the installed flatpaks.
Currently that's not the case for explicitly or implicitly added
uninstall operations. That's particularly bad for eol-rebase flatpaks
since they old version will be automatically removed without the new
version being installed. To address this, prevent uninstall operations
from being added for no deploy transactions.

Closes: #5172
2023-02-18 14:48:47 +00:00
Simon McVittie
77b3f0f03e Update NEWS
[skip ci]

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-18 14:13:32 +00:00
Dan Nicholson
cc122e2972 flatpak-run: Unset GDK_BACKEND
If the `GDK_BACKEND` environment variable is present and it's value does
not match the Wayland and X11 socket configuration, then a GTK app will
fail to run since it will only consider the display backend from the
environment variable.

This should probably be extended to cover other display environment
variables such as `QT_QPA_PLATFORM` for Qt and `SDL_VIDEODRIVER` for
SDL. However, I've only tested this with GTK applications.
2023-02-13 18:24:54 +00:00
Simon McVittie
be2de97e86 dir: If metadata is syntactically invalid, say which file is the problem
Similar to the previous commit, but for metadata.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 21:14:17 +00:00
Simon McVittie
3ede5382fa dir: If overrides are syntactically invalid, include path in error message
It's unhelpful to say something like "Key file contains line “x” which is
not a key-value pair, group, or comment" without specifying which file
we are talking about.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 21:14:17 +00:00
Simon McVittie
628750d2de list: Show a warning if we can't load the current version
Conceptually similar to the previous commit, except it didn't crash
before, just didn't display anything.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 21:14:17 +00:00
Simon McVittie
5e2e771ece list: Handle error in flatpak_dir_load_deployed()
flatpak_dir_load_deployed() can fail and return NULL. If that happens,
there is a semi-installed but broken app, and we should show a warning
rather than crashing.

Resolves: https://github.com/flatpak/flatpak/issues/5293
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 21:14:17 +00:00
Simon McVittie
5b2295508f Update NEWS
[skip ci]

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 12:13:34 +00:00
Simon McVittie
c1d0b46cd4 utils-http: Avoid deprecation warning with curl >= 7.85.0
CURLOPT_PROTOCOLS_STR is documented as the replacement for
CURLOPT_PROTOCOLS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-07 14:04:01 +00:00
Simon McVittie
64d627968e run: Avoid double-free of gpgconf stdout stream
g_subprocess_get_stdout_pipe() does not transfer ownership, so the
stream still belongs to the GSubprocess and we must not unref it.

Fixes: 764e5a4d "Add --socket=gpg-agent"
Resolves: https://github.com/flatpak/flatpak/issues/5095
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-07 14:03:47 +00:00
Phaedrus Leeds
b13d387aef dir: Add more debug output for unused refs
Inspired by the slight mystery of
https://github.com/flatpak/flatpak/issues/5192, this commit adds more
debug output to the functions that analyze installations for unused
refs. Some of the output is g_debug() (enabled by -vv) and some is
g_info() (enabled by -v) since otherwise the output would be too
verbose. This should hopefully help debug problems, not only related to
the unused refs code but anything involving dependencies.
2023-02-06 16:19:50 +00:00
Juan
b628f3f19d Spanish translation update 2023-02-06 16:17:59 +00:00
Simon McVittie
a98bbbe2ce Update translation files for 1.15.2 release
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.15.2
2023-02-06 14:07:32 +00:00
Simon McVittie
4b261f53ed Prepare v1.15.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-06 12:04:31 +00:00
Piotr Drąg
fa35ebe513 Update POTFILES.in 2023-02-05 12:08:23 -06:00
Patrick Griffis
bb730ef8b8 Revert "Add support for files generated by appstreamcli compose (#5277)"
This reverts commit 88f7ecd000.
2023-02-04 12:30:15 -06:00
Luna
88f7ecd000 Add support for files generated by appstreamcli compose (#5277)
Co-authored-by: Bartłomiej Piotrowski <b@bpiotrowski.pl>
Co-authored-by: Jamie Murphy <hello@itsjamie.dev>
2023-02-04 10:40:07 -06:00
Simon McVittie
e72ae11b93 NEWS: Update
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-30 10:22:19 +00:00
Forest
01910ad12f utils: Unmap the old summary.idx file before trying to replace it
Exporting to an existing repo on a Samba filesystem failed with EACCES
when libglnx called renameat() to replace the old summary.idx file.

    error: renameat: Permission denied

This occurred even when the user had appropriate permissions to the file
and its ancestor directories. The problem was that flatpak had mapped the
old file into memory for reading, and still held a reference to that mapping
when attempting to replace the underlying file. Apparently this works on some
filesystems, but not on cifs.

We therefore release the memory mapping before replacing the underlying file.

Fixes #5257

Co-authored-by: Patrick <tingping@tingping.se>
2023-01-22 19:21:36 -06:00
Dmitry
16be436de3 Russian translation update (#5262) 2023-01-22 10:13:55 -06:00
Dmitry
a9a2c70e96 Russian traslation updated (#5256) 2023-01-15 12:27:40 -06:00
Simon McVittie
0aa0284c10 exports: Test that a symlink to the root directory is rejected
Reproduces: https://github.com/flatpak/flatpak/issues/1357
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-12 15:13:34 +00:00
Simon McVittie
fe49f8f7ca exports: Assert that recently-excluded paths are excluded
Reproduces: https://github.com/flatpak/flatpak/issues/5205
Reproduces: https://github.com/flatpak/flatpak/issues/5207
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-12 15:13:34 +00:00
Simon McVittie
e3507918c0 exports: Don't export parent or ancestor of reserved directories
Previously, --filesystem=/run would prevent apps from starting by
breaking our ability to set up /run/flatpak and /run/host. Now it is
ignored, with a diagnostic message, resolving #5205 and #5207.

Similarly, --filesystem=/symlink-to-root (or --filesystem=host) would
have prevented apps from starting if a symlink like
`/symlink-to-root -> /` or `/symlink-to-root -> .` exists, and refusing
to export the target of that symlink avoids that failure mode,
resolving #1357.

Resolves: https://github.com/flatpak/flatpak/issues/1357
Resolves: https://github.com/flatpak/flatpak/issues/5205
Resolves: https://github.com/flatpak/flatpak/issues/5207
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-12 15:13:34 +00:00
Simon McVittie
a747e2c0c4 context: Show a warning if we cannot provide any $HOME
If $HOME is below a reserved path (for example `/usr/home/thompson`
for Unix traditionalists) or otherwise cannot be shared, or is a
symbolic link to somewhere that cannot be shared, then we will end
up running the app with $HOME not existing. This is unexpected, so
we should make more noise about it.

There are two situations here, both of which get a warning: if we have
--filesystem=home or --filesystem=host then we are trying to share the
real $HOME with the application, and if we do not, then we are trying
to create a directory at the location of the real $HOME and replicate
the chain of symlinks (if any) leading from $HOME to that location.

Unlike the previous commit, this is not expected to happen during unit
testing, so we do not use a g_warning() for this.

Diagnoses: https://github.com/flatpak/flatpak/issues/5035
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-12 15:13:34 +00:00
Simon McVittie
eebee9eb0f context: Show a warning when --filesystem exists but can't be shared
If the user gives us a override or command-line argument that we cannot
obey, like --filesystem=/usr/share/whatever or
--filesystem=/run/flatpak/whatever, then it's confusing that we silently
ignore it. We should give them an opportunity to see that their override
was ineffective.

However, there are a few situations where we still want to keep quiet.
If there is a --filesystem argument for something that simply doesn't
exist, we don't diagnose the failure to share it: that avoids creating
unnecessary noise for apps that opportunistically share locations that
might or might not exist, like the way the Steam app on Flathub asks
for access to $XDG_RUNTIME_DIR/app/com.discordapp.Discord.

Similarly, if we have been asked for --filesystem=host, the root
directory is very likely to contain symlinks into a reserved path, like
/lib -> usr/lib. We don't need a user-visible warning for that.

We actually use the equivalent of g_message() rather than g_warning(),
to avoid this being fatal during unit testing (in particular when we
do a `flatpak info` on an app that has never been run, which will
be unable to share its `.var/app` subdirectory). `app/flatpak-main.c`
currently displays them as equivalent to each other anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-12 15:13:34 +00:00
Simon McVittie
073bdccd9e exports: Move error handling up into caller
This lets flatpak_context_export() or other callers decide how they want
to handle failure to export each path. For now, the callers in
FlatpakExports are still using g_debug() unconditionally, but we can now
have somewhat better test coverage.

Helps: https://github.com/flatpak/flatpak/issues/1357
Helps: https://github.com/flatpak/flatpak/issues/5035
Helps: https://github.com/flatpak/flatpak/issues/5205
Helps: https://github.com/flatpak/flatpak/issues/5207
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-12 15:13:34 +00:00
Simon McVittie
6394e7f77c exports: Make _exports_path_expose produce a GError on failure
This is a step towards allowing its direct and indirect callers to decide
how serious the failure is, and debug or warn accordingly.

Helps: https://github.com/flatpak/flatpak/issues/5205
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-12 15:13:34 +00:00
Simon McVittie
ff1f8fc1fa exports: Never try to export /.flatpak-info
Just for completeness, in practice the host system will not have this.

Helps: https://github.com/flatpak/flatpak/issues/5205
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-12 15:13:34 +00:00