summaryrefslogtreecommitdiff
path: root/src/config.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-02-26 19:24:32 -0500
committerAdam <Adam@anope.org>2014-02-26 19:24:32 -0500
commite2d456d4ce69a9f2d942f5f3c736827c32421960 (patch)
treeaf84aceee0910469242777580a5f10fb2164861e /src/config.cpp
parent96202ae545cc4320020ae82419977096ec526a32 (diff)
Do not setuid/gid down until after modules are loaded
Diffstat (limited to 'src/config.cpp')
-rw-r--r--src/config.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/config.cpp b/src/config.cpp
index 734be17d3..566ff11b7 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -18,13 +18,6 @@
#include "channels.h"
#include "hashcomp.h"
-#ifndef _WIN32
-#include <errno.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
-#endif
-
using namespace Configuration;
File ServicesConf("services.conf", false); // Services configuration file name
@@ -533,31 +526,6 @@ Conf::Conf() : Block("")
if (!options->Get<unsigned>("seed"))
Log() << "Configuration option options:seed should be set. It's for YOUR safety! Remember that!";
-#ifndef _WIN32
- if (!options->Get<const Anope::string>("user").empty())
- {
- errno = 0;
- struct passwd *u = getpwnam(options->Get<const Anope::string>("user").c_str());
- if (u == NULL)
- Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError();
- else if (setuid(u->pw_uid) == -1)
- Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError();
- else
- Log() << "Successfully set user to " << options->Get<const Anope::string>("user");
- }
- if (!options->Get<const Anope::string>("group").empty())
- {
- errno = 0;
- struct group *g = getgrnam(options->Get<const Anope::string>("group").c_str());
- if (g == NULL)
- Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError();
- else if (setuid(g->gr_gid) == -1)
- Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError();
- else
- Log() << "Successfully set group to " << options->Get<const Anope::string>("group");
- }
-#endif
-
if (Config)
{
/* Apply module chnages */