Directory services integration test returns multiple values #269

Closed
opened 2026-01-19 18:29:53 +00:00 by michael · 0 comments
Owner

Originally created by @grismemj on GitHub.

Summary

The test for integrate system into a directory services infrastructure returns multiple items

Steps to reproduce

Run the current test on a system joined to OpenDirectory

Operating System version

macOS 11.6.2

What is the current bug behavior?

The test returns multiple items, which causes the integer check for 0 to fail
Here is the output on my system of the check code:

% /usr/bin/dscl localhost -list . | /usr/bin/grep -vE '(Contact|Search|Local|^)'; /bin/echo ?
LDAPv3
0

What is the expected correct behavior?

The check should only return 0

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)

Output of checks

% /usr/bin/dscl localhost -list . | /usr/bin/grep -vE '(Contact|Search|Local|^)'; /bin/echo ?
LDAPv3
0

Possible fixes

Make the grep quiet by adding -q
% /usr/bin/dscl localhost -list . | /usr/bin/grep -vqE '(Contact|Search|Local|^)'|echo ?
0

Originally created by @grismemj on GitHub. <!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label and verify the issue you're about to submit isn't a duplicate. ---> ### Summary The test for integrate system into a directory services infrastructure returns multiple items ### Steps to reproduce Run the current test on a system joined to OpenDirectory ### Operating System version macOS 11.6.2 ### What is the current *bug* behavior? The test returns multiple items, which causes the integer check for 0 to fail Here is the output on my system of the check code: % /usr/bin/dscl localhost -list . | /usr/bin/grep -vE '(Contact|Search|Local|^$)'; /bin/echo $? LDAPv3 0 ### What is the expected *correct* behavior? The check should only return 0 ### Relevant logs and/or screenshots (Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.) ### Output of checks % /usr/bin/dscl localhost -list . | /usr/bin/grep -vE '(Contact|Search|Local|^$)'; /bin/echo $? LDAPv3 0 ### Possible fixes Make the grep quiet by adding -q % /usr/bin/dscl localhost -list . | /usr/bin/grep -vqE '(Contact|Search|Local|^$)'|echo $? 0
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: usnistgov/macos_security#269