add username searching to UID

This commit is contained in:
Zane C. B-H 2019-08-22 22:54:17 -05:00
parent b89e94461d
commit 6960454998
1 changed files with 22 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package Proc::ProcessTable::Match::UID;
use 5.006;
use strict;
use warnings;
use User::pwent;
=head1 NAME
@ -138,6 +139,27 @@ sub match{
( $uid eq $proc_uid )
){
return 1;
}elsif(
( $uid =~ /[A-Za-z]/ ) &&
( $uid !~ /^\!/ )
){
my $pw=getpwnam($uid);
if ( defined( $pw ) ){
if ( $pw->uid eq $proc_uid ){
return 1;
}
}
}elsif(
( $uid =~ /[A-Za-z]/ ) &&
( $uid =~ /^\!/ )
){
$uid =~ s/^\!//;
my $pw=getpwnam($uid);
if ( defined( $pw ) ){
if ( $pw->uid ne $proc_uid ){
return 1;
}
}
}elsif( $uid =~ /^\<\=[0-9]+$/ ){
$uid=~s/^\<\=//;
if ( $proc_uid <= $uid ){