Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 312809

Summary: mysql.eclass - testing UID in pkg_setup() does not work as intended
Product: Gentoo Linux Reporter: Jeroen Roovers (RETIRED) <jer>
Component: EclassesAssignee: Gentoo Linux MySQL bugs team <mysql-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: kanelxake
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Simple ebuild for a test case

Description Jeroen Roovers (RETIRED) gentoo-dev 2010-04-02 13:50:44 UTC
This bit of code doesn't seem to work as intended:

mysql_pkg_setup() {
[...]
            if [[ $UID -eq 0 ]]; then
                eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
            fi
[...]
}

A simplified ebuild example, attached shortly, shows me this:


elmer /keeps/gentoo/local/app-portage/foobar # FEATURES=userpriv ebuild foobar-0.ebuild setup
 * CPV:  app-portage/foobar-0
 * REPO: JeR
 * USE:  elibc_glibc hppa kernel_linux test userland_GNU
root
elmer /keeps/gentoo/local/app-portage/foobar # FEATURES=-userpriv ebuild foobar-0.ebuild setup
 * CPV:  app-portage/foobar-0
 * REPO: JeR
 * USE:  elibc_glibc hppa kernel_linux test userland_GNU
root


Doing su to an unprivileged user does work in pkg_setup():


elmer /keeps/gentoo/local/app-portage/foobar # su jeroen -c 'ebuild foobar-0.ebuild setup'
 * CPV:  app-portage/foobar-0
 * REPO: JeR
 * USE:  elibc_glibc hppa kernel_linux test userland_GNU
jeroen


I've tested this with both =sys-apps/portage-2.1.8.3 and =sys-apps/portage-2.2_rc67.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-04-02 13:51:23 UTC
Created attachment 226275 [details]
Simple ebuild for a test case
Comment 2 Xake 2010-04-16 04:48:43 UTC
Nope, this does not work. Easy way to test: 

USE="-minimal" FEATURES="-userpriv test" emerge mysql

This will die because of a UID check, but not until src_test().
I actually came to bugreport that it did not die until after compilation was done.
Comment 3 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2012-01-06 15:27:50 UTC
I've asked Zac about this and changed the test in the mysql-v2.eclass of the mysql overlay[1]. This should now be fixed.

 [1] - http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commitdiff;h=6293a42a24cdf94936a87c1c9b26b699ac8c9157
Comment 4 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2012-01-06 21:44:07 UTC
I've moved the eclasses to the tree, so I'm closing this as fixed.
Please reopen if it fails for you.