diff --git a/src/pubd/repository.rs b/src/pubd/repository.rs index 126457f8..2f5a8486 100644 --- a/src/pubd/repository.rs +++ b/src/pubd/repository.rs @@ -311,8 +311,10 @@ impl RrdpServer { } // something changed, update notification file + let notification_path_new = self.notification_path_new(); let notification_path = self.notification_path(); - self.notification.write_xml(¬ification_path)?; + self.notification.write_xml(¬ification_path_new)?; + fs::rename(notification_path_new, notification_path)?; // clean up under the base dir: // - old session dirs @@ -401,6 +403,12 @@ impl RrdpServer { // Cannot fail. Config checked at startup. } + fn notification_path_new(&self) -> PathBuf { + let mut path = self.rrdp_base_dir.clone(); + path.push("new-notification.xml"); + path + } + fn notification_path(&self) -> PathBuf { let mut path = self.rrdp_base_dir.clone(); path.push("notification.xml");