Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 673888 - REQUEST: Function pkg_setup to support non-root.
Summary: REQUEST: Function pkg_setup to support non-root.
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL: https://github.com/RXT067/KGGO/tree/m...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-28 13:32 UTC by Jakub Hrbek
Modified: 2018-12-28 20:21 UTC (History)
0 users

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 Jakub Hrbek 2018-12-28 13:32:57 UTC
i've made this ebuild: https://github.com/RXT067/KGGO/blob/master/games-moba/leagueoflegends/leagueoflegends-4933455.ebuild which is able to install League Of Legends through portage.

I was able to workaround most of the issues resulting in League Of Legends running on what i believe is platinum with performance hit, but i'm unable to make it secure meaning that pkg_setup function is unable to use non-root (https://i.imgur.com/R3ilaRS.png).

I would like to request this feature to be implemented in pkg_setup function which would allow safe wineapp development in portage.

My abstract is to make using wineapps on gentoo easier and more effective using portage.

For bug wranglers: Recommended severity: Critical/Blocker - Is security hazard and complicates wineapp development on portage.

Reproducible: Always

Steps to Reproduce:
1. Add mensioned (dangerous) ebuild in your local overlay
2. Manifest it using `ebuild leagueoflegends...ebuild digest`
3. invoke `emerge leagueoflegends`
Actual Results:  
Portage emerges leagueoflegends with custom WINEPREFIX (WINE) as root which runs on platinum with performance hit using workarounds.

Expected Results:  
Install any wineapp on Gentoo that works on platinum with no issues that would prevent using the wineapp OOTB.

Using PlayOnLinux is uneffective since it seems to be unmaintained (based on my experience) and it's installers rarely works + is unable to make custom wine/patches to packages as good as portage.

Using lutris is impossible since maintainer is 'fixing' bugs that are only present on ubuntu and core implementation of lutris usually causes more random issues.

More info: https://github.com/RXT067/Research/tree/master/WINE-Dishonored2
Comment 1 Zac Medico gentoo-dev 2018-12-28 15:18:43 UTC
The src_unpack function is non-root. Maybe the leagueoflegends ebuilds can use src_unpack instead of pkg_setup, like this:

src_unpack() {
    default
    install_wine
}
Comment 2 Jakub Hrbek 2018-12-28 15:28:14 UTC
(In reply to Zac Medico from comment #1)
> The src_unpack function is non-root. Maybe the leagueoflegends ebuilds can
> use src_unpack instead of pkg_setup, like this:
> 
> src_unpack() {
>     default
>     install_wine
> }

using src_* results in error for wine https://paste.pound-python.org/show/7wSqPPauklg8C7mVXhwR/
Comment 3 Mike Gilbert gentoo-dev 2018-12-28 17:36:56 UTC
Doing everything in pkg_setup is not really how ebuilds are intended to be used. I don't think it makes sense to extend portage here.

That said, you do have full root privileges, including the ability to call setuid() to change the active user id.

For example, you might create a new, unprivileged user via "enewuser" in user.eclass, and then switch to that user using the "setpriv" command.
Comment 4 Jakub Hrbek 2018-12-28 20:21:03 UTC
(In reply to Mike Gilbert from comment #3)
> Doing everything in pkg_setup is not really how ebuilds are intended to be
> used. I don't think it makes sense to extend portage here.

Ideally i would like to use some "official gentoo way" to include this feature, but to my knowledge that is not possible at the moment. 

I'm aware that portage is not designed for this usecase, but even then it's already better then POL/Lutris for this usecase and it offers making custom wine patches + suggested feature would allow further functionality.

> That said, you do have full root privileges, including the ability to call
> setuid() to change the active user id.
> 
> For example, you might create a new, unprivileged user via "enewuser" in
> user.eclass, and then switch to that user using the "setpriv" command.

I've created this forum post https://forums.gentoo.org/viewtopic-t-1090988.html (to keep the bug related) can you provide more informations to setupid() ? Will investigate for possible workarounds.