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:
@ -1328,7 +1328,7 @@ pub fn upload_backup_log(
|
||||
// always verify blob/CRC at server side
|
||||
let blob = DataBlob::load_from_reader(&mut &data[..])?;
|
||||
|
||||
replace_file(&path, blob.raw_data(), CreateOptions::new())?;
|
||||
replace_file(&path, blob.raw_data(), CreateOptions::new(), false)?;
|
||||
|
||||
// fixme: use correct formatter
|
||||
Ok(formatter::JSON_FORMATTER.format_data(Value::Null, &*rpcenv))
|
||||
@ -1644,7 +1644,7 @@ pub fn set_group_notes(
|
||||
check_priv_or_backup_owner(&datastore, &backup_group, &auth_id, PRIV_DATASTORE_MODIFY)?;
|
||||
|
||||
let note_path = get_group_note_path(&datastore, &backup_group);
|
||||
replace_file(note_path, notes.as_bytes(), CreateOptions::new())?;
|
||||
replace_file(note_path, notes.as_bytes(), CreateOptions::new(), false)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ impl BackupEnvironment {
|
||||
let blob = DataBlob::load_from_reader(&mut &data[..])?;
|
||||
|
||||
let raw_data = blob.raw_data();
|
||||
replace_file(&path, raw_data, CreateOptions::new())?;
|
||||
replace_file(&path, raw_data, CreateOptions::new(), false)?;
|
||||
|
||||
self.log(format!("add blob {:?} ({} bytes, comp: {})", path, orig_len, blob_len));
|
||||
|
||||
|
@ -68,7 +68,7 @@ pub fn update_apt_proxy_config(proxy_config: Option<&ProxyConfig>) -> Result<(),
|
||||
if let Some(proxy_config) = proxy_config {
|
||||
let proxy = proxy_config.to_proxy_string()?;
|
||||
let data = format!("Acquire::http::Proxy \"{}\";\n", proxy);
|
||||
replace_file(PROXY_CFG_FN, data.as_bytes(), CreateOptions::new())
|
||||
replace_file(PROXY_CFG_FN, data.as_bytes(), CreateOptions::new(), false)
|
||||
} else {
|
||||
match std::fs::remove_file(PROXY_CFG_FN) {
|
||||
Ok(()) => Ok(()),
|
||||
|
@ -171,7 +171,7 @@ pub fn update_dns(
|
||||
data.push_str(options);
|
||||
}
|
||||
|
||||
replace_file(RESOLV_CONF_FN, data.as_bytes(), CreateOptions::new())?;
|
||||
replace_file(RESOLV_CONF_FN, data.as_bytes(), CreateOptions::new(), true)?;
|
||||
|
||||
Ok(Value::Null)
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ fn set_timezone(
|
||||
bail!("No such timezone.");
|
||||
}
|
||||
|
||||
replace_file("/etc/timezone", timezone.as_bytes(), CreateOptions::new())?;
|
||||
replace_file("/etc/timezone", timezone.as_bytes(), CreateOptions::new(), true)?;
|
||||
|
||||
let _ = std::fs::remove_file("/etc/localtime");
|
||||
|
||||
|
@ -1362,7 +1362,7 @@ fn try_restore_snapshot_archive<R: pxar::decoder::SeqRead>(
|
||||
let blob = DataBlob::encode(old_manifest.as_bytes(), None, true)?;
|
||||
|
||||
let options = CreateOptions::new();
|
||||
replace_file(&tmp_path, blob.raw_data(), options)?;
|
||||
replace_file(&tmp_path, blob.raw_data(), options, false)?;
|
||||
|
||||
manifest = Some(BackupManifest::try_from(blob)?);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user