builder: ignore missing temporary file on cleanup

This commit is contained in:
chack-agent
2026-02-24 20:23:22 +00:00
parent 1366202070
commit 8de5b44ffe

View File

@@ -20,7 +20,11 @@ def main(all_modules, all_no_fat_modules, no_network_scanning, small, include_mo
lbuilder = LinpeasBuilder(ploaded)
lbuilder.build()
lbuilder.write_linpeas(output)
os.remove(TEMPORARY_LINPEAS_BASE_PATH) # Remove the built linpeas_base_temp.sh file
# Best-effort cleanup of temporary file: ignore if it's not present
try:
os.remove(TEMPORARY_LINPEAS_BASE_PATH) # Remove the built linpeas_base_temp.sh file
except FileNotFoundError:
pass
st = os.stat(output)
os.chmod(output, st.st_mode | stat.S_IEXEC)