<def-group>
  <definition class="compliance" id="dconf_gnome_banner_enabled" version="1">
    <metadata>
      <title>Enable GNOME3 Login Warning Banner</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 7</platform>
        <platform>multi_platform_fedora</platform>
      </affected>
      <description>Enable the GNOME3 Login warning banner.</description>
      <reference source="galford" ref_id="20140823" ref_url="test_attestation" />
    </metadata>
    <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="Enable GUI banner" test_ref="test_banner_gui_enabled" />
        <criterion comment="Prevent user from disabling banner" test_ref="test_prevent_user_banner_gui_enabled_change" />
      </criteria>
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="GUI banner is enabled"
  id="test_banner_gui_enabled" version="1">
    <ind:object object_ref="obj_banner_gui_enabled" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_banner_gui_enabled"
  version="1">
    <ind:path>/etc/dconf/db/gdm.d/</ind:path>
    <ind:filename operation="pattern match">^.*$</ind:filename>
    <ind:pattern operation="pattern match">^\[org/gnome/login-screen]([^\n]*\n+)+?banner-message-enable=true$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="GUI banner cannot be changed by user"
  id="test_prevent_user_banner_gui_enabled_change" version="1">
    <ind:object object_ref="obj_prevent_user_banner_gui_enabled_change" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_prevent_user_banner_gui_enabled_change"
  version="1">
    <ind:path>/etc/dconf/db/gdm.d/locks/</ind:path>
    <ind:filename operation="pattern match">^.*$</ind:filename>
    <ind:pattern operation="pattern match">^/org/gnome/login-screen/banner-message-enable$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
