From c51487c4b233bdb39240b4bffd5d34fafc040090 Mon Sep 17 00:00:00 2001 From: Albert S Date: Thu, 30 Dec 2021 12:31:32 +0100 Subject: [PATCH] gui: Call setupAppinfo() also for the IPC server --- cli/sandboxedprocessor.cpp | 12 ++++++++++-- gui/main.cpp | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cli/sandboxedprocessor.cpp b/cli/sandboxedprocessor.cpp index 3f722d9..69444ba 100644 --- a/cli/sandboxedprocessor.cpp +++ b/cli/sandboxedprocessor.cpp @@ -27,13 +27,21 @@ static QMap processors{ void SandboxedProcessor::enableSandbox(QString readablePath) { 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; if(!readablePath.isEmpty()) { 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 { diff --git a/gui/main.cpp b/gui/main.cpp index dffd466..9449d18 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -16,6 +16,7 @@ int main(int argc, char *argv[]) QString socketPath = "/tmp/looqs-spawner"; if(argc > 1) { + Common::setupAppInfo(); QApplication a(argc, argv); QString arg = argv[1]; if(arg == "ipc")