From: tb Date: Mon, 8 Jul 2024 15:31:11 +0000 (+0000) Subject: Normalize the rsync caRepository to contain a trailing slash X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=39ab19dff5a4b23da99d01483aa932e948a0c0ad;p=openbsd Normalize the rsync caRepository to contain a trailing slash discussed with jca ok claudio --- diff --git a/usr.sbin/rpki-client/cert.c b/usr.sbin/rpki-client/cert.c index c6a762fa3d3..44a2eea36f7 100644 --- a/usr.sbin/rpki-client/cert.c +++ b/usr.sbin/rpki-client/cert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cert.c,v 1.148 2024/06/12 10:03:09 tb Exp $ */ +/* $OpenBSD: cert.c,v 1.149 2024/07/08 15:31:11 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * Copyright (c) 2021 Job Snijders @@ -534,6 +534,16 @@ sbgp_sia(const char *fn, struct cert *cert, X509_EXTENSION *ext) goto out; if (cert->repo == NULL && strncasecmp(carepo, RSYNC_PROTO, RSYNC_PROTO_LEN) == 0) { + if (carepo[strlen(carepo) - 1] != '/') { + char *carepo_tmp; + + if (asprintf(&carepo_tmp, "%s/", + carepo) == -1) + errx(1, NULL); + free(carepo); + carepo = carepo_tmp; + } + cert->repo = carepo; carepo = NULL; continue;