Path: blob/main/Mk/Scripts/check-vulnerable.sh
16461 views
#!/bin/sh1#2# MAINTAINER: [email protected]34set -e5set -o pipefail67. "${dp_SCRIPTSDIR}/functions.sh"89validate_env dp_ECHO_MSG dp_PKG_BIN dp_PORTNAME dp_PKGNAME1011[ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_CHECK_VULNERABLE}" ] && set -x1213set -u1415# If the package is pkg, disable these checks, it fails while16# upgrading when pkg is not there.17# FIXME: check is this is still true18if [ "${dp_PORTNAME}" = "pkg" ]; then19exit 020fi2122if [ ! -x "${dp_PKG_BIN}" ]; then23exit 024fi2526if ! vlist=$(${dp_PKG_BIN} audit "${dp_PKGNAME}"); then27${dp_ECHO_MSG} "===> ${dp_PKGNAME} has known vulnerabilities:"28${dp_ECHO_MSG} "$vlist"29${dp_ECHO_MSG} "=> Please update your ports tree and try again."30${dp_ECHO_MSG} "=> Note: Vulnerable ports are marked as such even if there is no update available."31${dp_ECHO_MSG} "=> If you wish to ignore this vulnerability rebuild with 'make DISABLE_VULNERABILITIES=yes'"32exit 133fi343536