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

Side by Side Diff: sandbox/linux/suid/client/setuid_sandbox_host.cc

Issue 2779893005: Continue to clean c_str() calls. (Closed)
Patch Set: Revert changes in font_service_app.cc Created 3 years, 8 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
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | ui/base/clipboard/clipboard_android.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium 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 "sandbox/linux/suid/client/setuid_sandbox_host.h" 5 #include "sandbox/linux/suid/client/setuid_sandbox_host.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 for (unsigned i = 0; kSUIDUnsafeEnvironmentVariables[i]; ++i) { 79 for (unsigned i = 0; kSUIDUnsafeEnvironmentVariables[i]; ++i) {
80 const char* env_var = kSUIDUnsafeEnvironmentVariables[i]; 80 const char* env_var = kSUIDUnsafeEnvironmentVariables[i];
81 // Get the saved environment variable corresponding to envvar. 81 // Get the saved environment variable corresponding to envvar.
82 std::unique_ptr<std::string> saved_env_var( 82 std::unique_ptr<std::string> saved_env_var(
83 CreateSavedVariableName(env_var)); 83 CreateSavedVariableName(env_var));
84 if (!saved_env_var) 84 if (!saved_env_var)
85 continue; 85 continue;
86 86
87 std::string value; 87 std::string value;
88 if (env->GetVar(env_var, &value)) 88 if (env->GetVar(env_var, &value))
89 env->SetVar(saved_env_var->c_str(), value); 89 env->SetVar(*saved_env_var, value);
90 else 90 else
91 env->UnSetVar(saved_env_var->c_str()); 91 env->UnSetVar(*saved_env_var);
92 } 92 }
93 } 93 }
94 94
95 const char* GetDevelSandboxPath() { 95 const char* GetDevelSandboxPath() {
96 return getenv("CHROME_DEVEL_SANDBOX"); 96 return getenv("CHROME_DEVEL_SANDBOX");
97 } 97 }
98 98
99 } // namespace 99 } // namespace
100 100
101 SetuidSandboxHost* SetuidSandboxHost::Create() { 101 SetuidSandboxHost* SetuidSandboxHost::Create() {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // kZygoteIdFd. Fixing this requires a sandbox API change. :( 185 // kZygoteIdFd. Fixing this requires a sandbox API change. :(
186 fds_to_remap->push_back(std::make_pair(dummy_fd->get(), kZygoteIdFd)); 186 fds_to_remap->push_back(std::make_pair(dummy_fd->get(), kZygoteIdFd));
187 } 187 }
188 188
189 void SetuidSandboxHost::SetupLaunchEnvironment() { 189 void SetuidSandboxHost::SetupLaunchEnvironment() {
190 SaveSUIDUnsafeEnvironmentVariables(env_.get()); 190 SaveSUIDUnsafeEnvironmentVariables(env_.get());
191 SetSandboxAPIEnvironmentVariable(env_.get()); 191 SetSandboxAPIEnvironmentVariable(env_.get());
192 } 192 }
193 193
194 } // namespace sandbox 194 } // namespace sandbox
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | ui/base/clipboard/clipboard_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698