2005-12-27 Jakub Jelinek <jakub@redhat.com>
authorroland <roland>
Mon, 6 Mar 2006 08:40:11 +0000 (08:40 +0000)
committerroland <roland>
Mon, 6 Mar 2006 08:40:11 +0000 (08:40 +0000)
* elf/ldconfig.c (search_dir): Skip prelink temporaries.

elf/ldconfig.c

index 52add4f..359fbdb 100644 (file)
@@ -693,7 +693,20 @@ search_dir (const struct dir_entry *entry)
 #endif
              !is_hwcap_platform (direntry->d_name)))
        continue;
-      len = strlen (entry->path) + strlen (direntry->d_name);
+      len = strlen (direntry->d_name);
+      /* Skip temporary files created by the prelink program.  Files with
+        names like these are never really DSOs we want to look at.  */
+      if (len >= sizeof (".#prelink#") - 1)
+       {
+         if (strcmp (direntry->d_name + len - sizeof (".#prelink#") + 1,
+                     ".#prelink#") == 0)
+           continue;
+         if (len >= sizeof (".#prelink#.XXXXXX") - 1
+             && memcmp (direntry->d_name + len - sizeof (".#prelink#.XXXXXX")
+                        + 1, ".#prelink#.", sizeof (".#prelink#.") - 1) == 0)
+           continue;
+       }
+      len += strlen (entry->path);
       if (len > file_name_len)
        {
          file_name_len = len + 1;