From aae370aa6aa20db440919b8044716911869ea0dc Mon Sep 17 00:00:00 2001
From: Gabe <redhatrises@gmail.com>
Date: Sun, 29 Jun 2014 19:26:37 -0600
Subject: [PATCH] Add support for gconf-tree.xml

- Adds support for %gconf-tree.xml in the existing gconf oval checks as %gconf-tree.xml is the top of the gconf configuration order of precedance.
---
 RHEL/6/input/checks/banner_gui_enabled.xml         | 22 +++++++++++++-
 .../input/checks/gconf_gnome_disable_automount.xml | 35 ++++++++++++++++++----
 .../checks/gconf_gnome_disable_thumbnailers.xml    | 19 ++++++++++--
 ...f_gnome_screensaver_idle_activation_enabled.xml | 19 ++++++++++--
 .../checks/gconf_gnome_screensaver_idle_delay.xml  | 13 ++++++++
 .../gconf_gnome_screensaver_lock_enabled.xml       | 12 ++++++++
 .../checks/gconf_gnome_screensaver_mode_blank.xml  | 19 ++++++++++--
 7 files changed, 123 insertions(+), 16 deletions(-)

diff --git a/RHEL/6/input/checks/banner_gui_enabled.xml b/RHEL/6/input/checks/banner_gui_enabled.xml
index 4be3183ab33553fc159b63e09d2906f60ce43cfe..953cc298cc7771ef709a31b02eb452243b85acaa 100644
--- a/RHEL/6/input/checks/banner_gui_enabled.xml
+++ b/RHEL/6/input/checks/banner_gui_enabled.xml
@@ -10,7 +10,9 @@
     </metadata>
     <criteria operator="OR">
       <extend_definition comment="gdm installed" definition_ref="package_gdm_installed" negate="true" />
-      <criterion comment="check settings" test_ref="test_banner_gui_enabled" />
+      <criterion comment="check var settings" test_ref="test_banner_gui_enabled" />
+      <criterion comment="check etc settings tree" test_ref="test_tree_banner_gui_enabled" />
+      <criterion comment="check etc settings without tree" test_ref="test_no_tree_banner_gui_enabled" />
     </criteria>
   </definition>
   <ind:xmlfilecontent_test check="all" comment="stuff" id="test_banner_gui_enabled" version="1">
@@ -22,6 +24,24 @@
     <ind:xpath>/gconf/entry[@name='banner_message_enable']/@value</ind:xpath>
   </ind:xmlfilecontent_object>
 
+<ind:xmlfilecontent_test check="all" comment="checks for gconf-tree file" id="test_tree_banner_gui_enabled" version="1">
+    <ind:object object_ref="object_banner_message_enable_tree" />
+    <ind:state state_ref="state_banner_message_enable" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="object_banner_message_enable_tree" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/%gconf-tree.xml</ind:filepath>
+    <ind:xpath>/gconf/dir/dir/dir/entry[@name='banner_message_enable']/@value</ind:xpath>
+  </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_test check="all" comment="checks for absent gconf-tree file" id="test_no_tree_banner_gui_enabled" version="1">
+    <ind:object object_ref="object_banner_message_enable_no_tree" />
+    <ind:state state_ref="state_banner_message_enable" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="object_banner_message_enable_no_tree" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/apps/gdm/simple-greeter/%gconf.xml</ind:filepath>
+    <ind:xpath>/gconf/entry[@name='banner_message_enable']/@value</ind:xpath>
+  </ind:xmlfilecontent_object>
+
   <ind:xmlfilecontent_state id="state_banner_message_enable" version="1">
     <ind:value_of datatype="string">true</ind:value_of>
   </ind:xmlfilecontent_state>
diff --git a/RHEL/6/input/checks/gconf_gnome_disable_automount.xml b/RHEL/6/input/checks/gconf_gnome_disable_automount.xml
index f78fc898a67e460cb31579dd82592ea37f78200f..5d788d13faaf02b3180d58ff91cdfb9c17f2d29b 100644
--- a/RHEL/6/input/checks/gconf_gnome_disable_automount.xml
+++ b/RHEL/6/input/checks/gconf_gnome_disable_automount.xml
@@ -14,7 +14,9 @@
     <criteria operator="OR">
       <extend_definition comment="GConf2 installed" definition_ref="package_GConf2_installed" negate="true" />
       <criterion comment="Disable automount in GNOME" test_ref="test_gconf_gnome_disable_automount" />
