diff --git a/security/rkhunter/Makefile b/security/rkhunter/Makefile index f5ed7d474a72..f5c2ef749bdd 100644 --- a/security/rkhunter/Makefile +++ b/security/rkhunter/Makefile @@ -1,55 +1,55 @@ PORTNAME= rkhunter PORTVERSION= 1.4.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= SF MAINTAINER= lukasz@wasikowski.net COMMENT= Rootkit detection tool WWW= http://rkhunter.sourceforge.net LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/files/LICENSE OPTIONS_DEFINE= LSOF NMAP DOCS OPTIONS_DEFAULT=LSOF RUN_DEPENDS+= p5-Digest-SHA1>=0:security/p5-Digest-SHA1 USES= perl5 shebangfix SHEBANG_FILES= files/check_modules.pl files/filehashsha.pl \ files/stat.pl NO_ARCH= yes NO_BUILD= yes SUB_FILES= 415.${PORTNAME} PORTDOCS= ACKNOWLEDGMENTS CHANGELOG FAQ LICENSE README LSOF_RUN_DEPENDS= lsof:sysutils/lsof NMAP_RUN_DEPENDS= nmap:security/nmap post-patch: @${REINPLACE_CMD} -i '' -e 's|{SHAREDIR}/man/man8|{PREFIX}/man/man8|g' \ ${WRKSRC}/installer.sh @${REINPLACE_CMD} -i '' -e 's|RKHPREFIX|${PREFIX}|g' \ ${WRKSRC}/files/${PORTNAME}.conf do-install: cd ${WRKSRC} && ./installer.sh --layout custom ${STAGEDIR}${PREFIX} --install ${INSTALL_MAN} ${WRKSRC}/files/${PORTNAME}.8 \ ${STAGEDIR}${MAN8PREFIX}/man/man8 @${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/security ${INSTALL_SCRIPT} ${WRKDIR}/415.${PORTNAME} ${STAGEDIR}${PREFIX}/etc/periodic/security @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/files/|} ${STAGEDIR}${DOCSDIR} @${REINPLACE_CMD} -i '' -e 's|${STAGEDIR}||g' \ ${STAGEDIR}${PREFIX}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf ${INSTALL_DATA} ${WRKSRC}/files/${PORTNAME}.conf ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample ${INSTALL_DATA} -m 640 ${WRKSRC}/files/programs_bad.dat ${STAGEDIR}${PREFIX}/var/lib/${PORTNAME}/db/programs_bad.dat.sample ${INSTALL_DATA} -m 640 ${WRKSRC}/files/mirrors.dat ${STAGEDIR}${PREFIX}/var/lib/${PORTNAME}/db/mirrors.dat.sample .for f in cn de en tr tr.utf8 zh zh.utf8 ja ${INSTALL_DATA} -m 640 ${WRKSRC}/files/i18n/${f} ${STAGEDIR}${PREFIX}/var/lib/${PORTNAME}/db/i18n/${f}.sample .endfor .include diff --git a/security/rkhunter/files/415.rkhunter.in b/security/rkhunter/files/415.rkhunter.in index b35e70f724b1..4e33dc5ab443 100644 --- a/security/rkhunter/files/415.rkhunter.in +++ b/security/rkhunter/files/415.rkhunter.in @@ -1,53 +1,52 @@ #!/bin/sh # This is a maintenance shell script for the rkhunter security tool. # You can enable this script in /etc/periodic.conf file by putting these lines into it: -# daily_rkhunter_update_enable="YES" -# daily_rkhunter_update_flags="--update --nocolors" -# daily_rkhunter_check_enable="YES" -# daily_rkhunter_check_flags="--checkall --nocolors --skip-keypress" +# security_rkhunter_update_enable="YES" +# security_rkhunter_update_period="daily" +# security_rkhunter_update_flags="--update --nocolors" +# security_rkhunter_check_enable="YES" +# security_rkhunter_check_period="daily" +# security_rkhunter_check_flags="--checkall --nocolors --skip-keypress" # # Written by: Gabor Kovesdan if [ -r /etc/defaults/periodic.conf ]; then . /etc/defaults/periodic.conf 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"} +# compatibility with pre-stable/12 style variables +for type in update check +do + for mode in enable flags + do + eval old=\"\$daily_rkhunter_${type}_${mode}\" + if test -n "$old" + then + echo "Warning: Variable \$daily_rkhunter_${type}_${mode} is deprecated, use \$security_rkhunter_${type}_${mode} instead." >&2 + eval : \${security_rkhunter_${type}_${mode}:="\$daily_rkhunter_${type}_${mode}"} + fi + done +done -case "$daily_rkhunter_update_enable" in - [Yy][Ee][Ss]) +# defaults +: ${security_rkhunter_update_period:="daily"} +: ${security_rkhunter_check_period:="daily"} +: ${security_rkhunter_update_flags:="--update --nocolors"} +: ${security_rkhunter_check_flags:="--checkall --nocolors --skip-keypress"} +if check_yesno_period security_rkhunter_update_enable +then 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 - -case "$daily_rkhunter_check_enable" in - [Yy][Ee][Ss]) + anticongestion + %%PREFIX%%/bin/rkhunter ${security_rkhunter_update_flags} +fi +if check_yesno_period security_rkhunter_check_enable +then echo "" echo "Running rkhunter..." - %%PREFIX%%/bin/rkhunter ${daily_rkhunter_check_flags} - ;; -esac + %%PREFIX%%/bin/rkhunter ${security_rkhunter_check_flags} +fi diff --git a/security/rkhunter/pkg-message b/security/rkhunter/pkg-message index ee7fe15bd879..3a4a2f1bb6ad 100644 --- a/security/rkhunter/pkg-message +++ b/security/rkhunter/pkg-message @@ -1,17 +1,19 @@ [ { type: install message: <