From ac21c2b508995209572b7ece84326e8f3bcd61a1 Mon Sep 17 00:00:00 2001 From: claudio Date: Wed, 3 Nov 2021 13:30:56 +0000 Subject: [PATCH] Print the name of the non conforming attribute in the XML parse error. OK beck@ --- usr.sbin/rpki-client/rrdp_delta.c | 6 +++--- usr.sbin/rpki-client/rrdp_snapshot.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/rpki-client/rrdp_delta.c b/usr.sbin/rpki-client/rrdp_delta.c index 450e6667e74..797c7588ad4 100644 --- a/usr.sbin/rpki-client/rrdp_delta.c +++ b/usr.sbin/rpki-client/rrdp_delta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrdp_delta.c,v 1.4 2021/10/28 11:57:00 claudio Exp $ */ +/* $OpenBSD: rrdp_delta.c,v 1.5 2021/11/03 13:30:56 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2021 Claudio Jeker @@ -87,7 +87,7 @@ start_delta_elem(struct delta_xml *dxml, const char **attr) continue; } PARSE_FAIL(p, "parse failed - non conforming " - "attribute found in delta elem"); + "attribute '%s' found in delta elem", attr[i]); } if (!(has_xmlns && dxml->version && dxml->session_id && dxml->serial)) PARSE_FAIL(p, "parse failed - incomplete delta attributes"); @@ -136,7 +136,7 @@ start_publish_withdraw_elem(struct delta_xml *dxml, const char **attr, continue; } PARSE_FAIL(p, "parse failed - non conforming " - "attribute found in publish/withdraw elem"); + "attribute '%s' found in publish/withdraw elem", attr[i]); } if (hasUri != 1) PARSE_FAIL(p, diff --git a/usr.sbin/rpki-client/rrdp_snapshot.c b/usr.sbin/rpki-client/rrdp_snapshot.c index 4b4e062ffd7..e7d648f5f97 100644 --- a/usr.sbin/rpki-client/rrdp_snapshot.c +++ b/usr.sbin/rpki-client/rrdp_snapshot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrdp_snapshot.c,v 1.3 2021/10/28 11:57:00 claudio Exp $ */ +/* $OpenBSD: rrdp_snapshot.c,v 1.4 2021/11/03 13:30:56 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2021 Claudio Jeker @@ -80,7 +80,7 @@ start_snapshot_elem(struct snapshot_xml *sxml, const char **attr) } PARSE_FAIL(p, "parse failed - non conforming " - "attribute found in snapshot elem"); + "attribute '%s' found in snapshot elem", attr[i]); } if (!(has_xmlns && sxml->version && sxml->session_id && sxml->serial)) PARSE_FAIL(p, -- 2.20.1