mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Use newer gflags namespace for command-line flags
PiperOrigin-RevId: 251639941 Change-Id: I3037ce9510a3bc62cf5c899c64f2e7d344a8b4ee
This commit is contained in:
parent
1b2b83676b
commit
9b78e331fa
|
@ -418,9 +418,9 @@ void ServeRequest(sandbox2::Comms* comms) {
|
||||||
} // namespace sapi
|
} // namespace sapi
|
||||||
|
|
||||||
extern "C" ABSL_ATTRIBUTE_WEAK int main(int argc, char** argv) {
|
extern "C" ABSL_ATTRIBUTE_WEAK int main(int argc, char** argv) {
|
||||||
google::SetCommandLineOptionWithMode("userspace_coredumper", "false",
|
gflags::SetCommandLineOptionWithMode("userspace_coredumper", "false",
|
||||||
google::SET_FLAG_IF_DEFAULT);
|
gflags::SET_FLAG_IF_DEFAULT);
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
google::InitGoogleLogging(argv[0]);
|
google::InitGoogleLogging(argv[0]);
|
||||||
|
|
||||||
// Note regarding the FD usage here: Parent and child seem to make use of the
|
// Note regarding the FD usage here: Parent and child seem to make use of the
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#define Z_STREAM_END 1
|
#define Z_STREAM_END 1
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
google::InitGoogleLogging(argv[0]);
|
google::InitGoogleLogging(argv[0]);
|
||||||
|
|
||||||
sapi::Sandbox sandbox(sapi::zlib::zlib_sapi_embed_create());
|
sapi::Sandbox sandbox(sapi::zlib::zlib_sapi_embed_create());
|
||||||
|
|
|
@ -46,7 +46,7 @@ static uint32_t ComputeCRC4Impl(const uint8_t* ptr, uint64_t len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
google::ParseCommandLineFlags(&argc, &argv, false);
|
gflags::ParseCommandLineFlags(&argc, &argv, false);
|
||||||
|
|
||||||
// Set-up the sandbox2::Client object, using a file descriptor (1023).
|
// Set-up the sandbox2::Client object, using a file descriptor (1023).
|
||||||
sandbox2::Comms comms(sandbox2::Comms::kSandbox2ClientCommsFD);
|
sandbox2::Comms comms(sandbox2::Comms::kSandbox2ClientCommsFD);
|
||||||
|
|
|
@ -82,7 +82,7 @@ bool SandboxedCRC4(sandbox2::Comms* comms, uint32_t* crc4) {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
google::InitGoogleLogging(argv[0]);
|
google::InitGoogleLogging(argv[0]);
|
||||||
|
|
||||||
if (absl::GetFlag(FLAGS_input).empty()) {
|
if (absl::GetFlag(FLAGS_input).empty()) {
|
||||||
|
|
|
@ -39,9 +39,9 @@ static int SandboxeeFunction(sandbox2::Comms* comms) {
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
// Writing to stderr limits the number of invoked syscalls.
|
// Writing to stderr limits the number of invoked syscalls.
|
||||||
google::SetCommandLineOptionWithMode("logtostderr", "true",
|
gflags::SetCommandLineOptionWithMode("logtostderr", "true",
|
||||||
google::SET_FLAG_IF_DEFAULT);
|
gflags::SET_FLAG_IF_DEFAULT);
|
||||||
google::ParseCommandLineFlags(&argc, &argv, false);
|
gflags::ParseCommandLineFlags(&argc, &argv, false);
|
||||||
|
|
||||||
// Instantiate Comms channel with the parent Executor
|
// Instantiate Comms channel with the parent Executor
|
||||||
sandbox2::Comms comms(sandbox2::Comms::kSandbox2ClientCommsFD);
|
sandbox2::Comms comms(sandbox2::Comms::kSandbox2ClientCommsFD);
|
||||||
|
|
|
@ -107,7 +107,7 @@ static int SandboxIteration(sandbox2::ForkClient* fork_client, int32_t i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
google::InitGoogleLogging(argv[0]);
|
google::InitGoogleLogging(argv[0]);
|
||||||
|
|
||||||
// Start a custom fork-server (via sandbox2::Executor).
|
// Start a custom fork-server (via sandbox2::Executor).
|
||||||
|
|
|
@ -98,7 +98,7 @@ std::unique_ptr<sandbox2::Policy> GetPolicy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
google::InitGoogleLogging(argv[0]);
|
google::InitGoogleLogging(argv[0]);
|
||||||
|
|
||||||
const std::string path = sandbox2::GetInternalDataDependencyFilePath(
|
const std::string path = sandbox2::GetInternalDataDependencyFilePath(
|
||||||
|
|
|
@ -96,7 +96,7 @@ void OutputFD(int fd) {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
google::InitGoogleLogging(argv[0]);
|
google::InitGoogleLogging(argv[0]);
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
|
|
|
@ -64,7 +64,7 @@ std::unique_ptr<sandbox2::Policy> GetPolicy() {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
google::InitGoogleLogging(argv[0]);
|
google::InitGoogleLogging(argv[0]);
|
||||||
|
|
||||||
if (absl::GetFlag(FLAGS_input).empty()) {
|
if (absl::GetFlag(FLAGS_input).empty()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user