Hey guys,
Well, I finally fixed my patch, and it's running well for me. So here
it is again.
New changes:
o Fixed stupid bug with free()'ing the dn rather than the filter
o Added a ton of LDAP structure freeing -- didn't know there were
methods for doing this :) So, now the dn gets freed appropriately, and
the LDAP search result structure gets freed. I also set the individual
entry ("e") to NULL, like ldap_get_next_entry would, just for
completeness.
o Searches are more memory friendly. Only the dn attribute is fetched,
because that's all that is needed. Norbert Klasen pointed this out
before, but I couldn't figure out how to do it. Eventually, Pierangelo
Masarati on the openldap-software list enlightened me as to how to do
this.
o Changed LDAP_DN and LDAP_PASSWD to LDAP_BIND_DN and LDAP_BIND_PW
respectively. These newer names coincide with the ones used in Postfix
and should make their usage a little more clearer.
o Changed LDAP_FILTER from a defuault of "(objectClass=posixAccount)" to
just "". If you want this behaviour, then set the sasl_ldap_filter line in
/etc/imapd.conf like so:
sasl_ldap_filter: (objectClass=posixAccount)
I specified this, so you know that the quotations are already taken care
of (see the source if you want to see why/how). I don't know what
affect double quoting would have, because I just do it this way :)
I'm looking at setting up a permanent home for this soon. Ideally, I'd
like to put it up on my personal site at negativetwenty.org, but I
haven't had time to set that up again yet. I could host it on my WPI
student account, but I don't want to move them later, lest people get
confused. Maybe Simon would be kind enough to host it with his other
patch? Otherwise, I'll wait until I get my web server back up.
As usual, any complaints/questions/whatever, direct them my way.
--
Kevin