Skip to main content

parse_command

Function parse_command 

Source
pub fn parse_command(original: &str) -> Result<Request, String>
Expand description

Parses the command sshd put in SSH_ORIGINAL_COMMAND.

Accepts exactly what a git client sends — git-upload-pack '<repo>', git-receive-pack '<repo>', and the dashless git upload-pack '<repo>' spelling — with exactly one argument. Everything else, git-upload-archive included, is refused: this account exists to serve two services and a surface it does not serve is a surface it cannot get wrong.

§Errors

Returns a message safe to print to whoever ran the command.