Your message dated Tue, 3 Jan 2017 23:11:58 +0100
with message-id <[email protected]>
and subject line liblockfile-bin: dotlogfile -r -1 doesn't work - gives up 
immediately
has caused the Debian Bug report #822795,
regarding liblockfile-bin: dotlogfile -r -1 doesn't work - gives up immediately
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
822795: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822795
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: liblockfile-bin
Version: 1.09-6
Severity: normal
Tags: patch

dotlockfile -r -1

doesn't work on x86_64 (haven't tried other archs) - instead of retrying
indefinitely, it never retries (behaves like "-r 0").

This seems to be due to an integer overflow, since:

        int             tries = retries + 1;

so if retries is already INT_MAX then adding one to it will cause it to
overfow.



-- System Information:
Debian Release: 8.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages liblockfile-bin depends on:
ii  libc6  2.19-18+deb8u4

liblockfile-bin recommends no packages.

liblockfile-bin suggests no packages.

-- no debconf information
--- liblockfile-1.09/dotlockfile.c.orig	2011-07-04 17:26:59.000000000 +0100
+++ liblockfile-1.09/dotlockfile.c	2016-04-27 15:46:31.302112422 +0100
@@ -31,6 +31,7 @@
 #include <errno.h>
 #include <maillock.h>
 #include <lockfile.h>
+#include <limits.h>
 
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
@@ -244,8 +245,10 @@
 				return L_ERROR;
 			}
 			if (retries == -1) {
-				/* 4000 years */
-				retries = 2147483647;
+				/* 4000 years with 32bit signed int.  *
+				 * Prevent overflow when we later set *
+				 * tries to retries plus 1            */
+				retries = INT_MAX - 1; 
 			}
 			break;
 		case 'm':

--- End Message ---
--- Begin Message ---
source: liblockfile
version: 1.11-1

Fixed in 1.11-1

--- End Message ---

Reply via email to