Skip to content

Commit b6e024c

Browse files
committed
My_webapp has a legit case for chown root x_x
1 parent adf5c84 commit b6e024c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

package_linter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def __init__(self, path):
493493
self.path = path
494494
self.manifest_ = Manifest(self.path)
495495
self.manifest = self.manifest_.manifest
496-
self.scripts = {f: Script(self.path, f) for f in scriptnames}
496+
self.scripts = {f: Script(self.path, f, self.manifest.get("id")) for f in scriptnames}
497497
self.configurations = Configurations(self)
498498
self.app_catalog = AppCatalog(self.manifest["id"])
499499

@@ -2262,9 +2262,10 @@ def good_quality(infos):
22622262
# |_| #
22632263
##################################
22642264
class Script(TestSuite):
2265-
def __init__(self, app_path, name):
2265+
def __init__(self, app_path, name, app_id):
22662266
self.name = name
22672267
self.app_path = app_path
2268+
self.app_id = app_id
22682269
self.path = app_path + "/scripts/" + name
22692270
self.exists = file_exists(self.path)
22702271
if not self.exists:
@@ -2689,6 +2690,11 @@ def sudo(self):
26892690

26902691
@test()
26912692
def chownroot(self):
2693+
2694+
# Mywebapp has a legit use case for this >_>
2695+
if self.app_id == "my_webapp":
2696+
return
2697+
26922698
if self.containsregex(
26932699
r"^\s*chown.* root:?[^$]* .*install_dir"
26942700
) and not self.contains('chown root:root "$install_dir"'):

0 commit comments

Comments
 (0)