From eecbab9e535a0290460e556e5f11b090b4bc92fc Mon Sep 17 00:00:00 2001
From: Mixer9 <35545791+Mixer9@users.noreply.github.com>
Date: Mon, 17 Sep 2018 12:45:21 -0500
Subject: [PATCH] Changed shell command
Changed the shell command per @cmattern-rht . Not all values returned with rpm -Va | grep ^.M have the same number of fields and so the rpm --setperms was failing on those empty values. This will take the last value which is always the path that is needed.
---
.../rpm_verification/rpm_verify_permissions/ansible/shared.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux_os/guide/system/software/integrity/software-integrity/rpm_verification/rpm_verify_permissions/ansible/shared.yml b/linux_os/guide/system/software/integrity/software-integrity/rpm_verification/rpm_verify_permissions/ansible/shared.yml
index dab1e298d72f..1426a1b95cbc 100644
--- a/linux_os/guide/system/software/integrity/software-integrity/rpm_verification/rpm_verify_permissions/ansible/shared.yml
+++ b/linux_os/guide/system/software/integrity/software-integrity/rpm_verification/rpm_verify_permissions/ansible/shared.yml
@@ -4,7 +4,7 @@
# complexity = high
# disruption = medium
- name: "Read list of files with incorrect permissions"
- shell: "rpm -Va | grep '^.M' | cut -d ' ' -f5- | sed -r 's;^.*\\s+(.+);\\1;g'"
+ shell: "rpm -Va | awk '/^.M/ {print $NF}'"
register: files_with_incorrect_permissions
failed_when: False
changed_when: False