[OpenWrt-Devel] [PATCH procd 1/4] ujail: don't add non existant library_path

Etienne CHAMPETIER champetier.etienne at gmail.com
Sun Nov 22 19:39:21 EST 2015


Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/elf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/jail/elf.c b/jail/elf.c
index cbb3051..34a5aca 100644
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -33,6 +33,10 @@ static LIST_HEAD(library_paths);
 
 void alloc_library_path(const char *path)
 {
+	struct stat s;
+	if (stat(path, &s))
+		return;
+
 	struct library_path *p;
 	char *_path;
 
@@ -343,10 +347,6 @@ void load_ldso_conf(const char *conf)
 				load_ldso_conf(gl.gl_pathv[i]);
 			globfree(&gl);
 		} else {
-			struct stat s;
-
-			if (stat(line, &s))
-				continue;
 			alloc_library_path(line);
 		}
 	}
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list