Skip to content

Commit 186e659

Browse files
committed
fix builder
1 parent 3559a62 commit 186e659

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: linPEAS/builder/src/linpeasBaseBuilder.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def build(self):
6666
self.linpeas_base += f"\nif echo $CHECKS | grep -q {section_info['name_check']}; then\n"
6767
self.linpeas_base += f'print_title "{section_name}"\n'
6868

69-
# Sort checks alphabetically to get them in the same order of they are in the folder
69+
# Sort checks alphabetically to get them in the same order as they are in the folder
7070
section_info["checks"] = sorted(section_info["checks"], key=lambda x: int(os.path.basename(x.path).split('_')[0]) if os.path.basename(x.path).split('_')[0].isdigit() else 99)
7171
for check in section_info["checks"]:
7272
for func in check.initial_functions:
@@ -193,8 +193,9 @@ def sort_variables(self, variables:List[LinpeasModule]):
193193

194194
def get_funcs_deps(self, module, all_funcs):
195195
"""Given 1 module and the list of modules return the functions recursively it depends on"""
196-
197-
for func in module.functions_used:
196+
197+
module_funcs = list(set(module.initial_functions + module.functions_used))
198+
for func in module_funcs:
198199
func_module = self.find_func_module(func)
199200
#print(f"{module.id} has found {func} in {func_module.id}") #To find circular dependencies
200201
if not func_module.is_function:

0 commit comments

Comments
 (0)