pub enum CommandError {
Empty,
TooLong {
len: usize,
max: usize,
},
ControlByte {
byte: u8,
at: usize,
},
NotUtf8,
UnknownCommand(String),
NotServed {
verb: &'static str,
why: &'static str,
},
MissingPath(&'static str),
MissingOperation {
verb: &'static str,
accepted: String,
},
UnknownOperation {
verb: &'static str,
operation: String,
accepted: String,
},
BadQuoting(&'static str),
Path {
reason: Option<PathReject>,
message: String,
},
}Expand description
Why an exec request was refused.
Every variant means the same thing on the wire (channel_failure, no
shell), but they are distinguished so the server log says which one happened.
Variants§
Empty
Nothing was sent.
TooLong
Over MAX_EXEC_LEN.
ControlByte
A NUL or other control byte was present.
NotUtf8
Not UTF-8.
UnknownCommand(String)
The verb is not one of SERVICES. This is the bash case.
NotServed
A git verb gunnar knows the name of and does not serve, refused by
name so the client prints a sentence rather than exec request failed on channel 0. Today that is git-upload-archive
(git archive --remote=): it is not a transfer, the archive is a
local operation on a clone, and answering it would be a second read
path beside upload-pack. The site test measured the bare channel
failure on 2026-08-30 and asked for the sentence.
MissingPath(&'static str)
A known verb with no argument.
MissingOperation
A verb that takes an <operation> was sent without one.
UnknownOperation
A verb that takes an <operation> was sent one it does not accept.
The offending token is carried escaped, because it came off the wire and goes into a log line.
Fields
BadQuoting(&'static str)
The quoting was malformed: unterminated, or trailing bytes after the closing quote.
Path
The path did not survive the sandbox in
gunnar_core::resolve_repo_path.
The rendered refusal is carried rather than the gunnar_core::Error
itself, which is neither Clone nor PartialEq, and reason is kept
alongside it so a test can assert which rule fired rather than merely
that something failed. A path refused for the wrong reason is one
refactor away from being accepted.
Fields
reason: Option<PathReject>Which sandbox rule fired, when the sandbox named one.
Trait Implementations§
Source§impl Clone for CommandError
impl Clone for CommandError
Source§impl Debug for CommandError
impl Debug for CommandError
Source§impl Display for CommandError
impl Display for CommandError
impl Eq for CommandError
Source§impl Error for CommandError
impl Error for CommandError
1.30.0 · 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()
Source§impl From<CommandError> for DispatchError
impl From<CommandError> for DispatchError
Source§fn from(source: CommandError) -> Self
fn from(source: CommandError) -> Self
Source§impl From<Error> for CommandError
impl From<Error> for CommandError
Source§impl PartialEq for CommandError
impl PartialEq for CommandError
impl StructuralPartialEq for CommandError
Auto Trait Implementations§
impl Freeze for CommandError
impl RefUnwindSafe for CommandError
impl Send for CommandError
impl Sync for CommandError
impl Unpin for CommandError
impl UnsafeUnpin for CommandError
impl UnwindSafe for CommandError
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.