1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 07:26:37 +02:00

We no longer have to use the rungroup provided at build time, it is specified in the config now

This commit is contained in:
Adam
2012-11-07 17:19:56 -05:00
parent 8b78b6bb10
commit ac57f41c87
3 changed files with 1 additions and 39 deletions
+1 -36
View File
@@ -21,10 +21,8 @@
#include "servers.h"
#ifndef _WIN32
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <grp.h>
#endif
Anope::string conf_dir = "conf", db_dir = "data", modules_dir = "lib", locale_dir = "locale", log_dir = "logs";
@@ -68,37 +66,6 @@ void introduce_user(const Anope::string &user)
/*************************************************************************/
/* Set GID if necessary. Return 0 if successful (or if RUNGROUP not
* defined), else print an error message to logfile and return -1.
*/
static int set_group()
{
#if defined(RUNGROUP) && defined(HAVE_SETGRENT)
struct group *gr;
setgrent();
while ((gr = getgrent()))
{
if (!strcmp(gr->gr_name, RUNGROUP))
break;
}
endgrent();
if (gr)
{
setgid(gr->gr_gid);
}
else
{
Log() << "Unknown run group '" << RUNGROUP << "'";
return -1;
}
#endif
return 0;
}
/*************************************************************************/
/* Vector of pairs of command line arguments and their params */
static std::vector<std::pair<Anope::string, Anope::string> > CommandLineArguments;
@@ -294,9 +261,7 @@ void Init(int ac, char **av)
#if defined(DEFUMASK) && HAVE_UMASK
umask(DEFUMASK);
#endif
if (set_group() < 0)
throw FatalException("set_group() fail");
RegisterTypes();
/* Parse command line arguments */