<def-group>
  <definition class="compliance" id="file_permissions_tftp_binary" version="1">
    <metadata>
      <title>TFTP Binary File Permissions</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>File permissions for the TFTP binary must be 0755.</description>
    </metadata>
    <criteria comment="package tftp-server removed or /etc/xinetd.d/tftp configured correctly" operator="OR">
		<extend_definition comment="rpm package tftp-server removed" definition_ref="package_tftp-server_removed" />
		<criterion test_ref="test_file_permissions_tftp_binary" />
    </criteria>
  </definition>

  <local_variable id="var_file_permissions_tftp_binary_list" comment="tftpd binary" datatype="string" version="1">
		<object_component item_field="subexpression" object_ref="object_file_permissions_tftp_binary_list" />
  </local_variable>
  <ind:textfilecontent54_object id="object_file_permissions_tftp_binary_list" version="1">
    <ind:filepath>/etc/xinetd.d/tftp</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*server\s.*(/.*)$</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  
  <unix:file_test check="all" check_existence="any_exist" comment="Testing tftpd binary permissions" id="test_file_permissions_tftp_binary" version="1">
    <unix:object object_ref="object_file_permissions_tftp_binary" />
    <unix:state state_ref="state_file_permissions_tftp_binary" />
  </unix:file_test>
  <unix:file_object comment="tftpd binary" id="object_file_permissions_tftp_binary" version="1">
    <unix:filepath var_ref="var_file_permissions_tftp_binary_list" var_check="at least one" />
  </unix:file_object>
  <unix:file_state id="state_file_permissions_tftp_binary" version="1">
    <unix:gwrite datatype="boolean">false</unix:gwrite>
    <unix:owrite datatype="boolean">false</unix:owrite>
  </unix:file_state>

</def-group>
