Added a run_as string in json to configure which user the app has to be run by.
This commit is contained in:
parent
f75e4d236c
commit
7426d1dfd7
1 changed files with 38 additions and 5 deletions
13
appinfo.cpp
13
appinfo.cpp
|
|
@ -52,6 +52,11 @@ void AppInfo::setRunMode(std::string mode)
|
|||
}
|
||||
}
|
||||
|
||||
void AppInfo::setRunAs(std::string run_as)
|
||||
{
|
||||
this->run_as = run_as;
|
||||
}
|
||||
|
||||
void AppInfo::setFinished()
|
||||
{
|
||||
this->state = State::exited;
|
||||
|
|
@ -89,6 +94,11 @@ std::string AppInfo::getProgramName() const
|
|||
return program_name;
|
||||
}
|
||||
|
||||
std::string AppInfo::getRunAs() const
|
||||
{
|
||||
return run_as;
|
||||
}
|
||||
|
||||
std::string AppInfo::getWorkingDir() const
|
||||
{
|
||||
return working_dir;
|
||||
|
|
@ -143,6 +153,7 @@ void AppInfo::copyFromData(AppInfo::AppData &other)
|
|||
this->after = other.after;
|
||||
this->env = other.env;
|
||||
setRunMode(other.run_mode);
|
||||
setRunAs(other.run_as);
|
||||
}
|
||||
|
||||
std::unordered_map<std::shared_ptr<AppInfo>, AppInfo::State> AppInfo::getParents() const
|
||||
|
|
@ -232,6 +243,7 @@ void AppInfo::printInfo(std::ostream &out)
|
|||
env = env.substr(0,env.size() - 2);
|
||||
out << "Environment: " << env << std::endl;
|
||||
out << "Create Log: " << create_log << std::endl;
|
||||
out << "Run as: " << run_as << std::endl;
|
||||
out << "************************************End************************************" << std::endl;
|
||||
}
|
||||
|
||||
|
|
@ -296,6 +308,7 @@ void AppInfo::AppData::printInfo(std::ostream &out)
|
|||
env = env.substr(0,env.size() - 2);
|
||||
out << "Environment: " << env << std::endl;
|
||||
out << "Create Log: " << AppData::create_log << std::endl;
|
||||
out << "Run as: " << run_as << std::endl;
|
||||
out << "************************************End************************************" << std::endl;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue