|
Android-cuttlefish cvd tool
|
#include <chroot.h>


Public Member Functions | |
| ChrootReadWriteFilesystem (ReadWriteFilesystem &real_filesystem, std::string_view path_prefix) | |
| Result< std::unique_ptr< ReaderSeeker > > | OpenReadOnly (std::string_view path) override |
| Result< uint32_t > | FileAttributes (std::string_view path) const override |
| Result< std::unique_ptr< ReaderWriterSeeker > > | CreateFile (std::string_view path) override |
| Result< void > | DeleteFile (std::string_view path) override |
| Result< std::unique_ptr< ReaderWriterSeeker > > | OpenReadWrite (std::string_view path) override |
| virtual Result< std::unique_ptr< ReaderWriterSeeker > > | CreateFile (std::string_view path)=0 |
| virtual Result< void > | DeleteFile (std::string_view path)=0 |
| virtual Result< std::unique_ptr< ReaderWriterSeeker > > | OpenReadWrite (std::string_view path)=0 |
Public Member Functions inherited from cuttlefish::ReadFilesystem | |
| virtual | ~ReadFilesystem ()=default |
| virtual Result< std::unique_ptr< ReaderSeeker > > | OpenReadOnly (std::string_view path)=0 |
| virtual Result< uint32_t > | FileAttributes (std::string_view path) const =0 |
Private Member Functions | |
| Result< std::string > | ChrootToRealPath (std::string_view) const |
Private Attributes | |
| ReadWriteFilesystem * | real_filesystem_ |
| std::string | path_prefix_ |
Wraps access to another ReadWriteFilesystem with an imposed path prefix.
Attempts to normalize file paths to avoid escaping by using absolute paths or ".." members, but is not safe against symlinks or bind mounts.
This is comparable to the fakechroot tool.
| cuttlefish::ChrootReadWriteFilesystem::ChrootReadWriteFilesystem | ( | ReadWriteFilesystem & | real_filesystem, |
| std::string_view | path_prefix | ||
| ) |
|
private |
|
overridevirtual |
Implements cuttlefish::ReadWriteFilesystem.
|
overridevirtual |
Implements cuttlefish::ReadWriteFilesystem.
|
overridevirtual |
Implements cuttlefish::ReadFilesystem.
|
overridevirtual |
Implements cuttlefish::ReadFilesystem.
|
overridevirtual |
Implements cuttlefish::ReadWriteFilesystem.
|
private |
|
private |