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?
This commit is contained in:
Franco Fichtner 2023-12-19 11:29:21 +01:00
parent ebd5696f1c
commit db8317cfaf

View File

@ -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");