[Buildroot] sudo: error while loading shared libraries

Arnout Vandecappelle arnout at mind.be
Wed May 5 18:52:40 UTC 2021



On 05/05/2021 13:14, Uwe Fechner wrote:
> Dear Thomas,
> 
> Thanks for looking into this issue, but your suggestion did not help:
> 
> $ LD_LIBRARY_PATH=/usr/libexec/sudo sudo dmesg
> sudo: error while loading shared libraries: libsudo_util.so.0: cannot open
> shared object file: No such file or directory

 You can also run readelf -d on the binary (on your build machine) to find out
which RUNPATH it uses, and which library it tries to open. If you don't see
libsudo_util.so.0 in there, then it's a dlopen()ed library after all.

 I've done a build locally, and indeed sudo is built with a RUNPATH pointing to
/usr/libexec/sudo.

 I've just created a runtime test for sudo (which I'll post soon) and I can't
reproduce the problem.

> Any other idea?

 I'd run it with strace to find out exactly where it goes wrong.

strace sudo dmesg

(you obviously have to add the strace package to your build first.)

 Note that it's possible that under strace it suddenly does work. That's because
strace drops the setuid bit, and that may be interfering for whatever reason.

 Regards,
 Arnout



More information about the buildroot mailing list