]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libuuid: reset initial cont-clock time on service start
authorMichael Trapp <michael.trapp@sap.com>
Tue, 10 Feb 2026 14:39:21 +0000 (15:39 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Feb 2026 13:18:07 +0000 (14:18 +0100)
commit2d838b735851a1eee84a779b1d7edc7c43e5d2fe
treefef2e0e7cc21ebe26797eb811f2f36cb6797fae5
parent95c72261dfdfdf06eaf83c786907b19da2c3b650
libuuid: reset initial cont-clock time on service start

When uuidd starts with --cont-clock enabled and reads a stale timestamp
from the state file, the continuous clock logic would apply a backwards
offset (default 2 hours), causing generated UUIDs to have incorrect
timestamps in the past.

Fix this by resetting last_clock_reg to the current time when the saved
timestamp is older than the current clock. This prevents the backwards
offset from being applied at service start.

[kzak@redhat.com: - fix comment, add commit message]

Fixes: https://github.com/util-linux/util-linux/issues/4018
Signed-off-by: Karel Zak <kzak@redhat.com>
libuuid/src/gen_uuid.c