<def-group oval_version="5.11"> 
  <definition class="compliance" id="dconf_gnome_login_banner_text" version="1">
    {{{ oval_metadata("Enable the GUI warning banner.") }}}
    <criteria operator="OR">
      <extend_definition comment="dconf installed" definition_ref="package_dconf_installed" negate="true" />
      <criteria comment="Enable GUI banner and prevent user from changing it" operator="AND">
        <extend_definition comment="dconf user profile exists" definition_ref="enable_dconf_user_profile" />
        <criterion comment="Prevent user from changing banner" test_ref="test_prevent_user_banner_change" />
        <criterion comment="Login banner is correctly set" test_ref="test_gdm_login_banner_text_setting" />
      </criteria>
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="GUI banner cannot be changed by user"
  id="test_prevent_user_banner_change" version="1">
    <ind:object object_ref="obj_prevent_user_banner_change" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_prevent_user_banner_change"
  version="1">
    <ind:path>/etc/dconf/db/{{{ dconf_gdm_dir }}}/locks/</ind:path>
    <ind:filename operation="pattern match">^.*$</ind:filename>
    <ind:pattern operation="pattern match">^/org/gnome/login-screen/banner-message-text$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="login banner text is correctly set"
  id="test_gdm_login_banner_text_setting" version="1">
    <ind:object object_ref="obj_gdm_login_banner_text_setting" />
    <ind:state state_ref="state_gdm_login_banner_text_setting" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_gdm_login_banner_text_setting"
  version="1">
    <ind:path>/etc/dconf/db/{{{ dconf_gdm_dir }}}/</ind:path>
    <ind:filename operation="pattern match">^.*$</ind:filename>
    <ind:pattern operation="pattern match">^banner-message-text=[\s]*'*(.*?)'$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_gdm_login_banner_text_setting" version="1">
    <ind:subexpression datatype="string" operation="pattern match" var_ref="login_banner_text" />
  </ind:textfilecontent54_state>

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

</def-group>
