From dd76704ea5e05a317b454726958c350996b6462b Mon Sep 17 00:00:00 2001 From: Marta Rybczynska Date: Mon, 2 May 2022 16:25:35 +0200 Subject: cve-update-db-native: update the CVE database once a day only The update of the NVD database was expected to happen once per hour. However, the database file date changes only if the content was actually updated. In practice, the check worked for the first hour after the new download. As the NVD database changes usually only once a day, we can just update it less frequently. (From OE-Core rev: d0a56ad3a278e18e766f833619cf97869bdf6a4c) Signed-off-by: Marta Rybczynska Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie (cherry picked from commit 35bccdedadeaba820d58b69fe74ce5e4c1f577e3) Signed-off-by: Steve Sakoman (cherry picked from commit 88f2fb1581a17b2cf59a694ca9afb89e38ed40b5) Signed-off-by: Steve Sakoman Signed-off-by: Richard Purdie --- meta/recipes-core/meta/cve-update-db-native.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb index 50052f8532..a6144979f0 100644 --- a/meta/recipes-core/meta/cve-update-db-native.bb +++ b/meta/recipes-core/meta/cve-update-db-native.bb @@ -42,10 +42,10 @@ python do_fetch() { if os.path.exists(db_file): os.remove(db_file) - # Don't refresh the database more than once an hour + # The NVD database changes once a day, so no need to update more frequently try: import time - if time.time() - os.path.getmtime(db_file) < (60*60): + if time.time() - os.path.getmtime(db_file) < (24*60*60): return except OSError: pass -- cgit v1.2.3-54-g00ecf