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

Unified Diff: child_job.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « child_job.h ('k') | child_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: child_job.cc
diff --git a/child_job.cc b/child_job.cc
index 5d8b3e986c0225b5e07ca40b83d800b72a99e018..df5857528403e059ad9ce1ce084ae5de788dc790 100644
--- a/child_job.cc
+++ b/child_job.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009-2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -126,8 +126,15 @@ const std::string ChildJob::GetName() const {
}
void ChildJob::SetArguments(const std::string& arguments) {
+ std::string argv0;
+ if (!arguments_.empty())
+ argv0 = arguments_[0];
+
arguments_.clear();
SplitString(arguments, ' ', &arguments_);
+
+ if (!argv0.empty())
+ arguments_[0] = argv0;
}
char const** ChildJob::CreateArgv() const {
« no previous file with comments | « child_job.h ('k') | child_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698