aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-08-25 21:50:13 +0000
committerUlrich Drepper <drepper@redhat.com>2003-08-25 21:50:13 +0000
commit82d8607da1e320ca964438b8158abb93a9b3d356 (patch)
treea71362b76d5f332d31b9189e299ba8cbe7659ef1
parent1c8c5277a7045ddd3d9b2db50be7e80318b7975c (diff)
downloadglibc-82d8607da1e320ca964438b8158abb93a9b3d356.zip
glibc-82d8607da1e320ca964438b8158abb93a9b3d356.tar.gz
glibc-82d8607da1e320ca964438b8158abb93a9b3d356.tar.bz2
Update.
2003-08-25 Jakub Jelinek <jakub@redhat.com> * elf/ldconfig.c (search_dir): Treat symlink as regular file if it won't point to itself unless it is .so symlink for the linker.
-rw-r--r--ChangeLog5
-rw-r--r--elf/ldconfig.c25
2 files changed, 26 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a7ed602..0dd9c47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-25 Jakub Jelinek <jakub@redhat.com>
+
+ * elf/ldconfig.c (search_dir): Treat symlink as regular file
+ if it won't point to itself unless it is .so symlink for the linker.
+
2003-08-25 Ulrich Drepper <drepper@redhat.com>
* libio/libio.h (_IO_fwide): In the mode==0 optimization, don't
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 444dc73..64c4f64 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -787,16 +787,33 @@ search_dir (const struct dir_entry *entry)
continue;
}
- /* Links will just point to itself. */
+
+ /* A link may just point to itself. */
if (is_link)
{
- free (soname);
- soname = xstrdup (direntry->d_name);
- }
+ /* If the path the link points to isn't its soname and it is not
+ .so symlink for ld(1) only, we treat it as a normal file. */
+ char *real_base_name = basename (real_name);
+
+ if (strcmp (real_base_name, soname) != 0)
+ {
+ len = strlen (real_base_name);
+ if (len < strlen (".so")
+ || strcmp (real_base_name + len - strlen (".so"), ".so") != 0
+ || strncmp (real_base_name, soname, len) != 0)
+ is_link = 0;
+ }
+ }
if (real_name != real_file_name)
free (real_name);
+ if (is_link)
+ {
+ free (soname);
+ soname = xstrdup (direntry->d_name);
+ }
+
if (flag == FLAG_ELF
&& (entry->flag == FLAG_ELF_LIBC5
|| entry->flag == FLAG_ELF_LIBC6))