<def-group>
  <!-- THIS FILE IS GENERATED by RHEL/6/input/checks/templates/create_umask_checks.py.  DO NOT EDIT.  -->
  <!-- INSTEAD OF EDIT THAT TEMPLATE IF NECESSARY. AFTER THAT BE SURE TO REGENERATE ALL CORRESPONDING -->
  <!-- UNCOMMENTED CHECSK FROM file_umask_checks.csv CSV FILE -->
  <definition class="compliance" id="OVALCHECKID" version="1">
    <metadata>
      <title>TITLE</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 6</platform>
      </affected>
      <description>DESCRIPTION</description>
    </metadata>
    <criteria>
      <criterion test_ref="tst_OVALCHECKID" />
    </criteria>
  </definition>

  <ind:textfilecontent54_object id="obj_umask_fromFILEID" comment="Umask value from FILEPATH" version="1">
    <ind:filepath>FILEPATH</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*(?i)UMASK(?-i)[\s]+([^#\s]*)</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <local_variable id="var_first_digit_of_umask_fromFILEID" datatype="int" version="1" comment="First octal digit of umask from FILEPATH">
    <substring substring_start="1" substring_length="1">
      <object_component item_field="subexpression" object_ref="obj_umask_fromFILEID" />
    </substring>
  </local_variable>

  <local_variable id="var_second_digit_of_umask_fromFILEID" datatype="int" version="1" comment="Second octal digit of umask from FILEPATH">
    <substring substring_start="2" substring_length="1">
      <object_component item_field="subexpression" object_ref="obj_umask_fromFILEID" />
    </substring>
  </local_variable>

  <local_variable id="var_third_digit_of_umask_fromFILEID" datatype="int" version="1" comment="Third octal digit of umask from FILEPATH">
    <substring substring_start="3" substring_length="1">
      <object_component item_field="subexpression" object_ref="obj_umask_fromFILEID" />
    </substring>
  </local_variable>

  <local_variable id="varFILEID_umask_as_number" datatype="int" version="1" comment="FILEPATH umask converted from string to a number">
    <arithmetic arithmetic_operation="add">
      <arithmetic arithmetic_operation="multiply">
        <literal_component datatype="int">64</literal_component>
        <variable_component var_ref="var_first_digit_of_umask_fromFILEID" />
      </arithmetic>
      <arithmetic arithmetic_operation="multiply">
        <literal_component datatype="int">8</literal_component>
        <variable_component var_ref="var_second_digit_of_umask_fromFILEID" />
      </arithmetic>
      <variable_component var_ref="var_third_digit_of_umask_fromFILEID" />
    </arithmetic>
  </local_variable>

  <external_variable id="USERUMASKVARIABLE" datatype="string" version="1" comment="Expected umask" />

  <local_variable id="var_first_digit_of_umask_from_USERUMASKVARIABLE" datatype="int" version="1" comment="First octal digit of umask from USERUMASKVARIABLE">
    <substring substring_start="1" substring_length="1">
      <variable_component var_ref="USERUMASKVARIABLE" />
    </substring>
  </local_variable>

  <local_variable id="var_second_digit_of_umask_from_USERUMASKVARIABLE" datatype="int" version="1" comment="Second octal digit of umask from USERUMASKVARIABLE">
    <substring substring_start="2" substring_length="1">
      <variable_component var_ref="USERUMASKVARIABLE" />
    </substring>
  </local_variable>

  <local_variable id="var_third_digit_of_umask_from_USERUMASKVARIABLE" datatype="int" version="1" comment="Third octal digit of umask from USERUMASKVARIABLE">
    <substring substring_start="3" substring_length="1">
      <variable_component var_ref="USERUMASKVARIABLE" />
    </substring>
  </local_variable>

  <local_variable id="USERUMASKVARIABLE_umask_as_number" datatype="int" version="1" comment="USERUMASKVARIABLE umask converted from string to a number">
    <arithmetic arithmetic_operation="add">
      <arithmetic arithmetic_operation="multiply">
        <literal_component datatype="int">64</literal_component>
        <variable_component var_ref="var_first_digit_of_umask_from_USERUMASKVARIABLE" />
      </arithmetic>
      <arithmetic arithmetic_operation="multiply">
        <literal_component datatype="int">8</literal_component>
        <variable_component var_ref="var_second_digit_of_umask_from_USERUMASKVARIABLE" />
      </arithmetic>
      <variable_component var_ref="var_third_digit_of_umask_from_USERUMASKVARIABLE" />
    </arithmetic>
  </local_variable>

  <ind:variable_test id="tst_OVALCHECKID" version="1" check="all" comment="Test the retrieved FILEPATH umask value(s) match the USERUMASKVARIABLE requirement">
    <ind:object object_ref="obj_OVALCHECKID" />
    <ind:state state_ref="ste_OVALCHECKID" />
  </ind:variable_test>

  <ind:variable_object id="obj_OVALCHECKID" version="1">
    <ind:var_ref>varFILEID_umask_as_number</ind:var_ref>
  </ind:variable_object>

  <ind:variable_state id="ste_OVALCHECKID" version="1">
    <ind:value datatype="int" operation="bitwise and" var_ref="USERUMASKVARIABLE_umask_as_number" />
  </ind:variable_state>
</def-group>
