Blame SOURCES/0041-libuuid-check-clock-value-from-LIBUUID_CLOCK_FILE.patch

d017ad
From cede4c481ba0f8fa4256341a0acca33f826fca4f Mon Sep 17 00:00:00 2001
d017ad
From: Michael Trapp <michael.trapp@sap.com>
d017ad
Date: Tue, 2 Aug 2022 14:16:43 +0200
d017ad
Subject: libuuid: check clock value from LIBUUID_CLOCK_FILE
d017ad
d017ad
The clock value from the LIBUUID_CLOCK_FILE must be checked in
d017ad
case of an update of libuuid. If clock==CLOCK_SEQ_CONT it must
d017ad
be set to a new value.
d017ad
d017ad
Upstream: http://github.com/util-linux/util-linux/commit/5d1424d85ac9e2a1369ee920038825c154ee5443
d017ad
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2141970
d017ad
Signed-off-by: Karel Zak <kzak@redhat.com>
d017ad
---
d017ad
 libuuid/src/gen_uuid.c | 5 +++++
d017ad
 1 file changed, 5 insertions(+)
d017ad
d017ad
diff --git a/libuuid/src/gen_uuid.c b/libuuid/src/gen_uuid.c
d017ad
index ac682a1d8..f05db467e 100644
d017ad
--- a/libuuid/src/gen_uuid.c
d017ad
+++ b/libuuid/src/gen_uuid.c
d017ad
@@ -274,6 +274,11 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low,
d017ad
 			last.tv_usec = tv2;
d017ad
 			adjustment = a;
d017ad
 		}
d017ad
+		// reset in case of reserved CLOCK_SEQ_CONT
d017ad
+		if (clock_seq == CLOCK_SEQ_CONT) {
d017ad
+			last.tv_sec = 0;
d017ad
+			last.tv_usec = 0;
d017ad
+		}
d017ad
 	}
d017ad
 
d017ad
 	if ((last.tv_sec == 0) && (last.tv_usec == 0)) {
d017ad
-- 
d017ad
2.39.1
d017ad