Use O_CLOEXEC when loading objects in ld.so

This commit is contained in:
Ulrich Drepper 2011-09-08 00:00:01 -04:00
parent fdc86bc9a8
commit b49865be8e
2 changed files with 3 additions and 1 deletions

View file

@ -1,5 +1,7 @@
2011-09-07 Ulrich Drepper <drepper@gmail.com>
* elf/dl-load.c (open_verify): Use O_CLOEXEC.
* elf/dl-libc.c (dlerror_run): Pass back error code from
dl_catch_error.

View file

@ -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;