Check whether implictely creating the store path is allowed

This commit is contained in:
Matthias Beyer 2016-07-16 22:37:07 +02:00
parent 4d650a63f7
commit 0ba67f7873

View file

@ -212,6 +212,15 @@ impl Store {
debug!("Building new Store object"); debug!("Building new Store object");
if !location.exists() { if !location.exists() {
if !config_implicit_store_create_allowed(store_config.as_ref()) {
warn!("Implicitely creating store directory is denied");
warn!(" -> Either because configuration does not allow it");
warn!(" -> or because there is no configuration");
return Err(SEK::CreateStoreDirDenied.into_error())
.map_err_into(SEK::FileError)
.map_err_into(SEK::IoError);
}
debug!("Creating store path"); debug!("Creating store path");
let c = create_dir_all(location.clone()); let c = create_dir_all(location.clone());
if c.is_err() { if c.is_err() {