From dcd41564c56a83c203fdff6649a1c223cbef7e70 Mon Sep 17 00:00:00 2001 From: jdp Date: Tue, 14 Jan 1997 17:53:55 +0000 Subject: [PATCH] If a library is found in the hints file, but the library doesn't exist, ignore the hint. This is a straightforward fix, and it should go into 2.2 after a burn-in period of a few days. Noticed by: bde --- gnu/usr.bin/ld/rtld/rtld.c | 4 ++++ libexec/rtld-aout/rtld.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index cbba78e0d2f6..6321a11ef1b4 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -1711,6 +1711,10 @@ findhint(name, major, minorp) */ if (strcmp(name, hstrtab + bp->hi_namex) == 0 && bp->hi_major == major) { + struct stat s; + + if (stat(hstrtab + bp->hi_pathx, &s) == -1) + return NULL; /* Doesn't actually exist */ *minorp = bp->hi_ndewey >= 2 ? bp->hi_minor : -1; return strdup(hstrtab + bp->hi_pathx); } diff --git a/libexec/rtld-aout/rtld.c b/libexec/rtld-aout/rtld.c index cbba78e0d2f6..6321a11ef1b4 100644 --- a/libexec/rtld-aout/rtld.c +++ b/libexec/rtld-aout/rtld.c @@ -1711,6 +1711,10 @@ findhint(name, major, minorp) */ if (strcmp(name, hstrtab + bp->hi_namex) == 0 && bp->hi_major == major) { + struct stat s; + + if (stat(hstrtab + bp->hi_pathx, &s) == -1) + return NULL; /* Doesn't actually exist */ *minorp = bp->hi_ndewey >= 2 ? bp->hi_minor : -1; return strdup(hstrtab + bp->hi_pathx); }