- correctly parse /proc/stat for boottime (bnc#899252) * added sudo-parse_boottime_properly.patch from Debian OBS-URL: https://build.opensuse.org/request/show/265535 OBS-URL: https://build.opensuse.org/package/show/Base:System/sudo?expand=0&rev=79
14 lines
446 B
Diff
14 lines
446 B
Diff
From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762465
|
|
|
|
--- a/plugins/sudoers/boottime.c
|
|
+++ b/plugins/sudoers/boottime.c
|
|
@@ -80,6 +80,8 @@
|
|
if (fp != NULL) {
|
|
while ((len = getline(&line, &linesize, fp)) != -1) {
|
|
if (strncmp(line, "btime ", 6) == 0) {
|
|
+ if (line[len - 1] == '\n')
|
|
+ line[len - 1] = '\0';
|
|
long long llval = strtonum(line + 6, 1, LLONG_MAX, NULL);
|
|
if (llval > 0) {
|
|
tv->tv_sec = (time_t)llval;
|