diff options
author | Adam <Adam@anope.org> | 2012-11-07 17:19:56 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-11-07 19:36:59 -0500 |
commit | ac57f41c8762050190badf1b24d67d260f869e00 (patch) | |
tree | 2de74f53c2104e2ca9c4883317e4bd2eb49946fe | |
parent | 8b78b6bb104e8c1088d066f153967678b50a15a8 (diff) |
We no longer have to use the rungroup provided at build time, it is specified in the config now
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | include/sysconf.h.cmake | 2 | ||||
-rw-r--r-- | src/init.cpp | 37 |
3 files changed, 1 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 502806c3a..52c18e426 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,7 +339,6 @@ check_include_file(stdint.h HAVE_STDINT_H) check_include_file(strings.h HAVE_STRINGS_H) # Check for the existance of the following functions -check_function_exists(setgrent HAVE_SETGRENT) check_function_exists(strcasecmp HAVE_STRCASECMP) check_function_exists(stricmp HAVE_STRICMP) check_function_exists(umask HAVE_UMASK) diff --git a/include/sysconf.h.cmake b/include/sysconf.h.cmake index 8470f81c4..5f0e275c3 100644 --- a/include/sysconf.h.cmake +++ b/include/sysconf.h.cmake @@ -7,7 +7,6 @@ #cmakedefine HAVE_CSTDINT 1 #cmakedefine HAVE_STDINT_H 1 #cmakedefine HAVE_STDDEF_H 1 -#cmakedefine HAVE_SETGRENT 1 #cmakedefine HAVE_STRCASECMP 1 #cmakedefine HAVE_STRICMP 1 #cmakedefine HAVE_STRINGS_H 1 @@ -16,7 +15,6 @@ #cmakedefine HAVE_EPOLL 1 #cmakedefine HAVE_POLL 1 #cmakedefine GETTEXT_FOUND 1 -#cmakedefine RUNGROUP "@RUNGROUP@" #ifdef HAVE_CSTDINT # include <cstdint> diff --git a/src/init.cpp b/src/init.cpp index cd53129a8..94ac7feb2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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 */ |