#include <filtering-source-accessor.hh>
|
enum | Type {
tRegular
, tSymlink
, tDirectory
, tChar
,
tBlock
, tSocket
, tFifo
, tUnknown
} |
|
typedef std::optional< Type > | DirEntry |
|
typedef std::map< std::string, DirEntry > | DirEntries |
|
An abstract wrapping SourceAccessor
that performs access control. Subclasses should override isAllowed()
to implement an access control policy. The error message is customized at construction.
◆ checkAccess()
void nix::FilteringSourceAccessor::checkAccess |
( |
const CanonPath & | path | ) |
|
Call makeNotAllowedError
to throw a RestrictedPathError
exception if isAllowed()
returns false
for path
.
◆ getPhysicalPath()
std::optional< std::filesystem::path > nix::FilteringSourceAccessor::getPhysicalPath |
( |
const CanonPath & | path | ) |
|
|
overridevirtual |
Return a corresponding path in the root filesystem, if possible. This is only possible for filesystems that are materialized in the root filesystem.
Reimplemented from nix::SourceAccessor.
◆ isAllowed()
virtual bool nix::FilteringSourceAccessor::isAllowed |
( |
const CanonPath & | path | ) |
|
|
pure virtual |
◆ maybeLstat()
◆ pathExists()
bool nix::FilteringSourceAccessor::pathExists |
( |
const CanonPath & | path | ) |
|
|
overridevirtual |
◆ readDirectory()
SourceAccessor::DirEntries nix::FilteringSourceAccessor::readDirectory |
( |
const CanonPath & | path | ) |
|
|
overridevirtual |
◆ readFile()
std::string nix::FilteringSourceAccessor::readFile |
( |
const CanonPath & | path | ) |
|
|
overridevirtual |
Return the contents of a file as a string.
- Note
- Unlike Unix, this method should not follow symlinks. Nix by default wants to manipulate symlinks explicitly, and not implictly follow them, as they are frequently untrusted user data and thus may point to arbitrary locations. Acting on the targets targets of symlinks should only occasionally be done, and only with care.
Reimplemented from nix::SourceAccessor.
◆ readLink()
std::string nix::FilteringSourceAccessor::readLink |
( |
const CanonPath & | path | ) |
|
|
overridevirtual |
◆ showPath()
std::string nix::FilteringSourceAccessor::showPath |
( |
const CanonPath & | path | ) |
|
|
overridevirtual |
The documentation for this struct was generated from the following files:
- /home/buildozer/aports/community/nix/src/nix-2.26.3/src/libfetchers/filtering-source-accessor.hh
- /home/buildozer/aports/community/nix/src/nix-2.26.3/src/libfetchers/filtering-source-accessor.cc