<def-group>
  <definition class="compliance" id="dir_perms_world_writable_system_owned" version="1">
    <metadata>
      <title>Find world writable directories not owned by a system account</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 6</platform>
      </affected>
      <description>All world writable directories should be owned by a system user.</description>
    </metadata>
    <criteria comment="check for local directories that are world writable and have uid greater than or equal to 500" negate="true">
      <criterion comment="check for local directories that are world writable and have uid greater than or equal to 500" test_ref="test_dir_world_writable_uid_gt_500" />
    </criteria>
  </definition>
  <unix:file_test check="all" comment="check for local directories that are world writable and have uid greater than or equal to 500" id="test_dir_world_writable_uid_gt_500" version="1">
    <unix:object object_ref="all_local_directories" />
    <unix:state state_ref="state_gid_is_user_and_world_writable" />
  </unix:file_test>
  <unix:file_object comment="all local directories" id="all_local_directories" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path operation="equals">/</unix:path>
    <unix:filename xsi:nil="true" />
    <filter action="include">state_gid_is_user_and_world_writable</filter>
  </unix:file_object>
  <unix:file_state comment="uid greater than or equal to 500 and world writable" id="state_gid_is_user_and_world_writable" version="1">
    <unix:user_id datatype="int" operation="greater than or equal">500</unix:user_id>
    <unix:owrite datatype="boolean">true</unix:owrite>
  </unix:file_state>
</def-group>
