aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkgcheck/checks/codingstyle.py')
-rw-r--r--src/pkgcheck/checks/codingstyle.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/pkgcheck/checks/codingstyle.py b/src/pkgcheck/checks/codingstyle.py
index 20d668f8..0c33c650 100644
--- a/src/pkgcheck/checks/codingstyle.py
+++ b/src/pkgcheck/checks/codingstyle.py
@@ -75,6 +75,19 @@ class BadCommandsCheck(Check):
_source = sources.EbuildParseRepoSource
known_results = frozenset({DeprecatedEapiCommand, BannedEapiCommand, BannedPhaseCall})
+ extra_banned_commands = frozenset(
+ {
+ # commands that modify user/group databases, not portable
+ "gpasswd",
+ "groupadd",
+ "groupdel",
+ "groupmod",
+ "useradd",
+ "userdel",
+ "usermod",
+ }
+ )
+
def feed(self, pkg):
for func_node, _ in bash.func_query.captures(pkg.tree.root_node):
for node, _ in bash.cmd_query.captures(func_node):
@@ -100,6 +113,10 @@ class BadCommandsCheck(Check):
yield BannedEapiCommand(
name, line=call, lineno=lineno + 1, eapi=pkg.eapi, pkg=pkg
)
+ elif name in self.extra_banned_commands:
+ yield BannedEapiCommand(
+ name, line=call, lineno=lineno + 1, eapi=pkg.eapi, pkg=pkg
+ )
class EendMissingArg(results.LineResult, results.Warning):