Deny non-absolut import pathes

This commit is contained in:
Matthias Beyer 2018-04-25 10:33:12 +02:00
parent 0e567e2358
commit b90abfb868
1 changed files with 5 additions and 0 deletions

View File

@ -178,6 +178,11 @@ fn import(rt: &Runtime) {
let scmd = rt.cli().subcommand_matches("import").unwrap(); // secured by main
let path = scmd.value_of("path").map(PathBuf::from).unwrap(); // secured by clap
if !path.is_absolute() {
error!("Import path must be absolute. Sorry.");
exit(1)
}
if !path.exists() {
error!("Path does not exist");
exit(1)