#-----------------------------------------------------------------------------
#
# Check /usr/bin/newgrp for group writability.
#

$file = '/usr/bin/newgrp';
&pcheck($file);
@mode = split(//, sprintf("%o", (stat($file))[2]));
if ($mode[4] >= 6) {
  &report("DANGER: Group writability $file vulnerability\n",
          "  To fix: \"chmod g-w $file\"\n\n");
  &failed;
  }
else {
  &report("INFO:  newgrp is not group writable.  This is good.\n");
  &passed;
  }

exit 0;
