“Operation not permitted” while dropping privileges using setuid() function

孤人 提交于 2019-12-04 07:17:57

Only the superuser or processes with the CAP_SETGID capability are allowed to set the GID. After the setuid() call, the effective UID isn't 0 any more, so you are not allowed to call setgid(). Try to reorder the two calls.

I've fixed using this library

http://pypi.python.org/pypi/privilege/1.0

That securely drop privileges from root to another user.

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