This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] * elf/dl-load.c (open_path): avoid writing to 'env_path_list' when none of the search directories exist.
- From: Allan McRae <allan at archlinux dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 13 Oct 2014 10:07:26 +1000
- Subject: [PATCH] * elf/dl-load.c (open_path): avoid writing to 'env_path_list' when none of the search directories exist.
- Authentication-results: sourceware.org; auth=none
From: Bram <bug_rh@spam.wizbit.be>
---
This patch was submitted to BZ#15378 over a year ago. I have an Arch Linux
user running into this bug who confirms the patch fixes their issues.
ChangeLog:
2014-10-xx Bram <bug_rh@spam.wizbit.be>
[BZ #15378]
* elf/dl-load.c (open_path): Avoid writing to 'env_path_list'
when none of the search directories exist.
elf/dl-load.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 9dd40e3..3ac64f3 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1897,9 +1897,9 @@ open_path (const char *name, size_t namelen, int mode,
if (sps->malloced)
free (sps->dirs);
- /* rtld_search_dirs is attribute_relro, therefore avoid writing
- into it. */
- if (sps != &rtld_search_dirs)
+ /* rtld_search_dirs and env_path_list are attribute_relro, therefore
+ avoid writing into it. */
+ if (sps != &rtld_search_dirs && sps != &env_path_list)
sps->dirs = (void *) -1;
}
--
2.1.2