Xref: utzoo unix-pc.sources:322 comp.sys.att:6804 Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ukma!rayssd!galaxia!lazlo!ccs From: ccs@lazlo.UUCP (Clifford C. Skolnick) Newsgroups: unix-pc.sources,comp.sys.att Subject: Re: KSHPR: prompt generator for .kshrc Message-ID: <183@lazlo.UUCP> Date: 24 Jun 89 17:13:15 GMT References: <19817@cup.portal.com> Reply-To: ccs@lazlo.UUCP (Clifford C. Skolnick) Organization: The Steam Tunnel, Henrietta, NY Lines: 39 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@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@lazlo.UUCP