mirror of https://github.com/CISOfy/lynis.git
Split name and version information for RPM based package manager
This commit is contained in:
parent
6815c9a915
commit
360e6b66f6
|
@ -137,7 +137,7 @@
|
|||
logtext "Test: Querying 'rpm -qa' to get package list"
|
||||
Display --indent 6 --text "- Querying RPM package manager"
|
||||
logtext "Output:"; logtext "--------"
|
||||
SPACKAGES=`${RPMBINARY} -qa 2> /dev/null | sort`
|
||||
SPACKAGES=`${RPMBINARY} -qa --query "%{NAME},%{VERSION}-%{RELEASE}.%{ARCH}\n" 2> /dev/null | sort`
|
||||
if [ "${SPACKAGES}" = "" ]; then
|
||||
logtext "Result: RPM binary available, but package list seems to be empty"
|
||||
logtext "Info: looks like the rpm binary is installed, but not used for package installation"
|
||||
|
@ -145,8 +145,10 @@
|
|||
else
|
||||
for J in ${SPACKAGES}; do
|
||||
N=`expr ${N} + 1`
|
||||
PACKAGE_NAME=`echo ${J} | awk -F, '{print $1}'`
|
||||
PACKAGE_VERSION=`echo ${J} | awk -F, '{print $2}'`
|
||||
logtext "Found package: ${J}"
|
||||
INSTALLED_PACKAGES="${INSTALLED_PACKAGES}|${J},0,"
|
||||
INSTALLED_PACKAGES="${INSTALLED_PACKAGES}|${PACKAGE_NAME},${PACKAGE_VERSION},"
|
||||
done
|
||||
report "installed_packages=${N}"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue