<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="USERUMASKVARIABLE_as_number" version="1">
    <metadata>
      <title>Value of 'USERUMASKVARIABLE' variable represented as octal number</title>
      <affected family="unix">
        <platform>multi_platform_rhel</platform>
      </affected>
      <description>Value of 'USERUMASKVARIABLE' variable represented as octal number</description>
    </metadata>
    <criteria operator="AND">
      <criterion test_ref="test_existence_of_USERUMASKVARIABLE_as_number_variable" />
    </criteria>
  </definition>

  <external_variable id="USERUMASKVARIABLE" datatype="string" version="1"
  comment="Value of USERUMASKVARIABLE (the required umask) as string" />

  <local_variable id="var_first_digit_of_umask_from_USERUMASKVARIABLE"
  comment="First octal digit of umask from USERUMASKVARIABLE"
  datatype="int" version="1">
    <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"
  comment="Second octal digit of umask from USERUMASKVARIABLE"
  datatype="int" version="1">
    <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"
  comment="Third octal digit of umask from USERUMASKVARIABLE"
  datatype="int" version="1">
    <substring substring_start="3" substring_length="1">
      <variable_component var_ref="USERUMASKVARIABLE" />
    </substring>
  </local_variable>

  <local_variable id="USERUMASKVARIABLE_umask_as_number"
  comment="USERUMASKVARIABLE umask converted from string to a number"
  datatype="int" version="1">
    <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>

  <!-- Dummy test to check existence of 'USERUMASKVARIABLE_as_number' variable.
       This allows us to reference the variable later -->
  <ind:variable_test id="test_existence_of_USERUMASKVARIABLE_as_number_variable"
  comment="Verify the existence of USERUMASKVARIABLE_as_number variable"
  check="all" check_existence="at_least_one_exists" version="1">
    <ind:object object_ref="object_USERUMASKVARIABLE_umask_as_number" />
  </ind:variable_test>

  <ind:variable_object id="object_USERUMASKVARIABLE_umask_as_number" version="1">
    <ind:var_ref>USERUMASKVARIABLE_umask_as_number</ind:var_ref>
  </ind:variable_object>

</def-group>
