add username searching to UID
This commit is contained in:
parent
b89e94461d
commit
6960454998
|
@ -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 ){
|
||||
|
|
Loading…
Reference in New Issue