diff -Nru openscap-1.2.15/debian/changelog openscap-1.2.15/debian/changelog --- openscap-1.2.15/debian/changelog 2021-01-06 14:23:12.000000000 +0100 +++ openscap-1.2.15/debian/changelog 2023-01-31 13:38:45.000000000 +0100 @@ -1,3 +1,15 @@ +openscap (1.2.15-1ubuntu0.4) bionic; urgency=medium + + * Make dpkg version comparison less strict for epoch digit. (LP: #2004476) + - d/p/debian-epoch-less-strict.patch: oval_cmp_evr_string: + Make epoch comparison less restrict for dpkg. + * Allow build of ComplianceAsCode and USG projects for platforms that use + remote resources. (LP: #2002551) + - d/p/allow-DS-session-to-continue-without-remote-resource.patch: + Allow DS session to continue without remote resource. + + -- Eduardo Barretto Tue, 31 Jan 2023 13:38:45 +0100 + openscap (1.2.15-1ubuntu0.3) bionic; urgency=medium * Add dpkg version comparison algorithm to avoid false positives. diff -Nru openscap-1.2.15/debian/patches/allow-DS-session-to-continue-without-remote-resource.patch openscap-1.2.15/debian/patches/allow-DS-session-to-continue-without-remote-resource.patch --- openscap-1.2.15/debian/patches/allow-DS-session-to-continue-without-remote-resource.patch 1970-01-01 01:00:00.000000000 +0100 +++ openscap-1.2.15/debian/patches/allow-DS-session-to-continue-without-remote-resource.patch 2023-01-31 13:38:45.000000000 +0100 @@ -0,0 +1,36 @@ +From bbcbffcf6f901cb67ca5645307d170a32504a491 Mon Sep 17 00:00:00 2001 +From: Watson Sato +Date: Tue, 30 Apr 2019 18:30:53 +0200 +Subject: [PATCH] Allow DS session to continue without remote resources + +--- + src/DS/sds.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/DS/sds.c b/src/DS/sds.c +index 2511e89d9d..b7c33a2e58 100644 +--- a/src/DS/sds.c ++++ b/src/DS/sds.c +@@ -412,6 +412,7 @@ static int ds_sds_dump_component_by_href(struct ds_sds_session *session, char* x + } + + ds_sds_session_remote_resources_progress(session)(true, "WARNING: Skipping '%s' file which is referenced from datastream\n", url); ++ // -2 means that remote resources were not downloaded + return -2; + } + +@@ -444,8 +445,12 @@ int ds_sds_dump_component_ref_as(const xmlNodePtr component_ref, struct ds_sds_s + xmlFree(xlink_href); + xmlFree(cref_id); + +- if (ret != 0) { +- ++ if (ret == -2) { ++ // A remote component was not dumped ++ // It should be ok to continue without it ++ free(target_filename_dirname); ++ return 0; ++ } else if (ret != 0) { + free(target_filename_dirname); + return -1; + } diff -Nru openscap-1.2.15/debian/patches/debian-epoch-less-strict.patch openscap-1.2.15/debian/patches/debian-epoch-less-strict.patch --- openscap-1.2.15/debian/patches/debian-epoch-less-strict.patch 1970-01-01 01:00:00.000000000 +0100 +++ openscap-1.2.15/debian/patches/debian-epoch-less-strict.patch 2023-01-31 13:38:35.000000000 +0100 @@ -0,0 +1,42 @@ +Backport of: +From ce34cd227439e17248dfdf55b0fc19859c88d075 Mon Sep 17 00:00:00 2001 +From: Eduardo Barretto +Date: Mon, 19 Dec 2022 15:27:39 +0100 +Subject: [PATCH] oval_cmp_evr_string: Make epoch comparison less restrict for + dpkg + +dpkg by default sets to 0 the epoch if no epoch is present. +--- + src/OVAL/results/oval_cmp_evr_string.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/src/OVAL/results/oval_cmp_evr_string.c b/src/OVAL/results/oval_cmp_evr_string.c +index 3ba0fa0cbd..1c440bb569 100644 +--- a/src/OVAL/results/oval_cmp_evr_string.c ++++ b/src/OVAL/results/oval_cmp_evr_string.c +@@ -395,12 +395,10 @@ oval_result_t oval_debian_evr_string_cmp(const char *state, const char *sys, ova + parseEVR(a_copy, &a_epoch, &a_version, &a_release); + parseEVR(b_copy, &b_epoch, &b_version, &b_release); + +- if (!a_epoch || !b_epoch) { +- oscap_seterr(OSCAP_EFAMILY_OVAL, "Invalid epoch."); +- free(a_copy); +- free(b_copy); +- return OVAL_RESULT_ERROR; +- } ++ if (!a_epoch) ++ a_epoch = "0"; ++ if (!b_epoch) ++ b_epoch = "0"; + + aux = strtol(a_epoch, NULL, 10); + if (aux < INT_MIN || aux > INT_MAX) { +@@ -441,7 +439,7 @@ oval_result_t oval_debian_evr_string_cmp(const char *state, const char *sys, ova + return ((result <= 0) ? OVAL_RESULT_TRUE : OVAL_RESULT_FALSE); + } + +- oscap_seterr(OSCAP_EFAMILY_OVAL, "Invalid type of operation in rpm version comparison: %d.", operation); ++ oscap_seterr(OSCAP_EFAMILY_OVAL, "Invalid type of operation in dpkg version comparison: %d.", operation); + return OVAL_RESULT_ERROR; + } + diff -Nru openscap-1.2.15/debian/patches/series openscap-1.2.15/debian/patches/series --- openscap-1.2.15/debian/patches/series 2021-01-06 14:23:12.000000000 +0100 +++ openscap-1.2.15/debian/patches/series 2023-01-31 13:38:45.000000000 +0100 @@ -8,3 +8,5 @@ dpkg-version-comparison-1.patch dpkg-version-comparison-2.patch dpkg-version-comparison-3.patch +debian-epoch-less-strict.patch +allow-DS-session-to-continue-without-remote-resource.patch