gui: Call setupAppinfo() also for the IPC server

This commit is contained in:
Albert S. 2021-12-30 12:31:32 +01:00
parent 407ee1210c
commit c51487c4b2
2 changed files with 11 additions and 2 deletions

View File

@ -27,13 +27,21 @@ static QMap<QString, Processor *> processors{
void SandboxedProcessor::enableSandbox(QString readablePath) void SandboxedProcessor::enableSandbox(QString readablePath)
{ {
struct exile_policy *policy = exile_init_policy(); struct exile_policy *policy = exile_init_policy();
if(policy == NULL)
{
qCritical() << "Could not init exile";
exit(EXIT_FAILURE);
}
policy->namespace_options = EXILE_UNSHARE_NETWORK | EXILE_UNSHARE_USER; policy->namespace_options = EXILE_UNSHARE_NETWORK | EXILE_UNSHARE_USER;
if(!readablePath.isEmpty()) if(!readablePath.isEmpty())
{ {
std::string readablePathLocation = readablePath.toStdString(); std::string readablePathLocation = readablePath.toStdString();
exile_append_path_policy(policy, EXILE_FS_ALLOW_ALL_READ, readablePathLocation.c_str()); if(exile_append_path_policy(policy, EXILE_FS_ALLOW_ALL_READ, readablePathLocation.c_str()) != 0)
{
qCritical() << "Failed to add path policies";
exit(EXIT_FAILURE);
}
} }
else else
{ {

View File

@ -16,6 +16,7 @@ int main(int argc, char *argv[])
QString socketPath = "/tmp/looqs-spawner"; QString socketPath = "/tmp/looqs-spawner";
if(argc > 1) if(argc > 1)
{ {
Common::setupAppInfo();
QApplication a(argc, argv); QApplication a(argc, argv);
QString arg = argv[1]; QString arg = argv[1];
if(arg == "ipc") if(arg == "ipc")