LFCS · Question #169
Which command will perform a one-level search from the DN c=INC, for all entries whose organization's name begins with RioDeJaneiro?
The correct answer is C. ldapsearch -LLL -s one -b "c=INC" "(o=RioDeJaneiro*)". The correct ldapsearch command performs a one-level search from the specified base DN, filtering for entries where the organizational name begins with 'RioDeJaneiro'.
Question
Options
- Aldapsearch -LLL -b "c=INC" "(o=description)" RioDeJaneiro*
- Bldapsearch -b "c=INC" -f "(o=description,cn=RioDeJaneiro%)"
- Cldapsearch -LLL -s one -b "c=INC" "(o=RioDeJaneiro*)"
- Dldapsearch -s sub -b "c=INC" -f "(o=RioDeJaneiro)(description)"
How the community answered
(50 responses)- A2% (1)
- B10% (5)
- C82% (41)
- D6% (3)
Why each option
The correct `ldapsearch` command performs a one-level search from the specified base DN, filtering for entries where the organizational name begins with 'RioDeJaneiro'.
The filter `"(o=description)" RioDeJaneiro*` is syntactically incorrect; the search string 'RioDeJaneiro*' is outside the filter parentheses and 'o=description' is not the intended filter.
The `-f` option is used to specify a file containing the filter, not the filter itself directly on the command line, and the filter syntax `"(o=description,cn=RioDeJaneiro%)"` uses an incorrect wildcard `%` and an invalid comma within an attribute value assertion.
The `-LLL` option outputs search results in a clean LDIF format without extraneous comments. `-s one` correctly sets the search scope to one level below the base DN, as requested. `-b "c=INC"` specifies the base distinguished name for the search, and `"(o=RioDeJaneiro*)"` is the accurate filter to match entries where the 'o' (organization name) attribute starts with 'RioDeJaneiro', using the standard LDAP wildcard character `*`.
The `-s sub` option specifies a subtree search, which is deeper than the requested one-level search, and the filter `"(o=RioDeJaneiro)(description)"` implies an `AND` operation between two separate attributes, not a pattern match on a single attribute.
Concept tested: LDAP search command syntax
Topics
Community Discussion
No community discussion yet for this question.