From db8317cfaf06523489f67acbaa3d0706caa205bb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 Dec 2023 11:29:21 +0100 Subject: [PATCH] firmware: geez, deal with injection of ".pkgsave" files I don't really know what the plan is here other than breaking existing pluggable directories and wasting space. We do clean this up but we can't stop and clean up all becase we can't trust pkg doing the right thing right away? --- src/etc/inc/system.inc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 84a4b228a..8f6a718a1 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -835,12 +835,17 @@ function system_firmware_configure($verbose = false) foreach ($scripts as $script) { $basename = basename($script); - if (is_executable($script) && $basename != 'README') { - /* run the script in passthru() but avoid standard output from this side */ - passthru($script . '> /dev/null'); - /* make a note about repo being handled */ - service_log(' ' . preg_replace('/\..*?$/', '', $basename)); + if ($basename == 'README' || strpos($basename, '.pgksave') !== false) { + continue; + } elseif (!is_executable($script)) { + continue; } + + /* run the script in passthru() but avoid standard output from this side */ + passthru($script . '> /dev/null'); + + /* make a note about repo being handled */ + service_log(' ' . preg_replace('/\..*?$/', '', $basename)); } service_log("\n");