Skip to content

Commit

Permalink
dracut-install: simplify ldd parsing logic
Browse files Browse the repository at this point in the history
The previous logic would not handle absolute paths on the left side of
the "=>" properly. For example, on Gentoo ARM64, ldd outputs this:

	/lib/ld-linux-aarch64.so.1 => /lib64/ld-linux-aarch64.so.1

At runtime, the kernel tries to load the file from /lib, and fails if we
only provide it in /lib64.

Instead of looking for the first slash after the "=>", just look for the
first slash, period. This would fail if we somehow had a relative path
on the left side (foo/libbar.so), but I'm not aware of any binaries that
would contain such an entry in DT_NEEDED.

Bug: https://bugs.gentoo.org/667752
Signed-off-by: Mike Gilbert <[email protected]>
  • Loading branch information
floppym authored and haraldh committed Oct 9, 2018
1 parent 225e4b9 commit 6d886bb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions install/dracut-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,7 @@ static int resolve_deps(const char *src)
if (strstr(buf, destrootdir))
break;

p = strstr(buf, "=>");
if (!p)
p = buf;

p = strchr(p, '/');
p = strchr(buf, '/');
if (p) {
char *q;

Expand Down

0 comments on commit 6d886bb

Please sign in to comment.