File: create-log.sh

package info (click to toggle)
swirc 3.5.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,092 kB
  • sloc: cpp: 19,125; ansic: 18,465; sh: 1,012; python: 254; makefile: 108; javascript: 20
file content (47 lines) | stat: -rwxr-xr-x 1,277 bytes parent folder | download
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
#!/usr/bin/env bash

if [ "$(whoami)" = "root" ]; then
	echo "running the program as root is forbidden"
	exit 1
elif [ $# -ne 1 ]; then
	echo "bogus number of args"
	exit 1
fi

INCLUDE_COMMON=$1
shift

if [ "${INCLUDE_COMMON}" != "y" ] && [ "${INCLUDE_COMMON}" != "n" ]; then
	echo "bad argument"
	exit 1
fi

DICT_FILE=irc.dict
MEGABYTES=40
NEXECS=471859
TMPFILE=$(mktemp log.XXXXXXXXXX)

if [ "${INCLUDE_COMMON}" = "y" ]; then
	cat <<EOF >"${TMPFILE}"
:localhost 001 Mo :Welcome
:localhost 002 Mo :Your host is 127.0.0.1
:localhost 003 Mo :This server was created ...
:localhost 004 Mo localhost 1.0 abc def
:localhost 005 Mo FOO BAR
:localhost 005 Mo BAZ QUX :are supported by this server
:localhost 042 Mo XXXXXXXXX :your unique ID
:localhost 251 Mo :There are 1 users and 0 services on 1 servers
:localhost 252 Mo 0 :operators online
:localhost 253 Mo 0 :unknown connections
:localhost 254 Mo 0 :channels formed
:localhost 255 Mo :I have ...
:localhost 265 Mo 0 0 :Current local users ...
:localhost 266 Mo 0 0 :Current global users ...
:localhost 375 Mo :- 127.0.0.1 Message of the Day -
:localhost 372 Mo :...
:localhost 376 Mo :End of MOTD command.
EOF
fi

afl-fuzz -i "in0" -o "out" -n -x "${DICT_FILE}" -E "${NEXECS}" -- \
    ./append-log "${TMPFILE}" "${MEGABYTES}"