KSHPR: prompt generator for .kshrc
Clifford C. Skolnick
ccs at lazlo.UUCP
Sun Jun 25 03:13:15 AEST 1989
Thad,
You wanted a way to detect setuid programs, well here is a quick
script I tossed together for you. I would of mailed it, but someone else
might find it useful also (who I don't know :-).
---- CUT HERE ----
# issu
# by Cliff Skolnick (ccs at lazlo.UUCP)
#
# issu script to determin if a user is setuid or not
# note, if the shell itself is suid, it will not detect this. You
# can check the number of fields returned by id if you want to add this
#
# Cheap and dirty way of seperating the output of id which encloses the
# uid in parenthesis. Let the shell do it with it's field seperation
# variable
IFS=${IFS}"()"
set `id`
uid1=$2
# get who is logged in on the terminal
set `who am i`
uid2=$1
# if the user logged in does not match who is running this, then it
# is set uid.
if [ $uid1 = $uid2 ]
then
echo "no"
exit 0
else
echo "yes"
exit 1
fi
---- CUT HERE ----
--
"I'd rather stay here with all the madmen, than perish with the sad man
roaming free" -- David Bowie
"Life is a test, only a test. If it was real, you would have been given much
better instructions." Clifford C. Skolnick / (716)427-8046 / ccs at lazlo.UUCP
More information about the Unix-pc.sources
mailing list