$NetBSD: patch-ad,v 1.5 2023/10/17 19:24:04 triaxx Exp $ - Add NetBSD to the list of OS's - Handle a false positive for NetBSD's netstat --- chkrootkit.orig 2009-07-30 14:10:54.000000000 +0000 +++ chkrootkit @@ -528,7 +528,7 @@ ${ROOTDIR}/usr/include/syslogs.h ${ROOTD ### OpenBSD rootkit v1 - if [ \( "$SYSTEM" != "SunOS" -a ${SYSTEM} != "Linux" \) -a ! -f /usr/lib/security/libgcj.security ] + if [ "$SYSTEM" != "SunOS" -a "$SYSTEM" != "Linux" -a "$SYSTEM" != "NetBSD" -a ! -f /usr/lib/security/libgcj.security ] then expertmode_output "${find} ${ROOTDIR}usr/lib/security" fi @@ -1010,7 +1010,7 @@ ${find} ${ROOTDIR}usr/sbin -name in.slog fi ### OpenBSD rootkit v1 - if [ \( "${SYSTEM}" != "SunOS" -a ${SYSTEM} != "Linux" \) -a ! -f ${ROOTDIR}usr/lib/security/libgcj.security ]; then + if [ "$SYSTEM" != "SunOS" -a "$SYSTEM" != "Linux" -a "$SYSTEM" != "NetBSD" -a ! -f /usr/lib/security/libgcj.security ]; then files="" if [ "${QUIET}" != "t" ];then printn "Searching for OBSD rk v1... "; fi files=`${find} ${ROOTDIR}usr/lib/security 2>/dev/null` @@ -1876,7 +1876,13 @@ chk_netstat () { STATUS=${NOT_INFECTED} -NETSTAT_I_L="/dev/hdl0/dev/xdta|/dev/ttyoa|/dev/pty[pqrsx]|/dev/cui|/dev/hdn0|/dev/cui221|/dev/dszy|/dev/ddth3|/dev/caca|^/prof|/dev/tux|grep|addr\.h|__bzero" +NETSTAT_I_L="/dev/hdl0/dev/xdta|/dev/ttyoa|/dev/pty[pqrsx]|/dev/cui|/dev/hdn0|/dev/cui221|/dev/dszy|/dev/ddth3|/dev/caca|^/prof|/dev/tux|addr\.h|__bzero" + + case "${SYSTEM}" in + NetBSD) ;; # NetBSD contains "mobile_regreply" + *) NETSTAT_I_L="${NETSTAT_I_L}|grep";; + esac + CMD=`loc netstat netstat $pth` if [ "${EXPERT}" = "t" ]; then