Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2020-12-17 16:51:52 +0300
committerGitHub <noreply@github.com>2020-12-17 16:51:52 +0300
commit8fb98cb25c80ad4655887af7aefc99db7c508f87 (patch)
treeb7a1ef2ec6e0f5b661245145f004a0f038451ce8 /include/tests_databases
parent208518d8fafac5910a908dc37109bf1b6da9714c (diff)
Only retrieve exit code
Redirect output of the count and every error to /dev/null, so we only get the exit code
Diffstat (limited to 'include/tests_databases')
-rw-r--r--include/tests_databases2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/tests_databases b/include/tests_databases
index fc44d690..9c8e1de0 100644
--- a/include/tests_databases
+++ b/include/tests_databases
@@ -86,7 +86,7 @@
# "-u root --password=" avoids ~/.my.cnf authentication settings
# "plugin = 'mysql_native_password' AND authentication_string = ''" avoids false positives when secure plugins are used
- FIND=$(${MYSQLCLIENTBINARY} --no-defaults -u root --password= --silent --batch --execute="SELECT count(*) FROM mysql.user WHERE user = 'root' AND plugin = 'mysql_native_password' AND authentication_string = ''" mysql 2>/dev/null; echo $?)
+ FIND=$(${MYSQLCLIENTBINARY} --no-defaults -u root --password= --silent --batch --execute="SELECT count(*) FROM mysql.user WHERE user = 'root' AND plugin = 'mysql_native_password' AND authentication_string = ''" mysql > /dev/null 2>&1; echo $?)
if [ "${FIND}" = "0" ]; then
LogText "Result: Login succeeded, no MySQL root password set!"
ReportWarning "${TEST_NO}" "No MySQL root password set"