<def-group>
  <definition class="compliance" id="accounts_unique_id" version="1">
    <metadata>
      <title>All Accounts Have Unique IDs</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 accounts on the system must have unique user or account IDs.</description>
    </metadata>
    <criteria>
      <criterion test_ref="test_accounts_unique_id" />
    </criteria>
  </definition>

  <local_variable id="var_accounts_unique_id" comment="account names" datatype="string" version="1">
		<object_component item_field="subexpression" object_ref="object_accounts_unique_id_var" />
  </local_variable>
  <ind:textfilecontent54_object id="object_accounts_unique_id_var" version="1">
    <ind:filepath>/etc/passwd</ind:filepath>
    <ind:pattern operation="pattern match">^(?:[\S]*?:){2}([0-9]+):{1}</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <unix:file_test check="all" check_existence="all_exist" comment="Testing account name uniqueness" id="test_accounts_unique_id" version="1">
    <unix:object object_ref="object_accounts_unique_id" />
    <unix:state state_ref="state_accounts_unique_id" />
  </unix:file_test>
  
  <ind:textfilecontent54_object id="object_accounts_unique_id" version="1">
    <ind:filepath>/etc/passwd</ind:filepath>
    <ind:pattern operation="pattern match">^(?:[\S]*?:){2}([0-9]+):{1}</ind:pattern>
    <ind:instance operation="greater than" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_accounts_unique_id" version="1">
    <ind:subexpression operation="equals" var_ref="var_accounts_unique_id" var_check="only one" datatype="string" />
  </ind:textfilecontent54_state>

</def-group>
