Enumerations | |
| enum | ESecurity { E_INSECURE, E_SECURE_DIR, E_SECURE_FILE } |
Functions | |
| String | realPath (const String &path) |
| std::pair< ESecurity, String > | security (String const &path, UserId uid) |
| std::pair< ESecurity, String > | security (String const &path) |
Equivalent to security(path, uid), where uid is the effective user ID of the process. | |
| std::pair< ESecurity, String > | security (String const &base_dir, String const &rel_path, UserId uid) |
A variant of security() that is more efficient if some ancestor directory of the path is already known to be secure and in canonical form. | |
| std::pair< ESecurity, String > | security (String const &base_dir, String const &rel_path) |
Equivalent to security(base_dir, rel_path, uid), where uid is the effective user ID of the process. | |
| String | dirname (const String &filename) |
| Take a string that contains a pathname, and return a string that is a pathname of the parent directory of that file. | |
| String | basename (const String &filename) |
| Take a string that contains a pathname, and return a string that is the filename with the path removed. | |
| String | getCurrentWorkingDirectory () |
| Get the process's current working directory. | |
| String BLOCXX_NAMESPACE::FileSystem::Path::basename | ( | const String & | filename | ) |
Take a string that contains a pathname, and return a string that is the filename with the path removed.
| filename | The file pathname |
Definition at line 1171 of file PosixFileSystem.cpp.
References BLOCXX_FILENAME_SEPARATOR, BLOCXX_FILENAME_SEPARATOR_C, BLOCXX_NAMESPACE::FileSystem::g_fileSystemMockObject, BLOCXX_NAMESPACE::String::lastIndexOf(), BLOCXX_NAMESPACE::String::length(), BLOCXX_NAMESPACE::String::npos, and BLOCXX_NAMESPACE::String::substring().
| String BLOCXX_NAMESPACE::FileSystem::Path::dirname | ( | const String & | filename | ) |
Take a string that contains a pathname, and return a string that is a pathname of the parent directory of that file.
Trailing '/' characters in the path are not counted as part of the path. If path does not contain a '/', then dirname() shall return the string ".". If path an empty string, dirname() shall return the string ".".
| filename | The file pathname |
Definition at line 1132 of file PosixFileSystem.cpp.
References BLOCXX_FILENAME_SEPARATOR, BLOCXX_FILENAME_SEPARATOR_C, BLOCXX_NAMESPACE::FileSystem::g_fileSystemMockObject, BLOCXX_NAMESPACE::String::lastIndexOf(), BLOCXX_NAMESPACE::String::length(), BLOCXX_NAMESPACE::String::npos, and BLOCXX_NAMESPACE::String::substring().
Referenced by BLOCXX_NAMESPACE::Secure::rand_save_state().
| String BLOCXX_NAMESPACE::FileSystem::Path::getCurrentWorkingDirectory | ( | ) |
Get the process's current working directory.
Calls to chdir() or fchdir() will modify this. Multi-threaded applications must exercise caution changing the current working directory.
| FileSystemException,: | ENOENT-The current working directory has been unlinked. |
Definition at line 1209 of file PosixFileSystem.cpp.
References BLOCXX_THROW_ERRNO, BLOCXX_NAMESPACE::FileSystem::g_fileSystemMockObject, and MAXPATHLEN.
Referenced by realPath(), and security().
| String BLOCXX_NAMESPACE::FileSystem::Path::realPath | ( | const String & | path | ) |
| path | The path to canonicalize. |
| FileSystemException | EACCESS, EIO, ELOOP, ENOENT, ENOTDIR |
Definition at line 1080 of file PosixFileSystem.cpp.
References BLOCXX_THROW, BLOCXX_NAMESPACE::String::c_str(), BLOCXX_NAMESPACE::FileSystem::g_fileSystemMockObject, getCurrentWorkingDirectory(), security(), and BLOCXX_NAMESPACE::String::startsWith().
Referenced by BLOCXX_NAMESPACE::FileSystem::readSymbolicLink().
| std::pair< ESecurity, String > BLOCXX_NAMESPACE::FileSystem::Path::security | ( | String const & | base_dir, | |
| String const & | rel_path | |||
| ) |
Equivalent to security(base_dir, rel_path, uid), where uid is the effective user ID of the process.
Definition at line 542 of file PathSecurity.cpp.
References security().
Referenced by rand_init_impl(), and BLOCXX_NAMESPACE::Secure::rand_save_state().
| std::pair< ESecurity, String > BLOCXX_NAMESPACE::FileSystem::Path::security | ( | String const & | base_dir, | |
| String const & | rel_path, | |||
| UserId | uid | |||
| ) |
A variant of security() that is more efficient if some ancestor directory of the path is already known to be secure and in canonical form.
realPath(), and rel_path is a relative path.security(path, uid), where path is the catenation of base_dir, "/", and rel_path, under the assumption that base_dir is a secure directory. Definition at line 529 of file PathSecurity.cpp.
References BLOCXX_NAMESPACE::String::c_str(), and BLOCXX_NAMESPACE::path_security().
Equivalent to security(path, uid), where uid is the effective user ID of the process.
Definition at line 536 of file PathSecurity.cpp.
References security().
| std::pair< ESecurity, String > BLOCXX_NAMESPACE::FileSystem::Path::security | ( | String const & | path, | |
| UserId | uid | |||
| ) |
realpath(path).root or user uid can change the contents of this directory or make path refer to some other file or directory, then sec = E_SECURE_DIR.root or user uid can change the contents of this file or make path refer to some other file or directory, then sec = E_SECURE_FILE.root or user uid can change what path refers to, or change the contents of the file or directory it refers to, then sec = E_INSECURE.root or user uid while the function executes.| FileSystemException | EACCESS, EIO, ELOOP, ENOENT, ENOTDIR |
Definition at line 522 of file PathSecurity.cpp.
References BLOCXX_FILENAME_SEPARATOR, BLOCXX_NAMESPACE::String::c_str(), getCurrentWorkingDirectory(), BLOCXX_NAMESPACE::isPathAbsolute(), and BLOCXX_NAMESPACE::path_security().
Referenced by realPath(), and security().
1.5.6