When a RRDP fetch failed not only clear the filesystem but also flush
authorclaudio <claudio@openbsd.org>
Wed, 2 Feb 2022 15:13:00 +0000 (15:13 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 2 Feb 2022 15:13:00 +0000 (15:13 +0000)
the to delete list stored this RRDP node.
Noticed by Job on console.rpki-client.org with the help of idnic.net
OK tb@

usr.sbin/rpki-client/repo.c

index fe4c2a1..32de2ed 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: repo.c,v 1.29 2022/01/28 14:11:27 claudio Exp $ */
+/*     $OpenBSD: repo.c,v 1.30 2022/02/02 15:13:00 claudio Exp $ */
 /*
  * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -944,6 +944,8 @@ rrdp_finish(unsigned int id, int ok)
                rr->state = REPO_FAILED;
                /* clear the RRDP repo since it failed */
                remove_contents(rr->basedir);
+               /* also clear the list of deleted files */
+               filepath_free(&rr->deleted);
        }
 
        repo_done(rr, ok);