Blame SOURCES/openscap-1.3.2-red-hat-errata-url-pr1388.patch

cf36c6
From e957c5104fc8bdd6a272c8e7019b08aec921dc95 Mon Sep 17 00:00:00 2001
cf36c6
From: =?UTF-8?q?=C5=A0imon=20Luka=C5=A1=C3=ADk?= <isimluk@fedoraproject.org>
cf36c6
Date: Tue, 30 Jul 2019 13:28:41 +0200
cf36c6
Subject: [PATCH 1/2] Fix URL link mechanism for Red Hat Errata
cf36c6
cf36c6
Previously, public description of each erratum was available under
cf36c6
cf36c6
    https://rhn.redhat.com/errata/
cf36c6
cf36c6
at some point in time this has changed to
cf36c6
cf36c6
    https://access.redhat.com/errata/
cf36c6
cf36c6
and since not all links redirect properly from old to new, we have to fix
cf36c6
OpenSCAP end as well.
cf36c6
cf36c6
This enables people reviewing XCCDF policy guide or XCCDF result report to click
cf36c6
on RH[SBE]A-YYYY-ABCD acronym and be redirected to public description of the
cf36c6
given erratum.
cf36c6
---
cf36c6
 xsl/xccdf-share.xsl | 4 ++--
cf36c6
 1 file changed, 2 insertions(+), 2 deletions(-)
cf36c6
cf36c6
diff --git a/xsl/xccdf-share.xsl b/xsl/xccdf-share.xsl
cf36c6
index 50b6ad950..37a74ffa2 100644
cf36c6
--- a/xsl/xccdf-share.xsl
cf36c6
+++ b/xsl/xccdf-share.xsl
cf36c6
@@ -55,8 +55,8 @@ Authors:
cf36c6
         <xsl:when test="starts-with(@system, 'http://cve.mitre.org')">
cf36c6
             <xsl:value-of select="text()"/>
cf36c6
         </xsl:when>
cf36c6
-        <xsl:when test="starts-with(@system, 'https://rhn.redhat.com/errata')">
cf36c6
-            <xsl:value-of select="text()"/>
cf36c6
+        <xsl:when test="starts-with(@system, 'https://access.redhat.com/errata')">
cf36c6
+            <xsl:value-of select="text()"/>
cf36c6
         </xsl:when>
cf36c6
         <xsl:otherwise>
cf36c6
             <xsl:value-of select="text()"/>
cf36c6
cf36c6
From c142a763dfd92d7b304d76aecc1615729fea8533 Mon Sep 17 00:00:00 2001
cf36c6
From: =?UTF-8?q?=C5=A0imon=20Luka=C5=A1=C3=ADk?= <isimluk@fedoraproject.org>
cf36c6
Date: Tue, 30 Jul 2019 14:06:09 +0200
cf36c6
Subject: [PATCH 2/2] Transformation from OVAL to XCCDF should also assume new
cf36c6
 url for RH Errata
cf36c6
cf36c6
---
cf36c6
 xsl/oval-to-xccdf.xsl | 6 +++---
cf36c6
 1 file changed, 3 insertions(+), 3 deletions(-)
cf36c6
cf36c6
diff --git a/xsl/oval-to-xccdf.xsl b/xsl/oval-to-xccdf.xsl
cf36c6
index 850ee97a2..9dd29fd58 100644
cf36c6
--- a/xsl/oval-to-xccdf.xsl
cf36c6
+++ b/xsl/oval-to-xccdf.xsl
cf36c6
@@ -86,9 +86,9 @@ Authors:
cf36c6
     </xsl:template>
cf36c6
 
cf36c6
     <xsl:template match="oval-def:reference[@source='RHSA']">
cf36c6
-        <xsl:if test="starts-with(@ref_url, 'https://rhn.redhat.com/errata')">
cf36c6
-            <xccdf:ident system="https://rhn.redhat.com/errata">
cf36c6
-                <xsl:copy-of select="substring-before(substring-after(@ref_url, 'https://rhn.redhat.com/errata/'), '.html')"/>
cf36c6
+        <xsl:if test="starts-with(@ref_url, 'https://access.redhat.com/errata')">
cf36c6
+            <xccdf:ident system="https://access.redhat.com/errata">
cf36c6
+                <xsl:copy-of select="substring-after(@ref_url, 'https://access.redhat.com/errata/')"/>
cf36c6
             </xccdf:ident>
cf36c6
         </xsl:if>
cf36c6
     </xsl:template>