~ubuntu-branches/ubuntu/vivid/exim4/vivid

« back to all changes in this revision

Viewing changes to src/lookups/ldap.c

  • Committer: Package Import Robot
  • Author(s): Corey Bryant
  • Date: 2014-08-04 11:48:39 UTC
  • mfrom: (56.1.2 utopic)
  • Revision ID: package-import@ubuntu.com-20140804114839-xoulpcx9nxi5m72u
Tags: 4.84~RC1-3ubuntu1
* Merge from Debian unstable (LP: #1351470). Remaining changes:
  - Show Ubuntu distribution on smtp:
    + debian/patches/fix_smtp_banner.patch: updated SMTP banner
      with Ubuntu distribution
    + debian/control: added lsb-release build dependency
  - Don't provide default-mta; in Ubuntu, we want postfix to be the
    default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
*     Exim - an Internet mail transport agent    *
3
3
*************************************************/
4
4
 
5
 
/* Copyright (c) University of Cambridge 1995 - 2012 */
 
5
/* Copyright (c) University of Cambridge 1995 - 2014 */
6
6
/* See the file NOTICE for conditions of use and distribution. */
7
7
 
8
8
/* Many thanks to Stuart Lynne for contributing the original code for this
1133
1133
uschar *p;
1134
1134
uschar *user = NULL;
1135
1135
uschar *password = NULL;
 
1136
uschar *local_servers = NULL;
1136
1137
uschar *server, *list;
1137
1138
uschar buffer[512];
1138
1139
 
1161
1162
      else if (strncmpic(name, US"TIME=", namelen) == 0) timelimit = Uatoi(value);
1162
1163
      else if (strncmpic(name, US"CONNECT=", namelen) == 0) tcplimit = Uatoi(value);
1163
1164
      else if (strncmpic(name, US"NETTIME=", namelen) == 0) tcplimit = Uatoi(value);
 
1165
      else if (strncmpic(name, US"SERVERS=", namelen) == 0) local_servers = value;
1164
1166
 
1165
1167
      /* Don't know if all LDAP libraries have LDAP_OPT_DEREF */
1166
1168
 
1288
1290
 
1289
1291
/* No default servers, or URL contains a server name: just one attempt */
1290
1292
 
1291
 
if (eldap_default_servers == NULL || p[3] != '/')
 
1293
if ((eldap_default_servers == NULL && local_servers == NULL) || p[3] != '/')
1292
1294
  {
1293
1295
  return perform_ldap_search(url, NULL, 0, search_type, res, errmsg,
1294
1296
    &defer_break, user, password, sizelimit, timelimit, tcplimit, dereference,
1295
1297
    referrals);
1296
1298
  }
1297
1299
 
1298
 
/* Loop through the default servers until OK or FAIL */
1299
 
 
1300
 
list = eldap_default_servers;
 
1300
/* Loop through the default servers until OK or FAIL. Use local_servers list
 
1301
 * if defined in the lookup, otherwise use the global default list */
 
1302
list = (local_servers == NULL) ? eldap_default_servers : local_servers;
1301
1303
while ((server = string_nextinlist(&list, &sep, buffer, sizeof(buffer))) != NULL)
1302
1304
  {
1303
1305
  int rc;