summaryrefslogtreecommitdiff
path: root/jail/elf.c
diff options
context:
space:
mode:
authorEtienne CHAMPETIER <champetier.etienne@gmail.com>2015-11-30 23:09:20 +0000
committerJohn Crispin <blogic@openwrt.org>2015-12-11 11:58:33 +0100
commit7646217c0d1775bc95cceb14f5c975ac7d157f05 (patch)
treee318355ef10afb4c3aecea8e6716091517ef9540 /jail/elf.c
parent6f192af24458cff4ca3e3f83533ac4c7f26b33e3 (diff)
downloadprocd-7646217c0d1775bc95cceb14f5c975ac7d157f05.tar.gz
ujail: add O_CLOEXEC flag to open() call
if we forget to close() in the future, this prevent fd leak Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
Diffstat (limited to 'jail/elf.c')
-rw-r--r--jail/elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/jail/elf.c b/jail/elf.c
index b8f2cc5..7c6076a 100644
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -81,7 +81,7 @@ int lib_open(char **fullpath, const char *file)
list_for_each_entry(p, &library_paths, list) {
snprintf(path, sizeof(path), "%s/%s", p->path, file);
- fd = open(path, O_RDONLY);
+ fd = open(path, O_RDONLY|O_CLOEXEC);
if (fd >= 0) {
*fullpath = strdup(path);
break;