117-300 · Question #235
Which of the following are common Net::LDAP methods? (Choose THREE correct answers.)
The correct answer is A. bind D. search E. unbind. See the full explanation below for the reasoning.
Question
Options
- Abind
- Bquery
- Cerror
- Dsearch
- Eunbind
How the community answered
(45 responses)- A84% (38)
- B11% (5)
- C4% (2)
Community Discussion
5The correct answers are A (bind), D (search), and E (unbind). These three map directly to core LDAP operations that the Net::LDAP Perl module wraps: bind authenticates your connection to the directory server, search queries the directory for matching entries, and unbind cleanly closes the session. Option B (query) is the trap here, because people assume it exists since "querying" is what you do with LDAP, but the actual method is search, not query. Option C (error) is also not a Net::LDAP method in the standard sense, so if you see it on the exam, eliminate it fast and move on.
Solid breakdown, though I would add that spinning up a quick OpenLDAP container and actually calling those methods in a test script cements the names far better than memorizing them, because you see the return objects and any connection errors firsthand.
bind, search, and unbind are the three Net::LDAP workhorses, but what happens if you skip the unbind step?
I locked in A, C, and D because error is absolutely a method you call on the Net::LDAP object to check what went wrong after an operation, and if you have ever traced through real LDAP code you will see it used right alongside bind and search to handle failure responses gracefully.
Grace, error is actually a method on the Net::LDAP::Message object returned by operations like search and add, not called directly on the Net::LDAP connection object itself, so C is out and E (add) belongs in the answer because add is a core Net::LDAP instance method just like bind and search.