winix can drop privileges now (if started as the root)

added parameters to the config:
 user (string)
 group (string)
 additional_groups (bool)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@668 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-10-24 17:49:38 +00:00
parent 149fd1629f
commit 9c34cb5862
7 changed files with 268 additions and 18 deletions

View File

@@ -44,7 +44,6 @@ void signal_term(int)
void print_syntax()
{
std::cout << "Syntax:" << std::endl;
@@ -86,6 +85,11 @@ int main(int argv, char ** argc)
log.Init(app.config.log_level, app.config.log_file, app.config.log_stdout, app.config.log_request);
nlog.Init(app.config.log_level, app.config.log_notify_file, false, 1);
if( !app.DropPrivileges() )
return 3;
app.LogUserGroups();
// app.config.base_server can be changed (stripped from 'http://' or a last slash)
// it is done when the config is read
log << log3 << "base_server: " << app.config.base_server << logend;