"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "include/osdetection" between
lynis-3.0.1.tar.gz and lynis-3.0.2.tar.gz

About: Lynis is a security and system auditing tool.

osdetection  (lynis-3.0.1):osdetection  (lynis-3.0.2)
skipping to change at line 193 skipping to change at line 193
LINUX_VERSION="CoreOS" LINUX_VERSION="CoreOS"
OS_NAME="CoreOS Linux" OS_NAME="CoreOS Linux"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
;; ;;
"debian") "debian")
LINUX_VERSION="Debian" LINUX_VERSION="Debian"
OS_NAME="Debian" OS_NAME="Debian"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
;; ;;
"elementary")
LINUX_VERSION="elementary OS"
OS_NAME="elementary OS"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a
wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release |
awk -F= '{print $2}' | tr -d '"')
;;
"endeavouros")
LINUX_VERSION="EndeavourOS"
OS_NAME="EndeavourOS"
OS_VERSION="Rolling release"
OS_VERSION_FULL="Rolling release"
;;
"fedora") "fedora")
LINUX_VERSION="Fedora" LINUX_VERSION="Fedora"
OS_NAME="Fedora Linux" OS_NAME="Fedora Linux"
OS_REDHAT_OR_CLONE=1 OS_REDHAT_OR_CLONE=1
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
;; ;;
"flatcar")
LINUX_VERSION="Flatcar"
LINUX_VERSION_LIKE="CoreOS"
OS_NAME="Flatcar Linux"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a
wk -F= '{print $2}' | tr -d '"')
;;
"gentoo") "gentoo")
LINUX_VERSION="Gentoo" LINUX_VERSION="Gentoo"
OS_NAME="Gentoo Linux" OS_NAME="Gentoo Linux"
OS_VERSION="Rolling release" OS_VERSION="Rolling release"
;; ;;
"ipfire")
LINUX_VERSION="IPFire"
OS_NAME="IPFire"
OS_VERSION=$(grep "^VERSION=" /etc/os-release | awk
-F= '{print $2}' | tr -d '"')
;;
"kali") "kali")
LINUX_VERSION="Kali" LINUX_VERSION="Kali"
OS_NAME="Kali Linux" OS_NAME="Kali Linux"
OS_VERSION="Rolling release" OS_VERSION="Rolling release"
;; ;;
"linuxmint") "linuxmint")
LINUX_VERSION="Linux Mint" LINUX_VERSION="Linux Mint"
OS_NAME="Linux Mint" OS_NAME="Linux Mint"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
;; ;;
"mageia")
LINUX_VERSION="Mageia"
OS_NAME="Mageia"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a
wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release |
awk -F= '{print $2}' | tr -d '"')
;;
"manjaro") "manjaro")
LINUX_VERSION="Manjaro" LINUX_VERSION="Manjaro"
OS_FULLNAME="Manjaro Linux" OS_FULLNAME="Manjaro Linux"
OS_NAME="Manjaro" OS_NAME="Manjaro"
OS_VERSION="Rolling release" OS_VERSION="Rolling release"
;; ;;
"nixos")
LINUX_VERSION="NixOS"
OS_NAME="NixOS"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a
wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release |
awk -F= '{print $2}' | tr -d '"')
;;
"ol") "ol")
LINUX_VERSION="Oracle Linux" LINUX_VERSION="Oracle Linux"
OS_NAME="Oracle Linux" OS_NAME="Oracle Linux"
OS_REDHAT_OR_CLONE=1 OS_REDHAT_OR_CLONE=1
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
;; ;;
"opensuse-tumbleweed") "opensuse-tumbleweed")
LINUX_VERSION="openSUSE Tumbleweed" LINUX_VERSION="openSUSE Tumbleweed"
# It's rolling release but has a snapshot version (t he date of the snapshot) # It's rolling release but has a snapshot version (t he date of the snapshot)
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
skipping to change at line 258 skipping to change at line 293
OS_NAME="PureOS" OS_NAME="PureOS"
;; ;;
"raspbian") "raspbian")
LINUX_VERSION="Raspbian" LINUX_VERSION="Raspbian"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /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" OS_NAME="Raspbian"
;; ;;
"rhel") "rhel")
LINUX_VERSION="RHEL" LINUX_VERSION="RHEL"
OS_NAME=$(grep "^PRETTY_NAME=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_NAME="RHEL"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
OS_FULLNAME="${OS_NAME} ${OS_VERSION_FULL}" OS_FULLNAME="${OS_NAME} ${OS_VERSION_FULL}"
OS_REDHAT_OR_CLONE=1 OS_REDHAT_OR_CLONE=1
;; ;;
"rosa")
LINUX_VERSION="ROSA Linux"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a
wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release |
awk -F= '{print $2}' | tr -d '"')
OS_NAME="ROSA Linux"
;;
"slackware") "slackware")
LINUX_VERSION="Slackware" LINUX_VERSION="Slackware"
OS_NAME="Slackware Linux" OS_NAME="Slackware Linux"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')
;; ;;
"sles")
LINUX_VERSION="SLES"
OS_NAME="openSUSE"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a
wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^PRETTY_NAME=" /etc/os-relea
se | awk -F= '{print $2}' | tr -d '"')
;;
"ubuntu") "ubuntu")
LINUX_VERSION="Ubuntu" LINUX_VERSION="Ubuntu"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /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="Ubuntu" OS_NAME="Ubuntu"
;; ;;
"void")
LINUX_VERSION="Void Linux"
OS_VERSION="Rolling release"
OS_NAME="Void Linux"
;;
"zorin")
LINUX_VERSION="Zorin OS"
OS_NAME="Zorin OS"
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | a
wk -F= '{print $2}' | tr -d '"')
OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release |
awk -F= '{print $2}' | tr -d '"')
;;
*) *)
ReportException "OS Detection" "Unknown OS found in /etc/os-release - Please create issue on GitHub project page: ${PROGRAM_SOURCE}" ReportException "OS Detection" "Unknown OS found in /etc/os-release - Please create issue on GitHub project page: ${PROGRAM_SOURCE}"
;; ;;
esac esac
fi fi
fi fi
# Alpine # Alpine
if [ -e "/etc/alpine-release" ]; then LINUX_VERSION="Alpine Linux"; OS_VERSION=$(cat /etc/alpine-release); fi if [ -e "/etc/alpine-release" ]; then LINUX_VERSION="Alpine Linux"; OS_VERSION=$(cat /etc/alpine-release); fi
skipping to change at line 387 skipping to change at line 445
fi fi
# Fedora # Fedora
FIND=$(grep "Fedora" /etc/redhat-release) FIND=$(grep "Fedora" /etc/redhat-release)
if [ ! "${FIND}" = "" ]; then if [ ! "${FIND}" = "" ]; then
OS_FULLNAME=$(grep "Fedora" /etc/redhat-release) OS_FULLNAME=$(grep "Fedora" /etc/redhat-release)
OS_VERSION="${OS_FULLNAME}" OS_VERSION="${OS_FULLNAME}"
LINUX_VERSION="Fedora" LINUX_VERSION="Fedora"
fi fi
# Mageia (has also /etc/megaia-release)
FIND=$(grep "Mageia" /etc/redhat-release)
if [ ! "${FIND}" = "" ]; then
OS_FULLNAME=$(grep "^Mageia" /etc/redhat-release)
OS_VERSION=$(grep "^Mageia" /etc/redhat-release | awk '{ if
($2=="release") { print $3 } }')
LINUX_VERSION="Mageia"
fi
# Oracle Enterprise Linux # Oracle Enterprise Linux
FIND=$(grep "Enterprise Linux Enterprise Linux Server" /etc/redh at-release) FIND=$(grep "Enterprise Linux Enterprise Linux Server" /etc/redh at-release)
if [ ! "${FIND}" = "" ]; then if [ ! "${FIND}" = "" ]; then
LINUX_VERSION="Oracle Enterprise Linux" LINUX_VERSION="Oracle Enterprise Linux"
OS_FULLNAME=$(grep "Enterprise Linux" /etc/redhat-release) OS_FULLNAME=$(grep "Enterprise Linux" /etc/redhat-release)
OS_VERSION="${OS_FULLNAME}" OS_VERSION="${OS_FULLNAME}"
fi fi
# Oracle Enterprise Linux # Oracle Enterprise Linux
if [ -e /etc/oracle-release ]; then if [ -e /etc/oracle-release ]; then
skipping to change at line 531 skipping to change at line 581
OS="OpenBSD" OS="OpenBSD"
OS_NAME="OpenBSD" OS_NAME="OpenBSD"
OS_FULLNAME=$(uname -s -r) OS_FULLNAME=$(uname -s -r)
OS_KERNELVERSION=$(uname -v) OS_KERNELVERSION=$(uname -v)
OS_VERSION=$(uname -r) OS_VERSION=$(uname -r)
HARDWARE=$(uname -m) HARDWARE=$(uname -m)
FIND_BINARIES="whereis" FIND_BINARIES="whereis"
SYSCTL_READKEY="" SYSCTL_READKEY=""
;; ;;
# Solaris / OpenSolaris # Solaris / OpenSolaris / Ilumos ...
SunOS) SunOS)
OS="Solaris" OS="Solaris"
OS_NAME="Sun Solaris" OS_KERNELVERSION=$(uname -v)
OS_FULLNAME=$(uname -s -r) OPENSOLARIS=0
OS_VERSION=$(uname -r)
if [ -f /etc/os-release ]; then
OS_ID=$(grep "^ID=" /etc/os-release | awk -F= '{print $2}' | tr
-d '"')
OS_VERSION=$(grep "^VERSION=" /etc/os-release | awk -F= '{print
$2}' | tr -d '"')
OS_FULLNAME=$(awk -F= '/^PRETTY_NAME=/ {print substr($2,2,length
($2)-2)}' /etc/os-release)
case "${OS_ID}" in
"solaris")
OS_NAME="Oracle Solaris"
;;
"omnios")
OS_NAME="OmniOS"
OPENSOLARIS=1
;;
"tribblix")
OS_NAME="Tribblix"
OS_FULLNAME="Tribblix ${OS_VERSION}"
OPENSOLARIS=1
;;
"*")
ReportException "OS Detection" "Unknown OS found in /etc
/os-release - Please create issue on GitHub project page: ${PROGRAM_SOURCE}"
;;
esac
elif [ "$(uname -o 2> /dev/null)" == "illumos" ]; then
OPENSOLARIS=1
# Solaris has a free form text file with release information
if grep "OpenIndiana" /etc/release > /dev/null; then
OS_NAME="OpenIndiana"
if grep "Hipster" /etc/release > /dev/null; then
OS_VERSION="$(tr ' ' '\n' < /etc/release | grep '[[:dig
it:]]\.[[:digit:]]')"
OS_FULLNAME="OpenIndiana Hipster $OS_VERSION"
else
OS_VERSION="Unknown"
OS_FULLNAME="OpenIndiana (unknown edition)"
fi
elif grep "OmniOS" /etc/release > /dev/null; then
OS_NAME="OmniOS"
OS_VERSION="$(tr ' ' '\n' < /etc/release | grep 'r[[:digit:
]]')"
if grep "Community Edition" /etc/release > /dev/null; then
OS_FULLNAME="OmniOS Community Edition v11 $OS_VERSION"
fi
elif grep "SmartOS" /etc/release > /dev/null; then
OS_NAME="SmartOS"
OS_VERSION="-"
OS_FULLNAME="SmartOS"
else
OS_NAME="Unknown Illumos"
fi
elif grep "SchilliX" /etc/release > /dev/null; then
OS_NAME="SchilliX"
OS_FULLNAME="$(head -n 1 /etc/release | xargs)"
OS_VERSION="$(echo "$OS_FULLNAME" | cut -d '-' -f 2)"
OPENSOLARIS=1
elif head -n 1 < /etc/release | grep "Oracle Solaris" > /dev/null; t
hen
OS_NAME="Oracle Solaris"
OS_FULLNAME="$(head -n 1 /etc/release | xargs)"
OS_VERSION="$(head -n 1 < /etc/release | xargs | cut -d ' ' -f 3
)"
elif head -n 1 < /etc/release | xargs | grep "^Solaris " > /dev/null
; then
OS_NAME="Sun Solaris"
# Example of /etc/release:
# Solaris 10 5/08
# ...
# Solaris 10 10/09 (Update 8)
# The first line does not contain the "Update" number,
# only if present.
if tail -1 < /etc/release | xargs | grep "^Solaris " > /dev/null
; then
OS_FULLNAME=$(tail -1 < /etc/release | xargs)
else
OS_FULLNAME=$(head -1 < /etc/release | xargs)
fi
OS_VERSION=$(echo "$OS_FULLNAME" | cut -d ' ' -f 2,3)
else # Old behaviour
OS_NAME="Sun Solaris"
OS_FULLNAME=$(uname -s -r)
OS_VERSION=$(uname -r)
fi
HARDWARE=$(uname -m) HARDWARE=$(uname -m)
if [ -x /usr/bin/isainfo ]; then if [ -x /usr/bin/isainfo ]; then
# Returns 32, 64 # Returns 32, 64
OS_MODE=$(/usr/bin/isainfo -b) OS_MODE=$(/usr/bin/isainfo -b)
fi fi
SYSCTL_READKEY="" SYSCTL_READKEY=""
;; ;;
# VMware products # VMware products
VMkernel) VMkernel)
 End of changes. 12 change blocks. 
14 lines changed or deleted 164 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)