This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
ldd functionality from suid binary
- From: Renáta Hodován <hodovan at inf dot u-szeged dot hu>
- To: libc-help at sourceware dot org
- Date: Thu, 12 Jul 2012 20:56:27 +0200
- Subject: ldd functionality from suid binary
Hi there,
I have a problem what I hope you can help in. I need a C++ function what
is able to work out an ldd-like functionality (this should be a part of
a bigger project). I already have a solution and you can find its
simplified version under the following link:
http://pastebin.com/3SwYj5vR
Unfortunately the binary, what will contain this code, has suid flag.
And in this case my example exits with status 5 error message (without
suid the code works fine).
I investigated the code of ldd and found the following in rtld.c :
process_dl_audit function:
if (mode != normal)
_exit (5);
So it seems to me that ldd doesn't work for suid binaries. But I hope
that I'm wrong.
This is why I'd like to ask your help to find a solution/workaround!
Thanks in advance,
Renata Hodovan