Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed bug in Mojo::Server where secondary groups were not reassigned …
…correctly
  • Loading branch information
kraih committed Oct 20, 2014
1 parent fa227b2 commit 37cf15f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,5 +1,7 @@

5.53 2014-10-20
- Fixed bug in Mojo::Server where secondary groups were not reassigned
correctly. (ksm, sri)

5.52 2014-10-18
- Fixed read-only file system compatibility of Mojo::Asset::File.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server.pm
Expand Up @@ -74,12 +74,12 @@ sub run { croak 'Method "run" not implemented by subclass' }
sub setuidgid {
my $self = shift;

# Group
# Group (make sure secondary groups are reassigned too)
if (my $group = $self->group) {
return $self->_log(qq{Group "$group" does not exist.})
unless defined(my $gid = getgrnam $group);
return $self->_log(qq{Can't switch to group "$group": $!})
unless POSIX::setgid($gid);
unless ($( = $) = "$gid $gid") && $) eq "$gid $gid" && $( eq "$gid $gid";
}

# User
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious.pm
Expand Up @@ -887,6 +887,8 @@ Kevin Old
Kitamura Akatsuki
Klaus S. Madsen
Lars Balker Rasmussen
Leon Brocard
Expand Down

0 comments on commit 37cf15f

Please sign in to comment.