From b7d24c3413307620fc6e7531ed838a119128631d Mon Sep 17 00:00:00 2001 From: SiemKorteweg Date: Tue, 6 Oct 2015 20:02:33 +0200 Subject: [PATCH] Make sure that the input of "uniq -d" is sorted to avoid that duplicate UID's and hosts entries are missed. --- include/tests_authentication | 2 +- include/tests_nameservices | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tests_authentication b/include/tests_authentication index e69f3aaa..06d732f6 100644 --- a/include/tests_authentication +++ b/include/tests_authentication @@ -69,7 +69,7 @@ fi # Check password file if [ -f ${PASSWD_FILE} ]; then - FIND=`cat ${PASSWD_FILE} | grep -v '^#' | cut -d ':' -f3 | uniq -d` + FIND=`cat ${PASSWD_FILE} | grep -v '^#' | cut -d ':' -f3 | sort | uniq -d` if [ "${FIND}" = "" ]; then Display --indent 2 --text "- Checking for non-unique UIDs" --result OK --color GREEN logtext "Result: all accounts found in ${PASSWD_FILE} are unique" diff --git a/include/tests_nameservices b/include/tests_nameservices index 9365c9f6..06aa98c3 100644 --- a/include/tests_nameservices +++ b/include/tests_nameservices @@ -588,7 +588,7 @@ if [ ${SKIPTEST} -eq 0 ]; then logtext "Test: check duplicate line in /etc/hosts" if [ -f /etc/hosts ]; then - sFIND=`cat /etc/hosts | egrep -v '^(#|$)' | uniq -d` + sFIND=`cat /etc/hosts | egrep -v '^(#|$)' | sort | uniq -d` if [ "${sFIND}" = "" ]; then logtext "Result: OK, no duplicate lines found" Display --indent 4 --text "- Checking /etc/hosts (duplicates)" --result OK --color GREEN