Ignore "operation not permitted" while dropping groups

Without this exception, you can't start ngIRCd as user any more,
it is analog to setting the user and group ID.
This commit is contained in:
Alexander Barton 2013-08-27 00:39:59 +02:00
parent e009ccbe66
commit 41f75b6974
1 changed files with 4 additions and 2 deletions

View File

@ -725,9 +725,11 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
goto out;
}
if (setgroups(0, NULL) != 0) {
Log(LOG_ERR, "Can't drop supplementary group ids: %s!",
real_errno = errno;
Log(LOG_ERR, "Can't drop supplementary group IDs: %s!",
strerror(errno));
goto out;
if (real_errno != EPERM)
goto out;
}
}
#endif