Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/repo: Fix multi-signature support when generating summary files #1489

Closed
wants to merge 1 commit into from

Conversation

jeremy-hiatt
Copy link
Contributor

Ensure that the metadata object is built up with the signatures from all keys
passed to ostree_repo_add_gpg_signature_summary(). Previously only the signature
from the last key would end up in the metadata.

Closes: #1488

@rh-atomic-bot
Copy link

Can one of the admins verify this patch?
I understand the following commands:

  • bot, add author to whitelist
  • bot, test pull request
  • bot, test pull request once

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the contribution! Just one comment below, though it's not a new issue so I can take care of it if you prefer.

@@ -4830,10 +4829,10 @@ ostree_repo_add_gpg_signature_summary (OstreeRepo *self,
cancellable, error))
return FALSE;

new_metadata = _ostree_detached_metadata_append_gpg_sig (existing_signatures, signature_data);
metadata = _ostree_detached_metadata_append_gpg_sig (metadata, signature_data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One subtle issue here is that we're leaking the previous value of metadata. Let's tweak it to something like this instead:

g_autoptr(GVariant) old_metadata = g_steal_pointer (&metadata);
metadata = _ostree_detached_metadata_append_gpg_sig (old_metadata, signature_data);

?

Ensure that the metadata object is built up with the signatures from all keys
passed to ostree_repo_add_gpg_signature_summary(). Previously only the signature
from the last key would end up in the metadata.

Closes: ostreedev#1488
@jeremy-hiatt
Copy link
Contributor Author

Hi @jlebon thanks for your feedback. I made the change as you described. Can you please take another look?

@jlebon
Copy link
Member

jlebon commented Mar 8, 2018

Thanks for the patch!
@rh-atomic-bot r+ 5d49262

@rh-atomic-bot
Copy link

⌛ Testing commit 5d49262 with merge 3b7044f...

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: jlebon
Pushing 3b7044f to master...

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