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