I have a program that launches a bunch of tasks with root privileges at startup. After that, he needs to refuse another user. How can I do that?
And just wondering, is it possible to restart root without restarting the program?
The short answer is to use the function setuid().
setuid()
You cannot re-gain root privileges after switching to a non-root user.
Source: https://habr.com/ru/post/1758645/More articles:using SQL database in multiple projects - c #I need a message / queue solution for my web system - pythonRails - How to organize model code? - ruby-on-railsFirefox doesn't close after testing selenium - linuxПроблема с URL при использовании lighttpd, django и fastcgi - djangoA work of art ascii through c # - c #jQuery: how can I apply .blur to * every * child of a div, and not to * any * child of a div? - jquery-selectorsHTML drag & drop best practices - javascriptchecking field values for null - stringCocoa Touch - Color of a round rectangular button? - cocoa-touchAll Articles