Imported Upstream version 0.6.26
This commit is contained in:
@@ -62,6 +62,15 @@ static void start_daemon(const char *log_name, int facility) {
|
||||
if ((pid = fork()) != 0)
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
/* When dropping privileges from root, the `setgroups` call will
|
||||
* remove any extraneous groups. If we don't call this, then
|
||||
* even though our uid has dropped, we may still have groups
|
||||
* that enable us to do super-user things. This will fail if we
|
||||
* aren't root, so don't bother checking the return value, this
|
||||
* is just done as an optimistic privilege dropping function.
|
||||
*/
|
||||
setgroups(0, NULL);
|
||||
|
||||
/* Get this waise to sessionleader */
|
||||
if (setsid() < 0) {
|
||||
printf("%s could not get sessionleader\n", log_name);
|
||||
|
||||
Reference in New Issue
Block a user