shared/gui: Add LOOQS_DISABLE_SANDBOX env to allow disabling sandboxing
Mainly for devs to check whether a problem is caused by sandboxing.
This commit is contained in:
@ -157,6 +157,16 @@ QString Common::databasePath()
|
||||
return env;
|
||||
}
|
||||
|
||||
bool Common::noSandboxModeRequested()
|
||||
{
|
||||
QString env = getenv("LOOQS_DISABLE_SANDBOX");
|
||||
if(env == "1")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString Common::ipcSocketPath()
|
||||
{
|
||||
return "/tmp/.looqs/looqs-ipc-socket";
|
||||
|
@ -15,6 +15,7 @@ QStringList excludedPaths();
|
||||
QStringList mountPaths();
|
||||
bool isTextFile(QFileInfo fileInfo);
|
||||
bool isMountPath(QString path);
|
||||
bool noSandboxModeRequested();
|
||||
QString versionText();
|
||||
} // namespace Common
|
||||
#endif
|
||||
|
@ -27,6 +27,11 @@ static QMap<QString, Processor *> processors{
|
||||
|
||||
void SandboxedProcessor::enableSandbox(QString readablePath)
|
||||
{
|
||||
if(Common::noSandboxModeRequested())
|
||||
{
|
||||
qInfo() << "Sandbox is disabled!" << Qt::endl;
|
||||
return;
|
||||
}
|
||||
struct exile_policy *policy = exile_init_policy();
|
||||
if(policy == NULL)
|
||||
{
|
||||
|
Fai riferimento in un nuovo problema
Block a user