<def-group>
  <definition class="compliance" id="dconf_gnome_disable_restart_shutdown" version="1">
    {{{ oval_metadata("Disable the GNOME3 Login GUI Restart and Shutdown buttons to all users on the login screen.") }}}
    <criteria operator="OR">
      <extend_definition comment="dconf installed" definition_ref="package_dconf_installed" negate="true" />
      <criteria comment="Disable GUI shutdown and restart buttons and prevent user from changing it" operator="AND">
        <extend_definition comment="dconf user profile exists" definition_ref="enable_dconf_user_profile" />
        <criterion comment="Disable restart and shutdown buttons" test_ref="test_disable_restart_buttons" />
        <criterion comment="Prevent user from changing" test_ref="test_prevent_user_enable_restart_buttons" />
      </criteria>
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="GUI restart and shutdown buttons are disabled"
  id="test_disable_restart_buttons" version="1">
    <ind:object object_ref="obj_disable_restart_buttons" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_disable_restart_buttons"
  version="1">
    <ind:path>/etc/dconf/db/{{{ dconf_gdm_dir }}}/</ind:path>
    <ind:filename operation="pattern match">^.*$</ind:filename>
    <ind:pattern operation="pattern match">^\[org/gnome/login-screen\]([^\n]*\n+)+?disable-restart-buttons=true$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="GUI restart and shutdown buttons cannot be enabled"
  id="test_prevent_user_enable_restart_buttons" version="1">
    <ind:object object_ref="obj_prevent_user_enable_restart_buttons" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_prevent_user_enable_restart_buttons"
  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/disable-restart-buttons$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
