use new fsync parameter to replace_file and atomic_open_or_create

Depend on proxmox 0.15.0 and proxmox-openid 0.8.1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer
2021-10-20 14:56:15 +02:00
parent 6b8329ee34
commit e0a19d3313
48 changed files with 73 additions and 57 deletions

View File

@ -22,7 +22,7 @@ zstd = { version = "0.6", features = [ "bindgen" ] }
pathpatterns = "0.1.2"
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
proxmox = { version = "0.14.0", features = [ "sortable-macro" ] }
proxmox = { version = "0.15.0", features = [ "sortable-macro" ] }
proxmox-router = { version = "1.1", features = [ "cli" ] }
proxmox-schema = { version = "1", features = [ "api-macro" ] }
proxmox-time = "1"

View File

@ -315,7 +315,7 @@ fn import_master_pubkey(path: String) -> Result<(), Error> {
let target_path = place_default_master_pubkey()?;
replace_file(&target_path, &pem_data, CreateOptions::new())?;
replace_file(&target_path, &pem_data, CreateOptions::new(), true)?;
println!("Imported public master key to {:?}", target_path);
@ -348,7 +348,7 @@ fn create_master_key() -> Result<(), Error> {
let pub_key: Vec<u8> = pkey.public_key_to_pem()?;
let filename_pub = "master-public.pem";
println!("Writing public master key to {}", filename_pub);
replace_file(filename_pub, pub_key.as_slice(), CreateOptions::new())?;
replace_file(filename_pub, pub_key.as_slice(), CreateOptions::new(), true)?;
let cipher = openssl::symm::Cipher::aes_256_cbc();
let priv_key: Vec<u8> =
@ -356,7 +356,7 @@ fn create_master_key() -> Result<(), Error> {
let filename_priv = "master-private.pem";
println!("Writing private master key to {}", filename_priv);
replace_file(filename_priv, priv_key.as_slice(), CreateOptions::new())?;
replace_file(filename_priv, priv_key.as_slice(), CreateOptions::new(), true)?;
Ok(())
}

View File

@ -126,7 +126,7 @@ fn record_repository(repo: &BackupRepository) {
let new_data = json!(map);
let _ = replace_file(path, new_data.to_string().as_bytes(), CreateOptions::new());
let _ = replace_file(path, new_data.to_string().as_bytes(), CreateOptions::new(), false);
}
async fn api_datastore_list_snapshots(
@ -1132,7 +1132,7 @@ async fn restore(param: Value) -> Result<Value, Error> {
if archive_name == MANIFEST_BLOB_NAME {
if let Some(target) = target {
replace_file(target, &backup_index_data, CreateOptions::new())?;
replace_file(target, &backup_index_data, CreateOptions::new(), false)?;
} else {
let stdout = std::io::stdout();
let mut writer = stdout.lock();