Fix duplicate global variables

Resolves: RHBZ#1793914
This commit is contained in:
Jan Černý 2020-01-27 10:54:51 +01:00
parent 7234b24941
commit 4a2ee82472
2 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,62 @@
From e9ae8e3fac97694aa9cbb1350b90f110e461e02d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
Date: Wed, 22 Jan 2020 12:59:47 +0100
Subject: [PATCH] Fix duplicate global variables
This should fix failed builds with GCC 10 on Rawhide.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1793914
---
src/OVAL/probes/unix/process58_probe.c | 2 +-
src/OVAL/probes/unix/process_probe.c | 4 ++--
src/OVAL/probes/unix/shadow_probe.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/OVAL/probes/unix/process58_probe.c b/src/OVAL/probes/unix/process58_probe.c
index 3b8d8d1d2..74a2feee0 100644
--- a/src/OVAL/probes/unix/process58_probe.c
+++ b/src/OVAL/probes/unix/process58_probe.c
@@ -152,7 +152,7 @@ static void report_finding(struct result_info *res, probe_ctx *ctx)
#if defined(OS_LINUX)
-unsigned long ticks, boot;
+static unsigned long ticks, boot;
static void get_boot_time(void)
{
diff --git a/src/OVAL/probes/unix/process_probe.c b/src/OVAL/probes/unix/process_probe.c
index ab0bdf67a..cc4e46ff1 100644
--- a/src/OVAL/probes/unix/process_probe.c
+++ b/src/OVAL/probes/unix/process_probe.c
@@ -58,7 +58,7 @@
#include "process_probe.h"
#include "oscap_helpers.h"
-oval_schema_version_t over;
+static oval_schema_version_t over;
/* Convenience structure for the results being reported */
struct result_info {
@@ -106,7 +106,7 @@ static void report_finding(struct result_info *res, probe_ctx *ctx)
#if defined(OS_LINUX)
-unsigned long ticks, boot;
+static unsigned long ticks, boot;
static void get_boot_time(void)
{
diff --git a/src/OVAL/probes/unix/shadow_probe.c b/src/OVAL/probes/unix/shadow_probe.c
index b1fe15095..24e3a4651 100644
--- a/src/OVAL/probes/unix/shadow_probe.c
+++ b/src/OVAL/probes/unix/shadow_probe.c
@@ -61,7 +61,7 @@
#include <probe/option.h>
#include "shadow_probe.h"
-oval_schema_version_t over;
+static oval_schema_version_t over;
#ifndef HAVE_SHADOW_H
int shadow_probe_main(probe_ctx *ctx, void *arg)

View File

@ -1,12 +1,13 @@
Name: openscap
Version: 1.3.2
Release: 2%{?dist}
Release: 3%{?dist}
Epoch: 1
Summary: Set of open source libraries enabling integration of the SCAP line of standards
License: LGPLv2+
URL: http://www.open-scap.org/
Source0: https://github.com/OpenSCAP/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
Patch0: openscap-1.3.3-cpp-operator-in-header.patch
Patch1: openscap-1.3.3-duplicate-globals.patch
BuildRequires: cmake >= 2.6
BuildRequires: gcc
BuildRequires: gcc-c++
@ -189,6 +190,9 @@ pathfix.py -i %{__python3} -p -n $RPM_BUILD_ROOT%{_bindir}/scap-as-rpm
%{_mandir}/man8/oscap-podman.8*
%changelog
* Mon Jan 27 2020 Jan Černý <jcerny@redhat.com> - 1:1.3.2-3
- Fix duplicate global variables (RHBZ#1793914)
* Wed Jan 15 2020 Jan Černý <jcerny@redhat.com> - 1:1.3.2-2
- Do not use C++ keyword operator as a function parameter name