Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 264519 - eutils.eclass: make enewuser/enewgroup use --system for system accounts with newer shadow package versions
Summary: eutils.eclass: make enewuser/enewgroup use --system for system accounts with ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 279608 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-01 15:25 UTC by Wolfram Schlich (RETIRED)
Modified: 2011-06-18 03:50 UTC (History)
7 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 Wolfram Schlich (RETIRED) gentoo-dev 2009-04-01 15:25:51 UTC
newer shadow packages have this option for useradd:
--8<--
-r, --system
    Create a system account.

    System users will be created with no aging information in /etc/shadow,
    and their numeric identifiers are choosen in the SYS_UID_MIN-SYS_UID_MAX
    range, defined in login.defs, instead of UID_MIN-UID_MAX (and their GID
    counterparts for the creation of groups).
--8<--

...and groupadd:

--8<--
-r, --system
    Create a system group.

    The numeric identifiers of new system groups are choosen in the
    SYS_GID_MIN-SYS_GID_MAX range, defined in login.defs, instead of
    GID_MIN-GID_MAX.
--8<--

finally, this allows one to have distinct ID ranges for accounts
created for system users/groups (e.g. created by portage) and for
manually created accounts (e.g. for human users).

the corresponding defaults in /etc/login.defs are:
--8<--
#
# Min/max values for automatic uid selection in useradd
#
UID_MIN                  1000
UID_MAX                 60000
# System accounts
SYS_UID_MIN               100
SYS_UID_MAX               999

#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN                  1000
GID_MAX                 60000
# System accounts
SYS_GID_MIN               100
SYS_GID_MAX               999
--8<--

please make enewuser/enewgroup from eutils.eclass support
those system accounts with those later shadow packages.
thanks!
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-04-01 22:23:06 UTC
That would be a quite handy enhancement IMHO.
Comment 2 Wolfram Schlich (RETIRED) gentoo-dev 2009-04-24 09:56:12 UTC
any news on this one? :)
Comment 3 Evert 2009-08-06 10:29:46 UTC
There's a patch in bug #262559 which allows enewgroup to use SYS_GID_MIN/MAX.

Unfortunately, this patch is lost after every sync so to implement this patch, one could write a simple script including the following commands until the patch is in portage:

emerge --sync
patch --forward -d /usr/portage/eclass < /path/to/eutils.patch

I use it all the time!
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2009-08-06 11:14:38 UTC
(In reply to comment #3)
> There's a patch in bug #262559 which allows enewgroup to use SYS_GID_MIN/MAX.
> 
> Unfortunately, this patch is lost after every sync so to implement this patch,
> one could write a simple script including the following commands until the
> patch is in portage:
> 
> emerge --sync
> patch --forward -d /usr/portage/eclass < /path/to/eutils.patch
> 
> I use it all the time!
> 

Bad idea.

That's not how you use a modified eclass. Instead you copy it to overlay, edit it, and set FEATURES="metadata-transfer" for it to be in effect.
Comment 5 Evert 2009-09-02 10:10:15 UTC
I applied the patch in portage overlay, now I know how you use a modified eclass, thanx!

Now I have another problem, because I see eutils.eclass has been changed (the function epatch_user has been added) so I had to patch this one in overlay again.

Now my question, is there any news on this bug?
I'm asking because otherwise I find myself monitoring changes in eutils.eclass and re-applying the patch in overlay everytime eutils.eclass has been changed...
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2010-06-24 22:21:50 UTC
This is fixed in the tree.
Comment 7 SpanKY gentoo-dev 2011-06-18 03:50:15 UTC
*** Bug 279608 has been marked as a duplicate of this bug. ***