Hello!

> I too still fail to see what's the actual problem. The test utility does
> exactly what it's supposed to do.
> 
> Of course if you're using a poor method to parse the query string and
> then pass the bits unchecked to "test" it could result in some weird
> side effects.

test is one of the main functions to check user input in this script language. 
There aren't much alternatives to it.

> in this case 
> 
> [ -z "=" ] shouldn't result in ./test.sh: line 6: [: too many arguments
> 
> apart from this bug? I still see no problem .. bud

The test function can't know what do you mean if you have more then one 
expression.

With
[ -n = -a #[...]
you can mean that:

1. if the string "=" is non empty and something other is true
or
2. if the string "-n" is equal to the string "-a"

the function can't find out what expression do you want. It can't differ a 
variable from a meta character.

If you only use one expression per test call, than the tool can use the 
argument length to find out what expression do you want. The bash, dash and 
BusyBox ash do so.

Regards
Alina
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to