Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 660372 - sys-apps/portage: git sync could abort checkout if signature verification fails
Summary: sys-apps/portage: git sync could abort checkout if signature verification fails
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 240187 659322
  Show dependency tree
 
Reported: 2018-07-04 18:23 UTC by Zac Medico
Modified: 2022-12-17 06:38 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2018-07-04 18:23:41 UTC
Suggested-by: Richard Freeman <rich0@gentoo.org>
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-07-04 20:10:39 UTC
Was thinking of that too but never really had the time to look into implementing it.  One thing that worries me is whether we won't end up breaking some corner case we didn't predict.
Comment 2 Richard Freeman gentoo-dev 2018-07-04 22:41:13 UTC
If the git verify fails, wouldn't the safest approach be to fail safe?  What corner case would have a git verification failure but we'd want to proceed?

It seems like webrsync already does something similar as well...
Comment 3 Zac Medico gentoo-dev 2018-07-05 00:34:59 UTC
(In reply to Michał Górny from comment #1)
> Was thinking of that too but never really had the time to look into
> implementing it.  One thing that worries me is whether we won't end up
> breaking some corner case we didn't predict.

We can add a way to toggle behavior via a repos.conf setting.

(In reply to Richard Freeman from comment #2)
> If the git verify fails, wouldn't the safest approach be to fail safe?

Yes, for safety we really want it to abort by default.
Comment 5 Larry the Git Cow gentoo-dev 2018-07-08 21:17:43 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=3cd8cf93abb6410cc877381531bb662a704dffa7

commit 3cd8cf93abb6410cc877381531bb662a704dffa7
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-07-05 10:10:36 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-07-08 21:16:31 +0000

    GitSync: abort checkout for signature problem (bug 660372)
    
    Fetch the upstream remote and use git merge to update the checkout
    only after successful verification of the upstream head.
    
    Suggested-by: Richard Freeman <rich0@gentoo.org>
    Reviewed-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Bug: https://bugs.gentoo.org/660372

 pym/portage/sync/modules/git/git.py | 39 ++++++++++++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 5 deletions(-)