<def-group>
  <definition class="compliance" id="file_permissions_run_control_scripts" version="1">
    <metadata>
      <title>File /etc/rc*/* and /etc/init.d/* 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 /etc/rc*/* and /etc/init.d/* must be 0755.</description>
    </metadata>
    <criteria>
      <criterion test_ref="test_file_permissions_etc_rc" />
      <criterion test_ref="test_file_permissions_etc_initd" />
    </criteria>
  </definition>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /etc/rc*/* permissions" id="test_file_permissions_etc_rc" version="1">
    <unix:object object_ref="object_file_permissions_etc_rc" />
    <unix:state state_ref="state_file_permissions_run_control_scripts" />
  </unix:file_test>
  <unix:file_object comment="/etc/rc.d/*" id="object_file_permissions_etc_rc" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="-1" recurse_file_system="local" />
    <unix:path>/etc/rc.d/</unix:path>
    <unix:filename operation="pattern match">.*</unix:filename>
    <filter action="exclude">state_file_permissions_run_control_scripts_symlink</filter>
  </unix:file_object>

  <unix:file_test check="all" check_existence="any_exist" comment="Testing /etc/init.d/* permissions" id="test_file_permissions_etc_initd" version="1">
    <unix:object object_ref="object_file_permissions_etc_initd" />
    <unix:state state_ref="state_file_permissions_run_control_scripts" />
  </unix:file_test>
  <unix:file_object comment="/etc/init.d/*" id="object_file_permissions_etc_initd" version="1">
    <unix:path>/etc/init.d</unix:path>
    <unix:filename operation="pattern match">.*</unix:filename>
    <filter action="exclude">state_file_permissions_run_control_scripts_symlink</filter>
  </unix:file_object>

  <unix:file_state id="state_file_permissions_run_control_scripts_symlink" version="1">
    <unix:type operation="equals">symbolic link</unix:type>
  </unix:file_state>

  <unix:file_state id="state_file_permissions_run_control_scripts" version="1">
    <unix:gwrite datatype="boolean">false</unix:gwrite>
    <unix:owrite datatype="boolean">false</unix:owrite>
  </unix:file_state>

</def-group>
