svn commit: r441287 - in head/security/rkhunter: . files
Alan Somers
asomers at FreeBSD.org
Sat May 20 02:59:03 UTC 2017
Author: asomers (src committer)
Date: Sat May 20 02:59:01 2017
New Revision: 441287
URL: https://svnweb.freebsd.org/changeset/ports/441287
Log:
Use anticongestion in security/rkhunter
Introduced in src r316342, the anticongestion feature unifies multiple periodic
scripts' disparate sleeps.
PR: 218446
Submitted by: lukasz at wasikowski.net
Reported by: asomers
Reviewed by: asomers
Approved by: Lukasz Wasikowski <lukasz at wasikowski.net> (maintainer)
Approved by: brd (ports)
Modified:
head/security/rkhunter/Makefile
head/security/rkhunter/files/415.rkhunter.in
Modified: head/security/rkhunter/Makefile
==============================================================================
--- head/security/rkhunter/Makefile Sat May 20 02:51:17 2017 (r441286)
+++ head/security/rkhunter/Makefile Sat May 20 02:59:01 2017 (r441287)
@@ -3,7 +3,7 @@
PORTNAME= rkhunter
PORTVERSION= 1.4.2
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= security
MASTER_SITES= SF
Modified: head/security/rkhunter/files/415.rkhunter.in
==============================================================================
--- head/security/rkhunter/files/415.rkhunter.in Sat May 20 02:51:17 2017 (r441286)
+++ head/security/rkhunter/files/415.rkhunter.in Sat May 20 02:59:01 2017 (r441287)
@@ -16,6 +16,13 @@ if [ -r /etc/defaults/periodic.conf ]; t
source_periodic_confs
fi
+SLEEP=/bin/sleep
+JOT=/usr/bin/jot
+
+random() {
+ ${JOT} -r 1 0 900
+}
+
: ${daily_rkhunter_update_flags="--update --nocolors"}
: ${daily_rkhunter_check_flags="--checkall --nocolors --skip-keypress"}
@@ -24,6 +31,16 @@ case "$daily_rkhunter_update_enable" in
echo ""
echo "Updating the rkhunter database..."
+ # When non-interactive, sleep to reduce congestion on rkhunter site
+ if [ "$1" != -nodelay ]; then
+ # In FreeBSD 12.0 the anticongestion function should be used
+ # instead of a hard-coded sleep
+ if [ -n "$anticongestion_sleeptime" ]; then
+ anticongestion
+ else
+ ${SLEEP} $(random)
+ fi
+ fi
%%PREFIX%%/bin/rkhunter ${daily_rkhunter_update_flags}
;;
esac
More information about the svn-ports-head
mailing list