From 3fdbd2a5ac8162e1c137b0a0cd004bd161e8d291 Mon Sep 17 00:00:00 2001 From: Bob Gendler Date: Wed, 2 Nov 2022 09:25:11 -0400 Subject: [PATCH] refactor[rules]: Fixed xpath Updated xpath to output all keys equaling DisabledPreferencePanes. This fixes if there are multiple profiles setting the same key. Issue #193 --- rules/icloud/icloud_appleid_system_settings_disable.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/icloud/icloud_appleid_system_settings_disable.yaml b/rules/icloud/icloud_appleid_system_settings_disable.yaml index 7d04ab90..79e2eebe 100644 --- a/rules/icloud/icloud_appleid_system_settings_disable.yaml +++ b/rules/icloud/icloud_appleid_system_settings_disable.yaml @@ -5,7 +5,7 @@ discussion: | Disabling the system setting prevents login to Apple ID and iCloud. check: | - /usr/bin/profiles show -output stdout-xml | /usr/bin/xmllint --xpath 'string(//*[contains(text(), "DisabledSystemSettings")]/following-sibling::*[1])' - | /usr/bin/grep -c com.apple.systempreferences.AppleIDSettings + /usr/bin/profiles show -output stdout-xml | /usr/bin/xmllint --xpath '//key[text()="DisabledSystemSettings"]/following-sibling::*[1]' - | /usr/bin/grep -c com.apple.systempreferences.AppleIDSettings result: integer: 1 fix: |