]> git.pld-linux.org Git - packages/sudo.git/commitdiff
correctly parse /proc/stat for boottime
authorElan Ruusamäe <glen@delfi.ee>
Sun, 17 May 2015 17:41:24 +0000 (20:41 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 17 May 2015 17:42:48 +0000 (20:42 +0300)
added sudo-parse_boottime_properly.patch from Debian
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762465

Sudo uses monotonic clock since 1.8.10,
so it may have something to do with the clock reset.
https://bugzilla.suse.com/show_bug.cgi?id=899252

Problem seems to manifest if tty tickets is disabled:
Defaults !tty_tickets

sudo-parse_boottime_properly.patch [new file with mode: 0644]
sudo.spec

diff --git a/sudo-parse_boottime_properly.patch b/sudo-parse_boottime_properly.patch
new file mode 100644 (file)
index 0000000..cf7495a
--- /dev/null
@@ -0,0 +1,15 @@
+From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762465
+
+Index: sudo-1.8.13/plugins/sudoers/boottime.c
+===================================================================
+--- sudo-1.8.13.orig/plugins/sudoers/boottime.c        2015-03-18 18:05:51.000000000 +0100
++++ sudo-1.8.13/plugins/sudoers/boottime.c     2015-05-14 14:48:33.855294076 +0200
+@@ -79,6 +79,8 @@ get_boottime(struct timespec *ts)
+     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) {
+                   ts->tv_sec = (time_t)llval;
index 197fc2f2a7ac69b11e81b3e2ac87d0f9c8b7a127..a1247ad1815ada4947e546ce84d76dc8d7bdf18c 100644 (file)
--- a/sudo.spec
+++ b/sudo.spec
@@ -28,7 +28,7 @@ Summary(ru.UTF-8):    Позволяет определенным пользова
 Summary(uk.UTF-8):     Дозволяє вказаним користувачам виконувати команди від імені root
 Name:          sudo
 Version:       1.8.13
-Release:       2
+Release:       2.1
 Epoch:         1
 License:       BSD
 Group:         Applications/System
@@ -40,6 +40,7 @@ Source3:      %{name}.logrotate
 Source4:       %{name}.tmpfiles
 Patch0:                %{name}-env.patch
 Patch1:                config.patch
+Patch2:                sudo-parse_boottime_properly.patch
 URL:           http://www.sudo.ws/sudo/
 %{?with_audit:BuildRequires:   audit-libs-devel}
 BuildRequires: autoconf >= 2.53
@@ -174,6 +175,7 @@ cp -p acinclude.m4 acinclude.m4.orig
 
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 ! [ -f m4/ax_sys_weak_alias.m4 ] # provide own copy only until it is there
 cp /usr/share/aclocal/ax_sys_weak_alias.m4 m4
This page took 0.188699 seconds and 4 git commands to generate.