| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
This should ensure that https://github.com/flatpak/flatpak/issues/4618
stays fixed.
(cherry picked from commit 45c7f5071c5341ce895c3b90268d97d08b032820)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commits that are found to have missing or invalid objects need to be
marked partial so that when the thing referencing them is reinstalled,
the missing objects will be pulled. libostree treats non-partial commits
as complete even if they're not, since verifying their completeness is
an expensive operation.
This exactly mirrors what the "ostree fsck" command does when it finds
corruption in a commit.
This fix is especially important because corrupt repos have been an
issue lately so we at least need repair to work properly.
Relatedly, delete invalid commit objects to ensure they are
re-downloaded, though it's not clear that code path is almost ever
reachable.
Fixes https://github.com/flatpak/flatpak/issues/4618
(cherry picked from commit 6fac58a9b90c128a28d028f8f60531513ad1498e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The man page states that the --all option for the list command includes
runtime extensions (e.g. that end in .Locale or .Debug) and this is the
case. When --all is omitted, we only show such extensions when the thing
they extend is not already in the list. However when you run a command
like "flatpak list --runtime --columns=application,branch", you get a
list that excludes runtime locale extensions but includes app locale
extensions, since the corresponding apps are not in the list despite
presumably being installed. This doesn't seem like the right behavior,
so tweak the logic so that app locale extensions are excluded when --all
is omitted and --runtime is used.
Strictly speaking the "extension-of" information is not guaranteed to be
present in the deploy data (which acquires it from the metadata), but in
practice it seems to be present for all but Sources extensions, and I
think it should be considered required since we are already using it to
implement functionality elsewhere in Flatpak:
https://github.com/flatpak/flatpak/issues/4585
(cherry picked from commit 470b321c63a3a20b43b7d4142ce3038edc87f808)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit re-works how we automatically "pin" runtimes that are
explicitly installed, to prevent them from being removed automatically.
In this implementation we do the update to the config as part of the
deploy, which has the following advantages:
(1) It ensures that there's never a confusing polkit prompt about
configuring the software installation when the user asked for a runtime
to be installed (https://github.com/flatpak/flatpak/issues/4200)
(2) It means we don't have to rely on the code on the error path of
flatpak_transaction_real_run() to un-pin the runtime in case something
went wrong with the installation, since we pin it almost atomically with
the deploy.
Fixes #4200
(cherry picked from commit 6f5bb3597e14a28be5953d5d773c225a86039254)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On two different code paths we were using the "Title" field in
flatpakref files as the title of a remote, which is incorrect. In most
cases, the remote added via the RuntimeRepo key will be the same as the
remote the app is from, so when the remote is added for the runtime, its
title will be correctly set using the Title value from the flatpakrepo
file and the app will therefore have an origin remote with a title set.
This is not currently true for flatpakref files that use
SuggestRemoteName=, see https://github.com/flatpak/flatpak/pull/4513
For flatpakref files that use a different remote than the RuntimeRepo,
we don't currently have a way for the title to be set automatically;
perhaps we should (https://github.com/flatpak/flatpak/issues/4512).
Fixes https://github.com/flatpak/flatpak/issues/4499
(cherry picked from commit 9dbd265cdd68099b62119e06f94bab43cf1f5ea9)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It can happen that a related ref is installed from a different remote
than the thing it's related to. We always want to update things from
their origin remote. However as of now FlatpakTransaction resolves the
commit of a related ref to the one available from the main ref origin,
and later sets the remote for the operation to the installed origin (see
commit 6793d90b8). In case there is a newer commit in the main ref
origin than the installed origin, this leads to an update operation
being erroneously created, only to then error out with an HTTP 404
error, because the commit from the main ref origin is being pulled from
the installed ref origin. For specific steps to reproduce see
https://github.com/flatpak/flatpak/issues/3128#issuecomment-948948040
So, ensure that when a FLATPAK_TRANSACTION_OPERATION_INSTALL_OR_UPDATE
operation is created for something that's installed, whether it's a
related ref or something else, the remote used is always the origin. And
ensure that the remote is set correctly before the stage where the op is
resolved to a commit, to avoid the situation described above. This is
essentially a re-implementation of the fix in commit 6793d90b8.
Also, add a unit test for this behavior.
This commit also makes a few changes to documentation to make it clear
that this related-ref-different-origin situation is possible.
Fixes #3128
(cherry picked from commit 49d9052d2248de8b5f3c4c1c6ca7dfceefcbcd2f)
(only merge conflicts in tests/testlibrary.c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently if the user specifies a ref to install that has been renamed
via the end-of-life-rebased mechanism, for example "flatpak install
com.visualstudio.code.oss", Flatpak erroneously tries to install both
the old and new versions of the app. This happens because the code
handling end-of-life-rebase conditions is written assuming the rebased
app is being updated rather than installed for the first time.
Specifically, in FlatpakCliTransaction and FlatpakQuietTransaction, in
end_of_lifed_with_rebase(), we treat a failure of
flatpak_transaction_add_uninstall() as fatal and return FALSE from the
signal handler, which means that the install operation that triggered
the signal will not be skipped (see the docs for
FlatpakTransaction::end-of-lifed-with-rebase).
So, instead check for the FLATPAK_ERROR_NOT_INSTALLED error code and
ignore it, so that the installation of the old version of the renamed
app will be properly cancelled.
Fixes https://github.com/flatpak/flatpak/issues/3754
(cherry picked from commit 3aa9a7f3a12e95e16051e43ba1a28ca837b4c3c5)
|
|
|
|
|
|
|
|
|
|
|
| |
The original commit (9865ed8989befe9653fb3cd919fb5518b09274d2) disabling
it claimed it fixed OCI downloads. This no longer seems to be a problem.
This has also exposed new bugs as some servers will send
gzip compressed data when the client does not send Accept-Encoding.
If we leave this enabled that issue goes away.
(cherry picked from commit cda4967a9e2977caccafb6f72eceab1159db113f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is a follow-up to "Fix implementation of xa.noenumerate
remote option" since that turned out to break
flatpak_installation_fetch_remote_ref_sync() in some cases. I didn't see
it at the time, but flatpak_decomposed_get_collection_id() explains that
the collection ID shouldn't be set on FlatpakDecomposed objects, even
when the remote has a collection ID set, unless they are being used to
enumerate refs from a file:// URI rather than a configured remote. So
this commit changes list_remote_refs() and list_all_remote_refs() to
keep the xa.noenumerate implementation working and to get
fetch_remote_ref_sync() working again (since the latter uses
flatpak_decomposed_new_from_parts() and thus doesn't set a collection ID
on the FlatpakDecomposed object used for comparison).
(cherry picked from commit f3214c59d2f687e47ab5d9a74d8a3ef45f8e0105)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the xa.noenumerate option on a remote is documented as causing
the remote not to be used when presenting available apps/runtimes or
when searching for dependencies. The idea is that the remote is only
used for providing updates for things installed from it, and this
functionality is used when creating an origin remote for something
installed via a flatpakref file.
However, the implementation of this in flatpak_dir_list_remote_refs() is
buggy. It returns an empty set of refs even if something is both locally
installed and available from the remote. This is because it is using
hash table comparisons of FlatpkDecomposed objects (via
flatpak_decomposed_hash()) which take into account both the ref (or
refspec) and the collection ID, and the local refs' FlatpakDecomposed
objects are created from a refspec whereas the remote refs'
FlatpakDecomposed objects are created from a ref alone. We could fix
this by having them both use refspecs, but it is better to use a
collection-ref tuple for the following reasons:
(1) Changing flatpak_dir_list_all_remote_refs() to use a refspec to
create the FlatpakDecomposed objects would be a breaking change for the
other users of that function.
(2) Both the local and remote refs are from the same remote so we don't
need to use the remote name to disambiguate them, even if no collection
ID is configured.
(3) The whole point of collection IDs is to make refs uniquely
identifiable, so we're using them for the intended purpose.
In addition to fixing this bug, this commit adds a unit test in
testlibrary.c so it stays fixed.
(cherry picked from commit 7f3556d92ca7af1eaabeaf893eefa2d970433368)
|
|
|
|
|
|
| |
...instead of the app we're building arch.
(cherry picked from commit 30964d2baccc03873c2bdbd7b74db919d62d576f)
|
|
|
|
|
| |
This would incorrectly overwrite the a11y-bus option and not set the default
session-bus options.
|
|
|
|
|
|
|
|
|
| |
Currently the output produced when assert_remote_in_installation() or
assert_remote_not_in_installation() fails is not helpful: it doesn't
mention the remote name or where the assertion was called from. Fix
those problems by rewriting it as a #define.
(cherry picked from commit dd48e78652079556bebfe930caad2efa09656584)
|
|
|
|
|
|
| |
It's easier to reason about the tests if they don't leave state behind.
(cherry picked from commit f753dd214c9a44f462ca013e7357ead8f35538aa)
|
|
|
|
|
|
|
| |
This will make the next commit simpler, and in my opinion this makes the
code more readable.
(cherry picked from commit 8f85f77ff9c1b1dea02ab96771a764ff86e7c024)
|
|
|
|
|
|
|
| |
Several of our users have been reporting this error to me, can never
tell what could be wrong.
(cherry picked from commit e28b1f31584a6fae71f51985187bc8f1755e9bd1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we verify the checksum of indexed summary files (which have
.sub file names) before writing them to the on-disk cache, so in theory
as long as the disk I/O is successful the data integrity should be
intact when we use it via the flatpak-variant-impl-private.h helpers
generated by variant-schema-compiler. However in practice people
sometimes hit assertion failures which are what you would expect to see
if the data is corrupt, since GVariant stores some metadata such as the
"offset size" toward the end of the data, and if we read this from
serialized user data instead it will obviously be incorrect. In one case
I was able to acquire the flathub.idx, flathub.idx.sig, and
flathub-x86_64-fad08cfb10713e749f02a0e894b5d577b7e9c4931fdf9d2fdc50364c002bc925.sub
files which reproduce one of the assertion failures, and the sub file
appears to be incomplete, like the writing of it was interrupted.
We use g_file_replace_contents() when saving these to the disk, and when
not replacing an existing file that function writes directly to the
final filename, so if interrupted it would be expected to leave an
incomplete file.
This commit changes the summary file handling so that we verify the
checksum of any indexed subsummary again after reading it from disk. If
it doesn't match we delete the on-disk cache and try fetching from the
network.
Fixes #4127
(cherry picked from commit 6d74eec0a97171ef46fac7aa4017c235758a1f3d)
|
|
|
|
|
|
| |
Fixes https://github.com/flatpak/flatpak/issues/4036
(cherry picked from commit 2c4c84ffee1a7b0c73f5af9dec02f63e6e1ef2ca)
|
|
|
|
| |
(cherry picked from commit dfde010a49ed02c966ee9050e8ea4dc75033bdb6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a few issues with the unit test logs that make them ugly:
1. Currently some lines of output from a command will appear after the
line from xtrace which has the next command, since the command was
printing to stdout and xtrace uses stderr. E.g. "Installation complete."
will appear after "+ flatpak --user install -y ..." but it is from the
previous install command.
2. Lines of output have many spaces after them to pad them to the table
width but this is not needed for non-fancy output.
3. Lines of output are mixed with output from httpd since they don't end
with a newline character, e.g. "Installing… ▊
4%127.0.0.1 - - [16/Nov/2021 00:18:24] "GET /..."
(cherry picked from commit 388c23cfc51b6b9f03dcdf87b11c0078f11227ea)
|
|
|
|
|
|
|
| |
This way the flatpak command is more consistently run under valgrind
when that is enabled.
(cherry picked from commit d23793294d59125e645273d8b3518a9c19b597eb)
|
|
|
|
|
|
|
| |
Spotted this by code inspection. Ignoring such refs was clearly the
intended behavior based on the comment.
(cherry picked from commit 17fbe516c4251c08a648f5e938af3af78fbd4ab4)
|
|
|
|
|
|
|
|
|
|
|
| |
flatpak_fancy_output() determines whether the output we write is
intended for e.g. a tty or e.g. a log file, the latter being "not
fancy". Currently we write carriage return characters in the not fancy
case, but change that to new lines, which are interpreted correctly by
editors such as vim (whereas a carriage return shows up as ^M since it
is not the correct newline character on Unixy operating systems).
(cherry picked from commit 86d6918a1186467fb4e26408ec1bb947dcf7ba28)
|
|
|
|
|
|
|
|
| |
The <bundle> element in the appstream data unambiguously provides the
full four-part flatpak ref, so use it to determine the app ID. But fall
back to using the <id> element, since that is required to be present.
(cherry picked from commit 39de0ef280a98f67d639444cc6ea3bcfa61c0eec)
|
|
|
|
|
|
|
|
|
|
| |
This commit changes the search command to properly output the app ID for
IDs that end in .desktop, e.g. to print org.telegram.desktop rather than
org.telegram.
Fixes https://github.com/flatpak/flatpak/issues/4535
(cherry picked from commit 62e09b406b8a7fb517c294d2c0b149a83f2cc64b)
|
|
|
|
|
|
| |
These are just based on a cursory reading of the spec.
(cherry picked from commit eabbff6fefb879d6726a31afa8ae17ee144855a7)
|
|
|
|
| |
(cherry picked from commit bcc114383b744e3dc32c0b859fc900f9793ce6c7)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/ServerStrings/
says:
> If the string starts with / or unix: the remaining address string is taken as
> UNIX socket name.
but previously the string was only taken to be a UNIX socket name if it began
with "unix:".
This is an issue in practice with WSLg <https://github.com/microsoft/wslg>
which sets $PULSE_SERVER to "/mnt/wslg/PulseServer", without a "unix:" prefix.
(cherry picked from commit 7534a970a5535d57d5fa07bd5ed9eb3647cbb7dc)
|
|
|
|
|
|
|
|
|
|
|
| |
All the other code paths which set `data->done` or `data->error` ensure
to wake up the main context so its loop exit conditions can be checked
again — this code path was missing a wakeup though.
Spotted by code inspection; I haven’t hit this in the wild.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
(cherry picked from commit 8ff02c0e5b0c2105e1b26a1a00ec264f6482ce3e)
|
|
|
|
|
|
|
|
| |
In particular, this checks that CVE-2017-5226, CVE-2019-10063 and
CVE-2021-41133 are still prevented.
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 7c5aec474caef7aa004286cc9359611ad21d227b)
|
|
|
|
|
|
|
|
|
|
| |
This exercises various syscalls. It's heavily based on the one from
<https://github.com/containers/bubblewrap/pull/459>, but with the
addition of a mode to output the numeric values of various expected
errno codes, which are not otherwise available to shell scripts.
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 4ce251882c488953ca6e3734f00c5dbe2e1e3e7a)
|
|
|
|
| |
(cherry picked from commit 2181f4f171abf824d8e3c754e9e7415813460856)
|
|
|
|
|
|
| |
Per the documentation, g_assert_null() is meant for unit tests.
(cherry picked from commit 0258fc82bb8eac176d45781b54920f0a27613890)
|
|
|
|
|
|
|
|
| |
Files that are generated manually by a maintainer and committed to git
should be in the srcdir, not the builddir.
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 647c51380c13b72adbd67e0aa83b3a2979f5c6a8)
|
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/flatpak/flatpak/commit/a99b748931e6444dadb0d0c8c1565da23f755800 introduced an environment variable for changing the flatpak path for exports.
On NixOS, we do not have a stable path we could use so we used to patch Flatpak to use `flatpak` program from `PATH`.
With the recent change, we drop our downstream patch in favour of setting the environment variable to `flatpak` but the tests do not expect that.
This is the test part of our former downstream patch so that tests can pass with exports using `flatpak` instead of an absolute path.
It still expects the binary path to end with `flatpak` so arbitrary `$FLATPAK_BINARY` will not work but we do not pass the environment variable to tests so we cannot do much better.
(cherry picked from commit 96dbe28cfa96e80b23fa1d8072eb36edad41279c)
|
|
|
|
|
|
| |
Fixes https://github.com/flatpak/flatpak/issues/4534
(cherry picked from commit 6cb4a2598eb5afe0b3471d8d5e0c9cda3efe84a0)
|
|
|
|
| |
(cherry picked from commit d9b57b9c95381850310b4862c91260dd90434e4d)
|
|
|
|
| |
(cherry picked from commit 20fd994c5c8bda4ea9f2b56cf3a83c15057a547f)
|
|
|
|
| |
(cherry picked from commit fd4e9e84cde35ac4c763178521b7c2c5d5fe4b4f)
|
|
|
|
| |
(cherry picked from commit 4b89d92dbdbf8c7641b324c4c04b159ccc0faf09)
|
|
|
|
| |
(cherry picked from commit 71a09d47d591633bc46e5012377dc29f7b3d4cc3)
|
|
|
|
| |
(cherry picked from commit 93d3cb4704af1537ff3230ddccdd5868c5e0114d)
|
|
|
|
|
|
|
|
|
|
|
|
| |
g_key_file_get_boolean() only accepts lower case "true" and "false", so
correct some instances of "False" in key files. This makes no functional
difference as long as the error pointer isn't checked since
g_key_file_get_boolean() also returns false when it can't parse the
value as a boolean. But it still seems good to be correct, and someone
could interpret the existence of "IsRuntime=False" as implying that
"IsRuntime=True" will work, which it doesn't.
(cherry picked from commit b0981912520de706f1e20993f3486ce83cd5787a)
|
|
|
|
| |
(cherry picked from commit f94721bef2327f9d6b4517da9a438084ea99726f)
|
|\
| |
| | |
Update Polish translation 211017 for flatpak-1.12.x
|
|/ |
|
| |
|
|
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|