Improve expansion in single quote false positives.
This commit is contained in:
parent
7d278c3ca1
commit
7e75d12ce1
|
@ -1100,6 +1100,8 @@ prop_checkSingleQuotedVariables7 = verifyNot checkSingleQuotedVariables "PS1='$P
|
||||||
prop_checkSingleQuotedVariables8 = verify checkSingleQuotedVariables "find . -exec echo '$1' {} +"
|
prop_checkSingleQuotedVariables8 = verify checkSingleQuotedVariables "find . -exec echo '$1' {} +"
|
||||||
prop_checkSingleQuotedVariables9 = verifyNot checkSingleQuotedVariables "find . -exec awk '{print $1}' {} \\;"
|
prop_checkSingleQuotedVariables9 = verifyNot checkSingleQuotedVariables "find . -exec awk '{print $1}' {} \\;"
|
||||||
prop_checkSingleQuotedVariables10= verify checkSingleQuotedVariables "echo '`pwd`'"
|
prop_checkSingleQuotedVariables10= verify checkSingleQuotedVariables "echo '`pwd`'"
|
||||||
|
prop_checkSingleQuotedVariables11= verifyNot checkSingleQuotedVariables "sed '${/lol/d}'"
|
||||||
|
prop_checkSingleQuotedVariables12= verifyNot checkSingleQuotedVariables "eval 'echo $1'"
|
||||||
checkSingleQuotedVariables params t@(T_SingleQuoted id s) =
|
checkSingleQuotedVariables params t@(T_SingleQuoted id s) =
|
||||||
when (s `matches` re) $
|
when (s `matches` re) $
|
||||||
if "sed" == commandName
|
if "sed" == commandName
|
||||||
|
@ -1123,8 +1125,11 @@ checkSingleQuotedVariables params t@(T_SingleQuoted id s) =
|
||||||
,"ksh"
|
,"ksh"
|
||||||
,"zsh"
|
,"zsh"
|
||||||
,"ssh"
|
,"ssh"
|
||||||
|
,"eval"
|
||||||
,"xprop"
|
,"xprop"
|
||||||
,"alias"
|
,"alias"
|
||||||
|
,"sudo" -- covering "sudo sh" and such
|
||||||
|
,"dpkg-query"
|
||||||
]
|
]
|
||||||
|| "awk" `isSuffixOf` commandName
|
|| "awk" `isSuffixOf` commandName
|
||||||
|| "perl" `isPrefixOf` commandName
|
|| "perl" `isPrefixOf` commandName
|
||||||
|
@ -1136,7 +1141,7 @@ checkSingleQuotedVariables params t@(T_SingleQuoted id s) =
|
||||||
otherwise -> False
|
otherwise -> False
|
||||||
|
|
||||||
re = mkRegex "\\$[{(0-9a-zA-Z_]|`.*`"
|
re = mkRegex "\\$[{(0-9a-zA-Z_]|`.*`"
|
||||||
sedContra = mkRegex "\\$[dpsaic]($|[^a-zA-Z])"
|
sedContra = mkRegex "\\$[{dpsaic]($|[^a-zA-Z])"
|
||||||
|
|
||||||
getFindCommand (T_SimpleCommand _ _ words) =
|
getFindCommand (T_SimpleCommand _ _ words) =
|
||||||
let list = map getLiteralString words
|
let list = map getLiteralString words
|
||||||
|
|
Loading…
Reference in New Issue