Added a run_as string in json to configure which user the app has to be run by.

This commit is contained in:
unrealdragon 2026-10-08 13:29:57 +05:30
commit 7426d1dfd7

View file

@ -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;
}