I think I introduced a bit of an error when skipping cleanup of RRDP
directories when RRDP is off. When RRDP is off the cache is updated via
rsync but when RRDP is turned back on later on the cache does not match
with the RRDP state file and so deltas will often fail to apply.

It is better to clean out .rrdp if rrdp is disabled so the repo is
properly synced.

The noop test is probably fine since we don't want to remove the rrdp
cache and state in a quick -n run. Still it would probably be better to
skip all repo cleanup in the noop case.

-- 
:wq Claudio

Index: repo.c
===================================================================
RCS file: /cvs/src/usr.sbin/rpki-client/repo.c,v
retrieving revision 1.28
diff -u -p -r1.28 repo.c
--- repo.c      26 Jan 2022 13:57:56 -0000      1.28
+++ repo.c      27 Jan 2022 16:30:41 -0000
@@ -1389,7 +1389,7 @@ repo_cleanup(struct filepath_tree *tree)
                         * clear them if they are not used anymore but
                         * only if rrdp is active.
                         */
-                       if (e->fts_pointer == RRDP_DIR && !noop && rrdpon &&
+                       if (e->fts_pointer == RRDP_DIR && !noop &&
                            e->fts_level == 2) {
                                if (!rrdp_is_active(path))
                                        e->fts_pointer = NULL;

Reply via email to