pub enum OutputPathError {
InvalidServerId {
server_id: String,
},
AbsolutePath {
path: String,
},
ParentTraversal {
path: String,
},
InvalidPath {
path: String,
},
ServerIdIsSymlink {
path: String,
},
Escape {
path: String,
},
NotADirectory {
path: String,
},
NotAFile {
path: String,
},
CreateDir {
path: String,
source: Error,
},
Io(Error),
}Expand description
Errors from resolving and confining a skill output path to its base directory.
Variants§
InvalidServerId
server_id is empty or is not a single plain path segment (e.g. it
contains a .., /, or is otherwise not a bare directory name).
AbsolutePath
The caller supplied an absolute output_path, which would override
the base directory entirely.
ParentTraversal
The caller-supplied output_path contains a .. component.
InvalidPath
The caller-supplied output_path has no file name component.
ServerIdIsSymlink
server_id’s own directory already exists as a symlink, which is
rejected outright regardless of where it points - including at a
sibling server’s own directory, which would otherwise pass a
resolve-and-confine check (issue #217).
Escape
The resolved path escapes the base directory, typically because a path component resolved through (or is itself) a symlink that points outside it.
NotADirectory
A path component that must be a directory already exists as something else (e.g. a regular file).
NotAFile
The resolved output path already exists as a directory.
CreateDir
Creating a directory needed to hold the output file failed.
Fields
Io(Error)
I/O error resolving the base directory itself.
Trait Implementations§
Source§impl Debug for OutputPathError
impl Debug for OutputPathError
Source§impl Display for OutputPathError
impl Display for OutputPathError
Source§impl Error for OutputPathError
impl Error for OutputPathError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()