mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-23 11:20:07 +00:00
Fix ldconfig to handle symlinks in chroot correctly.
This commit is contained in:
parent
f297602394
commit
7dee26605b
@ -1,5 +1,8 @@
|
|||||||
2010-05-03 Ulrich Drepper <drepper@redhat.com>
|
2010-05-03 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #11149]
|
||||||
|
* elf/ldconfig.c (search_dir): Fix handling of symlinks in chroot.
|
||||||
|
|
||||||
* elf/chroot_canon.c (chroot_canon): Use xmalloc and xrealloc.
|
* elf/chroot_canon.c (chroot_canon): Use xmalloc and xrealloc.
|
||||||
|
|
||||||
* elf/ldconfig.c (parse_conf_include): Don't fall back to
|
* elf/ldconfig.c (parse_conf_include): Don't fall back to
|
||||||
|
@ -773,7 +773,18 @@ search_dir (const struct dir_entry *entry)
|
|||||||
{
|
{
|
||||||
/* In case of symlink, we check if the symlink refers to
|
/* In case of symlink, we check if the symlink refers to
|
||||||
a directory. */
|
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)
|
if (opt_verbose)
|
||||||
error (0, errno, _("Cannot stat %s"), file_name);
|
error (0, errno, _("Cannot stat %s"), file_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user