#! /bin/sh /usr/share/dpatch/dpatch-run
## 002_checknet_sunos.dpatch by TomaszN <nowak2000@poczta.onet.pl>
##
## DP: awk invocation in checknet for sunos doesn't work
@DPATCH@
diff -urNad lsat-0.9.7.1~/checknet.c lsat-0.9.7.1/checknet.c
--- lsat-0.9.7.1~/checknet.c 2008-05-04 08:47:28.000000000 -0430
+++ lsat-0.9.7.1/checknet.c 2009-06-29 10:56:09.000000000 -0430
@@ -149,7 +149,7 @@
/* we are on Solaris, begin getting funky */
{
tempfile = "/tmp/lsat1.lsat";
- shellcode = "netstat -a -f inet |grep LISTEN |awk -F\" \" 'length($1) > 0 {print $1}' 2>/dev/null >> /tmp/lsat1.lsat";
+ shellcode = "netstat -a -f inet -n |grep LISTEN | sort -n 2>/dev/null >> /tmp/lsat1.lsat";
header = "These ports were found to be listening on the system.\nClose all ports or services you do not need.";
if ((dostuff(tempfile, filename, shellcode, header, html)) < 0)
{