mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Replace StrError with PLOG
PiperOrigin-RevId: 559380593 Change-Id: Ia7d2bcb3908b5e739ac5c4aaec1559fb6f86f383
This commit is contained in:
parent
41003aae83
commit
9dcc9db919
|
@ -574,7 +574,6 @@ cc_library(
|
||||||
"//sandboxed_api/sandbox2/network_proxy:client",
|
"//sandboxed_api/sandbox2/network_proxy:client",
|
||||||
"//sandboxed_api/sandbox2/util:bpf_helper",
|
"//sandboxed_api/sandbox2/util:bpf_helper",
|
||||||
"//sandboxed_api/util:raw_logging",
|
"//sandboxed_api/util:raw_logging",
|
||||||
"//sandboxed_api/util:strerror",
|
|
||||||
"@com_google_absl//absl/base:core_headers",
|
"@com_google_absl//absl/base:core_headers",
|
||||||
"@com_google_absl//absl/container:flat_hash_map",
|
"@com_google_absl//absl/container:flat_hash_map",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
|
|
|
@ -520,7 +520,6 @@ target_link_libraries(sandbox2_client
|
||||||
sandbox2::policy
|
sandbox2::policy
|
||||||
sandbox2::sanitizer
|
sandbox2::sanitizer
|
||||||
sandbox2::syscall
|
sandbox2::syscall
|
||||||
sapi::strerror
|
|
||||||
sapi::base
|
sapi::base
|
||||||
sapi::raw_logging
|
sapi::raw_logging
|
||||||
PUBLIC absl::flat_hash_map
|
PUBLIC absl::flat_hash_map
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
#include "sandboxed_api/sandbox2/syscall.h"
|
#include "sandboxed_api/sandbox2/syscall.h"
|
||||||
#include "sandboxed_api/sandbox2/util/bpf_helper.h"
|
#include "sandboxed_api/sandbox2/util/bpf_helper.h"
|
||||||
#include "sandboxed_api/util/raw_logging.h"
|
#include "sandboxed_api/util/raw_logging.h"
|
||||||
#include "sandboxed_api/util/strerror.h"
|
|
||||||
|
|
||||||
#ifndef SECCOMP_FILTER_FLAG_NEW_LISTENER
|
#ifndef SECCOMP_FILTER_FLAG_NEW_LISTENER
|
||||||
#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
|
#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
|
||||||
|
@ -56,8 +55,6 @@
|
||||||
namespace sandbox2 {
|
namespace sandbox2 {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using ::sapi::StrError;
|
|
||||||
|
|
||||||
void InitSeccompUnotify(sock_fprog prog, Comms* comms) {
|
void InitSeccompUnotify(sock_fprog prog, Comms* comms) {
|
||||||
// The policy might not allow sending the notify FD.
|
// The policy might not allow sending the notify FD.
|
||||||
// Create a separate thread that won't get the seccomp policy to send the FD.
|
// Create a separate thread that won't get the seccomp policy to send the FD.
|
||||||
|
@ -192,12 +189,12 @@ void Client::SetUpCwd() {
|
||||||
if (!cwd.empty()) {
|
if (!cwd.empty()) {
|
||||||
// On the other hand this chdir can fail without a sandbox escape. It will
|
// On the other hand this chdir can fail without a sandbox escape. It will
|
||||||
// probably not have the intended behavior though.
|
// probably not have the intended behavior though.
|
||||||
if (chdir(cwd.c_str()) == -1) {
|
if (chdir(cwd.c_str()) == -1 && SAPI_RAW_VLOG_IS_ON(1)) {
|
||||||
SAPI_RAW_VLOG(
|
SAPI_RAW_PLOG(
|
||||||
1,
|
INFO,
|
||||||
"chdir(%s) failed, falling back to previous cwd or / (with "
|
"chdir(%s) failed, falling back to previous cwd or / (with "
|
||||||
"namespaces). Use Executor::SetCwd() to set a working directory: %s",
|
"namespaces). Use Executor::SetCwd() to set a working directory",
|
||||||
cwd.c_str(), StrError(errno).c_str());
|
cwd.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user