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-03-31 16:49:54 +0300
committerGitHub <noreply@github.com>2020-03-31 16:49:54 +0300
commit4ff61a6f46dc016552c805407939211f0c90560b (patch)
tree11fa7ed342393960a841804c7573e3c4fd1ec9b1 /include
parente481d5a173b4d9af6f2ee1d268992d0f187ce50d (diff)
parenteb7dbab1ee55f24a300b58ef845edc18d443f68a (diff)
Merge pull request #890 from bginsbach/add-pkg_info
Add pkg_info
Diffstat (limited to 'include')
-rw-r--r--include/binaries1
-rw-r--r--include/functions3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/binaries b/include/binaries
index 16096fe4..5884fc0c 100644
--- a/include/binaries
+++ b/include/binaries
@@ -230,6 +230,7 @@
php) PHPBINARY="${BINARY}"; PHPVERSION=$(${BINARY} -v | awk '{ if ($1=="PHP") { print $2 }}' | head -1); LogText "Found known binary: php (programming language interpreter) - ${BINARY} (version ${PHPVERSION})" ;;
pkg) PKG_BINARY="${BINARY}"; LogText " Found known binary: pkg (software package administration) - ${BINARY}" ;;
pkg_admin) PKGADMINBINARY="${BINARY}"; LogText " Found known binary: pkg_admin (software package administration) - ${BINARY}" ;;
+ pkg_info) PKGINFOBINARY="${BINARY}"; LogText " Found known binary: pkg_info (software package information) - ${BINARY}" ;;
postconf) POSTCONFBINARY="${BINARY}"; LogText " Found known binary: postconf (postfix configuration) - ${BINARY}" ;;
postfix) POSTFIXBINARY="${BINARY}"; LogText " Found known binary: postfix (postfix binary) - ${BINARY}" ;;
prelink) PRELINKBINARY="${BINARY}"; LogText " Found known binary: prelink (system optimizer) - ${BINARY}" ;;
diff --git a/include/functions b/include/functions
index ed1a58eb..5b60419f 100644
--- a/include/functions
+++ b/include/functions
@@ -2041,6 +2041,9 @@
elif [ -n "${PKG_BINARY}" ]; then
output=$(${PKG_BINARY} -N info ${package} >/dev/null 2>&1)
exit_code=$? # 0=package installed, 70=invalid package
+ elif [ -n "${PKGINFOBINARY}" ]; then
+ output=$(${PKGINFOBINARY} -q -e ${package} >/dev/null 2>&1)
+ exit_code=$? # 0=package installed, 1=package not installed
elif [ -n "${RPMBINARY}" ]; then
output=$(${RPMBINARY} --quiet -q ${package} > /dev/null 2>&1)
exit_code=$?