| 1 | #!/bin/sh |
| 2 | |
| 3 | UID_BLACKLIST="0 65534" |
| 4 | USER_BLACKLIST="nobody" |
| 5 | |
| 6 | if [ -x "${UPAC_settingsd}/10_aide_usersuids" ]; then |
| 7 | #shellcheck disable=SC1090 |
| 8 | . "${UPAC_settingsd}/10_aide_usersuids" |
| 9 | fi |
| 10 | |
| 11 | blacklistfilter() { |
| 12 | BLACKLIST="$(echo "$@" | tr ' ' '\n')" |
| 13 | grep --invert-match --word-regexp --fixed-strings "${BLACKLIST}" |
| 14 | } |
| 15 | |
| 16 | printf "@@define LOCALUIDS (%s)\n" "$(\ |
| 17 | awk -F: '{print $3}' /etc/passwd | |
| 18 | sort --numeric-sort --unique | \ |
| 19 | blacklistfilter "${UID_BLACKLIST}" | \ |
| 20 | paste --serial --delimiters='|' \ |
| 21 | )" |
| 22 | printf "@@define LOCALUSERS (%s)\n" "$(\ |
| 23 | awk -F: '{print $1}' /etc/passwd | |
| 24 | sort --unique | \ |
| 25 | blacklistfilter "${USER_BLACKLIST}" | \ |
| 26 | paste --serial --delimiters='|' \ |
| 27 | )" |
| 28 | |
| 29 | # vim:tabstop=2:expandtab:shiftwidth=2 |