diff options
author | Etienne CHAMPETIER <champetier.etienne@gmail.com> | 2015-11-30 23:09:20 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-12-11 11:58:33 +0100 |
commit | 7646217c0d1775bc95cceb14f5c975ac7d157f05 (patch) | |
tree | e318355ef10afb4c3aecea8e6716091517ef9540 /jail/elf.c | |
parent | 6f192af24458cff4ca3e3f83533ac4c7f26b33e3 (diff) | |
download | procd-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |