Program can't load after setting the setuid bit on

穿精又带淫゛_ 提交于 2019-12-05 06:55:42

As AProgrammer said, while executing setuid programs, $LD_LIBRARY_PATH is ignored. Hence the path has to be hardcoded in the executable itself using this flag while linking

gcc -R $home/lib

The -R flag builds runtime search path list into executable.

Reference: http://www.justskins.com/forums/loading-shared-libraries-from-a-setuid-program-116597.html

In some Unix variants, suid executables have some security features like ignoring LD_LIBRARY_PATH, checking ownership and access rights on the executable and used shared libraries,... I don't remember the case of Solaris, but you should probably check that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!