Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: child_job_unittest.cc

Issue 3493012: Security patches: RestartJob ignores pid, argv[0]; kill runs as child UID (Closed) Base URL: http://git.chromium.org/git/login_manager.git
Patch Set: added comments, using -1 as suid in setresuid() calls Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « child_job.cc ('k') | mock_system_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "login_manager/child_job.h" 5 #include "login_manager/child_job.h"
6 6
7 #include <gtest/gtest.h> 7 #include <gtest/gtest.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 const char kNewArgsString[] = "ichi ni san"; 124 const char kNewArgsString[] = "ichi ni san";
125 const char* kNewArgsArray[] = { 125 const char* kNewArgsArray[] = {
126 "ichi", 126 "ichi",
127 "ni", 127 "ni",
128 "san" 128 "san"
129 }; 129 };
130 job.SetArguments(kNewArgsString); 130 job.SetArguments(kNewArgsString);
131 131
132 ASSERT_EQ(arraysize(kNewArgsArray), job.arguments_.size()); 132 ASSERT_EQ(arraysize(kNewArgsArray), job.arguments_.size());
133 for (size_t i = 0; i < arraysize(kNewArgsArray); ++i) { 133 EXPECT_EQ(argv[0], job.arguments_[0]);
134 for (size_t i = 1; i < arraysize(kNewArgsArray); ++i) {
134 EXPECT_EQ(kNewArgsArray[i], job.arguments_[i]); 135 EXPECT_EQ(kNewArgsArray[i], job.arguments_[i]);
135 } 136 }
136 } 137 }
137 138
138 } // namespace login_manager 139 } // namespace login_manager
OLDNEW
« no previous file with comments | « child_job.cc ('k') | mock_system_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698