Changeset - 161b220ee132
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-11-07 19:25:43
hanzz.k@gmail.com
Create working_dir after setuid/setgid
1 file changed with 9 insertions and 7 deletions:
0 comments (0 inline, 0 general)
spectrum/src/main.cpp
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)