#include <errno.h>
#include <fcntl.h>
#include <sys/ptrace.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/posix/eintr_wrapper.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
#include "sandbox/linux/services/scoped_process.h"
#include "sandbox/linux/services/yama.h"
#include "sandbox/linux/tests/unit_tests.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace sandbox {
namespace {
bool HasLinux32Bug() { … }
bool CanPtrace(pid_t pid) { … }
void ExitZeroIfCanPtrace(pid_t pid) { … }
bool CanSubProcessPtrace(pid_t pid) { … }
TEST(Yama, GetStatus) { … }
SANDBOX_TEST(Yama, RestrictPtraceSucceedsWhenYamaPresent) { … }
void SetYamaRestrictions(bool enable_restriction) { … }
TEST(Yama, RestrictPtraceWorks) { … }
SANDBOX_TEST(Yama, RestrictPtraceIsDefault) { … }
}
}