summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authorrnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-20 06:32:38 +0000
committerrnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-20 06:32:38 +0000
commitf2f4404fba85d2428abf87ca4a8b9d9b5fcc6d71 (patch)
tree1c7a64079a68836da8b11e3a0a8aa7db2b15d23f /sandbox
parentf92003d21aa48d8ec77941caf97aaabb5f5d9c84 (diff)
downloadchromium_src-f2f4404fba85d2428abf87ca4a8b9d9b5fcc6d71.zip
chromium_src-f2f4404fba85d2428abf87ca4a8b9d9b5fcc6d71.tar.gz
chromium_src-f2f4404fba85d2428abf87ca4a8b9d9b5fcc6d71.tar.bz2
Fix clang -Wwritable-strings warnings in the Windows sandbox
R=cpu@chromium.org BUG=82385 Review URL: https://codereview.chromium.org/294753003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271591 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/win/src/job.cc3
-rw-r--r--sandbox/win/src/job.h4
-rw-r--r--sandbox/win/src/named_pipe_policy_test.cc7
-rw-r--r--sandbox/win/src/policy_engine_unittest.cc2
-rw-r--r--sandbox/win/src/policy_low_level_unittest.cc18
5 files changed, 19 insertions, 15 deletions
diff --git a/sandbox/win/src/job.cc b/sandbox/win/src/job.cc
index 060ffa52..62b8d5c 100644
--- a/sandbox/win/src/job.cc
+++ b/sandbox/win/src/job.cc
@@ -14,7 +14,8 @@ Job::~Job() {
::CloseHandle(job_handle_);
};
-DWORD Job::Init(JobLevel security_level, wchar_t *job_name,
+DWORD Job::Init(JobLevel security_level,
+ const wchar_t* job_name,
DWORD ui_exceptions) {
if (job_handle_)
return ERROR_ALREADY_INITIALIZED;
diff --git a/sandbox/win/src/job.h b/sandbox/win/src/job.h
index 487722f..7c215ef 100644
--- a/sandbox/win/src/job.h
+++ b/sandbox/win/src/job.h
@@ -29,7 +29,9 @@ class Job {
// If the function succeeds, the return value is ERROR_SUCCESS. If the
// function fails, the return value is the win32 error code corresponding to
// the error.
- DWORD Init(JobLevel security_level, wchar_t *job_name, DWORD ui_exceptions);
+ DWORD Init(JobLevel security_level,
+ const wchar_t* job_name,
+ DWORD ui_exceptions);
// Assigns the process referenced by process_handle to the job.
// If the function succeeds, the return value is ERROR_SUCCESS. If the
diff --git a/sandbox/win/src/named_pipe_policy_test.cc b/sandbox/win/src/named_pipe_policy_test.cc
index fe8c71f..813cf1f 100644
--- a/sandbox/win/src/named_pipe_policy_test.cc
+++ b/sandbox/win/src/named_pipe_policy_test.cc
@@ -109,9 +109,10 @@ TEST(NamedPipePolicyTest, CreatePipeCanonicalization) {
// disable all string parsing and to send the string that follows it straight
// to the file system."
// http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx
- wchar_t* argv[2] = { L"\\\\?\\pipe\\test\\..\\bleh",
- L"\\Device\\NamedPipe\\test" };
- EXPECT_EQ(SBOX_TEST_SUCCEEDED, NamedPipe_Create(2, argv));
+ const wchar_t* argv[2] = { L"\\\\?\\pipe\\test\\..\\bleh",
+ L"\\Device\\NamedPipe\\test" };
+ EXPECT_EQ(SBOX_TEST_SUCCEEDED,
+ NamedPipe_Create(2, const_cast<wchar_t**>(argv)));
}
// The same test as CreatePipe but this time using strict interceptions.
diff --git a/sandbox/win/src/policy_engine_unittest.cc b/sandbox/win/src/policy_engine_unittest.cc
index e6c3435..f96ff37 100644
--- a/sandbox/win/src/policy_engine_unittest.cc
+++ b/sandbox/win/src/policy_engine_unittest.cc
@@ -60,7 +60,7 @@ TEST(PolicyEngineTest, Rules1) {
opcode_maker.MakeOpAction(FAKE_ACCESS_DENIED, kPolNone);
policy->opcode_count = 7;
- wchar_t* filename = L"c:\\Documents and Settings\\Microsoft\\BLAH.txt";
+ const wchar_t* filename = L"c:\\Documents and Settings\\Microsoft\\BLAH.txt";
unsigned long creation_mode = OPEN_EXISTING;
unsigned long flags = FILE_ATTRIBUTE_NORMAL;
void* security_descriptor = NULL;
diff --git a/sandbox/win/src/policy_low_level_unittest.cc b/sandbox/win/src/policy_low_level_unittest.cc
index 2b5d0f7..c9424c6 100644
--- a/sandbox/win/src/policy_low_level_unittest.cc
+++ b/sandbox/win/src/policy_low_level_unittest.cc
@@ -62,7 +62,7 @@ TEST(PolicyEngineTest, SimpleStrMatch) {
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
EXPECT_TRUE(policyGen.Done());
- wchar_t* filename = L"Z:\\Directory\\domo.txt";
+ const wchar_t* filename = L"Z:\\Directory\\domo.txt";
POLPARAMS_BEGIN(eval_params)
POLPARAM(filename) // Argument 0
@@ -95,7 +95,7 @@ TEST(PolicyEngineTest, SimpleIfNotStrMatch) {
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
EXPECT_TRUE(policyGen.Done());
- wchar_t* filename = NULL;
+ const wchar_t* filename = NULL;
POLPARAMS_BEGIN(eval_params)
POLPARAM(filename) // Argument 0
POLPARAMS_END;
@@ -133,7 +133,7 @@ TEST(PolicyEngineTest, SimpleIfNotStrMatchWild1) {
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
EXPECT_TRUE(policyGen.Done());
- wchar_t* filename = NULL;
+ const wchar_t* filename = NULL;
POLPARAMS_BEGIN(eval_params)
POLPARAM(filename) // Argument 0
POLPARAMS_END;
@@ -166,7 +166,7 @@ TEST(PolicyEngineTest, SimpleIfNotStrMatchWild2) {
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
EXPECT_TRUE(policyGen.Done());
- wchar_t* filename = NULL;
+ const wchar_t* filename = NULL;
POLPARAMS_BEGIN(eval_params)
POLPARAM(filename) // Argument 0
POLPARAMS_END;
@@ -205,7 +205,7 @@ TEST(PolicyEngineTest, IfNotStrMatchTwoRulesWild1) {
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
EXPECT_TRUE(policyGen.Done());
- wchar_t* filename = NULL;
+ const wchar_t* filename = NULL;
unsigned long access = 0;
POLPARAMS_BEGIN(eval_params)
POLPARAM(filename) // Argument 0
@@ -254,7 +254,7 @@ TEST(PolicyEngineTest, IfNotStrMatchTwoRulesWild2) {
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
EXPECT_TRUE(policyGen.Done());
- wchar_t* filename = NULL;
+ const wchar_t* filename = NULL;
unsigned long access = 0;
unsigned long sharing = 66;
@@ -328,7 +328,7 @@ TEST(PolicyEngineTest, OneRuleTest) {
EXPECT_TRUE(policyGen.AddRule(kNtFakeCreateFile, &pr));
EXPECT_TRUE(policyGen.Done());
- wchar_t* filename = L"c:\\Documents and Settings\\Microsoft\\BLAH.txt";
+ const wchar_t* filename = L"c:\\Documents and Settings\\Microsoft\\BLAH.txt";
unsigned long creation_mode = OPEN_EXISTING;
unsigned long flags = FILE_ATTRIBUTE_NORMAL;
void* security_descriptor = NULL;
@@ -484,7 +484,7 @@ TEST(PolicyEngineTest, ThreeRulesTest) {
// Test the policy evaluation.
- wchar_t* filename = L"";
+ const wchar_t* filename = L"";
unsigned long creation_mode = OPEN_EXISTING;
unsigned long flags = FILE_ATTRIBUTE_NORMAL;
void* security_descriptor = NULL;
@@ -588,7 +588,7 @@ TEST(PolicyEngineTest, PolicyRuleCopyConstructorTwoStrings) {
EXPECT_TRUE(policyGen.AddRule(2, &pr_copy));
EXPECT_TRUE(policyGen.Done());
- wchar_t* name = NULL;
+ const wchar_t* name = NULL;
POLPARAMS_BEGIN(eval_params)
POLPARAM(name)
POLPARAMS_END;