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>2022-09-17 17:49:26 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2022-09-17 17:49:26 +0300
commit73d43c25eb290e8879a590c8534202bcd400caeb (patch)
tree79d694b9aae2ac73b99c9e2281ac5ef8ad03ea86 /include
parentb53d6a80d706d29aaf7a03a31138b024230c49df (diff)
Moved section to discover current timestamp related to issue #1329
Diffstat (limited to 'include')
-rw-r--r--include/osdetection43
1 files changed, 30 insertions, 13 deletions
diff --git a/include/osdetection b/include/osdetection
index d9b8a41c..989b1b38 100644
--- a/include/osdetection
+++ b/include/osdetection
@@ -777,10 +777,26 @@
ECHONB=""
case ${OS} in
- "AIX") ECHOCMD="echo"; ECHONB="printf" ;;
- "DragonFly"|"FreeBSD"|"NetBSD") ECHOCMD="echo -e"; ECHONB="echo -n" ;;
- "macOS" | "Mac OS X") ECHOCMD="echo"; ECHONB="/bin/echo -n" ;;
- "Solaris") ECHOCMD="echo" ; test -f /usr/ucb/echo && ECHONB="/usr/ucb/echo -n" ;;
+ "AIX")
+ ECHOCMD="echo";
+ ECHONB="printf"
+ ;;
+ "DragonFly"|"FreeBSD"|"NetBSD")
+ ECHOCMD="echo -e"
+ ECHONB="echo -n"
+ NOW=$(date "+%s")
+ ;;
+ "macOS" | "Mac OS X")
+ ECHOCMD="echo"
+ ECHONB="/bin/echo -n"
+ NOW=$(date "+%s")
+ ;;
+
+ "Solaris")
+ ECHOCMD="echo"
+ test -f /usr/ucb/echo && ECHONB="/usr/ucb/echo -n"
+ NOW=$(nawk 'BEGIN{print srand()}')
+ ;;
"Linux")
# Check if dash is used (Debian/Ubuntu)
DEFAULT_SHELL=$(ls -l /bin/sh | awk -F'>' '{print $2}')
@@ -788,10 +804,14 @@
" dash") ECHOCMD="/bin/echo -e" ;;
*) ECHOCMD="echo -e" ;;
esac
+ NOW=$(date "+%s")
+ ;;
+ *)
+ ECHOCMD="echo -e"
+ NOW=$(date "+%s")
;;
- *) ECHOCMD="echo -e" ;;
esac
-
+
# Check if we have full featured commands, or are using BusyBox as a shell
if [ -x /bin/busybox ]; then
if [ -L /bin/ps ]; then
@@ -820,13 +840,10 @@
if [ -n "${EOL_TIMESTAMP}" ]; then
EOL_DATE=$(awk -v value="${FIND}" -F: '{if ($1=="os" && value ~ $2){print $3}}' ${DBDIR}/software-eol.db | head -n 1)
if [ -n "${EOL_DATE}" ]; then
- NOW=$(date "+%s")
- if [ -n "${NOW}" ]; then
- if [ ${NOW} -gt ${EOL_TIMESTAMP} ]; then
- EOL=1
- else
- EOL=0
- fi
+ if [ ${NOW} -gt ${EOL_TIMESTAMP} ]; then
+ EOL=1
+ else
+ EOL=0
fi
else
EOL=0