Replace StrError with PLOG

PiperOrigin-RevId: 559380593
Change-Id: Ia7d2bcb3908b5e739ac5c4aaec1559fb6f86f383
This commit is contained in:
Wiktor Garbacz 2023-08-23 04:08:02 -07:00 committed by Copybara-Service
parent 41003aae83
commit 9dcc9db919
3 changed files with 5 additions and 10 deletions

View File

@ -574,7 +574,6 @@ cc_library(
"//sandboxed_api/sandbox2/network_proxy:client",
"//sandboxed_api/sandbox2/util:bpf_helper",
"//sandboxed_api/util:raw_logging",
"//sandboxed_api/util:strerror",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/strings",

View File

@ -520,7 +520,6 @@ target_link_libraries(sandbox2_client
sandbox2::policy
sandbox2::sanitizer
sandbox2::syscall
sapi::strerror
sapi::base
sapi::raw_logging
PUBLIC absl::flat_hash_map

View File

@ -47,7 +47,6 @@
#include "sandboxed_api/sandbox2/syscall.h"
#include "sandboxed_api/sandbox2/util/bpf_helper.h"
#include "sandboxed_api/util/raw_logging.h"
#include "sandboxed_api/util/strerror.h"
#ifndef SECCOMP_FILTER_FLAG_NEW_LISTENER
#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
@ -56,8 +55,6 @@
namespace sandbox2 {
namespace {
using ::sapi::StrError;
void InitSeccompUnotify(sock_fprog prog, Comms* comms) {
// The policy might not allow sending the notify 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()) {
// On the other hand this chdir can fail without a sandbox escape. It will
// probably not have the intended behavior though.
if (chdir(cwd.c_str()) == -1) {
SAPI_RAW_VLOG(
1,
if (chdir(cwd.c_str()) == -1 && SAPI_RAW_VLOG_IS_ON(1)) {
SAPI_RAW_PLOG(
INFO,
"chdir(%s) failed, falling back to previous cwd or / (with "
"namespaces). Use Executor::SetCwd() to set a working directory: %s",
cwd.c_str(), StrError(errno).c_str());
"namespaces). Use Executor::SetCwd() to set a working directory",
cwd.c_str());
}
}
}