Updated the copyright declaration in several modules, removing any language which...
[citadel.git] / citadel / ldap.c
index 8efc6e59075bc7d6f8ab9b7e167e11c05b4ad434..385498443839cc8c4d3754652da535bbdad03f59 100644 (file)
@@ -2,21 +2,15 @@
  * These functions implement the portions of AUTHMODE_LDAP and AUTHMODE_LDAP_AD which
  * actually speak to the LDAP server.
  *
- * Copyright (c) 2010 by Art Cancro and the citadel.org development team.
+ * Copyright (c) 2011 by Art Cancro and the citadel.org development team.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 3.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 int ctdl_require_ldap_version = 3;
@@ -99,6 +93,7 @@ int CtdlTryUserLDAP(char *username,
        }
 
        ldap_set_option(ldserver, LDAP_OPT_PROTOCOL_VERSION, &ctdl_require_ldap_version);
+       ldap_set_option(ldserver, LDAP_OPT_REFERRALS, (void *)LDAP_OPT_OFF);
 
        striplt(config.c_ldap_bind_dn);
        striplt(config.c_ldap_bind_pw);
@@ -123,7 +118,8 @@ int CtdlTryUserLDAP(char *username,
        }
 
        syslog(LOG_DEBUG, "LDAP search: %s\n", searchstring);
-       i = ldap_search_ext_s(ldserver,                         /* ld                           */
+       (void) ldap_search_ext_s(
+               ldserver,                                       /* ld                           */
                config.c_ldap_base_dn,                          /* base                         */
                LDAP_SCOPE_SUBTREE,                             /* scope                        */
                searchstring,                                   /* filter                       */
@@ -242,6 +238,7 @@ int CtdlTryPasswordLDAP(char *user_dn, const char *password)
                else {
                        syslog(LOG_DEBUG, "LDAP: Cannot bind: %s (%d)\n", ldap_err2string(i), i);
                }
+               ldap_set_option(ldserver, LDAP_OPT_REFERRALS, (void *)LDAP_OPT_OFF);
                ldap_unbind(ldserver);
        }