From 714076b06f30358f239afbf5ad378c33dd1d2403 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Mon, 16 Jan 2023 10:10:31 -0600 Subject: [PATCH] Only restore prelinked binaries if prelinked is installed --- .../integrity/package_prelink_removed/ansible/shared.yml | 9 ++++++++- .../integrity/package_prelink_removed/bash/shared.sh | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/linux_os/guide/system/software/integrity/package_prelink_removed/ansible/shared.yml b/linux_os/guide/system/software/integrity/package_prelink_removed/ansible/shared.yml index f2152a6e3d5..69c9208f7e5 100644 --- a/linux_os/guide/system/software/integrity/package_prelink_removed/ansible/shared.yml +++ b/linux_os/guide/system/software/integrity/package_prelink_removed/ansible/shared.yml @@ -4,11 +4,18 @@ # complexity = medium # disruption = low +- name: Check If Prelinked Is Installed + ansible.builtin.stat: + path: /usr/sbin/prelink + get_checksum: no + register: prelink + - name: Restore Prelinked Binaries ansible.builtin.shell: cmd: prelink -ua + when: prelink.stat.exists -- name: Ensure prelink is removed +- name: Ensure prelink is Removed ansible.builtin.package: name: "prelink" state: absent diff --git a/linux_os/guide/system/software/integrity/package_prelink_removed/bash/shared.sh b/linux_os/guide/system/software/integrity/package_prelink_removed/bash/shared.sh index ebec1233fc7..65d1f61dcff 100644 --- a/linux_os/guide/system/software/integrity/package_prelink_removed/bash/shared.sh +++ b/linux_os/guide/system/software/integrity/package_prelink_removed/bash/shared.sh @@ -3,6 +3,10 @@ # strategy = disable # complexity = medium # disruption = low + +if [[ -f /usr/sbin/prelink ]]; +then prelink -ua +fi {{{ bash_package_remove(package="prelink") }}}