]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/tools/subscription.rs
use new fsync parameter to replace_file and atomic_open_or_create
[proxmox-backup.git] / src / tools / subscription.rs
index 1a9ada66eece5620fd6b5f351d8d3d29b0334e0a..5b1e6b639a91765e1f709b1ad8e5e7af303a417d 100644 (file)
@@ -312,7 +312,7 @@ pub fn write_subscription(info: SubscriptionInfo) -> Result<(), Error> {
         .group(backup_user.gid);
 
     let subscription_file = std::path::Path::new(SUBSCRIPTION_FN);
-    replace_file(subscription_file, raw.as_bytes(), file_opts)?;
+    replace_file(subscription_file, raw.as_bytes(), file_opts, true)?;
 
     update_apt_auth(key, server_id)?;
 
@@ -343,7 +343,7 @@ pub fn update_apt_auth(key: Option<String>, password: Option<String>) -> Result<
                 .owner(nix::unistd::ROOT);
 
             // we use a namespaced .conf file, so just overwrite..
-            replace_file(auth_conf, conf.as_bytes(), file_opts)
+            replace_file(auth_conf, conf.as_bytes(), file_opts, true)
                 .map_err(|e| format_err!("Error saving apt auth config - {}", e))?;
         }
         _ => match nix::unistd::unlink(auth_conf) {