diff options
author | Ulrich Drepper <drepper@redhat.com> | 2010-05-03 14:04:52 -0700 |
---|---|---|
committer | Petr Baudis <pasky@ucw.cz> | 2010-05-12 03:21:22 +0200 |
commit | 50a66cf51789d82e515951a9d378bfacc0289df7 (patch) | |
tree | 1897340cffdd1223ee77c356c99de0898aa1be79 /elf/ldconfig.c | |
parent | c4e15a30bd196e2201f4d183fc1bdec4f562be10 (diff) |
Fix ldconfig to handle symlinks in chroot correctly.
(cherry picked from commit 7dee26605bf8627f0673f81635c38c8a565dd2b7)
Diffstat (limited to 'elf/ldconfig.c')
-rw-r--r-- | elf/ldconfig.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/elf/ldconfig.c b/elf/ldconfig.c index 0d07a6075a..da77d80de6 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -773,7 +773,18 @@ search_dir (const struct dir_entry *entry) { /* In case of symlink, we check if the symlink refers to a directory. */ - if (__builtin_expect (stat64 (real_file_name, &stat_buf), 0)) + char *target_name = real_file_name; + if (opt_chroot) + { + target_name = chroot_canon (opt_chroot, file_name); + if (target_name == NULL) + { + if (strstr (file_name, ".so") == NULL) + error (0, 0, _("Input file %s not found.\n"), file_name); + continue; + } + } + if (__builtin_expect (stat64 (target_name, &stat_buf), 0)) { if (opt_verbose) error (0, errno, _("Cannot stat %s"), file_name); |