+      <criterion comment="Disable automount in GNOME" test_ref="test_gconf_tree_gnome_disable_automount" />
       <criterion comment="Disable autorun in GNOME" test_ref="test_gconf_gnome_disable_automount_autorun" />
+      <criterion comment="Disable autorun in GNOME" test_ref="test_gconf_tree_gnome_disable_automount_autorun" />
     </criteria>
   </definition>
   <ind:xmlfilecontent_test check="all" check_existence="all_exist"
@@ -23,24 +25,45 @@
     <ind:object object_ref="obj_gconf_gnome_disable_automount" />
     <ind:state state_ref="state_gconf_gnome_disable_automount" />
   </ind:xmlfilecontent_test>
-  <ind:xmlfilecontent_state id="state_gconf_gnome_disable_automount" version="1">
-    <ind:value_of datatype="string">false</ind:value_of>
-  </ind:xmlfilecontent_state>
   <ind:xmlfilecontent_object id="obj_gconf_gnome_disable_automount" version="1">
     <ind:filepath>/etc/gconf/gconf.xml.mandatory/apps/nautilus/preferences/%gconf.xml</ind:filepath>
     <ind:xpath>/gconf/entry[@name='media_automount']/@value</ind:xpath>
   </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_test check="all" check_existence="all_exist" comment="Disable automount in GNOME" id="test_gconf_tree_gnome_disable_automount" version="1">
+    <ind:object object_ref="obj_gconf_tree_gnome_disable_automount" />
+    <ind:state state_ref="state_gconf_gnome_disable_automount" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="obj_gconf_tree_gnome_disable_automount" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/%gconf-tree.xml</ind:filepath>
+    <ind:xpath>/gconf/dir/dir/dir/entry[@name='media_automount']/@value</ind:xpath>
+  </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_state id="state_gconf_gnome_disable_automount" version="1">
+    <ind:value_of datatype="string">false</ind:value_of>
+  </ind:xmlfilecontent_state>
+
   <ind:xmlfilecontent_test check="all" check_existence="all_exist"
   comment="Disable autorun in GNOME"
   id="test_gconf_gnome_disable_automount_autorun" version="1">
     <ind:object object_ref="obj_gconf_gnome_disable_automount_autorun" />
     <ind:state state_ref="state_gconf_gnome_disable_automount_autorun" />
   </ind:xmlfilecontent_test>
-  <ind:xmlfilecontent_state id="state_gconf_gnome_disable_automount_autorun" version="1">
-    <ind:value_of datatype="string">true</ind:value_of>
-  </ind:xmlfilecontent_state>
   <ind:xmlfilecontent_object id="obj_gconf_gnome_disable_automount_autorun" version="1">
     <ind:filepath>/etc/gconf/gconf.xml.mandatory/apps/nautilus/preferences/%gconf.xml</ind:filepath>
     <ind:xpath>/gconf/entry[@name='media_autorun_never']/@value</ind:xpath>
   </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_test check="all" check_existence="all_exist" comment="Disable autorun in GNOME" id="test_gconf_tree_gnome_disable_automount_autorun" version="1">
+    <ind:object object_ref="obj_gconf_tree_gnome_disable_automount_autorun" />
+    <ind:state state_ref="state_gconf_gnome_disable_automount_autorun" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="obj_gconf_tree_gnome_disable_automount_autorun" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/%gconf-tree.xml</ind:filepath>
+    <ind:xpath>/gconf/dir/dir/dir/entry[@name='media_autorun_never']/@value</ind:xpath>
+  </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_state id="state_gconf_gnome_disable_automount_autorun" version="1">
+    <ind:value_of datatype="string">true</ind:value_of>
+  </ind:xmlfilecontent_state>
 </def-group>
diff --git a/RHEL/6/input/checks/gconf_gnome_disable_thumbnailers.xml b/RHEL/6/input/checks/gconf_gnome_disable_thumbnailers.xml
index 80045a3772ddf9ba5b96527f8ab059c555c5b1aa..cca38f55bba54998c716652c7b1c54ec89f6b43e 100644
--- a/RHEL/6/input/checks/gconf_gnome_disable_thumbnailers.xml
+++ b/RHEL/6/input/checks/gconf_gnome_disable_thumbnailers.xml
@@ -14,6 +14,7 @@
     <criteria operator="OR">
       <extend_definition comment="GConf2 installed" definition_ref="package_GConf2_installed" negate="true" />
       <criterion comment="Disable thumbnailers in GNOME" test_ref="test_gconf_gnome_disable_thumbnailers" />
+      <criterion comment="Disable thumbnailers in GNOME" test_ref="test_gconf_tree_gnome_disable_thumbnailers" />
     </criteria>
   </definition>
   <ind:xmlfilecontent_test check="all" check_existence="all_exist"
@@ -22,11 +23,23 @@
     <ind:object object_ref="obj_gconf_gnome_disable_thumbnailers" />
     <ind:state state_ref="state_gconf_gnome_disable_thumbnailers" />
   </ind:xmlfilecontent_test>
-  <ind:xmlfilecontent_state id="state_gconf_gnome_disable_thumbnailers" version="1">
-    <ind:value_of datatype="string">true</ind:value_of>
-  </ind:xmlfilecontent_state>
   <ind:xmlfilecontent_object id="obj_gconf_gnome_disable_thumbnailers" version="1">
     <ind:filepath>/etc/gconf/gconf.xml.mandatory/desktop/gnome/thumbnailers/%gconf.xml</ind:filepath>
     <ind:xpath>/gconf/entry[@name='disable_all']/@value</ind:xpath>
   </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_test check="all" check_existence="all_exist"
+  comment="Disable thumbnailers in GNOME"
+  id="test_gconf_tree_gnome_disable_thumbnailers" version="1">
+    <ind:object object_ref="obj_gconf_tree_gnome_disable_thumbnailers" />
+    <ind:state state_ref="state_gconf_gnome_disable_thumbnailers" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="obj_gconf_tree_gnome_disable_thumbnailers" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/%gconf-tree.xml</ind:filepath>
+    <ind:xpath>/gconf/dir/dir/dir/entry[@name='disable_all']/@value</ind:xpath>
+  </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_state id="state_gconf_gnome_disable_thumbnailers" version="1">
+    <ind:value_of datatype="string">true</ind:value_of>
+  </ind:xmlfilecontent_state>
 </def-group>
diff --git a/RHEL/6/input/checks/gconf_gnome_screensaver_idle_activation_enabled.xml b/RHEL/6/input/checks/gconf_gnome_screensaver_idle_activation_enabled.xml
index 0d012a72c54b085e5eff4b8796dcfb1b6f6a306d..409806d48f18d171eaa0c9840e7ce61659234d44 100644
--- a/RHEL/6/input/checks/gconf_gnome_screensaver_idle_activation_enabled.xml
+++ b/RHEL/6/input/checks/gconf_gnome_screensaver_idle_activation_enabled.xml
@@ -12,6 +12,7 @@
     <criteria operator="OR">
       <extend_definition comment="GConf2 installed" definition_ref="package_GConf2_installed" negate="true" />
       <criterion comment="gnome screensaver is activated on idle" test_ref="test_gnome_screensaver_idle_activated" />
+      <criterion comment="gnome screensaver is activated on idle" test_ref="test_gconf_tree_gnome_screensaver_idle_activated" />
     </criteria>
   </definition>
   <ind:xmlfilecontent_test check="all"
@@ -20,11 +21,23 @@
     <ind:object object_ref="object_gnome_screensaver_idle_activated" />
     <ind:state state_ref="state_gnome_screensaver_idle_activated" />
   </ind:xmlfilecontent_test>
