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 $socket = $params{socket};
|
||||||
my ( $pid, $uid, $gid ) = unpack 'LLL', $socket->sockopt(SO_PEERCRED);
|
my ( $pid, $uid, $gid ) = unpack 'LLL', $socket->sockopt(SO_PEERCRED);
|
||||||
my $user = getpwuid($uid);
|
my $user = getpwuid($uid);
|
||||||
state $name = '';
|
my ( undef, undef, undef, $members ) = getgrnam('cualsea');
|
||||||
state $members = '';
|
|
||||||
if (!$name || !$members) {
|
|
||||||
while ( ( $name, undef, undef, $members ) = getgrent() ) {
|
|
||||||
if ( $name eq 'cualsea' ) {
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return any { $_ eq $user } split ' ', $members;
|
return any { $_ eq $user } split ' ', $members;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user