title: Generic LDAP base for search?
body: <p>I'm writing some C++/Win32 code to search for a user in an LDAP directory (really I need to validate a username/password is correct, and then verify group membership).  I have the username, so I'm hoping something like the following will work:</p>
  
  <pre><code>(&amp;(objectCategory=person)(objectClass=user)(uid={username}))
  </code></pre>
  
  <p>When I call <code>ldap_search</code> with this search/filter, I have to provide a starting base (node/OU/whatever) to search.  But I don't know where to start the search -- all I have is the username.  Is there anyway to specify the root of the tree that will work with OpenLDAP, Active Directory, Netscape LDAP, etc, etc?</p>
  
  <p>Also, anyone that can answer that could probably help with this: Is the uid attribute universally supported, or do I need to search on a different attribute depending on what brand of LDAP server I'm talking to?  (I've seen references to people needing to search on <code>uid</code>, <code>CN</code> and even <code>SAMAccountName</code>).</p>