summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-06-23 13:32:50 +0100
committerSteve Sakoman <steve@sakoman.com>2023-07-13 06:39:45 -1000
commit91243ad474be00e55aa99355edef44f2fe2311f1 (patch)
treeb7bb3724b1bb42f6c84d8544061735317083b690 /meta/recipes-core/meta
parent7614e00b9491e5d4d6df5492f72613a56ab390d7 (diff)
downloadopenembedded-core-contrib-91243ad474be00e55aa99355edef44f2fe2311f1.tar.gz
cve-update-nvd2-native: use exact times, don't truncate
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.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9aa0ec37f5f74252588d2494a71c71a7d8e68df9) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-core/meta')
-rw-r--r--meta/recipes-core/meta/cve-update-nvd2-native.bb4
1 files 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 0c627ef262..61f4d47f96 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")