Commit aed03594 authored by Brian Paul Bockelman's avatar Brian Paul Bockelman
Browse files

Restore ability to succeed based on group membership change.

parent 8630f549
......@@ -30,6 +30,7 @@ currdir=$PWD
host=`uname -n`
pilotid=`/usr/bin/id`
pilotidu=`/usr/bin/id -u`
pilotidg=`id -G | tr ' ' '\n' | sort -n | tr '\n' ' '`
add2buffer "Ran at $now on host $host as user:"
add2buffer "$pilotid"
......@@ -157,18 +158,36 @@ add2buffer "GLEXEC_TARGET_PROXY: $GLEXEC_TARGET_PROXY"
payloadid=`$glexec /usr/bin/id -u`
err=$?
if [ $err -ne 0 ]; then
do_print "Error: error $err executing $glexec getting payload uid/gid"
do_print "Error: error $err executing $glexec getting payload uid"
exit $NAG_CRITICAL
fi
if [ -z "$payloadid" ]; then
do_print "Error: /usr/bin/id returned an empty string for the payload"
do_print "Error: /usr/bin/id -u returned an empty string for the payload"
exit $NAG_CRITICAL
fi
if [ "X$payloadid" == "X$pilotidu" ]; then
add2buffer "Warning: Same /usr/bin/id for payload and pilot"
exitcode=$NAG_WARNING
# In this case, test the GIDs
payloadidg=`$glexec /usr/bin/id -G | tr ' ' '\n' | sort -n | tr '\n' ' '`
err=$?
if [ $err -ne 0 ]; then
do_print "Error: error $err executing $glexec getting payload gid"
exit $NAG_CRITICAL
fi
if [ -z "$payloadidg" ]; then
do_print "Error: /usr/bin/id -G returned an empty string for the payload"
exit $NAG_CRITICAL
fi
if [ "X$payloadidg" == "X$pilotidg" ]; then
add2buffer "Warning: Same /usr/bin/id for payload and pilot"
exitcode=$NAG_WARNING
fi
fi
add2buffer "Payload id: $payloadid"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment