qt5-webengine: fix sandbox large file flag constant for ppc64

This commit is contained in:
q66 2020-09-04 02:01:08 +02:00
parent e5bdd2b120
commit bba182874a

View file

@ -240,20 +240,16 @@ index d9789a713..6ff40c9b0 100644
// Ubuntu's version of glibc has a race condition in sem_post that can cause
// it to call futex(2) with bogus op arguments. To workaround this, we need
// to allow those futex(2) calls to fail with EINVAL, instead of crashing the
@@ -246,9 +261,11 @@ ResultExpr RestrictFcntlCommands() {
// operator.
// Glibc overrides the kernel's O_LARGEFILE value. Account for this.
@@ -259,6 +274,8 @@ ResultExpr RestrictFcntlCommands() {
uint64_t kOLargeFileFlag = O_LARGEFILE;
- if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
+ if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
+ || IsArchitecturePPC64())
if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
kOLargeFileFlag = 0100000;
+ else if (IsArchitecturePPC64())
+ kOLargeFileFlag = 0200000;
+
const Arg<int> cmd(1);
const Arg<long> long_arg(2);
@@ -262,14 +279,23 @@ ResultExpr RestrictFcntlCommands() {
@@ -273,14 +290,23 @@ ResultExpr RestrictFcntlCommands() {
F_SETLKW,
F_GETLK,
F_DUPFD,
@ -280,7 +276,7 @@ index d9789a713..6ff40c9b0 100644
ResultExpr RestrictSocketcallCommand() {
// Unfortunately, we are unable to restrict the first parameter to
// socketpair(2). Whilst initially sounding bad, it's noteworthy that very
@@ -409,7 +435,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
@@ -420,7 +446,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
ResultExpr RestrictPtrace() {
const Arg<int> request(0);
return Switch(request).CASES((