Create working_dir after setuid/setgid

This commit is contained in:
HanzZ 2011-11-07 19:25:43 +01:00
parent 97e1f91a16
commit 161b220ee1

View file

@ -188,13 +188,6 @@ int main(int argc, char **argv)
#ifndef WIN32
if (!no_daemon) {
// create directories
try {
boost::filesystem::create_directories(CONFIG_STRING(&config, "service.working_dir"));
}
catch (...) {
std::cerr << "Can't create service.working_dir directory " << CONFIG_STRING(&config, "service.working_dir") << ".\n";
return 1;
}
try {
boost::filesystem::create_directories(
boost::filesystem::path(CONFIG_STRING(&config, "service.pidfile")).parent_path().string()
@ -274,6 +267,15 @@ int main(int argc, char **argv)
limit.rlim_max = RLIM_INFINITY;
limit.rlim_cur = RLIM_INFINITY;
setrlimit(RLIMIT_CORE, &limit);
// create directories
try {
boost::filesystem::create_directories(CONFIG_STRING(&config, "service.working_dir"));
}
catch (...) {
std::cerr << "Can't create service.working_dir directory " << CONFIG_STRING(&config, "service.working_dir") << ".\n";
return 1;
}
#endif
Swift::SimpleEventLoop eventLoop;