Skip to content

Commit

Permalink
Release 0.6.2 - Fix issue with determining creation time on certain p…
Browse files Browse the repository at this point in the history
…latforms.
  • Loading branch information
Tim Bruijnzeels committed May 15, 2020
1 parent e6be1eb commit d10c88f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "krill"
version = "0.6.1"
version = "0.6.2"
edition = "2018"
authors = [ "The NLnet Labs RPKI team <rpki-team@nlnetlabs.nl>" ]
description = "Resource Public Key Infrastructure (RPKI) daemon"
Expand Down
8 changes: 8 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Please see [here](https://github.com/NLnetLabs/krill/projects?query=is%3Aopen+sort%3Aname-asc)
for planned releases.

## 0.6.2 Release 'That was even faster!'

So, as it turns out.. the code used to determine the age of snapshot files used in the previous
release was not safe on all platforms. This release fixes this!

Users who upgraded to 0.6.1 and see messages like: "Creation time is not available on this
platform currently" in their logs, please upgrade!

## 0.6.1 Release 'That was fast!'

This release fixes an issue where the Krill Repository Server deleted RRDP snapshot files as soon
Expand Down
2 changes: 1 addition & 1 deletion doc/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: "3.0.2"
info:
title: Krill RPKI Server API
version: 0.6.1
version: 0.6.2
description: |
# Introduction
Welcome to the documentation for the Krill server API, a JSON based
Expand Down
2 changes: 1 addition & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const KRILL_VERSION: &str = "0.6.1";
pub const KRILL_VERSION: &str = "0.6.2";
pub const KRILL_SERVER_APP: &str = "Krill";
pub const KRILL_CLIENT_APP: &str = "Krill Client";

Expand Down
27 changes: 14 additions & 13 deletions src/pubd/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl RrdpServer {
} else {
let path = entry.path();
if path.is_dir() {
fs::remove_dir_all(path)?;
let _best_effort_rm = fs::remove_dir_all(path);
}
}
}
Expand All @@ -286,9 +286,9 @@ impl RrdpServer {
if let Some(last) = self.notification.last_delta() {
if serial < last {
if path.is_dir() {
fs::remove_dir_all(path)?;
let _best_effort_rm = fs::remove_dir_all(path);
} else {
fs::remove_file(path)?;
let _best_effort_rm = fs::remove_file(path);
}

continue;
Expand All @@ -301,24 +301,25 @@ impl RrdpServer {
let snapshot_path =
Self::new_snapshot_path(&self.rrdp_base_dir, &self.session, serial);
if snapshot_path.exists() {
let meta = fs::metadata(&snapshot_path)?;
let created = meta.created()?;

let now = SystemTime::now();
if let Ok(duration) = now.duration_since(created) {
let minutes_old = duration.as_secs() / 60;
if minutes_old >= REPOSITORY_RRDP_SNAPSHOT_RETAIN_MINS {
fs::remove_file(snapshot_path)?;
if let Ok(meta) = fs::metadata(&snapshot_path) {
if let Ok(created) = meta.created() {
let now = SystemTime::now();
if let Ok(duration) = now.duration_since(created) {
let minutes_old = duration.as_secs() / 60;
if minutes_old >= REPOSITORY_RRDP_SNAPSHOT_RETAIN_MINS {
let _best_effort_rm = fs::remove_file(snapshot_path);
}
}
}
}
}
}
} else {
// clean up dirs or files under the base dir which are not sessions
if path.is_dir() {
fs::remove_dir_all(path)?;
let _best_effort_rm = fs::remove_dir_all(path);
} else {
fs::remove_file(path)?;
let _best_effort_rm = fs::remove_file(path);
}
}
}
Expand Down

0 comments on commit d10c88f

Please sign in to comment.