[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libc6_2.0.7r-3 considered harmful



In article <[🔎] Pine.LNX.3.96.980703194259.26531C-100000@dwarf.polaris.net> you wrote:
> I've tested the -4 version with:

> env LD_PRELOAD= ls

> env LD_PRELOAD=/lib/libc.so.6 ls

>        and

> env LS_PRELOAD=/lib/glc.so.2 ls

> each of which work as expected. (The last example gives the expected "not
> found" error)

> Unless I have still missed a potential test :-( this is a complete fix.

Sorry, I missed the /etc/ld.so.preload case since I wasn't aware of it at the
time despite someone raising it to me on IRC.  It's basically the same problem.
Also, my original solution deleted the code to deal with the '::' case which
David inserted.  Here's my revised patch against -4.

-- 
Debian GNU/Linux 2.0beta is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
--- rtld.c.orig	Sat Jul  4 05:19:53 1998
+++ rtld.c	Sat Jul  4 05:18:43 1998
@@ -366,13 +366,18 @@
       char *p;
       list += strspn (list, " :");
       while (list && *list && (p = strsep (&list, " :")) != NULL)
-	if (! __libc_enable_secure || strchr (p, '/') == NULL)
-	  {
-	    struct link_map *new_map = _dl_map_object (l, p, 1, lt_library, 0);
-	    if (new_map->l_opencount == 1)
-	      /* It is no duplicate.  */
-	      ++npreloads;
-	  }
+	{
+	  if (! __libc_enable_secure || strchr (p, '/') == NULL)
+	    {
+	      struct link_map *new_map = _dl_map_object (l, p, 1, lt_library, 0);
+	      if (new_map->l_opencount == 1)
+	        /* It is no duplicate.  */
+	        ++npreloads;
+	    }
+
+	  if (list != NULL)
+	    list += strspn (list, " :");
+	}
     }
 
   /* Read the contents of the file.  */
@@ -428,7 +433,7 @@
 	{
 	  char *p;
 	  runp = file + strspn (file, ": \t\n");
-          while (*runp && (p = strsep (&runp, ": \t\n")) != NULL)
+          while (runp && *runp && (p = strsep (&runp, ": \t\n")) != NULL)
 	    {
 	      struct link_map *new_map = _dl_map_object (l, p, 1,
 							 lt_library, 0);


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: