Skip to content

Commit d10c88f

Browse files
author
Tim Bruijnzeels
committed
Release 0.6.2 - Fix issue with determining creation time on certain platforms.
1 parent e6be1eb commit d10c88f

File tree

6 files changed

+26
-17
lines changed

6 files changed

+26
-17
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "krill"
3-
version = "0.6.1"
3+
version = "0.6.2"
44
edition = "2018"
55
authors = [ "The NLnet Labs RPKI team <[email protected]>" ]
66
description = "Resource Public Key Infrastructure (RPKI) daemon"

Changelog.md

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Please see [here](https://github.com/NLnetLabs/krill/projects?query=is%3Aopen+sort%3Aname-asc)
44
for planned releases.
55

6+
## 0.6.2 Release 'That was even faster!'
7+
8+
So, as it turns out.. the code used to determine the age of snapshot files used in the previous
9+
release was not safe on all platforms. This release fixes this!
10+
11+
Users who upgraded to 0.6.1 and see messages like: "Creation time is not available on this
12+
platform currently" in their logs, please upgrade!
13+
614
## 0.6.1 Release 'That was fast!'
715

816
This release fixes an issue where the Krill Repository Server deleted RRDP snapshot files as soon

doc/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: "3.0.2"
22
info:
33
title: Krill RPKI Server API
4-
version: 0.6.1
4+
version: 0.6.2
55
description: |
66
# Introduction
77
Welcome to the documentation for the Krill server API, a JSON based

src/constants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub const KRILL_VERSION: &str = "0.6.1";
1+
pub const KRILL_VERSION: &str = "0.6.2";
22
pub const KRILL_SERVER_APP: &str = "Krill";
33
pub const KRILL_CLIENT_APP: &str = "Krill Client";
44

src/pubd/repository.rs

+14-13
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl RrdpServer {
264264
} else {
265265
let path = entry.path();
266266
if path.is_dir() {
267-
fs::remove_dir_all(path)?;
267+
let _best_effort_rm = fs::remove_dir_all(path);
268268
}
269269
}
270270
}
@@ -286,9 +286,9 @@ impl RrdpServer {
286286
if let Some(last) = self.notification.last_delta() {
287287
if serial < last {
288288
if path.is_dir() {
289-
fs::remove_dir_all(path)?;
289+
let _best_effort_rm = fs::remove_dir_all(path);
290290
} else {
291-
fs::remove_file(path)?;
291+
let _best_effort_rm = fs::remove_file(path);
292292
}
293293

294294
continue;
@@ -301,24 +301,25 @@ impl RrdpServer {
301301
let snapshot_path =
302302
Self::new_snapshot_path(&self.rrdp_base_dir, &self.session, serial);
303303
if snapshot_path.exists() {
304-
let meta = fs::metadata(&snapshot_path)?;
305-
let created = meta.created()?;
306-
307-
let now = SystemTime::now();
308-
if let Ok(duration) = now.duration_since(created) {
309-
let minutes_old = duration.as_secs() / 60;
310-
if minutes_old >= REPOSITORY_RRDP_SNAPSHOT_RETAIN_MINS {
311-
fs::remove_file(snapshot_path)?;
304+
if let Ok(meta) = fs::metadata(&snapshot_path) {
305+
if let Ok(created) = meta.created() {
306+
let now = SystemTime::now();
307+
if let Ok(duration) = now.duration_since(created) {
308+
let minutes_old = duration.as_secs() / 60;
309+
if minutes_old >= REPOSITORY_RRDP_SNAPSHOT_RETAIN_MINS {
310+
let _best_effort_rm = fs::remove_file(snapshot_path);
311+
}
312+
}
312313
}
313314
}
314315
}
315316
}
316317
} else {
317318
// clean up dirs or files under the base dir which are not sessions
318319
if path.is_dir() {
319-
fs::remove_dir_all(path)?;
320+
let _best_effort_rm = fs::remove_dir_all(path);
320321
} else {
321-
fs::remove_file(path)?;
322+
let _best_effort_rm = fs::remove_file(path);
322323
}
323324
}
324325
}

0 commit comments

Comments
 (0)