]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - bin/sh/tests/builtins/getopts10.0
Fix multiple vulnerabilities in rtsold.
[FreeBSD/FreeBSD.git] / bin / sh / tests / builtins / getopts10.0
1 # $FreeBSD$
2
3 set -- -x arg
4 opt=not
5 getopts x opt
6 r1=$? OPTIND1=$OPTIND opt1=$opt
7 : $(: $((OPTIND = 1)))
8 getopts x opt
9 r2=$? OPTIND2=$OPTIND
10 [ "$r1" = 0 ] && [ "$OPTIND1" = 2 ] && [ "$opt1" = x ] && [ "$r2" != 0 ] &&
11         [ "$OPTIND2" = 2 ]