Changeset - e00778ef4b37
[Not reviewed]
0 1 0
HanzZ - 13 years ago 2013-01-20 21:32:09
hanzz.k@gmail.com
Create backend directory as root before setuid/setgid, otherwise we don't have permissions to do that
1 file changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/logging.cpp
Show inline comments
 
@@ -91,8 +91,11 @@ static intercept_stream* intercepter_cout;
 
static intercept_stream* intercepter_cerr;
 

	
 

	
 
static void initLogging(Config *config, std::string key) {
 
static void initLogging(Config *config, std::string key, bool only_create_dir = false) {
 
	if (CONFIG_STRING(config, key).empty()) {
 
		if (only_create_dir) {
 
			return;
 
		}
 
		root = log4cxx::Logger::getRootLogger();
 
#ifdef _MSC_VER
 
		root->addAppender(new ConsoleAppender(new PatternLayout(L"%d %-5p %c: %m%n")));
 
@@ -157,6 +160,10 @@ static void initLogging(Config *config, std::string key) {
 
			}
 
		}
 

	
 
		if (only_create_dir) {
 
			return;
 
		}
 

	
 
		log4cxx::PropertyConfigurator::configure(p);
 

	
 
		// Change owner of main log file
 
@@ -190,6 +197,7 @@ void initBackendLogging(Config *config) {
 

	
 
void initMainLogging(Config *config) {
 
	initLogging(config, "logging.config");
 
	initLogging(config, "logging.backend_config", true);
 
}
 

	
 
void redirect_stderr() {
0 comments (0 inline, 0 general)