Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
audit: innitialize rc to prevent arithmetic error when stat succeed
Baptiste Daroussin committed 1 month ago
commit 0bd96a4d51d9decb478c73e54de6f53801e0fc3d
parent 35584e6
1 file changed +5 -1
modified scripts/periodic/405.pkg-base-audit.in
@@ -54,7 +54,7 @@ auditfile="${PKG_DBDIR}/vuln.xml"
audit_base() {
	local pkgargs="$1"
	local basedir="$2"
-
	local rc
+
	local rc=0
	local then
	local now
	local usrlv
@@ -109,6 +109,10 @@ audit_base() {
		date -r "${then}" -Iminutes || rc=3
	fi

+
	# Reset rc: the stat/date block above only informs the fetch
+
	# decision; the actual return code should come from pkg audit.
+
	rc=0
+

	# cannot check kernel in jail or chroot
	if [ -z "`echo "$pkgargs" | egrep '^-[cj]'`" -a `sysctl -n security.jail.jailed` = 0 ]; then
		krnlv=$(freebsd-version -k | sed 's,^,FreeBSD-kernel-,;s,-RELEASE-p,_,;s,-RELEASE$,,')