Sourceware Bugzilla – Attachment 4552 Details for
Bug 10253
RPATH $ORIGIN breaks if resulting path has colons in it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
quick fix
rpath_colon_fix.patch (text/plain), 2.74 KB, created by
Zach Kanzler
on 2010-01-24 09:29:16 UTC
(
hide
)
Description:
quick fix
Filename:
MIME Type:
Creator:
Zach Kanzler
Created:
2010-01-24 09:29:16 UTC
Size:
2.74 KB
patch
obsolete
>diff --git a/elf/dl-load.c b/elf/dl-load.c >index 597193c..62acedb 100644 >--- a/elf/dl-load.c >+++ b/elf/dl-load.c >@@ -378,9 +378,12 @@ static struct r_search_path_struct rtld_search_dirs attribute_relro; > > static size_t max_dirnamelen; > >+// ADDED BY THEY4KMAN (1/24/2010): added link_map variable to use for the new >+// expand_dynamic_string_token call below. > static struct r_search_path_elem ** > fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, >- int check_trusted, const char *what, const char *where) >+ int check_trusted, const char *what, const char *where, >+ struct link_map *l) > { > char *cp; > size_t nelems = 0; >@@ -388,6 +391,11 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, > while ((cp = __strsep (&rpath, sep)) != NULL) > { > struct r_search_path_elem *dirp; >+ >+ // ADDED BY THEY4KMAN (1/24/2010): replacing variables after splitting >+ // paths. >+ cp = expand_dynamic_string_token(l, cp); >+ > size_t len = strlen (cp); > > /* `strsep' can pass an empty string. This has to be >@@ -468,6 +476,9 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, > dirp->dirname = ((char *) dirp + sizeof (*dirp) > + ncapstr * sizeof (enum r_dir_status)); > *((char *) __mempcpy ((char *) dirp->dirname, cp, len)) = '\0'; >+ // ADDED BY THEY4KMAN (1/24/2010): free(cp) the copy we've created >+ // with expand_dynamic_string_token above. >+ free(cp); > dirp->dirnamelen = len; > > if (len > max_dirnamelen) >@@ -551,7 +562,10 @@ decompose_rpath (struct r_search_path_struct *sps, > > /* Make a writable copy. At the same time expand possible dynamic > string tokens. */ >- copy = expand_dynamic_string_token (l, rpath); >+// CHANGED BY THEY4KMAN (1/24/2010): we want to replace variables AFTER >+// splitting the path with colons. >+// copy = expand_dynamic_string_token (l, rpath); >+ copy = local_strdup(rpath); > if (copy == NULL) > { > errstring = N_("cannot create RUNPATH/RPATH copy"); >@@ -576,7 +590,7 @@ decompose_rpath (struct r_search_path_struct *sps, > _dl_signal_error (ENOMEM, NULL, NULL, errstring); > } > >- fillin_rpath (copy, result, ":", 0, what, where); >+ fillin_rpath (copy, result, ":", 0, what, where, l); > > /* Free the copied RPATH string. `fillin_rpath' make own copies if > necessary. */ >@@ -775,7 +789,12 @@ _dl_init_paths (const char *llp) > > (void) fillin_rpath (llp_tmp, env_path_list.dirs, ":;", > INTUSE(__libc_enable_secure), "LD_LIBRARY_PATH", >- NULL); >+ NULL, >+#ifdef SHARED >+ l); >+#else >+ NULL); >+#endif > > if (env_path_list.dirs[0] == NULL) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10253
:
3987
| 4552