This file is indexed.

/usr/lib/kannel/checks/check_sendsms.sh is in kannel-extras 1.4.3-2fakesync2build1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/sh
#
# Use `test/fakesmsc' to test sendsms in smsbox.

set -e
#set -x

host=127.0.0.1
times=10
interval=0
loglevel=0
sendsmsport=13013
global_sender=13013 
username=tester
password=foobar

url="http://$host:$sendsmsport/cgi-bin/sendsms?from=123&to=234&\
text=test&username=$username&password=$password"

gw/bearerbox -v $loglevel gw/smskannel.conf > check_sendsms_bb.log 2>&1 &
bbpid=$!

sleep 2

test/fakesmsc -H $host -i $interval -m $times '123 234 text nop' \
    > check_sendsms_smsc.log 2>&1 &

sleep 1
gw/smsbox -v $loglevel gw/smskannel.conf > check_sendsms_sms.log 2>&1 &

sleep 2

# All cgivars are OK
url="http://$host:$sendsmsport/cgi-bin/sendsms?from=123&to=234&\
text=test&username=$username&password=$password"

i=0
while [ $i -lt $times ]
do
    test/test_http $url >> check_sendsms.log 2>&1
    i=`expr $i + 1`
done

sleep 5

if grep 'WARNING:|ERROR:|PANIC:' check_sendsms*.log >/dev/null ||
   [ $times -ne `grep -c 'Got message .*: <123 234 text test>' \
    check_sendsms_smsc.log` ]
then
	echo check_sendsms.sh failed with non-empty fields 1>&2
	echo See check_sendsms*.log for info 1>&2
	exit 1
fi

# Empty fields: message. This is OK, we must get a canned reply
url="http://$host:$sendsmsport/cgi-bin/sendsms?from=123&to=234&\
text=&username=$username&password=$password"

test/test_http $url >> check_sendsms.log 2>&1
sleep 1

if grep 'WARNING:|ERROR:|PANIC:' check_sendsms*.log >/dev/null ||
   [ 1 -ne `grep -c '<123 234 text <Empty reply from service provider>' \
       check_sendsms_smsc.log` ]
then
	echo check_sendsms.sh failed with empty message 1>&2
	echo See check_sendsms*.log for info 1>&2
	exit 1
fi

# From. This is OK, too: now global-sender replaces from field
url="http://$host:$sendsmsport/cgi-bin/sendsms?from=&to=234&\
text=test&username=$username&password=$password"

test/test_http $url >> check_sendsms.log 2>&1
sleep 1

if grep 'WARNING:|ERROR:|PANIC:' check_sendsms*.log >/dev/null ||
   [ 1 -ne `grep -c '<'$global_sender' 234 text test>' check_sendsms_smsc.log` ]
then
	echo check_sendsms.sh failed with empty from field 1>&2
	echo See check_sendsms*.log for info 1>&2
	exit 1
fi

# To. Now smsbox must report an error.
url="http://$host:$sendsmsport/cgi-bin/sendsms?from=123&to=&\
text=&username=$username&password=$password"

test/test_http $url >> check_sendsms.log 2>&1
sleep 1

if grep 'WARNING:|ERROR:|PANIC:' check_sendsms*.log >/dev/null ||
   [ 1 -ne `grep -c 'got empty <to> cgi variable' check_sendsms_sms.log` ]
then
	echo check_sendsms.sh failed with empty to field 1>&2
	echo See check_sendsms*.log for info 1>&2
	exit 1
fi

# Username. This is an authentication error.
url="http://$host:$sendsmsport/cgi-bin/sendsms?from=123&to=234&\
text=&username=&password=$password"

test/test_http $url >> check_sendsms.log 2>&1
sleep 1

if grep 'WARNING:|ERROR:|PANIC:' check_sendsms*.log >/dev/null ||
   [ 1 -ne `grep -c '<Authorization failed for sendsms>' \
       check_sendsms_sms.log` ]
then
	echo check_sendsms.sh failed username authorisation test 1>&2
	echo See check_sendsms*.log for info 1>&2
	exit 1
fi

# Password. Ditto.
url="http://$host:$sendsmsport/cgi-bin/sendsms?from=123&to=234&\
text=&username=$username&password="

if grep 'WARNING:|ERROR:|PANIC:' check_sendsms*.log >/dev/null ||
   [ 1 -ne `grep -c '<Authorization failed for sendsms>' \
       check_sendsms_sms.log` ]
then
	echo check_sendsms.sh failed with password authorisation test 1>&2
	echo See check_sendsms*.log for info 1>&2
	exit 1
fi

kill -INT $bbpid
wait

# Do we panic when going down ?
if grep 'WARNING:|ERROR:|PANIC:' check_sendsms*.log >/dev/null
then
	echo check_sendsms.sh failed when going down 1>&2
	echo See check_sendsms*.log for info 1>&2
	exit 1
fi

rm check_sendsms*.log

exit 0