Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
etf
cmssam
Commits
aed03594
Commit
aed03594
authored
May 14, 2012
by
Brian Paul Bockelman
Browse files
Restore ability to succeed based on group membership change.
parent
8630f549
Changes
1
Hide whitespace changes
Inline
Side-by-side
nagios/org.cms.glexec/probes/org.cms.glexec/testjob/tests/glprobe.sh
View file @
aed03594
...
...
@@ -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
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment