summaryrefslogtreecommitdiffstats
path: root/src/tests/mandb-bogus-symlink
blob: 0e8cca568377742c5cf820c0b914cedfc0e2a5f3 (plain)
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
#! /bin/sh

# Test for double free or corruption crash with bogus filename and symlink of man page.
#   https://bugzilla.redhat.com/show_bug.cgi?id=702904

: "${srcdir=.}"
# shellcheck source-path=SCRIPTDIR
. "$srcdir/testlib.sh"

: "${MANDB=mandb}"

init
fake_config /usr/share/man
MANPATH="$tmpdir/usr/share/man"
export MANPATH

mkdir -p "$tmpdir/usr/share/man/man8"
mkdir -p "$tmpdir/usr/lib/aa-bbb"
write_page test1 8 "$tmpdir/usr/lib/aa-bbb/aa-test1.8.gz" UTF-8 gz t \
	'test1 \- testing man page'
ln -s "../../../lib/aa-bbb/aa-test1.8.gz" "$tmpdir/usr/share/man/man8/aa-test1.8.gz"
run $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man"
report 'double free' "$?"

finish