From 22098042ba637e283f50344292510d4780f3b724 Mon Sep 17 00:00:00 2001 From: VAIO73 <50487331+Vaso73@users.noreply.github.com> Date: Sat, 17 Oct 2026 11:53:30 +0000 Subject: [PATCH] fix: exclude Alpine service supervision from native discovery --- AppImage/scripts/native_app_discovery.py | 2 ++ .../scripts/tests/test_native_app_discovery.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/AppImage/scripts/native_app_discovery.py b/AppImage/scripts/native_app_discovery.py index 5ade84bd..29a56b7b 100644 --- a/AppImage/scripts/native_app_discovery.py +++ b/AppImage/scripts/native_app_discovery.py @@ -46,6 +46,8 @@ _NAME = re.compile(r'[A-Za-z0-9][A-Za-z0-9_.+@-]{0,63}\Z') _VERSION = re.compile(r'v?\d+(?:\.\d+){1,4}(?:[-+._][A-Za-z0-9.-]+)?\Z') _SYSTEM = { 'ssh', 'sshd', 'cron', 'crond', 'postfix', 'rsyslog', 'syslog', 'syslog-ng', + # Alpine/OpenRC system logging and service supervision are not apps. + 'klogd', 'syslogd', 'openrc-user', 'runit', 'runsvdir', 'runsv', 'supervise-daemon', 'dbus', 'dbus-broker', 'systemd', 'udev', 'networking', 'network', 'networkmanager', 'dhcpcd', 'dhclient', 'chrony', 'chronyd', 'ntp', 'ntpd', 'openntpd', 'agetty', 'getty', 'login', 'polkit', 'polkitd', 'accounts-daemon', 'acpid', 'anacron', diff --git a/AppImage/scripts/tests/test_native_app_discovery.py b/AppImage/scripts/tests/test_native_app_discovery.py index d1432b65..5e90b4cf 100644 --- a/AppImage/scripts/tests/test_native_app_discovery.py +++ b/AppImage/scripts/tests/test_native_app_discovery.py @@ -126,6 +126,24 @@ class DiscoveryFixtures(unittest.TestCase): self.assertEqual(result['candidates'], []) self.assertFalse(any(native.FOOTPRINT_SCRIPT in call for call in self.calls)) + def test_alpine_openrc_infrastructure_has_zero_footprint_probes(self): + # Actual Alpine 3.24.1 CT217 init metadata: klogd, user and runsvdir. + # The runsvdir definition can exist without /usr/bin/runsvdir installed; + # rejecting it must precede probing, not turn the scan into partial. + for name, executable in ( + ('klogd', '/sbin/klogd'), + ('user', '/usr/libexec/rc/bin/openrc-user'), + ('runsvdir', '/usr/bin/runsvdir'), + ('renamed-system-service', '/usr/libexec/rc/bin/openrc-user'), + ): + with self.subTest(name=name): + self.calls.clear() + result = native.scan(101, self.runner( + service(name=name, exe=executable, directory='', manager='openrc'))) + self.assertEqual(result['status'], 'complete') + self.assertEqual(result['candidates'], []) + self.assertFalse(any(native.FOOTPRINT_SCRIPT in call for call in self.calls)) + def test_helper_services_and_templates_have_zero_footprint_probes(self): cases = [ ('netpulse-stable-update', '/bin/bash', '/opt/netpulse', '/opt/netpulse/stable-apply.sh'),