Skip to content

Flatpak 1.4 backports - #3111

Merged
alexlarsson merged 14 commits into
flatpak:flatpak-1.4.xfrom
alexlarsson:flatpak-1.4-backports
Sep 18, 2019
Merged

alexlarsson merged 14 commits into
flatpak:flatpak-1.4.xfrom
alexlarsson:flatpak-1.4-backports

Conversation

@alexlarsson

Copy link
Copy Markdown
Member

No description provided.

smcv and others added 10 commits September 18, 2019 09:46
This works around an old polkit client library bug which would cause
a segfault in this situation. The bug was fixed long ago in upstream
polkit, but is still present in Debian 10 'buster', Ubuntu 19.04 'disco'
and all older releases, due to Debian/Ubuntu using a branch of polkit
to avoid the mozjs dependency. It should finally get fixed in Debian 11
and Ubuntu 19.10.

Signed-off-by: Simon McVittie <[email protected]>
Bug-Debian: https://bugs.debian.org/923046

Closes: flatpak#2997
Approved by: matthiasclasen

(cherry picked from commit 75b5b7c)
…_install_bundle()

Signed-off-by: Andre Moreira Magalhaes <[email protected]>

Closes: flatpak#3025
Approved by: matthiasclasen

(cherry picked from commit 37a7b6e)
It's an error to call g_set_error() on an error that's already set, and
flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED
for us when necessary, so just pass on any errors to the caller of
flatpak_dir_get_origin(). In the case that the error is something else,
that should be treated as an error, because we never expect the deploy
directory to exist but not have a deploy file (see the implementations
of flatpak_dir_deploy() and flatpak_dir_undeploy()).

Closes: flatpak#3032
Approved by: alexlarsson

(cherry picked from commit b44c1a5)
Unfortunately in commit 253fcc6 I broke the build-bundle command so
that it is unable to resolve remote refs (as opposed to local ones).
This means in the normal case of building a bundle for an app installed
from a remote it fails:

$ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable
error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found

This is because flatpak_repo_resolve_rev() interprets a NULL remote name
to mean the ref is local (in refs/heads/) but in this case we just don't
know which remote it's from. This commit fixes the issue by using
ostree_repo_resolve_rev() directly which searches refs/heads/ and
refs/remotes/, and if that fails falling back to iterating over refs
returned by ostree_repo_list_collection_refs() to catch collection-refs
that may be in refs/mirrors/.

Also, add a unit test that fails without this patch.

Fixes flatpak#3026

Closes: flatpak#3032
Approved by: alexlarsson

(cherry picked from commit 5e65174)
If the download URL for an icon was already cached locally, the HTTP
code returned FLATPAK_OCI_ERROR_NOT_CHANGED - this was treated as a real
error, and after downloading missing icons, all present icons were
deleted!

See https://bugzilla.redhat.com/show_bug.cgi?id=1683375

Closes: flatpak#3048
Approved by: alexlarsson

(cherry picked from commit a794c07)
This prevents a crash in flatpak_installation_list_remotes_by_type() if
the `FlatpakDir` can’t ensure it has a repo configured.

Signed-off-by: Philip Withnall <[email protected]>

Closes: flatpak#3028
Approved by: alexlarsson

(cherry picked from commit 791f318)
This puts the checksum autoptr in the inner scope of the loop where
it gets assigned to avoid leaking all but the last iteration value.

Closes: flatpak#3093
Approved by: mwleeds

(cherry picked from commit ca72dd5)
We were only handling the old single-value 'version' key, even though
we handled the 'versions' key when finding remote related refs.

The result of this was that some extensions, such as the 19.08 opengl
default one was installed by default (as it was found as remote related)
yet still removed with --unused (as it was not locally related).

Fixes flatpak#3004

Closes: flatpak#3093
Approved by: mwleed

(manually cherry-picked from commit e4b1d16)
Currently if you have a remote configured with the URL
"https://dl.flathub.org/repo/" (as you would if you use the flatpakrepo
file) and you use a flatpakref file which specifies the URL
"https://dl.flathub.org/repo", Flatpak tries to add a duplicate remote
because it doesn't see those URLs as equal. So ignore the trailing slash
when comparing remote URLs. OSTree works equally well with both kinds
(it uses g_build_filename()).

Flathub served flatpakref files with URLs missing a trailing slash until
this commit:
flathub-infra/ansible@b20694f09

Also, add a unit test that fails without this patch.

Fixes flatpak#2979

Closes: flatpak#3065
Approved by: alexlarsson

(cherry picked from commit af4504c)
The iovec write_vecs[] array on the stack was just 2 element, but we
sometimes use 3 elements of it. This was causing random crashes due to
corrupting the stack.

Closes: flatpak#3110
Approved by: alexlarsson

(cherry picked from commit 84e7b19)
@alexlarsson

Copy link
Copy Markdown
Member Author

@rh-atomic-bot r+

@rh-atomic-bot

Copy link
Copy Markdown

📌 Commit 6c2b565 has been approved by alexlarsson

@rh-atomic-bot

Copy link
Copy Markdown

⌛ Testing commit 6c2b565 with merge b5d1151...

rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
This works around an old polkit client library bug which would cause
a segfault in this situation. The bug was fixed long ago in upstream
polkit, but is still present in Debian 10 'buster', Ubuntu 19.04 'disco'
and all older releases, due to Debian/Ubuntu using a branch of polkit
to avoid the mozjs dependency. It should finally get fixed in Debian 11
and Ubuntu 19.10.

Signed-off-by: Simon McVittie <[email protected]>
Bug-Debian: https://bugs.debian.org/923046

Closes: #2997
Approved by: matthiasclasen

(cherry picked from commit 75b5b7c)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
…_install_bundle()

Signed-off-by: Andre Moreira Magalhaes <[email protected]>

Closes: #3025
Approved by: matthiasclasen

(cherry picked from commit 37a7b6e)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
It's an error to call g_set_error() on an error that's already set, and
flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED
for us when necessary, so just pass on any errors to the caller of
flatpak_dir_get_origin(). In the case that the error is something else,
that should be treated as an error, because we never expect the deploy
directory to exist but not have a deploy file (see the implementations
of flatpak_dir_deploy() and flatpak_dir_undeploy()).

Closes: #3032
Approved by: alexlarsson

(cherry picked from commit b44c1a5)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
Unfortunately in commit 253fcc6 I broke the build-bundle command so
that it is unable to resolve remote refs (as opposed to local ones).
This means in the normal case of building a bundle for an app installed
from a remote it fails:

$ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable
error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found

This is because flatpak_repo_resolve_rev() interprets a NULL remote name
to mean the ref is local (in refs/heads/) but in this case we just don't
know which remote it's from. This commit fixes the issue by using
ostree_repo_resolve_rev() directly which searches refs/heads/ and
refs/remotes/, and if that fails falling back to iterating over refs
returned by ostree_repo_list_collection_refs() to catch collection-refs
that may be in refs/mirrors/.

Also, add a unit test that fails without this patch.

Fixes #3026

Closes: #3032
Approved by: alexlarsson

(cherry picked from commit 5e65174)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
If the download URL for an icon was already cached locally, the HTTP
code returned FLATPAK_OCI_ERROR_NOT_CHANGED - this was treated as a real
error, and after downloading missing icons, all present icons were
deleted!

See https://bugzilla.redhat.com/show_bug.cgi?id=1683375

Closes: #3048
Approved by: alexlarsson

(cherry picked from commit a794c07)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
This prevents a crash in flatpak_installation_list_remotes_by_type() if
the `FlatpakDir` can’t ensure it has a repo configured.

Signed-off-by: Philip Withnall <[email protected]>

Closes: #3028
Approved by: alexlarsson

(cherry picked from commit 791f318)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
This puts the checksum autoptr in the inner scope of the loop where
it gets assigned to avoid leaking all but the last iteration value.

Closes: #3093
Approved by: mwleeds

(cherry picked from commit ca72dd5)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
We were only handling the old single-value 'version' key, even though
we handled the 'versions' key when finding remote related refs.

The result of this was that some extensions, such as the 19.08 opengl
default one was installed by default (as it was found as remote related)
yet still removed with --unused (as it was not locally related).

Fixes #3004

Closes: #3093
Approved by: mwleed

(manually cherry-picked from commit e4b1d16)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
Currently if you have a remote configured with the URL
"https://dl.flathub.org/repo/" (as you would if you use the flatpakrepo
file) and you use a flatpakref file which specifies the URL
"https://dl.flathub.org/repo", Flatpak tries to add a duplicate remote
because it doesn't see those URLs as equal. So ignore the trailing slash
when comparing remote URLs. OSTree works equally well with both kinds
(it uses g_build_filename()).

Flathub served flatpakref files with URLs missing a trailing slash until
this commit:
flathub-infra/ansible@b20694f09

Also, add a unit test that fails without this patch.

Fixes #2979

Closes: #3065
Approved by: alexlarsson

(cherry picked from commit af4504c)

Closes: #3111
Approved by: alexlarsson
rh-atomic-bot pushed a commit that referenced this pull request Sep 18, 2019
The iovec write_vecs[] array on the stack was just 2 element, but we
sometimes use 3 elements of it. This was causing random crashes due to
corrupting the stack.

Closes: #3110
Approved by: alexlarsson

(cherry picked from commit 84e7b19)

Closes: #3111
Approved by: alexlarsson
@alexlarsson

Copy link
Copy Markdown
Member Author

Hmm. I think we need the multi-version requirements i'm working on too.

@alexlarsson

Copy link
Copy Markdown
Member Author

i.e. we want this too: #3112

This sets required-flatpak in the metadata to some different versions
and ensure we're properly able or not able to install it.

Additionally it uses some options with multiple versions. This is not
yet supported but I want to test the existing code and make sure it
properly falls back to just using the first element of the list.

Closes: flatpak#3112
Approved by: alexlarsson

(cherry picked from commit 6211730)
Support a list of versions that are supported. This will be useful
for e.g. the extra_data for extensions once that is backported to
1.2, because that will require it to say that it is supported for
> 1.2.5 in the 1.2 series and > 1.4.2 otherwise.

Closes: flatpak#3112
Approved by: alexlarsson

(cherry picked from commit 5026f01)
@alexlarsson
alexlarsson merged commit 9bbe6fb into flatpak:flatpak-1.4.x Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants