Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915842 - sys-apps/portage-9999 with app-portage/getuto-1.9.1: breaks --pretend
Summary: sys-apps/portage-9999 with app-portage/getuto-1.9.1: breaks --pretend
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, PullRequest
Depends on: 916256
Blocks:
  Show dependency tree
 
Reported: 2023-10-16 07:35 UTC by Nowa Ammerlaan
Modified: 2024-01-02 04:46 UTC (History)
1 user (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 Nowa Ammerlaan gentoo-dev 2023-10-16 07:35:24 UTC
When calling emerge with --pretend as an unprivileged user, a fatal error occurs because emerge tries to run getuto but this can only be run as root.

andrew@andrew-gentoo-pc ~ % emerge -pv --verbose-conflicts thunderbird
zsh: correct 'thunderbird' to '.thunderbird' [nyae]? n
/usr/bin/getuto must be run as root!
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.11/emerge", line 59, in <module>
retval = emerge_main()
^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/_emerge/main.py", line 1306, in emerge_main
return run_action(emerge_config)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 3476, in run_action
mytrees["bintree"].populate(
File "/usr/lib/python3.11/site-packages/portage/dbapi/bintree.py", line 880, in populate
self._populate_remote(getbinpkg_refresh=getbinpkg_refresh)
File "/usr/lib/python3.11/site-packages/portage/dbapi/bintree.py", line 1281, in _populate_remote
self._run_trust_helper()
File "/usr/lib/python3.11/site-packages/portage/dbapi/bintree.py", line 1270, in _run_trust_helper
ret.check_returncode()
File "/usr/lib/python3.11/subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '/usr/bin/getuto' returned non-zero exit status 100.

Portage should not call getuto if it is called with the --pretend argument.
Comment 1 Larry the Git Cow gentoo-dev 2023-11-06 21:38:44 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=6ae45739e208b7a9d59e0b6056be72a5791aae04

commit 6ae45739e208b7a9d59e0b6056be72a5791aae04
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-11-06 17:07:10 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-06 17:25:04 +0000

    bintree: don't call trust helper with --pretend
    
    Trust helpers are likely to need privileges and it's a bit too far for pretend
    there, I think. People can run it manually if they want it done for them anyway.
    
    We could check writable instead but I'd like to get a fix in for the regression
    first.
    
    Bug: https://bugs.gentoo.org/915842
    Signed-off-by: Sam James <sam@gentoo.org>

 NEWS                                     |  3 +++
 lib/_emerge/actions.py                   |  3 +++
 lib/portage/dbapi/bintree.py             | 14 +++++++++++---
 lib/portage/tests/dbapi/test_bintree.py  |  6 ++++--
 lib/portage/tests/emerge/test_actions.py |  4 +++-
 5 files changed, 24 insertions(+), 6 deletions(-)
Comment 2 Larry the Git Cow gentoo-dev 2023-11-06 21:42:11 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0baf5e0bd0879f55a87111ced2140262dbec689b

commit 0baf5e0bd0879f55a87111ced2140262dbec689b
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-11-06 21:41:33 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-06 21:41:33 +0000

    sys-apps/portage: add 3.0.55
    
    Closes: https://bugs.gentoo.org/916256
    Closes: https://bugs.gentoo.org/915842
    Closes: https://bugs.gentoo.org/916247
    Closes: https://bugs.gentoo.org/916336
    Closes: https://bugs.gentoo.org/916601
    Closes: https://bugs.gentoo.org/916614
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.55.ebuild | 238 +++++++++++++++++++++++++++++++++
 2 files changed, 239 insertions(+)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-11 03:30:50 UTC
PR to add a test as well at https://github.com/gentoo/portage/pull/1179.
Comment 4 Larry the Git Cow gentoo-dev 2023-11-11 07:23:20 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=00ce1c2e21575c6154ce22d0fcf676e2654c56b3

commit 00ce1c2e21575c6154ce22d0fcf676e2654c56b3
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-11-11 03:29:17 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-11 07:23:08 +0000

    tests: test_bintree: add test for trust helper --pretend issue
    
    Followup to 6ae45739e208b7a9d59e0b6056be72a5791aae04.
    
    Bug: https://bugs.gentoo.org/915842
    Signed-off-by: Sam James <sam@gentoo.org>

 lib/portage/tests/dbapi/test_bintree.py | 45 +++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
Comment 5 Larry the Git Cow gentoo-dev 2024-01-02 04:46:15 UTC
The bug has been referenced in the following commit(s):

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

commit b071a966357a29e8450688a28ca918166b9e4eb0
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-01-02 04:00:02 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-02 04:09:56 +0000

    bintree: don't call trust helper unless bindb is writable
    
    Followup to 6ae45739e208b7a9d59e0b6056be72a5791aae04. My qualm there wrt
    writable was whether or not doing something which mutated state (and therefore
    possibly the package list) would be confusing but that doesn't make much sense
    for a few reasons.
    
    Anyway, change the test to be not just for no-pretend, but also whether the
    bindb is writable too, as pretend is already a proxy for whether we may
    not have privileges (I can imagine someone possibly having bindb privileges
    but not /etc/portage/gnupg, so better to just head this off entirely).
    
    Bug: https://bugs.gentoo.org/915842
    Bug: https://bugs.gentoo.org/920180
    Signed-off-by: Sam James <sam@gentoo.org>

 NEWS                         | 3 ++-
 lib/portage/dbapi/bintree.py | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)