diff --git a/linux_os/guide/system/permissions/files/file_permissions_ungroupowned/tests/group_in_usr_lib.pass.sh b/linux_os/guide/system/permissions/files/file_permissions_ungroupowned/tests/group_in_usr_lib.pass.sh new file mode 100644 index 00000000000..2dba98f1f26 --- /dev/null +++ b/linux_os/guide/system/permissions/files/file_permissions_ungroupowned/tests/group_in_usr_lib.pass.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# +UNOWNED_FILES=$(df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -nogroup) + +IFS=$"\n" +for f in $UNOWNED_FILES; do + rm -f "$f" +done + +touch /root/test +chown 9999:9999 /root/test +echo "testgroup:x:9999:" >> /usr/lib/group diff --git a/linux_os/guide/system/permissions/files/file_permissions_ungroupowned/tests/unowned_in_sysroot.pass.sh b/linux_os/guide/system/permissions/files/file_permissions_ungroupowned/tests/unowned_in_sysroot.pass.sh new file mode 100644 index 00000000000..a65499c6a64 --- /dev/null +++ b/linux_os/guide/system/permissions/files/file_permissions_ungroupowned/tests/unowned_in_sysroot.pass.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# +# remediation = none + +UNOWNED_FILES=$(df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -nogroup) + +IFS=$"\n" +for f in $UNOWNED_FILES; do + rm -f "$f" +done + +mkdir /sysroot +touch /sysroot/test +chown 9999:9999 /sysroot/test