Print this page
5910 libnisdb won't build with modern GCC

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnisdb/ldap_op.c
          +++ new/usr/src/lib/libnisdb/ldap_op.c
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
       22 + * Copyright 2015 Gary Mills
  22   23   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
  26   27  #include <synch.h>
  27   28  #include <strings.h>
  28   29  #include <sys/time.h>
  29   30  #include <ctype.h>
  30   31  
  31   32  #include "ldap_op.h"
↓ open down ↓ 476 lines elided ↑ open up ↑
 508  509  }
 509  510  
 510  511  /* Accept a server/port indication, and call ldap_init() */
 511  512  static LDAP *
 512  513  ldapInit(char *srv, int port, bool_t use_ssl) {
 513  514          LDAP                    *ld;
 514  515          int                     ldapVersion = LDAP_VERSION3;
 515  516          int                     derefOption = LDAP_DEREF_ALWAYS;
 516  517          int                     timelimit = proxyInfo.search_time_limit;
 517  518          int                     sizelimit = proxyInfo.search_size_limit;
 518      -        char                    *myself = "ldapInit";
 519  519  
 520  520          if (srv == 0)
 521  521                  return (0);
 522  522  
 523  523          if (use_ssl) {
 524  524                  ld = ldapssl_init(srv, port, 1);
 525  525          } else {
 526  526                  ld = ldap_init(srv, port);
 527  527          }
 528  528  
↓ open down ↓ 82 lines elided ↑ open up ↑
 611  611          return (ret);
 612  612  }
 613  613  
 614  614  /*
 615  615   * Free 'lc' and all related memory. Caller must hold the exclusive lock.
 616  616   * Return LDAP_UNAVAILABLE upon success, in which case the caller mustn't
 617  617   * try to use the structure pointer in any way.
 618  618   */
 619  619  static int
 620  620  freeCon(__nis_ldap_conn_t *lc) {
 621      -        char                    *myself = "freeCon";
 622  621  
 623  622          if (!assertExclusive(lc))
 624  623                  return (LDAP_PARAM_ERROR);
 625  624  
 626  625          incrementRC(lc);
 627  626  
 628  627          /* Must be unused, unbound, and not on the 'ldapCon' list */
 629  628          if (lc->onList || lc->refCount != 1 || lc->isBound) {
 630  629                  lc->doDel++;
 631  630                  decrementRC(lc);
↓ open down ↓ 395 lines elided ↑ open up ↑
1027 1026          }
1028 1027  
1029 1028          /* Work on a copy of 'serverList' */
1030 1029          sl = sls = sdup(myself, T, serverList);
1031 1030          if (sl == 0) {
1032 1031                  (void) rw_unlock(&ldapConLock);
1033 1032                  return (LDAP_NO_MEMORY);
1034 1033          }
1035 1034  
1036 1035          /* Remove leading white space */
1037      -        for (0; *sl == ' ' || *sl == '\t'; sl++);
     1036 +        for (; *sl == ' ' || *sl == '\t'; sl++);
1038 1037  
1039 1038          /* Create connection for each server on the list */
1040 1039          for (s = sl; *s != '\0'; s = e+1) {
1041 1040                  int     l;
1042 1041  
1043 1042                  /* Find end of server/port token */
1044 1043                  for (e = s; *e != ' ' && *e != '\t' && *e != '\0'; e++);
1045 1044                  if (*e != '\0')
1046 1045                          *e = '\0';
1047 1046                  else
↓ open down ↓ 1172 lines elided ↑ open up ↑
2220 2219   * add otherwise (ignored if we're deleting).
2221 2220   */
2222 2221  int
2223 2222  ldapModify(char *dn, __nis_rule_value_t *rv, char *objClassAttrs,
2224 2223                  int addFirst) {
2225 2224          int                     stat, add = 0;
2226 2225          LDAPMod                 **mods = 0;
2227 2226          __nis_ldap_conn_t       *lc;
2228 2227          struct timeval          tv;
2229 2228          LDAPMessage             *msg = 0;
2230      -        char                    *myself = "ldapModify";
2231 2229          int                     msgid;
2232 2230          int                     lderr;
2233 2231          char                    **referralsp = NULL;
2234 2232          bool_t                  delete = FALSE;
2235 2233  
2236 2234          if (dn == 0)
2237 2235                  return (LDAP_PARAM_ERROR);
2238 2236  
2239 2237          if ((lc = findCon(&stat)) == 0)
2240 2238                  return (stat);
↓ open down ↓ 502 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX