Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 850634 - acct-user.eclass: RDEPEND on a shell when ACCT_USER_SHELL is set.
Summary: acct-user.eclass: RDEPEND on a shell when ACCT_USER_SHELL is set.
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
: 855485 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-06-08 14:20 UTC by Kobboi
Modified: 2023-01-20 02:06 UTC (History)
4 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 Kobboi 2022-06-08 14:20:00 UTC
Some acct-user/* packages set ACCT_USER_SHELL but do not RDEPEND on the package providing that shell. Maybe not obvious for /bin/sh (or do we have some virtual for shells?) but at least the ones that set the value to /bin/bash should depend on bash.

Might also be considered an issue with the packages in question instead of the eclass, not sure.

I am hitting this when trying to install packages with portage to a directory using ROOT=somedir, which I hope you consider to be a valid use case.

Reproducible: Always
Comment 1 Kobboi 2022-06-08 14:20:57 UTC
>>> Installing (214 of 2904) acct-user/git-0-r2::gentoo to /home/christophe/Projects/gentoo/app-misc/tracker/rootfs/
 * checking 2 files for package collisions
>>> Merging acct-user/git-0-r2 to /home/christophe/Projects/gentoo/app-misc/tracker/rootfs/
 * Adding user 'git' to your system ...
 *  - Userid: 196
 * A shell was specified but it does not exist!
Comment 2 Mike Gilbert gentoo-dev 2022-06-08 20:57:07 UTC
I think it would make more sense for individual user packages to put the relevant package in RDEPEND.

To do it in the eclass, we would need to maintain some kind of mapping from known ACCT_USER_SHELL values to package names.
Comment 3 Mike Gilbert gentoo-dev 2022-06-08 21:03:15 UTC
We have 3 existing values for SHELL in the gentoo repo:

/sbin/nologin (the default)
/bin/bash
/bin/sh

sys-apps/shadow provides /sbin/nologin.
app-shells/bash provides both /bin/bash and /bin/sh.

Both packages are in @system, so an explicit dependency on them is not strictly necessary.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-06-09 04:51:57 UTC
I'm afraid this is not technically feasible within the framework.  ACCT_USER_SHELL is not a pre-inherit variable, and I don't think changing it at this point is really worth the effort, given that the need for any special need here is extremely rare.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-01 07:37:24 UTC
*** Bug 855485 has been marked as a duplicate of this bug. ***
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-01 07:38:01 UTC
I think we should probably make it a pre-inherit variable. Having to accumulate hacks for new ROOTs and such is a pain.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-01 07:38:38 UTC
(In reply to Sam James from comment #6)
> I think we should probably make it a pre-inherit variable. Having to
> accumulate hacks for new ROOTs and such is a pain.

... that is, we can change it, fix ebuilds in ::gentoo, and if ebuilds don't work correctly in overlays, then that's the same as plenty of other pre-inherit violations.