Skip to content

Commit 9d0b404

Browse files
committed
utils/oscap-im: Inherit environment for scanning and remediating
Bash remediations require PATH to be inherited by the oscap process to work correctly.
1 parent 8cf1954 commit 9d0b404

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/oscap-im

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818

1919
import argparse
20+
import os
2021
import subprocess
2122
import sys
2223
import tempfile
@@ -130,7 +131,7 @@ def scan_and_remediate(args):
130131
add_common_args(args, oscap_cmd)
131132
add_eval_args(args, oscap_cmd)
132133
oscap_cmd.append(args.data_stream)
133-
env = {"OSCAP_PREFERRED_ENGINE": "SCE"}
134+
env = {**os.environ, "OSCAP_PREFERRED_ENGINE": "SCE"}
134135
try:
135136
subprocess.run(oscap_cmd, env=env, check=True)
136137
except subprocess.CalledProcessError as e:

0 commit comments

Comments
 (0)