~ubuntu-branches/ubuntu/trusty/bash/trusty-security

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/bash
#
# Out of file descriptors, because it forgets to close redirection.  Only
# happens in a shell function.  Problem through bash-4.2.

ulimit -n 128

bug()
{
c=`ulimit -n`
let c+=100
while let c--
do
	while read -ru3 x
	do
		echo -n :
	done 3< <(echo x)

done
}

bug
echo

exit 0