firefox: fix sandbox for fcntl

The assumption that O_LARGEFILE is 0 is only true on glibc,
setting it to 00100000 is wrong for many architectures.
This commit is contained in:
Johannes 2020-11-23 22:45:51 +01:00 committed by Johannes
parent 7897abe64f
commit 9b135e65c4
2 changed files with 18 additions and 1 deletions

View file

@ -0,0 +1,17 @@
--- security/sandbox/linux/SandboxFilter.cpp 2020-11-23 22:41:14.556378950 +0100
+++ security/sandbox/linux/SandboxFilter.cpp 2020-11-23 22:40:23.595806444 +0100
@@ -68,7 +68,13 @@
// The headers define O_LARGEFILE as 0 on x86_64, but we need the
// actual value because it shows up in file flags.
-#define O_LARGEFILE_REAL 00100000
+#if defined(__x86_64__) || defined(__i386__) || defined(__mips__)
+#define O_LARGEFILE_REAL 0100000
+#elif defined(__powerpc__)
+#define O_LARGEFILE_REAL 0200000
+#else
+#define O_LARGEFILE_REAL O_LARGEFILE
+#endif
// Not part of UAPI, but userspace sees it in F_GETFL; see bug 1650751.
#define FMODE_NONOTIFY 0x4000000

View file

@ -4,7 +4,7 @@
#
pkgname=firefox
version=83.0
revision=1
revision=2
build_helper="rust"
short_desc="Mozilla Firefox web browser"
maintainer="Johannes <johannes.brechtmann@gmail.com>"