<def-group>
  <definition class="compliance" id="dconf_gnome_disable_automount" version="2">
    {{{ oval_metadata("The system's default desktop environment, GNOME3, will mount
      devices and removable media (such as DVDs, CDs and USB flash drives)
      whenever they are inserted into the system. Disable automount within GNOME3.", title="Disable GNOME3 automount") }}}
    <criteria operator="OR">
      <extend_definition comment="dconf installed" definition_ref="package_dconf_installed" negate="true" />
      <criteria comment="Disable GNOME3 automount and prevent user from changing it" operator="AND">
        <extend_definition comment="dconf user profile exists" definition_ref="enable_dconf_user_profile" />
        <criterion comment="Disable automount in GNOME3" test_ref="test_dconf_gnome_disable_automount" />
        <criterion comment="Prevent user from changing automount setting" test_ref="test_prevent_user_gnome_automount" />
      </criteria>
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="Disable automount in GNOME3"
  id="test_dconf_gnome_disable_automount" version="1">
    <ind:object object_ref="obj_dconf_gnome_disable_automount" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_dconf_gnome_disable_automount"
  version="1">
    <ind:path>/etc/dconf/db/local.d/</ind:path>
    <ind:filename operation="pattern match">^.*$</ind:filename>
    <ind:pattern operation="pattern match">^\[org/gnome/desktop/media-handling\]([^\n]*\n+)+?automount=false$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="Prevent user from changing automount setting"
  id="test_prevent_user_gnome_automount" version="1">
    <ind:object object_ref="obj_prevent_user_gnome_automount" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_prevent_user_gnome_automount"
  version="1">
    <ind:path>/etc/dconf/db/local.d/locks/</ind:path>
    <ind:filename operation="pattern match">^.*$</ind:filename>
    <ind:pattern operation="pattern match">^/org/gnome/desktop/media-handling/automount$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
