mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Reduce logspam: Log Tomoyo LSM check only with VLOG
PiperOrigin-RevId: 387114844 Change-Id: Ib670799e3327fcc991ad012ccee20b96089c2f48
This commit is contained in:
parent
ccd7b03026
commit
85c58dc2d7
|
@ -332,6 +332,7 @@ cc_library(
|
|||
"//sandboxed_api/util:flags",
|
||||
"//sandboxed_api/util:raw_logging",
|
||||
"//sandboxed_api/util:status",
|
||||
"//sandboxed_api/util:strerror",
|
||||
"//sandboxed_api/util:temp_file",
|
||||
"@com_google_absl//absl/base:core_headers",
|
||||
"@com_google_absl//absl/cleanup",
|
||||
|
|
|
@ -301,6 +301,7 @@ target_link_libraries(sandbox2_sandbox2
|
|||
absl::str_format
|
||||
absl::strings
|
||||
absl::synchronization
|
||||
sapi::strerror
|
||||
sapi::base
|
||||
PUBLIC absl::status
|
||||
absl::statusor
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
#include "sandboxed_api/util/file_helpers.h"
|
||||
#include "sandboxed_api/util/raw_logging.h"
|
||||
#include "sandboxed_api/util/status_macros.h"
|
||||
#include "sandboxed_api/util/strerror.h"
|
||||
#include "sandboxed_api/util/temp_file.h"
|
||||
|
||||
using std::string;
|
||||
|
@ -132,8 +133,9 @@ void MaybeEnableTomoyoLsmWorkaround(Mounts& mounts, std::string& comms_fd_dev) {
|
|||
if (auto status = sapi::file::GetContents(
|
||||
"/sys/kernel/security/lsm", &lsm_list, sapi::file::Defaults());
|
||||
!status.ok() && !absl::IsNotFound(status)) {
|
||||
SAPI_RAW_PLOG(WARNING, "Checking active LSMs failed: %s",
|
||||
std::string(status.message()).c_str());
|
||||
SAPI_RAW_VLOG(1, "Checking active LSMs failed: %s: %s",
|
||||
std::string(status.message()).c_str(),
|
||||
sapi::StrError(errno).c_str());
|
||||
return false;
|
||||
}
|
||||
return absl::StrContains(lsm_list, "tomoyo");
|
||||
|
|
Loading…
Reference in New Issue
Block a user