Merge pull request #1460 from contivero/umask-flags

Check umask flags under dash & POSIX sh (fixes #1459)
This commit is contained in:
Vidar Holen 2019-01-15 19:18:21 -08:00 committed by GitHub
commit c1adc588fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -147,6 +147,8 @@ prop_checkBashisms64 = verify checkBashisms "#!/bin/sh\nreadonly -a"
prop_checkBashisms65 = verifyNot checkBashisms "#!/bin/sh\nreadonly -p"
prop_checkBashisms66 = verifyNot checkBashisms "#!/bin/sh\ncd -P ."
prop_checkBashisms67 = verify checkBashisms "#!/bin/sh\ncd -P -e ."
prop_checkBashisms68 = verify checkBashisms "#!/bin/sh\numask -p"
prop_checkBashisms69 = verifyNot checkBashisms "#!/bin/sh\numask -S"
checkBashisms = ForShell [Sh, Dash] $ \t -> do
params <- ask
kludge params t
@ -297,7 +299,8 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
("printf", []),
("read", if isDash then ["r", "p"] else ["r"]),
("readonly", ["p"]),
("ulimit", if isDash then ["H", "S", "t", "f", "d", "s", "c", "m", "l", "p", "n"] else ["f"])
("ulimit", if isDash then ["H", "S", "t", "f", "d", "s", "c", "m", "l", "p", "n"] else ["f"]),
("umask", ["S"])
]
bashism t@(T_SourceCommand id src _) =
let name = fromMaybe "" $ getCommandName src