summaryrefslogtreecommitdiffstats
path: root/patches/ima-evm-utils-1.0/0004-evmctl-find-add-missing-error-handling-and-propagate.patch
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2015-11-13 11:16:28 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2015-11-19 11:40:07 +0100
commit13990299f9f1914f128f8ecaba05ad85c0afc5d9 (patch)
tree77735e4aa78c303c432d769cd663ed268c5edff7 /patches/ima-evm-utils-1.0/0004-evmctl-find-add-missing-error-handling-and-propagate.patch
parent784e047d4ca009890cfdda6badcff5e416096911 (diff)
downloadptxdist-13990299f9f1914f128f8ecaba05ad85c0afc5d9.tar.gz
ptxdist-13990299f9f1914f128f8ecaba05ad85c0afc5d9.tar.xz
ima-evm-utils: version bump to 1.0
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'patches/ima-evm-utils-1.0/0004-evmctl-find-add-missing-error-handling-and-propagate.patch')
-rw-r--r--patches/ima-evm-utils-1.0/0004-evmctl-find-add-missing-error-handling-and-propagate.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/ima-evm-utils-1.0/0004-evmctl-find-add-missing-error-handling-and-propagate.patch b/patches/ima-evm-utils-1.0/0004-evmctl-find-add-missing-error-handling-and-propagate.patch
new file mode 100644
index 000000000..1eee4f1bf
--- /dev/null
+++ b/patches/ima-evm-utils-1.0/0004-evmctl-find-add-missing-error-handling-and-propagate.patch
@@ -0,0 +1,40 @@
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Fri, 13 Nov 2015 14:04:37 +0100
+Subject: [PATCH] evmctl: find(): add missing error handling and propagate
+ error
+
+This patch adds the missing error handling to the while() loop in the find()
+function, so that evmctl properly fails on errors.
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ src/evmctl.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/evmctl.c b/src/evmctl.c
+index 19f5f3bc87b0..6606e4958080 100644
+--- a/src/evmctl.c
++++ b/src/evmctl.c
+@@ -1097,13 +1097,20 @@ static int find(const char *path, int dts, find_cb_t func)
+ }
+
+ while ((de = readdir(dir))) {
++ int err;
++
+ if (!strcmp(de->d_name, "..") || !strcmp(de->d_name, "."))
+ continue;
+ log_debug("path: %s, type: %u\n", de->d_name, de->d_type);
+ if (de->d_type == DT_DIR)
+- find(de->d_name, dts, func);
++ err = find(de->d_name, dts, func);
+ else if (dts & (1 << de->d_type))
+- func(de->d_name);
++ err = func(de->d_name);
++
++ if (err) {
++ closedir(dir);
++ return -1;
++ }
+ }
+
+ if (chdir("..")) {