Using getgrnam instead of getgrent.
This commit is contained in:
parent
c05e0eb0ed
commit
e16a5e52fa
@ -261,15 +261,7 @@ sub new {
|
||||
my $socket = $params{socket};
|
||||
my ( $pid, $uid, $gid ) = unpack 'LLL', $socket->sockopt(SO_PEERCRED);
|
||||
my $user = getpwuid($uid);
|
||||
state $name = '';
|
||||
state $members = '';
|
||||
if (!$name || !$members) {
|
||||
while ( ( $name, undef, undef, $members ) = getgrent() ) {
|
||||
if ( $name eq 'cualsea' ) {
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
my ( undef, undef, undef, $members ) = getgrnam('cualsea');
|
||||
return any { $_ eq $user } split ' ', $members;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user