<def-group>
  <definition class="compliance" id="file_owner_binary_dirs" version="1">
    <metadata>
      <title>Binary Files Owner</title>
      <affected family="unix">
        <platform>CentOS 4</platform>
		<platform>CentOS 5</platform>
		<platform>Red Hat Enterprise Linux 4</platform>
		<platform>Red Hat Enterprise Linux 5</platform>
      </affected>
      <description>Owner for files in binary directories must be root.</description>
    </metadata>
    <criteria>
      <criterion test_ref="test_file_owner_binary_dirs_etc" />
      <criterion test_ref="test_file_owner_binary_dirs_bin" />
      <criterion test_ref="test_file_owner_binary_dirs_usr_bin" />
      <criterion test_ref="test_file_owner_binary_dirs_usr_lbin" />
      <criterion test_ref="test_file_owner_binary_dirs_usr_usb" />
      <criterion test_ref="test_file_owner_binary_dirs_sbin" />
      <criterion test_ref="test_file_owner_binary_dirs_usr_sbin" />
    </criteria>
  </definition>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /etc/* owner" id="test_file_owner_binary_dirs_etc" version="1">
    <unix:object object_ref="object_file_owner_binary_dirs_etc" />
    <unix:state state_ref="state_file_owner_binary_dirs" />
  </unix:file_test>
  <unix:file_object comment="/etc/*" id="object_file_owner_binary_dirs_etc" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path operation="equals">/etc/</unix:path>
    <unix:filename operation="pattern match">^.*$</unix:filename>
  </unix:file_object>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /bin/* owner" id="test_file_owner_binary_dirs_bin" version="1">
    <unix:object object_ref="object_file_owner_binary_dirs_bin" />
    <unix:state state_ref="state_file_owner_binary_dirs" />
  </unix:file_test>
  <unix:file_object comment="/bin/*" id="object_file_owner_binary_dirs_bin" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path operation="equals">/bin</unix:path>
    <unix:filename operation="pattern match">^.*$</unix:filename>
  </unix:file_object>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /usr/bin/* owner" id="test_file_owner_binary_dirs_usr_bin" version="1">
    <unix:object object_ref="object_file_owner_binary_dirs_usr_bin" />
    <unix:state state_ref="state_file_owner_binary_dirs" />
  </unix:file_test>
  <unix:file_object comment="/usr/bin/*" id="object_file_owner_binary_dirs_usr_bin" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path operation="equals">/usr/bin</unix:path>
    <unix:filename operation="pattern match">^.*$</unix:filename>
  </unix:file_object>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /usr/lbin/* owner" id="test_file_owner_binary_dirs_usr_lbin" version="1">
    <unix:object object_ref="object_file_owner_binary_dirs_usr_lbin" />
    <unix:state state_ref="state_file_owner_binary_dirs" />
  </unix:file_test>
  <unix:file_object comment="/usr/lbin/*" id="object_file_owner_binary_dirs_usr_lbin" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path operation="equals">/usr/lbin</unix:path>
    <unix:filename operation="pattern match">^.*$</unix:filename>
  </unix:file_object>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /usr/usb/* owner" id="test_file_owner_binary_dirs_usr_usb" version="1">
    <unix:object object_ref="object_file_owner_binary_dirs_usr_usb" />
    <unix:state state_ref="state_file_owner_binary_dirs" />
  </unix:file_test>
  <unix:file_object comment="/usr/usb/*" id="object_file_owner_binary_dirs_usr_usb" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path operation="equals">/usr/usb</unix:path>
    <unix:filename operation="pattern match">^.*$</unix:filename>
  </unix:file_object>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /sbin/* owner" id="test_file_owner_binary_dirs_sbin" version="1">
    <unix:object object_ref="object_file_owner_binary_dirs_sbin" />
    <unix:state state_ref="state_file_owner_binary_dirs" />
  </unix:file_test>
  <unix:file_object comment="/sbin/*" id="object_file_owner_binary_dirs_sbin" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path operation="equals">/sbin</unix:path>
    <unix:filename operation="pattern match">^.*$</unix:filename>
  </unix:file_object>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /usr/sbin/* owner" id="test_file_owner_binary_dirs_usr_sbin" version="1">
    <unix:object object_ref="object_file_owner_binary_dirs_usr_sbin" />
    <unix:state state_ref="state_file_owner_binary_dirs" />
  </unix:file_test>
  <unix:file_object comment="/usr/sbin/*" id="object_file_owner_binary_dirs_usr_sbin" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path operation="equals">/usr/sbin</unix:path>
    <unix:filename operation="pattern match">^.*$</unix:filename>
  </unix:file_object>

  <unix:file_state id="state_file_owner_binary_dirs" version="1">
    <unix:user_id datatype="int" operation="less than">500</unix:user_id>
  </unix:file_state>
</def-group>
