summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarta Rybczynska <rybczynska@gmail.com>2022-05-02 16:25:35 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-03 17:49:50 +0100
commit0fddde5ded54c25e6af6540cf2d1beec78bab77a (patch)
treeaf1bf6351fb9c292d9f6aab52c16f4664cf130c9
parentf485f6089a79f2b97e9ccf2e3d5930082626cf53 (diff)
downloadpoky-0fddde5ded54c25e6af6540cf2d1beec78bab77a.tar.gz
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: 35bccdedadeaba820d58b69fe74ce5e4c1f577e3) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/meta/cve-update-db-native.bb4
1 files 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 e5822cee58..af39480dda 100644
--- a/meta/recipes-core/meta/cve-update-db-native.bb
+++ b/meta/recipes-core/meta/cve-update-db-native.bb
@@ -43,10 +43,10 @@ python do_fetch() {
43 if os.path.exists(db_file): 43 if os.path.exists(db_file):
44 os.remove(db_file) 44 os.remove(db_file)
45 45
46 # Don't refresh the database more than once an hour 46 # The NVD database changes once a day, so no need to update more frequently
47 try: 47 try:
48 import time 48 import time
49 if time.time() - os.path.getmtime(db_file) < (60*60): 49 if time.time() - os.path.getmtime(db_file) < (24*60*60):
50 bb.debug(2, "Recently updated, skipping") 50 bb.debug(2, "Recently updated, skipping")
51 return 51 return
52 except OSError: 52 except OSError: