dcavalca / rpms / util-linux

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