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:
authorSimon Biewald <simon@fam-biewald.de>2020-08-15 18:21:13 +0300
committerSimon Biewald <simon@fam-biewald.de>2020-08-15 18:29:20 +0300
commit3abc39598a3b367825bc3bf3dcfd75dce040ee50 (patch)
tree912cd1a7c691aceeca64476521edd7fd0ddda6ce /include/osdetection
parent529bcb2a6036718da41ef0bfc52fae7f20bdfcac (diff)
Add LINUX_VERSION_LIKE for variations of Linux distribution
Real Ubuntu and Debian do not have LINUX_VERSION_LIKE set. They are different enough to consider them as a different distribution. Tests targetting any of distributions based of those two should check both, LINUX_VERSION and LINUX_VERSION_LIKE.
Diffstat (limited to 'include/osdetection')
-rw-r--r--include/osdetection8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/osdetection b/include/osdetection
index 4af35a18..537742df 100644
--- a/include/osdetection
+++ b/include/osdetection
@@ -197,11 +197,13 @@
;;
"kali")
LINUX_VERSION="Kali"
+ LINUX_VERSION_LIKE="Debian"
OS_NAME="Kali Linux"
OS_VERSION="Rolling release"
;;
"linuxmint")
LINUX_VERSION="Linux Mint"
+ LINUX_VERSION_LIKE="Ubuntu"
OS_NAME="Linux Mint"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
@@ -231,18 +233,21 @@
;;
"pop")
LINUX_VERSION="Pop!_OS"
+ LINUX_VERSION_LIKE="Ubuntu"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
OS_NAME="Pop!_OS"
;;
"pureos")
LINUX_VERSION="PureOS"
+ LINUX_VERSION_LIKE="Debian"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
OS_NAME="PureOS"
;;
"raspbian")
LINUX_VERSION="Raspbian"
+ LINUX_VERSION_LIKE="Debian"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
OS_NAME="Raspbian"
@@ -324,6 +329,7 @@
LINUX_VERSION="Ubuntu"
elif [ "${FIND}" = "elementary OS" ]; then
LINUX_VERSION="elementary OS"
+ LINUX_VERSION_LIKE="Ubuntu"
OS_VERSION=$(grep "^DISTRIB_RELEASE=" /etc/lsb-release | cut -d '=' -f2)
OS_FULLNAME=$(grep "^DISTRIB_DESCRIPTION=" /etc/lsb-release | cut -d '=' -f2 | sed 's/"//g')
else
@@ -340,6 +346,8 @@
FIND=$(lsb_release --id | awk -F: '{ print $2 }' | awk '{ print $1 }')
if [ "${FIND}" = "LinuxMint" ]; then
LINUX_VERSION="Linux Mint"
+ # LMDE (Linux Mint Debian Edition) should be detected as Debian
+ LINUX_VERSION_LIKE="Ubuntu"
OS_VERSION=$(lsb_release --release | awk '{ print $2 }')
OS_FULLNAME="Linux Mint ${OS_VERSION}"
fi