From: Ross Burton <ross.bur...@arm.com>

When requesting updates in a specific range, use the actual current time
and database mtime instead of truncating to midnight, and explicitly set
the timezone to UTC so that NIST don't treat the timestamps as _their_ local
time when they're _our_ local time.

Signed-off-by: Ross Burton <ross.bur...@arm.com>
---
 meta/recipes-core/meta/cve-update-nvd2-native.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/meta/cve-update-nvd2-native.bb 
b/meta/recipes-core/meta/cve-update-nvd2-native.bb
index 0c627ef2623..61f4d47f961 100644
--- a/meta/recipes-core/meta/cve-update-nvd2-native.bb
+++ b/meta/recipes-core/meta/cve-update-nvd2-native.bb
@@ -172,8 +172,8 @@ def update_db_file(db_tmp_file, d, database_time):
     # The maximum range for time is 120 days
     # Force a complete update if our range is longer
     if (database_time != 0):
-        database_date = 
datetime.datetime.combine(datetime.date.fromtimestamp(database_time), 
datetime.time())
-        today_date = datetime.datetime.combine(datetime.date.today(), 
datetime.time())
+        database_date = datetime.datetime.fromtimestamp(database_time, 
tz=datetime.timezone.utc)
+        today_date = datetime.datetime.now(tz=datetime.timezone.utc)
         delta = today_date - database_date
         if delta.days < 120:
             bb.debug(2, "CVE database: performing partial update")
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183329): 
https://lists.openembedded.org/g/openembedded-core/message/183329
Mute This Topic: https://lists.openembedded.org/mt/99717257/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to