From d36b80c791a10d976f30388b8393136a85c14532 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 29 Apr 2015 13:53:14 +0200 Subject: kconfig: avoid using wordexp OpenBSD refuses to implement it due to security concerns, so use glob instead. Change-Id: I7531cfe91deff240f7874d94d5acb340b87e51b6 Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/10028 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/kconfig/zconf.l | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'util/kconfig/zconf.l') diff --git a/util/kconfig/zconf.l b/util/kconfig/zconf.l index b19e4de43c..e20d9c238e 100644 --- a/util/kconfig/zconf.l +++ b/util/kconfig/zconf.l @@ -8,12 +8,12 @@ * Released under the terms of the GNU GPL v2.0. */ +#include #include #include #include #include #include -#include #include "lkc.h" @@ -339,17 +339,23 @@ void zconf_nextfile(const char *name) void zconf_nextfiles(const char *wildcard) { - wordexp_t p; + glob_t g; char **w; int i; - wordexp(wildcard, &p, 0); - w = p.we_wordv; + if (glob(wildcard, 0, NULL, &g) != 0) { + return; + } + if (g.gl_pathv == NULL) { + globfree(&g); + return; + } - for (i = p.we_wordc - 1; i >= 0; i--) - zconf_nextfile(w[i]); + w = g.gl_pathv; + while (*w) + zconf_nextfile(*w++); - wordfree(&p); + globfree(&g); } static void zconf_endfile(void) -- cgit v1.2.3