c6d234
commit bb195224acc14724e9fc2dbaa8d0b20b72ace79b
c6d234
Author: Dmitry V. Levin <ldv@altlinux.org>
c6d234
Date:   Sun Dec 17 23:49:46 2017 +0000
c6d234
c6d234
    elf: do not substitute dst in $LD_LIBRARY_PATH twice [BZ #22627]
c6d234
c6d234
Index: glibc-2.17-c758a686/elf/dl-load.c
c6d234
===================================================================
c6d234
--- glibc-2.17-c758a686.orig/elf/dl-load.c
c6d234
+++ glibc-2.17-c758a686/elf/dl-load.c
c6d234
@@ -829,25 +829,7 @@ _dl_init_paths (const char *llp)
c6d234
 
c6d234
   if (llp != NULL && *llp != '\0')
c6d234
     {
c6d234
-      char *llp_tmp;
c6d234
-
c6d234
-#ifdef SHARED
c6d234
-      /* Expand DSTs.  */
c6d234
-      size_t cnt = DL_DST_COUNT (llp, 1);
c6d234
-      if (__builtin_expect (cnt == 0, 1))
c6d234
-	llp_tmp = strdupa (llp);
c6d234
-      else
c6d234
-	{
c6d234
-	  /* Determine the length of the substituted string.  */
c6d234
-	  size_t total = DL_DST_REQUIRED (l, llp, strlen (llp), cnt);
c6d234
-
c6d234
-	  /* Allocate the necessary memory.  */
c6d234
-	  llp_tmp = (char *) alloca (total + 1);
c6d234
-	  llp_tmp = _dl_dst_substitute (l, llp, llp_tmp, 1);
c6d234
-	}
c6d234
-#else
c6d234
-      llp_tmp = strdupa (llp);
c6d234
-#endif
c6d234
+      char *llp_tmp = strdupa (llp);
c6d234
 
c6d234
       /* Decompose the LD_LIBRARY_PATH contents.  First determine how many
c6d234
 	 elements it has.  */