Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 50470
Status: resolved
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: skyfive.508 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: make test is failed even on new version of IO::Async(0.24)
Date: Tue, 13 Oct 2009 17:26:28 -0700
To: bug-IO-Async [...] rt.cpan.org
From: Takeshi Ohishi <skyfive.508 [...] gmail.com>
Hi, Mr.Evans This is Takeshi Ohishi. I tried to install IO::Async from cpan, but 'make test' cannot be passed. If you have time, please check this. I must be happy if you fix this. - Distribution name and version IO-Async 0.24 - My Perl version v5.8.8 built for darwin-thread-multi-2level - OS vendor and version(the result of `uname -a`) Darwin MacBookPro-Takeshi.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 And the part of occurring the error on t/35loop-child-root.t is as below # Failed test 'combined setuid/gid/groups' # at t/35loop-child-root.t line 84. # got: 'EUID: 20 # EGID: 10 # Groups: 0 6 5 10 # ' # expected: 'EUID: 20 # EGID: 10 # Groups: 4 5 6 10 # ' # Looks like you failed 1 test of 5. t/35loop-child-root.t ........ Dubious, test returned 1 (wstat 256, 0x100) Thanks! -- """ Takeshi Ohishi DeNA Global, Inc. address: 1 Waters Park Dr., Suite 165 San Mateo, CA 94403 mail: takeshi@denaglobal.com phone: +1-650-638-1026 private: skyfive.508@gmail.com """
On Tue Oct 13 20:27:10 2009, skyfive.508@gmail.com wrote: Show quoted text
> Darwin MacBookPro-Takeshi.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul
Show quoted text
> # got: Groups: 0 6 5 10 > # expected: Groups: 4 5 6 10
Hmmmm.... I wonder if that is darwin doing something weird with group security? Can you please try running the following little test as root, and printing me the output? perl -e 'print "UID=$>\n"; $) = "4 5 6 10"; print "Groups=$)\n"' That's basically the test that fails. Can you also try putting such numbers as 100 101 102 103 and see if the output is any different? -- Paul Evans
Subject: Re: [rt.cpan.org #50470] make test is failed even on new version of IO::Async(0.24)
Date: Thu, 15 Oct 2009 10:06:08 -0700
To: bug-IO-Async [...] rt.cpan.org
From: Takeshi Ohishi <skyfive.508 [...] gmail.com>
Thanks for your reply! root# perl -e 'print "UID=$>\n"; $) = "4 5 6 10"; print "Groups=$)\n"' UID=0 Groups=4 10 6 4 root# perl -e 'print "UID=$>\n"; $) = "100 101 102 103"; print "Groups=$)\n"' UID=0 Groups=100 103 102 100 Nmmm, I'm not sure if that is right or not...can you figure out? On Thu, Oct 15, 2009 at 3:30 AM, Paul Evans via RT <bug-IO-Async@rt.cpan.org Show quoted text
> wrote:
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50470 > > > On Tue Oct 13 20:27:10 2009, skyfive.508@gmail.com wrote:
> > Darwin MacBookPro-Takeshi.local 9.8.0 Darwin Kernel Version 9.8.0: Wed
> Jul >
> > # got: Groups: 0 6 5 10 > > # expected: Groups: 4 5 6 10
> > Hmmmm.... > > I wonder if that is darwin doing something weird with group security? > > Can you please try running the following little test as root, and > printing me the output? > > perl -e 'print "UID=$>\n"; $) = "4 5 6 10"; print "Groups=$)\n"' > > That's basically the test that fails. Can you also try putting such > numbers as 100 101 102 103 and see if the output is any different? > > -- > > Paul Evans >
-- """ Takeshi Ohishi DeNA Global, Inc. address: 1 Waters Park Dr., Suite 165 San Mateo, CA 94403 mail: takeshi@denaglobal.com phone: +1-650-638-1026 private: skyfive.508@gmail.com """
On Thu Oct 15 13:06:24 2009, skyfive.508@gmail.com wrote: Show quoted text
> Nmmm, I'm not sure if that is right or not...can you figure out?
OK. I've done some digging around, and got someone to test some things on a Darwin box for me - I don't have access to one myself. It seems that it's a bit more strict with its setgroups() - it requires one of those groups to be your primary GID. So, I've adjusted the test script to call setgid before setgroups. I've also adjusted it to be a little less sensitive to differences in the output. Can you try out the attached new version of the test script, and let me know if it works? -- Paul Evans
#!/usr/bin/perl -w use strict; use IO::Async::Test; use Test::More; use POSIX qw( WEXITSTATUS ); # These tests check the parts of Loop->spawn_child that need to be root to # work. Since we're unlikely to be root, skip the lot if we're not. if( $< == 0 ) { plan tests => 5; } else { plan skip_all => "not root"; } is( $>, 0, 'am root'); require IO::Async::Loop::Poll; my $loop = IO::Async::Loop::Poll->new(); testing_loop( $loop ); my ( $exitcode, $dollarbang, $dollarat ); $loop->spawn_child( code => sub { return $> }, setup => [ setuid => 10 ], on_exit => sub { ( undef, $exitcode, $dollarbang, $dollarat ) = @_ }, ); wait_for { defined $exitcode }; is( WEXITSTATUS($exitcode), 10, 'setuid' ); $loop->spawn_child( code => sub { return $) }, setup => [ setgid => 10 ], on_exit => sub { ( undef, $exitcode, $dollarbang, $dollarat ) = @_ }, ); undef $exitcode; wait_for { defined $exitcode }; is( WEXITSTATUS($exitcode), 10, 'setgid' ); $loop->spawn_child( code => sub { return $) =~ m/ 5 / }, setup => [ setgroups => [ 4, 5, 6 ] ], on_exit => sub { ( undef, $exitcode, $dollarbang, $dollarat ) = @_ }, ); undef $exitcode; wait_for { defined $exitcode }; is( WEXITSTATUS($exitcode), 1, 'setgroups' ); my $child_out; $loop->run_child( code => sub { print "EUID: $>\n"; my ( $gid, @groups ) = split( m/ /, $) ); print "EGID: $gid\n"; print "Groups: " . join( " ", sort { $a <=> $b } @groups ) . "\n"; return 0; }, setup => [ setgid => 10, setgroups => [ 4, 5, 6, 10 ], setuid => 20, ], on_finish => sub { ( undef, $exitcode, $child_out ) = @_; }, ); undef $exitcode; wait_for { defined $exitcode }; is( $child_out, "EUID: 20\nEGID: 10\nGroups: 4 5 6 10\n", 'combined setuid/gid/groups' );
Subject: Re: [rt.cpan.org #50470] make test is failed even on new version of IO::Async(0.24)
Date: Sun, 18 Oct 2009 10:23:26 -0700
To: bug-IO-Async [...] rt.cpan.org
From: Takeshi Ohishi <skyfive.508 [...] gmail.com>
Awesome!This test works well! Now I can use IO::Async ;) Thanks a lot. -- Takeshi On Sun, Oct 18, 2009 at 10:02 AM, Paul Evans via RT < bug-IO-Async@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50470 > > > On Thu Oct 15 13:06:24 2009, skyfive.508@gmail.com wrote:
> > Nmmm, I'm not sure if that is right or not...can you figure out?
> > OK. I've done some digging around, and got someone to test some things > on a Darwin box for me - I don't have access to one myself. > > It seems that it's a bit more strict with its setgroups() - it requires > one of those groups to be your primary GID. So, I've adjusted the test > script to call setgid before setgroups. I've also adjusted it to be a > little less sensitive to differences in the output. > > Can you try out the attached new version of the test script, and let me > know if it works? > > -- > > Paul Evans >
-- """ Takeshi Ohishi DeNA Global, Inc. address: 1 Waters Park Dr., Suite 165 San Mateo, CA 94403 mail: takeshi@denaglobal.com phone: +1-650-638-1026 private: skyfive.508@gmail.com """
On Sun Oct 18 13:23:42 2009, skyfive.508@gmail.com wrote: Show quoted text
> Awesome!This test works well! Now I can use IO::Async ;) > > Thanks a lot.
Glad I could help. I'll include this test with the next version; 0.25. When that's released I'll close this bug. Will leave it open until then, for reference. -- Paul Evans
On Sun Oct 18 19:17:16 2009, PEVANS wrote: Show quoted text
> On Sun Oct 18 13:23:42 2009, skyfive.508@gmail.com wrote:
> > Awesome!This test works well! Now I can use IO::Async ;) > > > > Thanks a lot.
> > Glad I could help. > > I'll include this test with the next version; 0.25. When that's released > I'll close this bug. Will leave it open until then, for reference.
Just uploaded 0.25 to CPAN now. Hopefully that fixes things. -- Paul Evans