diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-04-25 10:33:12 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-04-25 10:33:12 +0200 |
commit | b90abfb86814142b1483d9e540298607cf6894de (patch) | |
tree | 60b247b4c2c80544ec5cf2bb64ff139647b9b8d5 /bin/domain/imag-contact | |
parent | 0e567e235823108de81cbf15cd385d488691ec50 (diff) |
Deny non-absolut import pathes
Diffstat (limited to 'bin/domain/imag-contact')
-rw-r--r-- | bin/domain/imag-contact/src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/domain/imag-contact/src/main.rs b/bin/domain/imag-contact/src/main.rs index e277dcfc..031c2169 100644 --- a/bin/domain/imag-contact/src/main.rs +++ b/bin/domain/imag-contact/src/main.rs @@ -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) |