mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1660901 - Support the fstat-like subset of fstatat in the Linux sandbox policies. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D88499
This commit is contained in:
parent
271c9183fa
commit
08c45b9f68
@ -243,6 +243,12 @@ class SandboxPolicyCommon : public SandboxPolicyBase {
|
||||
auto path = reinterpret_cast<const char*>(aArgs.args[1]);
|
||||
auto buf = reinterpret_cast<statstruct*>(aArgs.args[2]);
|
||||
auto flags = static_cast<int>(aArgs.args[3]);
|
||||
|
||||
if (fd != AT_FDCWD && (flags & AT_EMPTY_PATH) != 0 &&
|
||||
strcmp(path, "") == 0) {
|
||||
return ConvertError(fstatsyscall(fd, buf));
|
||||
}
|
||||
|
||||
if (fd != AT_FDCWD && path[0] != '/') {
|
||||
SANDBOX_LOG_ERROR("unsupported fd-relative fstatat(%d, \"%s\", %p, %d)",
|
||||
fd, path, buf, flags);
|
||||
|
@ -19,10 +19,12 @@
|
||||
typedef struct stat64 statstruct;
|
||||
# define statsyscall stat64
|
||||
# define lstatsyscall lstat64
|
||||
# define fstatsyscall fstat64
|
||||
#elif defined(__NR_stat)
|
||||
typedef struct stat statstruct;
|
||||
# define statsyscall stat
|
||||
# define lstatsyscall lstat
|
||||
# define fstatsyscall fstat
|
||||
#else
|
||||
# error Missing stat syscall include.
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user