#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "sandbox/linux/suid/client/setuid_sandbox_host.h"
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <memory>
#include <string>
#include <utility>
#include "base/command_line.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/posix/eintr_wrapper.h"
#include "base/process/launch.h"
#include "base/process/process_metrics.h"
#include "base/strings/string_number_conversions.h"
#include "sandbox/linux/suid/common/sandbox.h"
#include "sandbox/linux/suid/common/suid_unsafe_environment_variables.h"
namespace sandbox {
namespace {
void SetSandboxAPIEnvironmentVariable(base::Environment* env) { … }
void UnsetExpectedEnvironmentVariables(base::EnvironmentMap* env_map) { … }
std::string* CreateSavedVariableName(const char* env_var) { … }
void SaveSUIDUnsafeEnvironmentVariables(base::Environment* env) { … }
const char* GetDevelSandboxPath() { … }
}
std::unique_ptr<SetuidSandboxHost> SetuidSandboxHost::Create() { … }
SetuidSandboxHost::SetuidSandboxHost(std::unique_ptr<base::Environment> env)
: … { … }
SetuidSandboxHost::~SetuidSandboxHost() = default;
bool SetuidSandboxHost::IsDisabledViaEnvironment() { … }
base::FilePath SetuidSandboxHost::GetSandboxBinaryPath() { … }
void SetuidSandboxHost::PrependWrapper(base::CommandLine* cmd_line) { … }
void SetuidSandboxHost::SetupLaunchOptions(
base::LaunchOptions* options,
base::ScopedFD* dummy_fd) { … }
void SetuidSandboxHost::SetupLaunchEnvironment() { … }
}