memorysafety / sudo-rs

A memory safe implementation of sudo and su.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

su parses `'-g ' ghost` as `-g ghost`

japaric opened this issue · comments

whereas ogsu parses that as -g ' ' ghost

relevant test

sudo-rs/src/su/cli.rs

Lines 485 to 494 in d10d42f

#[test]
fn short_flag_whitespace_positional_argument() {
let expected = SuOptions {
action: SuAction::Run,
group: vec![" ".to_string()],
user: "ghost".to_string(),
..Default::default()
};
assert_eq!(expected, parse(&["-g ", "ghost"]));
}