<def-group>
  <definition class="compliance" id="banner_etc_gdm_banner" version="2">
    {{{ oval_metadata("The system login banner text should be set correctly.") }}}
    <criteria operator="OR">
      <extend_definition comment="gdm installed" definition_ref="package_gdm_installed" negate="true" />
      <criteria operator="AND">
        <criterion comment="/etc/gdm/banner is set appropriately" test_ref="test_banner_etc_gdm_banner" />
        <criterion comment="/etc/gdm/banner is world-readable" test_ref="test_banner_etc_gdm_banner_readable" />
      </criteria>
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="correct banner in /etc/gdm/banner" id="test_banner_etc_gdm_banner" version="1">
    <ind:object object_ref="object_banner_etc_gdm_banner" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_banner_etc_gdm_banner" version="1">
    <ind:filepath>/etc/gdm/banner</ind:filepath>
    <ind:pattern var_ref="login_banner_text" operation="pattern match" />
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <external_variable comment="warning banner text variable" datatype="string" id="login_banner_text" version="1" />

  <unix:file_test check="all" check_existence="all_exist" comment="/etc/gdm/banner read permissions" id="test_banner_etc_gdm_banner_readable" version="1">
    <unix:object object_ref="object_banner_etc_gdm_banner_readable" />
    <unix:state state_ref="state_banner_etc_gdm_banner_readable" />
  </unix:file_test>
  <unix:file_object comment="/etc/gdm/banner" id="object_banner_etc_gdm_banner_readable" version="1">
    <unix:filepath>/etc/gdm/banner</unix:filepath>
  </unix:file_object>
  <unix:file_state id="state_banner_etc_gdm_banner_readable" version="1">
      <unix:uread datatype="boolean">true</unix:uread>
      <unix:gread datatype="boolean">true</unix:gread>
      <unix:oread datatype="boolean">true</unix:oread>
  </unix:file_state>
</def-group>
