Skip to content

common: Better handle NULL collection IDs - #2081

Closed
mwleeds wants to merge 1 commit into
flatpak:masterfrom
mwleeds:fix-empty-collection-id-handling
Closed

mwleeds wants to merge 1 commit into
flatpak:masterfrom
mwleeds:fix-empty-collection-id-handling

Conversation

@mwleeds

@mwleeds mwleeds commented Sep 8, 2018

Copy link
Copy Markdown
Contributor

Currently if you instal from a flatpak bundle that doesn't have a
collection ID set or from a flatpakref file that has the CollectionID
key set to the empty sting, you end up with an invalid configuration on
the origin remote created. This is because the collection_id parameter
of flatpak_dir_create_origin_remote() is set to the empty string, not
NULL, and create_origin_remote_config() then only checks for NULL when
deciding whether to set gpg-verify-summary to true or false. Then
because there's no collection ID configured but gpg-verify-summary is
set to false, you get the error "Can't pull from untrusted non-gpg
verified remote" when trying to pull related refs or update the app.

This commit fixes the bug by checking for the empty string when the
collection ID is read from a bundle or ref file, and collapsing that
into NULL.

Currently if you install from a flatpak bundle that doesn't have a
collection ID set or from a flatpakref file that has the CollectionID
key set to the empty sting, you end up with an invalid configuration on
the origin remote created. This is because the collection_id parameter
of flatpak_dir_create_origin_remote() is set to the empty string, not
NULL, and create_origin_remote_config() then only checks for NULL when
deciding whether to set gpg-verify-summary to true or false. Then
because there's no collection ID configured but gpg-verify-summary is
set to false, you get the error "Can't pull from untrusted non-gpg
verified remote" when trying to pull related refs or update the app.

This commit fixes the bug by checking for the empty string when the
collection ID is read from a bundle or ref file, and collapsing that
into NULL.
@mwleeds
mwleeds force-pushed the fix-empty-collection-id-handling branch from a791997 to 93f88ca Compare September 8, 2018 23:33
@alexlarsson

Copy link
Copy Markdown
Member

@rh-atomic-bot r+

@rh-atomic-bot

Copy link
Copy Markdown

📌 Commit 93f88ca has been approved by alexlarsson

@rh-atomic-bot

Copy link
Copy Markdown

⌛ Testing commit 93f88ca with merge e4befb1...

@rh-atomic-bot

Copy link
Copy Markdown

☀️ Test successful - status-papr
Approved by: alexlarsson
Pushing e4befb1 to master...

@mwleeds
mwleeds deleted the fix-empty-collection-id-handling branch September 12, 2018 17:05
uajain pushed a commit to uajain/flatpak that referenced this pull request Oct 12, 2018
Currently if you install from a flatpak bundle that doesn't have a
collection ID set or from a flatpakref file that has the CollectionID
key set to the empty sting, you end up with an invalid configuration on
the origin remote created. This is because the collection_id parameter
of flatpak_dir_create_origin_remote() is set to the empty string, not
NULL, and create_origin_remote_config() then only checks for NULL when
deciding whether to set gpg-verify-summary to true or false. Then
because there's no collection ID configured but gpg-verify-summary is
set to false, you get the error "Can't pull from untrusted non-gpg
verified remote" when trying to pull related refs or update the app.

This commit fixes the bug by checking for the empty string when the
collection ID is read from a bundle or ref file, and collapsing that
into NULL.

Closes: flatpak#2081
Approved by: alexlarsson
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.

3 participants