#
# Checks for non-commented out ypupdated in /etc/inetd.conf
#
#
#
#

$file = '/etc/inetd.conf';
&pcheck("ypupdated vulnerability");
if ($chkconfig{'network'}) {
  open(INETD, $file);
  while (<INETD>) {
    chop;
    if (/^\s*#/) { next; }
    if (substr($_, 0, length('ypupdated')) eq 'ypupdated') {
      &report("DANGER:  ypupdated vulnerability.\n");
      &report("  There is a vulnerability present in /usr/etc/rpc.ypupdated\n");
      &report("  and it is almost totally unnecessary to have it running.\n");
      &report("  Comment out line $. of $file and then 'kill -HUP' the\n");
      &report("  inetd process to fix.\n\n");
      $failed = 1;
      }
    }
  close(INETD);
  if ($failed) { &failed; }
  else {
   &report("INFO:  ypupdated is disabled.  This is good.\n");
   &passed;
   }
  }
else {
  &report("INFO:  Networking is disabled.\n");
  &passed;
  }

exit 0;
