update shared.sh#3333
Merged
jan-cerny merged 1 commit intoComplianceAsCode:masterfrom Sep 19, 2018
Merged
Conversation
Removed cut function and returned the last field with awk, this provides better listing since not all values returned will have the same fields. It also removes whitespace at the beginning of the values returned. see comparison below:
<code>
[root@soctxadm01:~]# rpm -Va --nofiledigest | grep '^.M' | cut -d ' ' -f4-
/etc/selinux/targeted/active/seusers
/etc/selinux/targeted/active/users_extra
/var/lib/rpm/__db.001
/var/lib/rpm/__db.002
/var/lib/rpm/__db.003
/opt/splunkforwarder/etc/auth
/var/lib/systemd/random-seed
/etc/insights-client/.exp.sed
/etc/insights-client/.fallback.json
/etc/insights-client/.fallback.json.asc
/etc/insights-client/cert-api.access.redhat.com.pem
/etc/insights-client/insights-client.conf
/etc/insights-client/redhattools.pub.gpg
/etc/insights-client/rpm.egg
/etc/insights-client/rpm.egg.asc
/var/lock/iscsi
/var/lock/iscsi/lock
/run/lsm
/run/lsm/ipc
/var/log/dmesg
[root@soctxadm01:~]# rpm -Va --nofiledigest | grep '^.M' | awk '{print $NF}'
/etc/selinux/targeted/active/seusers
/etc/selinux/targeted/active/users_extra
/var/lib/rpm/__db.001
/var/lib/rpm/__db.002
/var/lib/rpm/__db.003
/opt/splunkforwarder/etc/auth
/var/lib/systemd/random-seed
/etc/insights-client/.exp.sed
/etc/insights-client/.fallback.json
/etc/insights-client/.fallback.json.asc
/etc/insights-client/cert-api.access.redhat.com.pem
/etc/insights-client/insights-client.conf
/etc/insights-client/redhattools.pub.gpg
/etc/insights-client/rpm.egg
/etc/insights-client/rpm.egg.asc
/var/lock/iscsi
/var/lock/iscsi/lock
/run/lsm
/run/lsm/ipc
/var/log/dmesg
</code>
Collaborator
|
Can one of the admins verify this patch? |
|
The inspection completed: No new issues |
Contributor
|
@openscap-ci test this please. |
Collaborator
|
@Mixer9 This is great. But I noticed that it is different form the code in Ansible in #3328. I know it was there before, but I think it should be the same. My opinion is that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed cut function and returned the last field with awk, this provides better listing since not all values returned will have the same fields. It also removes whitespace at the beginning of the values returned. see comparison below:
Description:
Change rpm command to get list of files that permissions changed on.
Rationale:
The original method returns empty fields from values who have less fields.