]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2005-01-07 Jakub Jelinek <jakub@redhat.com>
authorRoland McGrath <roland@gnu.org>
Wed, 16 Feb 2005 11:18:39 +0000 (11:18 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 16 Feb 2005 11:18:39 +0000 (11:18 +0000)
[BZ #738]
* elf/dl-load.c (open_path): If rtld_search_dirs is in RELRO segment,
avoid writing to it if none of the standard search directories exist.

elf/dl-load.c

index eb1a7919fb8d00250491b0a979915670d84ba80f..3da3df7346b2dbebd26ea6047e899c1257ebd8bb 100644 (file)
@@ -1788,7 +1788,12 @@ open_path (const char *name, size_t namelen, int preloaded,
         must not be freed using the general free() in libc.  */
       if (sps->malloced)
        free (sps->dirs);
-      sps->dirs = (void *) -1;
+#ifdef HAVE_Z_RELRO
+      /* rtld_search_dirs is attribute_relro, therefore avoid writing
+        into it.  */
+      if (sps != &rtld_search_dirs)
+#endif
+       sps->dirs = (void *) -1;
     }
 
   return -1;