#!/usr/share/ucs-test/runner bash
# shellcheck shell=bash
## desc: Checking for *.secret files in /etc that are read- or writeable by group "other"
## bugs: [29477]
## exposure: safe
## tags:
##  - basic
##  - apptest

tmpfile="$(mktemp "/tmp/ucs-test-find-XXXXXXX")"

find -L /etc \( -iname "*secret" ! -wholename "*templates*listfilter.secret" \) \( -perm /o+r -o -perm /o+w \) -print0 > "$tmpfile"

if [ -s "$tmpfile" ]
then
    RETVAL=110
    xargs -0 ls -la <"$tmpfile"
fi
rm -f "$tmpfile"

exit $RETVAL
# vim: set ft=sh :
