shared: SandboxedProcessor: Fix scope issue with readablePathLocation
The pointer becomes invalid as readablePathLocation falls out of scope, and exile.h quits with an error. This may indicate exile API sucks, so something to think about there.
This commit is contained in:
parent
5ed82a7dda
commit
15615776d3
@ -35,9 +35,10 @@ void SandboxedProcessor::enableSandbox(QString readablePath)
|
|||||||
}
|
}
|
||||||
policy->namespace_options = EXILE_UNSHARE_NETWORK | EXILE_UNSHARE_USER;
|
policy->namespace_options = EXILE_UNSHARE_NETWORK | EXILE_UNSHARE_USER;
|
||||||
|
|
||||||
|
std::string readablePathLocation;
|
||||||
if(!readablePath.isEmpty())
|
if(!readablePath.isEmpty())
|
||||||
{
|
{
|
||||||
std::string readablePathLocation = readablePath.toStdString();
|
readablePathLocation = readablePath.toStdString();
|
||||||
if(exile_append_path_policies(policy, EXILE_FS_ALLOW_ALL_READ, readablePathLocation.c_str()) != 0)
|
if(exile_append_path_policies(policy, EXILE_FS_ALLOW_ALL_READ, readablePathLocation.c_str()) != 0)
|
||||||
{
|
{
|
||||||
qCritical() << "Failed to add path policies";
|
qCritical() << "Failed to add path policies";
|
||||||
|
Loading…
Reference in New Issue
Block a user