Imported Upstream version 0.6.26

This commit is contained in:
Mario Fetka
2017-10-20 17:10:51 +02:00
parent bebe87317f
commit a6b4158f1f
158 changed files with 13552 additions and 2851 deletions

View File

@@ -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);