diff options
author | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-13 22:06:07 +0000 |
---|---|---|
committer | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-13 22:06:07 +0000 |
commit | 2c56af1a6677c9b1141778173dcb1b3bdb63f14b (patch) | |
tree | 4f304305f2af8989b051cc139e0dc7a1ca222143 /sandbox/src/filesystem_interception.cc | |
parent | 2e783a8979a41c25f76d58bacc6329d86936b6e0 (diff) | |
download | chromium_src-2c56af1a6677c9b1141778173dcb1b3bdb63f14b.zip chromium_src-2c56af1a6677c9b1141778173dcb1b3bdb63f14b.tar.gz chromium_src-2c56af1a6677c9b1141778173dcb1b3bdb63f14b.tar.bz2 |
Return the right error code when we proxy a call
to the broker.
IIRC we decided to always return access denied because
we did not want to leak the real error code, but this
is bogus for 2 reasons:
1. The broker will return access denied if it's not
allowed in the policy
2. The check to hide the return code is in the renderer,
so it would have been possible for a malicious user to see
it anyway.
I also added a test for it.
BUG:3965
Review URL: http://codereview.chromium.org/10615
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/filesystem_interception.cc')
-rw-r--r-- | sandbox/src/filesystem_interception.cc | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sandbox/src/filesystem_interception.cc b/sandbox/src/filesystem_interception.cc index 5f1a253..8183f12 100644 --- a/sandbox/src/filesystem_interception.cc +++ b/sandbox/src/filesystem_interception.cc @@ -76,7 +76,7 @@ NTSTATUS WINAPI TargetNtCreateFile(NtCreateFileFunction orig_CreateFile, break; if (!NT_SUCCESS(answer.nt_status)) - break; + return answer.nt_status; __try { *file = answer.handle; @@ -144,7 +144,7 @@ NTSTATUS WINAPI TargetNtOpenFile(NtOpenFileFunction orig_OpenFile, PHANDLE file, break; if (!NT_SUCCESS(answer.nt_status)) - break; + return answer.nt_status; __try { *file = answer.handle; @@ -208,9 +208,6 @@ NTSTATUS WINAPI TargetNtQueryAttributesFile( if (SBOX_ALL_OK != code) break; - if (!NT_SUCCESS(answer.nt_status)) - break; - return answer.nt_status; } while (false); @@ -269,9 +266,6 @@ NTSTATUS WINAPI TargetNtQueryFullAttributesFile( if (SBOX_ALL_OK != code) break; - if (!NT_SUCCESS(answer.nt_status)) - break; - return answer.nt_status; } while (false); @@ -348,9 +342,6 @@ NTSTATUS WINAPI TargetNtSetInformationFile( if (SBOX_ALL_OK != code) break; - if (!NT_SUCCESS(answer.nt_status)) - break; - status = answer.nt_status; } while (false); |