Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 796815 - app-admin/github-backup-utils[test]: leaks systemd service stop requests to system
Summary: app-admin/github-backup-utils[test]: leaks systemd service stop requests to s...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-20 07:40 UTC by Michał Górny
Modified: 2024-06-18 15:31 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-06-20 07:40:51 UTC
While running the test suite, I repeatedly get a GUI window asking me for root password in order to 'stop consul.service'.  Sounds like a major command leak. 
 Not that I'm running such a service.
Comment 1 Mike Gilbert gentoo-dev 2021-06-20 15:40:22 UTC
Several tests call "ghe-restore", which calls "ssh ... sudo systemctl stop consul".

https://github.com/github/backup-utils/blob/v3.0.0/bin/ghe-restore#L301

As well, the tests use a wrapper script for ssh that removes any "sudo" calls and runs the commands locally.

https://github.com/github/backup-utils/blob/v3.0.0/test/bin/ssh#L37

The end result is that "systemctl stop consul" gets executed directly as the portage user, which triggers a polkit prompt if portage is not running as root.
Comment 2 Mike Gilbert gentoo-dev 2021-06-20 15:46:05 UTC
ghe-restore attempts to perform many privileged operations, and it doesn't look like it was really designed for use in an isolated test environment.

I would recommend masking the test USE flag until/unless the tests can be made more safe for general use.
Comment 3 Pacho Ramos gentoo-dev 2024-06-18 14:45:01 UTC
Other tests are still failing but, at least, they don't seem to end up asking for privileges in my system with 3.8.0 version
Comment 4 Larry the Git Cow gentoo-dev 2024-06-18 15:31:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ae704d20ec8a0bac6662a527c909a56d36de8af

commit 6ae704d20ec8a0bac6662a527c909a56d36de8af
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2024-06-18 15:30:26 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2024-06-18 15:30:26 +0000

    app-admin/github-backup-utils:
    
    The tests are meant to be run in an isolated environment, so restrict
    them.
    This also removes the need for python.
    
    Closes: https://bugs.gentoo.org/796815
    Closes: https://bugs.gentoo.org/929273
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 app-admin/github-backup-utils/github-backup-utils-3.12.3.ebuild | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)