From 836416af68aed9009874caa6d32137d84fc11d8a Mon Sep 17 00:00:00 2001 From: Mixer9 <35545791+Mixer9@users.noreply.github.com> Date: Wed, 19 Sep 2018 15:47:48 -0500 Subject: [PATCH] update shared.sh This change has the same effect as #3328 and potentially could return empty values based on number of field differences, using awk and printing the last field no matter how many fixes this issue. --- .../rpm_verification/rpm_verify_hashes/bash/shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux_os/guide/system/software/integrity/software-integrity/rpm_verification/rpm_verify_hashes/bash/shared.sh b/linux_os/guide/system/software/integrity/software-integrity/rpm_verification/rpm_verify_hashes/bash/shared.sh index b18d20d5d7ea..9746ca4edcdd 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/rpm_verification/rpm_verify_hashes/bash/shared.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/rpm_verification/rpm_verify_hashes/bash/shared.sh @@ -1,7 +1,7 @@ # platform = multi_platform_rhel, multi_platform_fedora # Find which files have incorrect hash (not in /etc, because there are all system related config. files) and then get files names -files_with_incorrect_hash="$(rpm -Va | grep -E '^..5.* /(bin|sbin|lib|lib64|usr)/' | sed -r 's;^.*\s(.+)$;\1;g' )" +files_with_incorrect_hash="$(rpm -Va | grep -E '^..5.* /(bin|sbin|lib|lib64|usr)/' | awk '{print $NF}' )" # From files names get package names and change newline to space, because rpm writes each package to new line packages_to_reinstall="$(rpm -qf $files_with_incorrect_hash | tr '\n' ' ')"