mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
Fix a tiny bug in shlib support of ldd(1); if dlopen(lib, RTLD_TRACE)
returns, exit gracefully with 0. This fixes the behavior you see when you specify libc.so. It occurs because ldd(1) itself is linked with libc.so. $ ldd /usr/lib/libc.so /usr/lib/libc.so: ldd: /usr/lib/libc.so: (null) /usr/lib/libc.so: exit status 1 Reviewed by: silence of audit@
This commit is contained in:
parent
4cfccbc445
commit
005ba515dc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96818
@ -220,12 +220,13 @@ main(int argc, char *argv[])
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
if (is_shlib == 0) {
|
||||
if (is_shlib) {
|
||||
if (dlopen(*argv, RTLD_TRACE))
|
||||
_exit(0); /* libc.so */
|
||||
warnx("%s: %s", *argv, dlerror());
|
||||
} else {
|
||||
execl(*argv, *argv, (char *)NULL);
|
||||
warn("%s", *argv);
|
||||
} else {
|
||||
dlopen(*argv, RTLD_TRACE);
|
||||
warnx("%s: %s", *argv, dlerror());
|
||||
}
|
||||
_exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user