Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 554
blob2943bd83659e6e129116561770a6b084511c7359
1 #!/bin/sh
2 # PCP QA Test No. 554
3 # security hole via system() from pmie
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=1 # failure is the default!
17 trap "rm -f $tmp.* /tmp/ls; exit \$status" 0 1 2 3 15
19 # real QA test starts here
20 echo "expect /tmp/ls ..."
21 echo
23 cd /tmp
24 $sudo rm -f ls
25 cat <<End-of-File >ls
26 #!/bin/sh
27 echo "Bingo! ... I have a shell now"
29 End-of-File
30 chmod 755 ls
32 PATH=.:$PATH
33 export PATH
34 cat <<End-of-File | $sudo pmie -t 2 -T 1 2>/dev/null
35 hinv.ncpu > 0 -> shell "ls /tmp/ls";
36 End-of-File
38 sleep 2
40 # success, all done
41 status=0
42 exit