Skip to content
Snippets Groups Projects
Commit cf713501 authored by Roman Borschel's avatar Roman Borschel Committed by Bastian Köcher
Browse files

Ensure config directory exists. (#1802)

Ensure the config directory exists before trying to write the public key file.
It is the responsibility of obtain_private_key to do so, as per the purpose
of this function.
parent 2acab712
No related merge requests found
......@@ -42,6 +42,7 @@ pub fn obtain_private_key(
.map_err(|err| IoError::new(IoErrorKind::InvalidData, err))
} else {
if let Some(ref path) = net_config_path {
fs::create_dir_all(Path::new(path))?;
// Try fetch the key from a the file containing the secret.
let secret_path = Path::new(path).join(SECRET_FILE);
match load_private_key_from_file(&secret_path) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment