]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cve-update-db-native: update the CVE database once a day only
authorMarta Rybczynska <rybczynska@gmail.com>
Mon, 2 May 2022 14:25:35 +0000 (16:25 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 3 May 2022 16:49:31 +0000 (17:49 +0100)
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.

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>
meta/recipes-core/meta/cve-update-db-native.bb

index e5822cee586a4f238142f0a2263ed9692f0ae44a..af39480ddaa3797eb791a9378ce569b68ad711d0 100644 (file)
@@ -43,10 +43,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):
             bb.debug(2, "Recently updated, skipping")
             return
     except OSError: