From 155bedbdce5bc9fadcf5a36111e2d4cdd7b40977 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Thu, 22 Aug 2019 23:22:12 -0500 Subject: [PATCH] add EUID set search --- Proc-ProcessTable-ncps/bin/ncps | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Proc-ProcessTable-ncps/bin/ncps b/Proc-ProcessTable-ncps/bin/ncps index 06505d2..6372a3e 100755 --- a/Proc-ProcessTable-ncps/bin/ncps +++ b/Proc-ProcessTable-ncps/bin/ncps @@ -19,8 +19,8 @@ sub help{ --cF Show children major faults. --m Memory usage percent to search for. ---mi Invert the memory usage search. +--eu Search for proccs witha EUID set. +--eui Invert the EUID search. -f Show minor faults. @@ -30,6 +30,9 @@ sub help{ -j A comma seperated list of JIDs to search for. --ji Invert the JIDs earch. +-m Memory usage percent to search for. +--mi Invert the memory usage search. + -n Show number of threads. --nc disable color. @@ -99,6 +102,7 @@ my $jids_string; my $jids_invert=0; my $uids_string; my $uids_invert=0; +my $euid=0; # get the commandline options Getopt::Long::Configure ('no_ignore_case'); @@ -139,6 +143,7 @@ GetOptions( 'ji' => \$jids_invert, 'u=s' => \$uids_string, 'ui' => \$uids_invert, + 'eu' => \$euid, ); # print the version info if requested @@ -292,6 +297,18 @@ if ( defined( $uids_string ) ){ }); } +# +# handles the EUID set search +# +if ( $euid ){ + push( @filters, { + type=>'EUIDset', + invert=>$uids_invert, + args=>{ + }, + }); +} + # XOR common boolean CLI flags if ( defined( $ENV{NCPS_jid} ) ){ $jid = $jid ^ 1;