Reputation: 13
I can't find the meaning, the difference between these two examples for search filter
(&(objectClass=user)(sn=*)(bysUserName=*)(|(bysUserName={0})(cn={0})))
(&(|(bysUserName={0})(cn={0}))(objectClass=User))
Can anyone help me figure out these two filters? Thanks
Upvotes: 1
Views: 115
Reputation: 755471
If you reorder them a bit, I guess you'll see the difference:
(&(objectClass=user)(sn=*)(bysUserName=*)(|(bysUserName={0})(cn={0})))
(&(objectClass=User) (|(bysUserName={0})(cn={0})))
The first one has additional restrictions on sn
(must contain some value) and bysUserName
(same thing - must contain some value) that aren't present in the second filter.
Basically, the &
defines an AND condition, while the |
is an OR operator - so the first filter requires your LDAP objects to satisfy:
objectClass
must be user
sn
must contain something (cannot be empty)bysUserName
must contain something bysUserName
or cn
must match the value that replaces the {0}
placeholderThe second filter just requires points (1) and (4)
Upvotes: 1