[prev in list] [next in list] [prev in thread] [next in thread]
List: gentoo-dev
Subject: Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
From: Alexander Tsoy <alexander () tsoy ! me>
Date: 2014-04-15 8:13:07
Message-ID: 20140415121307.4a478171 () home ! puleglot
[Download RAW message or body]
В Tue, 15 Apr 2014 12:06:44 +0400
Alexander Tsoy <alexander@tsoy.me> пишет:
> В Tue, 15 Apr 2014 11:11:53 +0900
> Naohiro Aota <naota@gentoo.org> пишет:
>
> > Diego Elio Pettenò <flameeyes@flameeyes.eu> writes:
> >
> > > I'm pretty sure we have an eclass function to get the name of the
> > > 0 group.
> >
> > I can't find one... but found qmail.eclass is using exactly same
> > method.
> >
> > > export GROUP_ROOT="$(id -gn root)"
>
> "id -gn root" prints initial group name of the user root. This is
> exactly what you want in fcaps.eclass. In linux "id" accepts only
> username as argument, it doesn't support uid.
>
But if you really want to convert gid=0 to groupname, then use egetent()
as also noted by Cyprien:
inherit user
...
local group=$(egetent group 0)
group=${group%%:*}
--
Alexander Tsoy
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic