develooper Front page | perl.perl5.porters | Postings from June 2019

[perl #134194] Cannot assign multiple groups to $EFFECTIVE_GROUP_ID/ $EGID / $)

From:
Tony Cook via RT
Date:
June 13, 2019 05:24
Subject:
[perl #134194] Cannot assign multiple groups to $EFFECTIVE_GROUP_ID/ $EGID / $)
Message ID:
rt-4.0.24-24720-1560403430-1891.134194-15-0@perl.org
On Wed, 12 Jun 2019 17:54:36 -0700, devel@sumpfralle.de wrote:
> The behaviour of "$)" ($EFFECTIVE_GROUP_ID) has changed between 5.28
> and 5.30:
> 
> 
> perl 5.28
> 
> # perl -E 'say $); $)="104 104"; say $); say $! '
> 0 0 1 2 3 4 6 10 11 26 27
> 104 104
> 
> 
> perl 5.30
> 
> # perl -E 'say $); $)="104 104"; say $); say $! '
> 0 0 1 2 3 4 6 10 11 26 27
> 104 0 1 2 3 4 6 10 11 26 27
> Invalid argument
> 
> (example by "bes-internal"; see
> https://github.com/munin-monitoring/munin/issues/1202#issuecomment-
> 501498851)
> 
> 
> Specifying only a single number does not cause an error.
> The man page (perlvar) describes that multiple values (separated by
> space) are
> allowed. Thus the new behaviour of 5.30 seems to be unintended.

The attached seems to fix it for me:

  # ./perl -e '$) = "0 0 1000"; system "id"'
  uid=0(root) gid=0(root) groups=0(root),1000(tony)

There's no tests for setting $) that I can find and I'm not sure it's practical to add one.

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=134194



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About