Replies: 4 comments
-
Or the expected result could be "not 0" |
Beta Was this translation helpful? Give feedback.
-
Just brainstormed with @golbiga. Add this to rules that are using For instance: If the result is 0 you fail. If the result is 1 or more you pass. So if you are enforcing a rule more than once you still pass, as you should. |
Beta Was this translation helpful? Give feedback.
-
As far as I can tell... By my count there are about 67 rules for config profiles that use grep -c and are expecting integer: 1 |
Beta Was this translation helpful? Give feedback.
-
It's not a bad idea. We'll have to discuss and see. I worry if there may be a reason not to, that we're not thinking of. So I'm hesitant to go forth and update all of the rules. |
Beta Was this translation helpful? Give feedback.
-
Rules that use grep -c with the expected result of “1” should actually have the expected of “greater than 0”
There are instances where two rules test for the same key, just in different configuration profile domains.
For instance:
sysprefs_siri_prefpane_disable
/usr/bin/profiles -P -o stdout | /usr/bin/grep -c 'com.apple.preferences.speech'
mobileconfig_info:
com.apple.systempreferences:
DisabledPreferencePanes:
- com.apple.preferences.speech
sysprefs_siri_prefpane_hide
/usr/bin/profiles -P -o stdout | /usr/bin/grep -c 'com.apple.preferences.speech'
mobileconfig_info:
com.apple.systempreferences:
HiddenPreferencePanes:
- com.apple.preferences.speech
The above results with an integer of “2” and fails the test even though the configuration profile is correctly implemented.
Beta Was this translation helpful? Give feedback.
All reactions