Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing an empty attribute list to LDAP:SEARCH retrieves all attributes #7

Open
luismbo opened this issue Aug 26, 2014 · 2 comments
Open

Comments

@luismbo
Copy link

luismbo commented Aug 26, 2014

I was using `ldap:search' to figure whether some user exists in a given directory using this code:

(ldap:search conn `(and (= :uid ,some-user)) :attributes nil)

Somewhat unexpectedly, this seems to retrieve all attributes, because I'm getting this error:

Probably a binary field: jpegPhoto
   [Condition of type TRIVIAL-LDAP:PROBABLY-BINARY-FIELD-ERROR]

My workaround is to pass some dummy attribute name to the attributes argument, but it seems like nil should work there. Am I doing something wrong?

@rwiker
Copy link
Owner

rwiker commented Aug 26, 2014

nil means "everything", and is the same as not passing the :attributes argument. If you want to indicate no attributes, you could/should specify '("1.1"), which is reserved for this use (I think).

It might be a good idea to change this in trivial-ldap; for example, by making 't mean all attributes, and 'nil mean none, or possibly let 'nil mean everything (as it does now) and map :none to the list '("1.1").

@luismbo
Copy link
Author

luismbo commented Aug 26, 2014

FWIW, coming from someone that knows very little about LDAP, t for all and nil for none/'("1.1") makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants