<def-group>
  <definition class="compliance" id="shells_file_references" version="1">
    <metadata>
      <title>All User Login Shells Must Be Listed In The Shells File</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>All shells referenced in /etc/passwd must be listed 
	  in the /etc/shells file, except any shells specified for the purpose 
	  of preventing logins.</description>
    </metadata>
    <criteria>
      <criterion test_ref="test_shells_file_references" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="Testing login shells in /etc/shells" id="test_shells_file_references" version="1">
    <ind:object object_ref="object_shells_file_references" />
    <ind:state state_ref="state_shells_file_references" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_shells_file_references" version="1">
    <ind:filepath>/etc/passwd</ind:filepath>
    <ind:pattern operation="pattern match">^.*:(/.*)$</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_state id="state_shells_file_references" version="1">
    <ind:subexpression operation="equals" var_ref="var_shells_file_references" var_check="at least one" datatype="string" />
  </ind:textfilecontent54_state>
  <ind:textfilecontent54_state id="state_shells_file_references_nologin" version="1">
    <ind:subexpression datatype="string" operation="pattern match">^(?!/usr/bin/false|/bin/false|/dev/null|/sbin/nologin|/bin/sync|/sbin/halt|/sbin/shutdown).*$</ind:subexpression>
  </ind:textfilecontent54_state>
  
  <local_variable id="var_shells_file_references" comment="login shells" datatype="string" version="1">
		<object_component item_field="subexpression" object_ref="object_shells_file_references_var" />
  </local_variable>
  <ind:textfilecontent54_object id="object_shells_file_references_var" version="1">
    <ind:filepath>/etc/shells</ind:filepath>
    <ind:pattern operation="pattern match">^(.*)$</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

</def-group>
