From: claudio Date: Tue, 13 Apr 2021 13:35:59 +0000 (+0000) Subject: Before adding a file to the temporary rrdp repo remove it from the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=66477c5c62b155efefbad7fcfa8d2004bbb79c4d;p=openbsd Before adding a file to the temporary rrdp repo remove it from the deleted filepath set. A file can only be in one set (deleted or added) but not on both. OK benno@ --- diff --git a/usr.sbin/rpki-client/repo.c b/usr.sbin/rpki-client/repo.c index a5720ed44f5..981dfab5808 100644 --- a/usr.sbin/rpki-client/repo.c +++ b/usr.sbin/rpki-client/repo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: repo.c,v 1.4 2021/04/07 14:19:31 claudio Exp $ */ +/* $OpenBSD: repo.c,v 1.5 2021/04/13 13:35:59 claudio Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -778,6 +778,10 @@ rrdp_handle_file(size_t id, enum publish_type pt, char *uri, if (pt == PUB_DEL) { filepath_add(&rr->deleted, uri); } else { + fp = filepath_find(&rr->deleted, uri); + if (fp != NULL) + filepath_put(&rr->deleted, fp); + /* add new file to temp dir */ if ((fn = rrdp_filename(rr, uri, 1)) == NULL) return 0;