]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Fix global to local URI mapping on manifest entries
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 5 Oct 2023 00:22:34 +0000 (18:22 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 5 Oct 2023 00:22:34 +0000 (18:22 -0600)
Straightforward bug; was neither downloading to the intended location
nor attempting to locate the file there afterwards.

src/types/uri.c

index dd6885260804d08373344149dcaa63125132171c..7776b1a169d3263519c3a44d3b3255add7ff9496 100644 (file)
@@ -341,9 +341,7 @@ map_caged(struct rpki_uri *uri)
        if (notification == NULL)
                pr_crit("Programming error: Notification not recorded.");
 
-       pb_init(&pb);
-
-       error = pb_append(&pb, "rrdp");
+       error = pb_init_cache(&pb, "rrdp");
        if (error)
                return error;
        error = append_guri(&pb, notification->global, "https://", ENOTHTTPS, true);
@@ -430,7 +428,9 @@ uri_create_mft(struct rpki_uri **result, struct rpki_uri *mft, IA5String_t *ia5)
                return error;
        }
 
-       uri->type = UT_RSYNC;
+       uri->type = (validation_get_notification_uri(state_retrieve()) == NULL)
+           ? UT_RSYNC
+           : UT_CAGED;
 
        error = autocomplete_local(uri);
        if (error) {