commit 74a7688a81cb539e02431fff6dea8ee204b6ff80 Author: Gian-Carlo Pascutto gcp@mozilla.com Date: Mon Jun 19 20:07:38 2017 +0200
Bug 1374281. r=jld
MozReview-Commit-ID: Ko5m5i4Wkd6
--HG-- extra : rebase_source : 3076315ef3639a89f752addbb01d5d08a9c2db75 --- security/sandbox/linux/broker/SandboxBroker.cpp | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/security/sandbox/linux/broker/SandboxBroker.cpp b/security/sandbox/linux/broker/SandboxBroker.cpp index a31d1fc6684a..d79656c3407f 100644 --- a/security/sandbox/linux/broker/SandboxBroker.cpp +++ b/security/sandbox/linux/broker/SandboxBroker.cpp @@ -360,6 +360,10 @@ AllowOpen(int aReqFlags, int aPerms) if (aReqFlags & O_CREAT) { needed |= SandboxBroker::MAY_CREATE; } + // Linux allows O_TRUNC even with O_RDONLY + if (aReqFlags & O_TRUNC) { + needed |= SandboxBroker::MAY_WRITE; + } return (aPerms & needed) == needed; }
tor-commits@lists.torproject.org