Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 May 2017 02:59:01 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r441287 - in head/security/rkhunter: . files
Message-ID:  <201705200259.v4K2x1wH068788@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@wasikowski.net
  Reported by:	asomers
  Reviewed by:	asomers
  Approved by:	Lukasz Wasikowski <lukasz@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705200259.v4K2x1wH068788>