Skip to content
API Documentation
BastionGuard™
PolicySecurity.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <string>
5
7
8class PolicySecurity final {
9public:
10 /*
11 * Opens the policy with O_NOFOLLOW, validates the already-open descriptor
12 * and reads from that same descriptor. This removes the validate/open
13 * time-of-check/time-of-use window.
14 */
15 [[nodiscard]] static std::string read(
16 const std::filesystem::path& path,
17 bool requireSecureOwnership);
18};
19
20} // namespace bastionguard::rootguard
static std::string read(const std::filesystem::path &path, bool requireSecureOwnership)