Instead of storing the short TAL name as repouri use the first TAL URI
authorclaudio <claudio@openbsd.org>
Wed, 29 Mar 2023 17:03:29 +0000 (17:03 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 29 Mar 2023 17:03:29 +0000 (17:03 +0000)
for that. This is more in line with the other uses of repouri.
OK tb@

usr.sbin/rpki-client/repo.c

index 059fbfc..0a2513c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: repo.c,v 1.41 2022/12/28 21:30:18 jmc Exp $ */
+/*     $OpenBSD: repo.c,v 1.42 2023/03/29 17:03:29 claudio Exp $ */
 /*
  * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1012,18 +1012,18 @@ ta_lookup(int id, struct tal *tal)
 
        /* Look up in repository table. (Lookup should actually fail here) */
        SLIST_FOREACH(rp, &repos, entry) {
-               if (strcmp(rp->repouri, tal->descr) == 0)
+               if (strcmp(rp->repouri, tal->uri[0]) == 0)
                        return rp;
        }
 
        rp = repo_alloc(id);
        rp->basedir = repo_dir(tal->descr, "ta", 0);
-       if ((rp->repouri = strdup(tal->descr)) == NULL)
+       if ((rp->repouri = strdup(tal->uri[0])) == NULL)
                err(1, NULL);
 
        /* check if sync disabled ... */
        if (noop) {
-               logx("ta/%s: using cache", rp->repouri);
+               logx("%s: using cache", rp->basedir);
                entityq_flush(&rp->queue, rp);
                return rp;
        }