-  <ind:xmlfilecontent_state id="state_gnome_screensaver_idle_activated" version="1">
-    <ind:value_of datatype="string">true</ind:value_of>
-  </ind:xmlfilecontent_state>
   <ind:xmlfilecontent_object id="object_gnome_screensaver_idle_activated" version="1">
     <ind:filepath>/etc/gconf/gconf.xml.mandatory/apps/gnome-screensaver/%gconf.xml</ind:filepath>
     <ind:xpath>/gconf/entry[@name='idle_activation_enabled']/@value</ind:xpath>
   </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_test check="all"
+  comment="gnome screensaver is activated on idle"
+  id="test_gconf_tree_gnome_screensaver_idle_activated" version="1">
+    <ind:object object_ref="object_gconf_tree_gnome_screensaver_idle_activated" />
+    <ind:state state_ref="state_gnome_screensaver_idle_activated" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="object_gconf_tree_gnome_screensaver_idle_activated" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/%gconf-tree.xml</ind:filepath>
+    <ind:xpath>/gconf/dir/dir/entry[@name='idle_activation_enabled']/@value</ind:xpath>
+  </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_state id="state_gnome_screensaver_idle_activated" version="1">
+    <ind:value_of datatype="string">true</ind:value_of>
+  </ind:xmlfilecontent_state>
 </def-group>
diff --git a/RHEL/6/input/checks/gconf_gnome_screensaver_idle_delay.xml b/RHEL/6/input/checks/gconf_gnome_screensaver_idle_delay.xml
index 00f11df4095d35302e1a1ecf6f03e6ab399c8a56..619f77f841467bedbb64c140da23cb40f2d27015 100644
--- a/RHEL/6/input/checks/gconf_gnome_screensaver_idle_delay.xml
+++ b/RHEL/6/input/checks/gconf_gnome_screensaver_idle_delay.xml
@@ -12,6 +12,7 @@
     <criteria operator="OR">
       <extend_definition comment="GConf2 installed" definition_ref="package_GConf2_installed" negate="true" />
       <criterion comment="check value of idle_delay in GCONF" test_ref="test_gnome_screensaver_idle_delay" />
+      <criterion comment="check value of idle_delay in GCONF" test_ref="test_gconf_tree_gnome_screensaver_idle_delay" />
     </criteria>
   </definition>
   <ind:xmlfilecontent_test check="all"
@@ -24,6 +25,18 @@
     <ind:filepath>/etc/gconf/gconf.xml.mandatory/desktop/gnome/session/%gconf.xml</ind:filepath>
     <ind:xpath>/gconf/entry[@name='idle_delay']/@value</ind:xpath>
   </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_test check="all"
+  comment="test screensaver timeout period"
+  id="test_gconf_tree_gnome_screensaver_idle_delay" version="1">
+    <ind:object object_ref="object_gconf_tree_gnome_screensaver_idle_delay" />
+    <ind:state state_ref="state_gnome_screensaver_idle_delay" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="object_gconf_tree_gnome_screensaver_idle_delay" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/%gconf-tree.xml</ind:filepath>
+    <ind:xpath>/gconf/dir/dir/dir/entry[@name='idle_delay']/@value</ind:xpath>
+  </ind:xmlfilecontent_object>
+
   <ind:xmlfilecontent_state comment="idle timeout"
   id="state_gnome_screensaver_idle_delay" version="1">
     <ind:value_of datatype="int" operation="less than or equal" var_check="all"
diff --git a/RHEL/6/input/checks/gconf_gnome_screensaver_lock_enabled.xml b/RHEL/6/input/checks/gconf_gnome_screensaver_lock_enabled.xml
index cc031fcf000167afc70ec1891171f048f2a5ec60..5ec09b4ef7187779823ff9353498678e4e9a9080 100644
--- a/RHEL/6/input/checks/gconf_gnome_screensaver_lock_enabled.xml
+++ b/RHEL/6/input/checks/gconf_gnome_screensaver_lock_enabled.xml
@@ -12,6 +12,7 @@
     <criteria operator="OR">
       <extend_definition comment="GConf2 installed" definition_ref="package_GConf2_installed" negate="true" />
       <criterion comment="screensaver lock is enabled" test_ref="test_screensaver_lock_enabled" />
