]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use O_CLOEXEC when loading objects in ld.so
authorUlrich Drepper <drepper@gmail.com>
Thu, 8 Sep 2011 04:00:01 +0000 (00:00 -0400)
committerUlrich Drepper <drepper@gmail.com>
Thu, 8 Sep 2011 04:00:01 +0000 (00:00 -0400)
ChangeLog
elf/dl-load.c

index 0d2580d5b9add2ad0825d083310edeaf00d57add..94d502ac6ffdb9c515caa3ab0c8941cbf23f6d35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
 
index 7d7008dd75b8e1f651a2becf6fbf231a355f984b..e8d0401f24804a6c3d223012642c9ac57a10a153 100644 (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;