Blob Blame History Raw
From 2e15ace4f3fe4b7e5e5b3829ddcd2d13f2743544 Mon Sep 17 00:00:00 2001
From: Martin Preisler <mpreisle@redhat.com>
Date: Wed, 18 Apr 2018 11:55:40 -0400
Subject: [PATCH] Force the CHROOT offline mode for RPM related probes

librpm doesn't fully support the rpmtsSetRootDir, we can't rely on it.
---
 src/OVAL/probes/unix/linux/rpminfo.c          | 2 +-
 src/OVAL/probes/unix/linux/rpmverify.c        | 2 +-
 src/OVAL/probes/unix/linux/rpmverifyfile.c    | 2 +-
 src/OVAL/probes/unix/linux/rpmverifypackage.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/OVAL/probes/unix/linux/rpminfo.c b/src/OVAL/probes/unix/linux/rpminfo.c
index 77759b047..8f52f020c 100644
--- a/src/OVAL/probes/unix/linux/rpminfo.c
+++ b/src/OVAL/probes/unix/linux/rpminfo.c
@@ -269,7 +269,7 @@ void probe_preload ()
 
 void probe_offline_mode ()
 {
-	probe_setoption(PROBEOPT_OFFLINE_MODE_SUPPORTED, PROBE_OFFLINE_OWN|PROBE_OFFLINE_RPMDB);
+	probe_setoption(PROBEOPT_OFFLINE_MODE_SUPPORTED, PROBE_OFFLINE_CHROOT|PROBE_OFFLINE_RPMDB);
 }
 
 void *probe_init (void)
diff --git a/src/OVAL/probes/unix/linux/rpmverify.c b/src/OVAL/probes/unix/linux/rpmverify.c
index 1a9aca01a..b1a9eaf05 100644
--- a/src/OVAL/probes/unix/linux/rpmverify.c
+++ b/src/OVAL/probes/unix/linux/rpmverify.c
@@ -226,7 +226,7 @@ void probe_preload ()
 
 void probe_offline_mode ()
 {
-	probe_setoption(PROBEOPT_OFFLINE_MODE_SUPPORTED, PROBE_OFFLINE_OWN);
+	probe_setoption(PROBEOPT_OFFLINE_MODE_SUPPORTED, PROBE_OFFLINE_CHROOT);
 }
 
 void *probe_init (void)
diff --git a/src/OVAL/probes/unix/linux/rpmverifyfile.c b/src/OVAL/probes/unix/linux/rpmverifyfile.c
index 877653b84..cbcb85fc0 100644
--- a/src/OVAL/probes/unix/linux/rpmverifyfile.c
+++ b/src/OVAL/probes/unix/linux/rpmverifyfile.c
@@ -311,7 +311,7 @@ void probe_preload ()
 
 void probe_offline_mode ()
 {
-	probe_setoption(PROBEOPT_OFFLINE_MODE_SUPPORTED, PROBE_OFFLINE_OWN);
+	probe_setoption(PROBEOPT_OFFLINE_MODE_SUPPORTED, PROBE_OFFLINE_CHROOT);
 }
 
 void *probe_init (void)
diff --git a/src/OVAL/probes/unix/linux/rpmverifypackage.c b/src/OVAL/probes/unix/linux/rpmverifypackage.c
index 3c0dd5003..2a110ef5a 100644
--- a/src/OVAL/probes/unix/linux/rpmverifypackage.c
+++ b/src/OVAL/probes/unix/linux/rpmverifypackage.c
@@ -312,7 +312,7 @@ ret:
 
 void probe_offline_mode ()
 {
-	probe_setoption(PROBEOPT_OFFLINE_MODE_SUPPORTED, PROBE_OFFLINE_OWN);
+	probe_setoption(PROBEOPT_OFFLINE_MODE_SUPPORTED, PROBE_OFFLINE_CHROOT);
 }
 
 void *probe_init (void)
-- 
2.14.3