head	1.2;
access;
symbols
	RELEASE_4_9_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2003.09.26.22.08.33;	author edwin;	state dead;
branches;
next	1.1;

1.1
date	2003.09.04.13.03.05;	author edwin;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Update port: security/chkrootkit: upgrade to version 0.42

	Version upgrade from 0.41 to 0.42.
	It works on FreeBSD 2.2.X, 3.X, 4.X and 5.X.

PR:		ports/56757
Submitted by:	Luiz Eduardo Roncato Cordeiro <cordeiro@@nic.br>
@
text
@--- chkrootkit.orig	Sun Aug 24 12:04:58 2003
+++ chkrootkit	Sun Aug 24 12:08:26 2003
@@@@ -1020,8 +1020,10 @@@@
              STATUS=${INFECTED}
           fi;;
        FreeBSD)
+          TMP="2"
+          if [ "${FreeBSD5}" = "yes" ]; then TMP="1"; fi
           if [ `${strings} -a ${CMD} | \
-                ${egrep} -c "${GENERIC_ROOTKIT_LABEL}"` -ne 2 ]
+                ${egrep} -c "${GENERIC_ROOTKIT_LABEL}"` -ne "${TMP}" ]
           then
              STATUS=${INFECTED}
           fi;;
@@@@ -1053,7 +1055,9 @@@@
              fi
           fi;;
        FreeBSD)
-          if [ `${strings} -a ${CMD} | ${egrep} -c "${GENERIC_ROOTKIT_LABEL}"` -ne 2 ]
+          TMP="2"
+          if [ "${FreeBSD5}" = "yes" ] ; then TMP="1"; fi
+          if [ `${strings} -a ${CMD} | ${egrep} -c "${GENERIC_ROOTKIT_LABEL}"` -ne "${TMP}" ]
              then
              STATUS=${INFECTED}
           fi;;
@@@@ -1264,7 +1268,10 @@@@
         return 5
     fi
 
-    if ${strings} -a ${CMD} | ${egrep} "${LS_INFECTED_LABEL}" >/dev/null 2>&1
+    TMP="0"
+    if [ "${FreeBSD5}" = "yes" ] ; then TMP="1"; fi
+    if [ `${strings} -a ${CMD} | \
+          ${egrep} -c "${LS_INFECTED_LABEL}"` -ne "${TMP}" ]
     then
        STATUS=${INFECTED}
     fi
@@@@ -1342,7 +1349,10 @@@@
         return 5
     fi
 
-    if ${strings} -a ${CMD} | ${egrep} "${PS_I_L}" >/dev/null 2>&1
+    TMP="0"
+    if [ "${FreeBSD5}" = "yes" ] ; then TMP="1"; fi
+    if [ `${strings} -a ${CMD} | \
+          ${egrep} -c "${PS_I_L}"` -ne "${TMP}" ]
     then
        STATUS=${INFECTED}
     fi
@@@@ -1560,7 +1570,10 @@@@
         return 5
     fi
 
-    if ${strings} -a ${CMD} | ${egrep} "${GENERIC_ROOTKIT_LABEL}" > /dev/null 2>&1
+    TMP="0"
+    if [ "${FreeBSD5}" = "yes" ] ; then TMP="2"; fi
+    if [ `${strings} -a ${CMD} | \
+          ${egrep} -c "${GENERIC_ROOTKIT_LABEL}"` -ne "${TMP}" ]
     then
         STATUS=${INFECTED}
     fi
@@@@ -1750,7 +1763,7 @@@@
     STATUS=${NOT_INFECTED}
     CMD=`loc vdir vdir $pth`
     VDIR_INFECTED_LABEL="/lib/volc"
-    if [ -r ${CMD} ]; then
+    if [ ! -r ${CMD} ]; then
         return ${NOT_FOUND}
     fi
 
@@@@ -2323,6 +2336,13 @@@@
 
 SYSTEM=`${uname} -s`
 VERSION=`${uname} -r`
+
+if [ "${SYSTEM}" = "FreeBSD" ] ; then
+   if [ -n '`uname -r | grep "^5"`' ] ; then
+      FreeBSD5="yes"
+   fi
+fi
+
 if [ "${SYSTEM}" != "FreeBSD" -a ${SYSTEM} != "OpenBSD" ] ; then
    V=44
 else
@


1.1
log
@Teach security/chkrootkit

	I finnaly got fed up with that FAQ about chkrootkit. The
	solution was either to add a Q+A to the FAQ or fix the port.

	This introduce a new variable, FreeBSD5, that is set to
	"yes" if we're running FreeBSD 5 or higher.

	This variable is used to fix the tests of the following
	binaries, so they would DTRT on FreeBSD 5: chfn chsh date
	ls ps

	I also fixed a bug in the cheking of vdir, but it's irrelevant
	for FreeBSD.

Informed maintainer.

PR:		ports/55919
Submitted by:	Yonatan@@xpert.com <Yonatan@@xpert.com>
@
text
@@

