olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1540480-6.patch

00db10
commit 2bd86632b7cb97dc9002a23795e140fc880e1987
00db10
Author: Dmitry V. Levin <ldv@altlinux.org>
00db10
Date:   Wed Dec 20 11:27:51 2017 +0000
00db10
00db10
    elf: remove redundant is_path argument
00db10
    
00db10
    is_path argument is no longer used and could be safely removed.
00db10
    
00db10
    * elf/dl-dst.h (DL_DST_COUNT): Remove is_path argument, all callers
00db10
    updated.
00db10
    * elf/dl-load.c (is_dst, _dl_dst_count, _dl_dst_substitute,
00db10
    expand_dynamic_string_token): Likewise.
00db10
    * sysdeps/generic/ldsodefs.h (_dl_dst_count, _dl_dst_substitute): Remove
00db10
    is_path argument.
00db10
00db10
Index: glibc-2.17-c758a686/elf/dl-deps.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/elf/dl-deps.c
00db10
+++ glibc-2.17-c758a686/elf/dl-deps.c
00db10
@@ -101,7 +101,7 @@ struct list
00db10
   ({									      \
00db10
     const char *__str = (str);						      \
00db10
     const char *__result = __str;					      \
00db10
-    size_t __dst_cnt = DL_DST_COUNT (__str, 0);				      \
00db10
+    size_t __dst_cnt = DL_DST_COUNT (__str);				      \
00db10
 									      \
00db10
     if (__dst_cnt != 0)							      \
00db10
       {									      \
00db10
@@ -115,7 +115,7 @@ DST not allowed in SUID/SGID programs"))
00db10
 	__newp = (char *) alloca (DL_DST_REQUIRED (l, __str, strlen (__str),  \
00db10
 						   __dst_cnt));		      \
00db10
 									      \
00db10
-	__result = _dl_dst_substitute (l, __str, __newp, 0);		      \
00db10
+	__result = _dl_dst_substitute (l, __str, __newp);		      \
00db10
 									      \
00db10
 	if (*__result == '\0')						      \
00db10
 	  {								      \
00db10
Index: glibc-2.17-c758a686/elf/dl-dst.h
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/elf/dl-dst.h
00db10
+++ glibc-2.17-c758a686/elf/dl-dst.h
00db10
@@ -20,13 +20,13 @@
00db10
 
00db10
 /* Determine the number of DST elements in the name.  Only if IS_PATH is
00db10
    nonzero paths are recognized (i.e., multiple, ':' separated filenames).  */
00db10
-#define DL_DST_COUNT(name, is_path) \
00db10
+#define DL_DST_COUNT(name) \
00db10
   ({									      \
00db10
     size_t __cnt = 0;							      \
00db10
     const char *__sf = strchr (name, '$');				      \
00db10
 									      \
00db10
     if (__builtin_expect (__sf != NULL, 0))				      \
00db10
-      __cnt = _dl_dst_count (__sf, is_path);			      \
00db10
+      __cnt = _dl_dst_count (__sf);					      \
00db10
 									      \
00db10
     __cnt; })
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
@@ -232,8 +232,7 @@ is_trusted_path_normalize (const char *p
00db10
 
00db10
 
00db10
 static size_t
00db10
-is_dst (const char *start, const char *name, const char *str,
00db10
-	int is_path, int secure)
00db10
+is_dst (const char *start, const char *name, const char *str, int secure)
00db10
 {
00db10
   size_t len;
00db10
   bool is_curly = false;
00db10
@@ -271,7 +270,7 @@ is_dst (const char *start, const char *n
00db10
 
00db10
 
00db10
 size_t
00db10
-_dl_dst_count (const char *name, int is_path)
00db10
+_dl_dst_count (const char *name)
00db10
 {
00db10
   const char *const start = name;
00db10
   size_t cnt = 0;
00db10
@@ -283,10 +282,9 @@ _dl_dst_count (const char *name, int is_
00db10
       /* $ORIGIN is not expanded for SUID/GUID programs (except if it
00db10
 	 is $ORIGIN alone) and it must always appear first in path.  */
00db10
       ++name;
00db10
-      if ((len = is_dst (start, name, "ORIGIN", is_path,
00db10
-			 INTUSE(__libc_enable_secure))) != 0
00db10
-	  || (len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0
00db10
-	  || (len = is_dst (start, name, "LIB", is_path, 0)) != 0)
00db10
+      if ((len = is_dst (start, name, "ORIGIN", INTUSE(__libc_enable_secure))) != 0
00db10
+	  || (len = is_dst (start, name, "PLATFORM", 0)) != 0
00db10
+	  || (len = is_dst (start, name, "LIB", 0)) != 0)
00db10
 	++cnt;
00db10
 
00db10
       name = strchr (name + len, '$');
00db10
@@ -298,8 +296,7 @@ _dl_dst_count (const char *name, int is_
00db10
 
00db10
 
00db10
 char *
00db10
-_dl_dst_substitute (struct link_map *l, const char *name, char *result,
00db10
-		    int is_path)
00db10
+_dl_dst_substitute (struct link_map *l, const char *name, char *result)
00db10
 {
00db10
   const char *const start = name;
00db10
 
00db10
@@ -319,8 +316,7 @@ _dl_dst_substitute (struct link_map *l,
00db10
 	  size_t len;
00db10
 
00db10
 	  ++name;
00db10
-	  if ((len = is_dst (start, name, "ORIGIN", is_path,
00db10
-			     INTUSE(__libc_enable_secure))) != 0)
00db10
+	  if ((len = is_dst (start, name, "ORIGIN", INTUSE(__libc_enable_secure))) != 0)
00db10
 	    {
00db10
 #ifndef SHARED
00db10
 	      if (l == NULL)
00db10
@@ -332,9 +328,9 @@ _dl_dst_substitute (struct link_map *l,
00db10
 	      check_for_trusted = (INTUSE(__libc_enable_secure)
00db10
 				   && l->l_type == lt_executable);
00db10
 	    }
00db10
-	  else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)
00db10
+	  else if ((len = is_dst (start, name, "PLATFORM", 0)) != 0)
00db10
 	    repl = GLRO(dl_platform);
00db10
-	  else if ((len = is_dst (start, name, "LIB", is_path, 0)) != 0)
00db10
+	  else if ((len = is_dst (start, name, "LIB", 0)) != 0)
00db10
 	    repl = DL_DST_LIB;
00db10
 
00db10
 	  if (repl != NULL && repl != (const char *) -1)
00db10
@@ -378,7 +374,7 @@ _dl_dst_substitute (struct link_map *l,
00db10
    belonging to the map is loaded.  In this case the path element
00db10
    containing $ORIGIN is left out.  */
00db10
 static char *
00db10
-expand_dynamic_string_token (struct link_map *l, const char *s, int is_path)
00db10
+expand_dynamic_string_token (struct link_map *l, const char *s)
00db10
 {
00db10
   /* We make two runs over the string.  First we determine how large the
00db10
      resulting string is and then we copy it over.  Since this is no
00db10
@@ -389,7 +385,7 @@ expand_dynamic_string_token (struct link
00db10
   char *result;
00db10
 
00db10
   /* Determine the number of DST elements.  */
00db10
-  cnt = DL_DST_COUNT (s, is_path);
00db10
+  cnt = DL_DST_COUNT (s);
00db10
 
00db10
   /* If we do not have to replace anything simply copy the string.  */
00db10
   if (__builtin_expect (cnt, 0) == 0)
00db10
@@ -403,7 +399,7 @@ expand_dynamic_string_token (struct link
00db10
   if (result == NULL)
00db10
     return NULL;
00db10
 
00db10
-  return _dl_dst_substitute (l, s, result, is_path);
00db10
+  return _dl_dst_substitute (l, s, result);
00db10
 }
00db10
 
00db10
 
00db10
@@ -458,7 +454,7 @@ fillin_rpath (char *rpath, struct r_sear
00db10
     {
00db10
       struct r_search_path_elem *dirp;
00db10
 
00db10
-      to_free = cp = expand_dynamic_string_token (l, cp, 1);
00db10
+      to_free = cp = expand_dynamic_string_token (l, cp);
00db10
 
00db10
       size_t len = strlen (cp);
00db10
 
00db10
@@ -2263,7 +2259,7 @@ _dl_map_object (struct link_map *loader,
00db10
     {
00db10
       /* The path may contain dynamic string tokens.  */
00db10
       realname = (loader
00db10
-		  ? expand_dynamic_string_token (loader, name, 0)
00db10
+		  ? expand_dynamic_string_token (loader, name)
00db10
 		  : local_strdup (name));
00db10
       if (realname == NULL)
00db10
 	fd = -1;
00db10
Index: glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/sysdeps/generic/ldsodefs.h
00db10
+++ glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h
00db10
@@ -983,11 +983,11 @@ extern void _dl_nothread_init_static_tls
00db10
 extern const char *_dl_get_origin (void) attribute_hidden;
00db10
 
00db10
 /* Count DSTs.  */
00db10
-extern size_t _dl_dst_count (const char *name, int is_path) attribute_hidden;
00db10
+extern size_t _dl_dst_count (const char *name) attribute_hidden;
00db10
 
00db10
 /* Substitute DST values.  */
00db10
 extern char *_dl_dst_substitute (struct link_map *l, const char *name,
00db10
-				 char *result, int is_path) attribute_hidden;
00db10
+				 char *result) attribute_hidden;
00db10
 
00db10
 /* Check validity of the caller.  */
00db10
 extern int _dl_check_caller (const void *caller, enum allowmask mask)