]> git.ipfire.org Git - thirdparty/systemd.git/commit
timedated: Send error when time set is past build date time
authorPavithra Barithaya <pavithrabarithaya07@gmail.com>
Thu, 13 Feb 2025 06:58:40 +0000 (12:28 +0530)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Feb 2025 14:22:15 +0000 (15:22 +0100)
commit6a12c90ca39b45087a84c7faa014f24cd6dc330c
tree13833792ce98ec2d75a086569691eef39baba53c
parent4ce6b7d2b63f0f7c382e1091d5e1aacffde95ba6
timedated: Send error when time set is past build date time

When the user/customer sets the time on the system which is prior
than that of the systemd build time, as systemd doesn't allow time
before it's build date after a reboot, systemd is resetting it but
there is no error or exception present in the setTime method due
to which user/customer is unaware of why the time is reset back to
the systemd-build time.

Added a condition check in the set_time() method to return an
error when tried to set time past the systemd build date.

Tested: Verified that it throws an error when we try to set the
time prior to systemd build date.

Change-Id: Ia6b58320bdb7234a21885a44af8fd3bda64c3789
src/timedate/timedated.c
test/units/TEST-30-ONCLOCKCHANGE.sh