Bug 1080567: Don't report registry NAME_NOT_FOUND errors for the Windows warn only sandbox. r=tabraldes

This commit is contained in:
Bob Owen 2014-10-13 15:12:28 +01:00
parent 56add99667
commit 64a69cb8af
2 changed files with 18 additions and 11 deletions

View File

@ -1,4 +1,5 @@
Please add a link to the bugzilla bug and patch name that should be re-applied.
Also, please update any existing links to their actual mozilla-central changeset.
https://bugzilla.mozilla.org/show_bug.cgi?id=1018966 wosChromiumChanges.patch
https://hg.mozilla.org/mozilla-central/rev/e7eef85c1b0a
https://bugzilla.mozilla.org/show_bug.cgi?id=1080567 bug1080567.patch

View File

@ -10,7 +10,7 @@
#include "sandbox/win/src/sandbox_nt_util.h"
#include "sandbox/win/src/sharedmem_ipc_client.h"
#include "sandbox/win/src/target_services.h"
#ifdef MOZ_CONTENT_SANDBOX // For upstream merging, use patch in bug 1018966 to reapply warn only sandbox code
#ifdef MOZ_CONTENT_SANDBOX
#include "mozilla/warnonlysandbox/warnOnlySandbox.h"
#endif
@ -29,9 +29,11 @@ NTSTATUS WINAPI TargetNtCreateKey(NtCreateKeyFunction orig_CreateKey,
return status;
#ifdef MOZ_CONTENT_SANDBOX
mozilla::warnonlysandbox::LogBlocked("NtCreateKey",
object_attributes->ObjectName->Buffer,
object_attributes->ObjectName->Length);
if (STATUS_OBJECT_NAME_NOT_FOUND != status) {
mozilla::warnonlysandbox::LogBlocked("NtCreateKey",
object_attributes->ObjectName->Buffer,
object_attributes->ObjectName->Length);
}
#endif
// We don't trust that the IPC can work this early.
@ -173,9 +175,11 @@ NTSTATUS WINAPI TargetNtOpenKey(NtOpenKeyFunction orig_OpenKey, PHANDLE key,
return status;
#ifdef MOZ_CONTENT_SANDBOX
mozilla::warnonlysandbox::LogBlocked("NtOpenKey",
object_attributes->ObjectName->Buffer,
object_attributes->ObjectName->Length);
if (STATUS_OBJECT_NAME_NOT_FOUND != status) {
mozilla::warnonlysandbox::LogBlocked("NtOpenKey",
object_attributes->ObjectName->Buffer,
object_attributes->ObjectName->Length);
}
#endif
return CommonNtOpenKey(status, key, desired_access, object_attributes);
@ -196,9 +200,11 @@ NTSTATUS WINAPI TargetNtOpenKeyEx(NtOpenKeyExFunction orig_OpenKeyEx,
return status;
#ifdef MOZ_CONTENT_SANDBOX
mozilla::warnonlysandbox::LogBlocked("NtOpenKeyEx",
object_attributes->ObjectName->Buffer,
object_attributes->ObjectName->Length);
if (STATUS_OBJECT_NAME_NOT_FOUND != status) {
mozilla::warnonlysandbox::LogBlocked("NtOpenKeyEx",
object_attributes->ObjectName->Buffer,
object_attributes->ObjectName->Length);
}
#endif
return CommonNtOpenKey(status, key, desired_access, object_attributes);