summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
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 07:03:17 -1000
commit60cd2c29eab24d046b08632497a37094e2794612 (patch)
tree56e1376a480ac3ab681034dc0760e6365ed44e18 /meta/recipes-core
parent122c106794b3bfe2fede6d3de8e0a8ec8b856c41 (diff)
downloadpoky-60cd2c29eab24d046b08632497a37094e2794612.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. (From OE-Core rev: e12b81ede54c92e372f0d80373bb91254d0a889f) 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')
-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):
172 # The maximum range for time is 120 days 172 # The maximum range for time is 120 days
173 # Force a complete update if our range is longer 173 # Force a complete update if our range is longer
174 if (database_time != 0): 174 if (database_time != 0):
175 database_date = datetime.datetime.combine(datetime.date.fromtimestamp(database_time), datetime.time()) 175 database_date = datetime.datetime.fromtimestamp(database_time, tz=datetime.timezone.utc)
176 today_date = datetime.datetime.combine(datetime.date.today(), datetime.time()) 176 today_date = datetime.datetime.now(tz=datetime.timezone.utc)
177 delta = today_date - database_date 177 delta = today_date - database_date
178 if delta.days < 120: 178 if delta.days < 120:
179 bb.debug(2, "CVE database: performing partial update") 179 bb.debug(2, "CVE database: performing partial update")