From ca86a763669147f4312d877b322737feb6ff7a3a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 21 Jul 2003 20:17:47 +0000 Subject: Update. 2003-07-21 HJ Lu * elf/ldconfig.c (search_dir): Treat symlink as regular file if it won't point to itself. --- elf/ldconfig.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'elf') diff --git a/elf/ldconfig.c b/elf/ldconfig.c index bb9a3d4c83..1acacb4225 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -787,11 +787,18 @@ search_dir (const struct dir_entry *entry) if (real_name != real_file_name) free (real_name); - /* 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, we treat + it as a normal file. */ + if (strcmp (basename (real_name), soname) != 0) + is_link = 0; + else + { + free (soname); + soname = xstrdup (direntry->d_name); + } } if (flag == FLAG_ELF -- cgit v1.2.1