Bug#958353: sleepd: fails to correctly read acpi subsystem version
Package: sleepd
Version: 2.10
Severity: normal
Tags: patch
Dear Maintainer,
When running with a newer kernel (4.19.0-8-amd64 from buster, though
this also occurs with 5.4.0-0.bpo.4-amd64 from backports), and without
upower installed, sleepd fails to start, complaining
ACPI subsystem 2018081 too is old, consider upgrading to 20011018.
It appears that with these kernels, /sys/module/acpi/parameters/acpica_version
no longer ends with a newline character. This file actually contains
"20180810". Note that the final '0' character is discarded.
It seems that acpi.c:get_acpi_file() is erroneously truncating the
last byte when reading acpi files. This was never exposed earlier, as
the truncated byte was a newline, not part of the version number.
The following patch seems to fix the problem.
--- acpi.c.dist 2018-09-16 03:13:08.000000000 -0600
+++ acpi.c 2020-04-18 08:13:44.946652962 -0600
@@ -67,7 +67,8 @@
fd = open(file, O_RDONLY);
if (fd == -1) return NULL;
end = read(fd, buf, sizeof(buf));
- buf[end-1] = '\0';
+ buf[end] = '\0';
close(fd);
return buf;
}
-- System Information:
Debian Release: 10.3
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.4.0-0.bpo.4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C), LANGUAGE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages sleepd depends on:
ii libc6 2.28-10
ii libglib2.0-0 2.58.3-2+deb10u2
ii libupower-glib3 0.99.10-1
ii lsb-base 10.2019051400
Versions of packages sleepd recommends:
ii pm-utils 1.4.1-18
pn upower <none>
sleepd suggests no packages.
-- Configuration Files:
/etc/default/sleepd changed:
PARAMS="-b 2 -s '/etc/acpi/sleep_suspend.sh sleep'"
-- no debconf information
Reply to: