mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1046541 - Use stdio for non-Android Linux sandbox error messages. r=kang
--HG-- extra : rebase_source : e93a4a76f8188d715886e263a366d694c28b4525
This commit is contained in:
parent
1d729bea82
commit
54f805e8b9
@ -26,6 +26,7 @@
|
|||||||
#include "mozilla/dom/Exceptions.h"
|
#include "mozilla/dom/Exceptions.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
|
#include "prenv.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
@ -41,23 +42,14 @@
|
|||||||
#include "SandboxFilter.h"
|
#include "SandboxFilter.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_LOGGING
|
|
||||||
#define FORCE_PR_LOG 1
|
|
||||||
#endif
|
|
||||||
#include "prlog.h"
|
|
||||||
#include "prenv.h"
|
|
||||||
|
|
||||||
// See definition of SandboxDie, below.
|
// See definition of SandboxDie, below.
|
||||||
#include "sandbox/linux/seccomp-bpf/die.h"
|
#include "sandbox/linux/seccomp-bpf/die.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
#define LOG_ERROR(args...) __android_log_print(ANDROID_LOG_ERROR, "Sandbox", ## args)
|
#define LOG_ERROR(args...) __android_log_print(ANDROID_LOG_ERROR, "Sandbox", ## args)
|
||||||
#elif defined(PR_LOGGING)
|
|
||||||
static PRLogModuleInfo* gSeccompSandboxLog;
|
|
||||||
#define LOG_ERROR(args...) PR_LOG(mozilla::gSeccompSandboxLog, PR_LOG_ERROR, (args))
|
|
||||||
#else
|
#else
|
||||||
#define LOG_ERROR(args...)
|
#define LOG_ERROR(fmt, args...) fprintf(stderr, "Sandbox: " fmt, ## args)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -434,13 +426,6 @@ IsSandboxingSupported(void)
|
|||||||
void
|
void
|
||||||
SetCurrentProcessSandbox()
|
SetCurrentProcessSandbox()
|
||||||
{
|
{
|
||||||
#if !defined(ANDROID) && defined(PR_LOGGING)
|
|
||||||
if (!gSeccompSandboxLog) {
|
|
||||||
gSeccompSandboxLog = PR_NewLogModule("SeccompSandbox");
|
|
||||||
}
|
|
||||||
PR_ASSERT(gSeccompSandboxLog);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (InstallSyscallReporter()) {
|
if (InstallSyscallReporter()) {
|
||||||
LOG_ERROR("install_syscall_reporter() failed\n");
|
LOG_ERROR("install_syscall_reporter() failed\n");
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ SandboxFilterImpl::Build() {
|
|||||||
* How are those syscalls found?
|
* How are those syscalls found?
|
||||||
* 1) via strace -p <child pid> or/and
|
* 1) via strace -p <child pid> or/and
|
||||||
* 2) the child will report which system call has been denied by seccomp-bpf,
|
* 2) the child will report which system call has been denied by seccomp-bpf,
|
||||||
* just before exiting, via NSPR or Android logging.
|
* just before exiting
|
||||||
* System call number to name mapping is found in:
|
* System call number to name mapping is found in:
|
||||||
* bionic/libc/kernel/arch-arm/asm/unistd.h
|
* bionic/libc/kernel/arch-arm/asm/unistd.h
|
||||||
* or your libc's unistd.h/kernel headers.
|
* or your libc's unistd.h/kernel headers.
|
||||||
|
Loading…
Reference in New Issue
Block a user