about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--elf/dl-load.c21
2 files changed, 6 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 086bb81956..297dd703c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-27  Dmitry V. Levin  <ldv@altlinux.org>
+
+	* elf/dl-load.c (_dl_dst_substitute): Remove checks that is_path
+	is set and name contains ':', and all code depending on these checks.
+
 2017-12-24  Zack Weinberg  <zackw@panix.com>
 
 	* libio/libio.h, libio/_G_config.h: New stub headers which issue a
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 2964464158..a60277d311 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -291,13 +291,7 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
 	      /* We cannot use this path element, the value of the
 		 replacement is unknown.  */
 	      wp = last_elem;
-	      name += len;
-	      while (*name != '\0' && (!is_path || *name != ':'))
-		++name;
-	      /* Also skip following colon if this is the first rpath
-		 element, but keep an empty element at the end.  */
-	      if (wp == result && is_path && *name == ':' && name[1] != '\0')
-		++name;
+	      break;
 	    }
 	  else
 	    /* No DST we recognize.  */
@@ -306,19 +300,6 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
       else
 	{
 	  *wp++ = *name++;
-	  if (is_path && *name == ':')
-	    {
-	      /* In SUID/SGID programs, after $ORIGIN expansion the
-		 normalized path must be rooted in one of the trusted
-		 directories.  */
-	      if (__glibc_unlikely (check_for_trusted)
-		  && !is_trusted_path_normalize (last_elem, wp - last_elem))
-		wp = last_elem;
-	      else
-		last_elem = wp;
-
-	      check_for_trusted = false;
-	    }
 	}
     }
   while (*name != '\0');