From: Ulrich Drepper Date: Thu, 8 Sep 2011 04:00:01 +0000 (-0400) Subject: Use O_CLOEXEC when loading objects in ld.so X-Git-Tag: glibc-2.15~333 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b49865be8e798e567a23c01f188546aef514ba06;p=platform%2Fupstream%2Fglibc.git Use O_CLOEXEC when loading objects in ld.so --- diff --git a/ChangeLog b/ChangeLog index 0d2580d..94d502a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2011-09-07 Ulrich Drepper + * elf/dl-load.c (open_verify): Use O_CLOEXEC. + * elf/dl-libc.c (dlerror_run): Pass back error code from dl_catch_error. diff --git a/elf/dl-load.c b/elf/dl-load.c index 7d7008d..e8d0401 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1706,7 +1706,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader, #endif /* Open the file. We always open files read-only. */ - int fd = __open (name, O_RDONLY); + int fd = __open (name, O_RDONLY | O_CLOEXEC); if (fd != -1) { ElfW(Ehdr) *ehdr;