All of lore.kernel.org
 help / color / mirror / Atom feed
From: mariano.lopez@linux.intel.com
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/3] cve-check-tool patch to allow select dir for the db
Date: Wed, 24 Feb 2016 15:27:07 +0000	[thread overview]
Message-ID: <ae976c56455701eb7b7f0d9a95f80baaa388b705.1456327117.git.mariano.lopez@linux.intel.com> (raw)
In-Reply-To: <cover.1456327117.git.mariano.lopez@linux.intel.com>
In-Reply-To: <cover.1456327117.git.mariano.lopez@linux.intel.com>

From: Mariano Lopez <mariano.lopez@linux.intel.com>

This patch allows to select the directory for the
database used by cve-check-tool.

[YOCTO #7515]

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
---
 .../change_logic_cve_get_file_parent.patch         | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 meta/recipes-devtools/cve-check-tool/cve-check-tool/change_logic_cve_get_file_parent.patch

diff --git a/meta/recipes-devtools/cve-check-tool/cve-check-tool/change_logic_cve_get_file_parent.patch b/meta/recipes-devtools/cve-check-tool/cve-check-tool/change_logic_cve_get_file_parent.patch
new file mode 100644
index 0000000..077de88
--- /dev/null
+++ b/meta/recipes-devtools/cve-check-tool/cve-check-tool/change_logic_cve_get_file_parent.patch
@@ -0,0 +1,45 @@
+From 22cc9186909f98f024d78a08504d0bf532806de0 Mon Sep 17 00:00:00 2001
+From: Mariano Lopez <mariano.lopez@linux.intel.com>
+Date: Thu, 18 Feb 2016 14:26:02 +0000
+Subject: [PATCH] util.c: Change logic in cve_get_file_parent()
+
+Function cve_get_file_parent() will try to get the
+realpath and the get the dirname. If the file used
+to get parent doesn't exist the call will fail.
+
+This problem is present when using another directory
+for the database, realpath() won't find the nvd.db
+file and the program will exit quitely.
+
+This patch will first get the dirname and the get
+the realpath to avoid failing when the doesn't exist.
+
+Upstream-Status: Accepted [Release v5.6.3]
+
+Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
+---
+ src/library/util.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/src/library/util.c b/src/library/util.c
+index 8a20728..4d4a576 100644
+--- a/src/library/util.c
++++ b/src/library/util.c
+@@ -184,11 +184,9 @@ bool cve_is_dir(const char *p)
+ 
+ char *cve_get_file_parent(const char *p)
+ {
+-        char *r = realpath(p, NULL);
+-        if (!r) {
+-                return NULL;
+-        }
+-        return dirname(r);
++        autofree(char) *d = strdup(p);
++        char *r = realpath(dirname(d), NULL);
++        return r;
+ }
+ 
+ bool cve_file_set_text(const char *path, char *text)
+-- 
+2.6.2
+
-- 
2.6.2



  parent reply	other threads:[~2016-02-24 23:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 15:27 [PATCH 0/3] Add initial capability to check CVEs for recipes mariano.lopez
2016-02-24 15:27 ` [PATCH 1/3] cve-check-tool: Add recipe mariano.lopez
2016-02-25  0:44   ` Burton, Ross
2016-02-24 15:27 ` mariano.lopez [this message]
2016-02-25 13:33   ` [PATCH 2/3] cve-check-tool patch to allow select dir for the db Burton, Ross
2016-02-25 14:46     ` Mariano Lopez
2016-02-24 15:27 ` [PATCH 3/3] cve-check.bbclass: Add class mariano.lopez
2016-02-29 14:50   ` Burton, Ross
2016-02-29 20:06     ` Mariano Lopez
2016-02-25 12:14 ` [PATCH 0/3] Add initial capability to check CVEs for recipes Mikko.Rapeli
2016-02-25 12:29   ` Mikko.Rapeli
2016-02-25 13:27     ` Mikko.Rapeli
2016-02-25 14:09       ` Mikko.Rapeli
2016-02-26  8:14         ` Mikko.Rapeli
2016-02-26 14:48           ` Mariano Lopez
2016-02-26 14:56             ` Mikko.Rapeli
2016-02-26 14:57               ` Mikko.Rapeli
2016-02-26 15:38                 ` Mariano Lopez
2016-02-29 14:17           ` Burton, Ross
2016-02-29 14:19             ` Mikko.Rapeli
2016-03-01 15:15               ` Mariano Lopez
2016-03-02  6:32                 ` Mikko.Rapeli
     [not found] ` <56CF2B81.4080500@mvista.com>
2016-02-25 17:22   ` Mariano Lopez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae976c56455701eb7b7f0d9a95f80baaa388b705.1456327117.git.mariano.lopez@linux.intel.com \
    --to=mariano.lopez@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.