4 ms·
`sudo ldd /usr/sbin/sshd` why would you put `sudo ldd` on a slide.
by stabbles 2y ago
`sudo ldd /usr/sbin/sshd` why would you put `sudo ldd` on a slide.
- deleted 2y ago[deleted]
- xyst 2y agoThe lecturer did state this was very dangerous and should never be done in a real machine. ldd has an unfortunate side effect of actually executing code within some libraries (the exact details, I don’t know. Maybe it’s library specific)
- stabbles 2y agoOn very old glibc ldd used to set an env variable and run the executable. The assumption being that PT_INTERP is set to glibcs dynamic linker. The dynamic linker would dump resolved libraries and stop execution if the variable was set. My guess is they wanted one and only one code path, whereas a separate resolver in `ldd` could get out of sync with the dynamic linker and therefore report incorrect results. But obviously binaries do not have to have an interpreter set at all, or they may point it to any other executable that's not glibcs dynamic linker, and the result is it would just execute like normal. The fact that the lecturer is aware of it makes `sudo ldd` look even more odd.