<def-group>
  <definition class="compliance" id="{{{ rule_id }}}" version="1">
    {{{ oval_metadata("All Interactive Users Must Have A Home Directory Defined") }}}
    <criteria>
      <criterion test_ref="test_accounts_user_interactive_home_directory_defined"
                 comment="All Interactive Users Must Have A Home Directory Defined"/>
    </criteria>
  </definition>

  <!-- For detailed comments about logic used in this OVAL, check the
       "file_ownership_home_directories" rule.
       #### creation of object #### -->
  <unix:password_object id="object_accounts_user_interactive_home_directory_defined_objects"
                        version="1">
    <unix:username datatype="string" operation="not equal">nobody</unix:username>
    <filter action="include">state_accounts_user_interactive_home_directory_defined_uids</filter>
  </unix:password_object>

  <unix:password_state id="state_accounts_user_interactive_home_directory_defined_uids"
                       version="1">
    <unix:user_id datatype="int" operation="greater than or equal">{{{ uid_min }}}</unix:user_id>
  </unix:password_state>

  <!-- #### creation of state #### -->
  <unix:password_state id="state_accounts_user_interactive_home_directory_defined" version="1">
    <unix:home_dir operation="pattern match">^\/[^\/\n]*\/[^\/\n]{1,}.*$</unix:home_dir>
  </unix:password_state>

  <!-- #### creation of test #### -->
  <unix:password_test id="test_accounts_user_interactive_home_directory_defined" check="all"
                      check_existence="any_exist" version="1"
                      comment="All Interactive Users Have A Home Directory Defined">
    <unix:object object_ref="object_accounts_user_interactive_home_directory_defined_objects"/>
    <unix:state state_ref="state_accounts_user_interactive_home_directory_defined"/>
  </unix:password_test>
</def-group>
