public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
@ 2014-04-13  0:18 naota
  2014-04-13  0:40 ` hasufell
  2014-07-31 10:21 ` [gentoo-dev] " Mike Frysinger
  0 siblings, 2 replies; 9+ messages in thread
From: naota @ 2014-04-13  0:18 UTC (permalink / raw
  To: constanze, base-system; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

fcaps.eclass is using group name 'root' which is not available on BSD
system. Instead you can use "0", or $(id -g -n 0) if you'd prefer "group
name"

Index: fcaps.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v
retrieving revision 1.8
diff -u -r1.8 fcaps.eclass
--- fcaps.eclass	27 Jun 2013 01:18:57 -0000	1.8
+++ fcaps.eclass	13 Apr 2014 00:16:44 -0000
@@ -80,7 +80,7 @@
 
 	# Process the user options first.
 	local owner='root'
-	local group='root'
+	local group=$(id -g -n 0)
 	local mode='4711'
 	local caps_mode='711'
 

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
  2014-04-13  0:18 [gentoo-dev] [PATCH] fcaps.eclass: Group name portability naota
@ 2014-04-13  0:40 ` hasufell
  2014-04-13  6:29   ` Diego Elio Pettenò
  2014-04-15  2:10   ` Naohiro Aota
  2014-07-31 10:21 ` [gentoo-dev] " Mike Frysinger
  1 sibling, 2 replies; 9+ messages in thread
From: hasufell @ 2014-04-13  0:40 UTC (permalink / raw
  To: gentoo-dev

naota@gentoo.org:
> fcaps.eclass is using group name 'root' which is not available on BSD
> system. Instead you can use "0", or $(id -g -n 0) if you'd prefer "group
> name"
> 
> Index: fcaps.eclass
> ===================================================================
> RCS file: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v
> retrieving revision 1.8
> diff -u -r1.8 fcaps.eclass
> --- fcaps.eclass	27 Jun 2013 01:18:57 -0000	1.8
> +++ fcaps.eclass	13 Apr 2014 00:16:44 -0000
> @@ -80,7 +80,7 @@
>  
>  	# Process the user options first.
>  	local owner='root'
> -	local group='root'
> +	local group=$(id -g -n 0)
>  	local mode='4711'
>  	local caps_mode='711'
>  
> 

# id -g -n 0
id: 0: no such user


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
  2014-04-13  0:40 ` hasufell
@ 2014-04-13  6:29   ` Diego Elio Pettenò
  2014-04-15  2:11     ` Naohiro Aota
  2014-04-15  2:10   ` Naohiro Aota
  1 sibling, 1 reply; 9+ messages in thread
From: Diego Elio Pettenò @ 2014-04-13  6:29 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

I'm pretty sure we have an eclass function to get the name of the 0 group.
On 12 Apr 2014 17:41, "hasufell" <hasufell@gentoo.org> wrote:

> naota@gentoo.org:
> > fcaps.eclass is using group name 'root' which is not available on BSD
> > system. Instead you can use "0", or $(id -g -n 0) if you'd prefer "group
> > name"
> >
> > Index: fcaps.eclass
> > ===================================================================
> > RCS file: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v
> > retrieving revision 1.8
> > diff -u -r1.8 fcaps.eclass
> > --- fcaps.eclass      27 Jun 2013 01:18:57 -0000      1.8
> > +++ fcaps.eclass      13 Apr 2014 00:16:44 -0000
> > @@ -80,7 +80,7 @@
> >
> >       # Process the user options first.
> >       local owner='root'
> > -     local group='root'
> > +     local group=$(id -g -n 0)
> >       local mode='4711'
> >       local caps_mode='711'
> >
> >
>
> # id -g -n 0
> id: 0: no such user
>
>

[-- Attachment #2: Type: text/html, Size: 1447 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
  2014-04-13  0:40 ` hasufell
  2014-04-13  6:29   ` Diego Elio Pettenò
@ 2014-04-15  2:10   ` Naohiro Aota
  1 sibling, 0 replies; 9+ messages in thread
From: Naohiro Aota @ 2014-04-15  2:10 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

hasufell <hasufell@gentoo.org> writes:

> naota@gentoo.org:
>> fcaps.eclass is using group name 'root' which is not available on BSD
>> system. Instead you can use "0", or $(id -g -n 0) if you'd prefer "group
>> name"
>> 
>> Index: fcaps.eclass
>> ===================================================================
>> RCS file: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v
>> retrieving revision 1.8
>> diff -u -r1.8 fcaps.eclass
>> --- fcaps.eclass	27 Jun 2013 01:18:57 -0000	1.8
>> +++ fcaps.eclass	13 Apr 2014 00:16:44 -0000
>> @@ -80,7 +80,7 @@
>>  
>>  	# Process the user options first.
>>  	local owner='root'
>> -	local group='root'
>> +	local group=$(id -g -n 0)
>>  	local mode='4711'
>>  	local caps_mode='711'
>>  
>> 
>
> # id -g -n 0
> id: 0: no such user

Strange. Is this busybox id? /usr/bin/id from both sys-apps/coreutils (Linux)
and sys-freebsd/freebsd-ubin (FreeBSD) just worked fine for me.


[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
  2014-04-13  6:29   ` Diego Elio Pettenò
@ 2014-04-15  2:11     ` Naohiro Aota
  2014-04-15  7:48       ` Cyprien Nicolas
  2014-04-15  8:06       ` Alexander Tsoy
  0 siblings, 2 replies; 9+ messages in thread
From: Naohiro Aota @ 2014-04-15  2:11 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

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)"

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
  2014-04-15  2:11     ` Naohiro Aota
@ 2014-04-15  7:48       ` Cyprien Nicolas
  2014-04-15  8:06       ` Alexander Tsoy
  1 sibling, 0 replies; 9+ messages in thread
From: Cyprien Nicolas @ 2014-04-15  7:48 UTC (permalink / raw
  To: gentoo-dev

Il y a 5 heures et 36 minutes, Naohiro Aota écrivit :
> 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)"

user.eclass provides egetent

  egetent group 0

should give you the same output as $ getent group 0 | cut -d: -f1

-- 
Cyprien Nicolas (Fulax)
Gentoo Lisp project contrib


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
  2014-04-15  2:11     ` Naohiro Aota
  2014-04-15  7:48       ` Cyprien Nicolas
@ 2014-04-15  8:06       ` Alexander Tsoy
  2014-04-15  8:13         ` Alexander Tsoy
  1 sibling, 1 reply; 9+ messages in thread
From: Alexander Tsoy @ 2014-04-15  8:06 UTC (permalink / raw
  To: gentoo-dev

В 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.

-- 
Alexander Tsoy


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
  2014-04-15  8:06       ` Alexander Tsoy
@ 2014-04-15  8:13         ` Alexander Tsoy
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Tsoy @ 2014-04-15  8:13 UTC (permalink / raw
  To: gentoo-dev

В 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-dev] Re: [PATCH] fcaps.eclass: Group name portability
  2014-04-13  0:18 [gentoo-dev] [PATCH] fcaps.eclass: Group name portability naota
  2014-04-13  0:40 ` hasufell
@ 2014-07-31 10:21 ` Mike Frysinger
  1 sibling, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2014-07-31 10:21 UTC (permalink / raw
  To: naota; +Cc: constanze, base-system, gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

On Sun 13 Apr 2014 09:18:35 naota@gentoo.org wrote:
> fcaps.eclass is using group name 'root' which is not available on BSD
> system. Instead you can use "0", or $(id -g -n 0) if you'd prefer "group
> name"

there's no need for `id` shenanigans ... using a plain 0 is fine

http://sources.gentoo.org/eclass/fcaps.eclass?r1=1.9&r2=1.10
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-07-31 10:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-13  0:18 [gentoo-dev] [PATCH] fcaps.eclass: Group name portability naota
2014-04-13  0:40 ` hasufell
2014-04-13  6:29   ` Diego Elio Pettenò
2014-04-15  2:11     ` Naohiro Aota
2014-04-15  7:48       ` Cyprien Nicolas
2014-04-15  8:06       ` Alexander Tsoy
2014-04-15  8:13         ` Alexander Tsoy
2014-04-15  2:10   ` Naohiro Aota
2014-07-31 10:21 ` [gentoo-dev] " Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox