Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 707508 - acct-group.eclass: ACCT_GROUP_ID=-1 doesn't work with enewgroup
Summary: acct-group.eclass: ACCT_GROUP_ID=-1 doesn't work with enewgroup
Status: RESOLVED FIXED
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:
Depends on:
Blocks:
 
Reported: 2020-01-30 19:46 UTC by adebeus
Modified: 2020-02-26 10:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Error log (acct-group-dynamic-error.log,4.68 KB, text/x-log)
2020-01-30 19:46 UTC, adebeus
Details
0001-user.eclass-enewgroup-allow-1-as-gid.patch (0001-user.eclass-enewgroup-allow-1-as-gid.patch,1.06 KB, patch)
2020-01-31 14:58 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description adebeus 2020-01-30 19:46:25 UTC
Created attachment 609378 [details]
Error log

The acct-group eclass is supposed to accept "-1" as a value for ACCT_GROUP_ID that will cause the group ID to be dynamically allocated, according to the documentation (https://devmanual.gentoo.org/eclass-reference/acct-group.eclass/index.html). But it doesn't work - acct-group_pkg_pretend completes successfully because it has a "[[ ${ACCT_GROUP_ID} -eq -1 ]] && return" line, but acct-group_pkg_preinst fails because it tries to pass -1 as a GID to enewgroup, which dies because -1 is an invalid GID. Log is attached.

To fix this, either acct-group should pass something different to enewgroup instead of -1 or user.eclass should be fixed to make enewgroup handle this case.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-01-31 14:58:43 UTC
Created attachment 609514 [details, diff]
0001-user.eclass-enewgroup-allow-1-as-gid.patch

Could you try the attached patch?  I've copied the code from enewuser but I can't test it right now.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-02-14 14:41:50 UTC
Ping.
Comment 3 Larry the Git Cow gentoo-dev 2020-02-26 10:28:39 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9370ca73534408e928474c4a808eb04051e435d3

commit 9370ca73534408e928474c4a808eb04051e435d3
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2020-01-31 14:56:48 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-02-26 10:28:27 +0000

    user.eclass: enewgroup, allow -1 as gid
    
    Allow using '-1' to specify 'next free GID' for enewgroup.  While
    technically this can already be specified by omitting gid, allowing -1
    improves consistency with enewuser.
    
    Closes: https://bugs.gentoo.org/707508
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/user.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)