Package: lsat
Version: 0.9.7.1-1
Severity: normal
Tags: patch

On SunOS 5.10 checknet module doesn't work:
"awk: can't open length($1) > 0 {print $1}"

I changed the "shellcode":
 * it sorts results numerically instead of using AWK
 * it passes -n to netstat to avoid long lookups
--- checknet.c.orig     czw lut  5 15:05:43 2009
+++ checknet.c  czw lut  5 15:06:55 2009
@@ -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)
        {

Reply via email to