+      <criterion comment="screensaver lock is enabled" test_ref="test_gconf_tree_screensaver_lock_enabled" />
     </criteria>
   </definition>
   <ind:xmlfilecontent_test check="all" comment="screensaver lock is enabled"
@@ -23,6 +24,17 @@
     <ind:filepath>/etc/gconf/gconf.xml.mandatory/apps/gnome-screensaver/%gconf.xml</ind:filepath>
     <ind:xpath>/gconf/entry[@name='lock_enabled']/@value</ind:xpath>
   </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_test check="all" comment="screensaver lock is enabled"
+  id="test_gconf_tree_screensaver_lock_enabled" version="1">
+    <ind:object object_ref="object_gconf_tree_screensaver_lock_enabled" />
+    <ind:state state_ref="state_screensaver_lock_enabled" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="object_gconf_tree_screensaver_lock_enabled" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/%gconf-tree.xml</ind:filepath>
+    <ind:xpath>/gconf/dir/dir/entry[@name='lock_enabled']/@value</ind:xpath>
+  </ind:xmlfilecontent_object>
+
   <ind:xmlfilecontent_state id="state_screensaver_lock_enabled" version="1">
     <ind:value_of datatype="string">true</ind:value_of>
   </ind:xmlfilecontent_state>
diff --git a/RHEL/6/input/checks/gconf_gnome_screensaver_mode_blank.xml b/RHEL/6/input/checks/gconf_gnome_screensaver_mode_blank.xml
index 8229d71140cfa8fb3027ebe1d380f93e722a0767..d6bec8ecc15d08839a9d9e2f081417dc2ef71f30 100644
--- a/RHEL/6/input/checks/gconf_gnome_screensaver_mode_blank.xml
+++ b/RHEL/6/input/checks/gconf_gnome_screensaver_mode_blank.xml
@@ -11,6 +11,7 @@
     <criteria operator="OR">
       <extend_definition comment="GConf2 installed" definition_ref="package_GConf2_installed" negate="true" />
       <criterion comment="gnome screensaver set to blank screen" test_ref="test_gnome_screensaver_mode" />
+      <criterion comment="gnome screensaver set to blank screen" test_ref="test_gconf_tree_gnome_screensaver_mode" />
     </criteria>
   </definition>
   <ind:xmlfilecontent_test check="all"
@@ -19,11 +20,23 @@
     <ind:object object_ref="object_gnome_screensaver_mode" />
     <ind:state state_ref="state_gnome_screensaver_mode" />
   </ind:xmlfilecontent_test>
-  <ind:xmlfilecontent_state id="state_gnome_screensaver_mode" version="1">
-    <ind:value_of datatype="string">blank-only</ind:value_of>
-  </ind:xmlfilecontent_state>
   <ind:xmlfilecontent_object id="object_gnome_screensaver_mode" version="1">
     <ind:filepath>/etc/gconf/gconf.xml.mandatory/apps/gnome-screensaver/%gconf.xml</ind:filepath>
     <ind:xpath>/gconf/entry[@name='mode']/stringvalue[1]/text()</ind:xpath>
   </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_test check="all"
+  comment="gnome screensaver set to blank screen"
+  id="test_gconf_tree_gnome_screensaver_mode" version="1">
+    <ind:object object_ref="object_gconf_tree_gnome_screensaver_mode" />
+    <ind:state state_ref="state_gnome_screensaver_mode" />
+  </ind:xmlfilecontent_test>
+  <ind:xmlfilecontent_object id="object_gconf_tree_gnome_screensaver_mode" version="1">
+    <ind:filepath>/etc/gconf/gconf.xml.mandatory/%gconf-tree.xml</ind:filepath>
+    <ind:xpath>/gconf/dir/dir/entry[@name='mode']/stringvalue[1]/text()</ind:xpath>
+  </ind:xmlfilecontent_object>
+
+  <ind:xmlfilecontent_state id="state_gnome_screensaver_mode" version="1">
+    <ind:value_of datatype="string">blank-only</ind:value_of>
+  </ind:xmlfilecontent_state>
 </def-group>
-- 
1.9.3

