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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnisdb/ldap_nisdbquery.c
          +++ new/usr/src/lib/libnisdb/ldap_nisdbquery.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 2009 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
  26   27  
  27   28  #include <strings.h>
  28   29  #include <string.h>
  29   30  #include <lber.h>
  30   31  #include <ldap.h>
  31   32  
↓ open down ↓ 2 lines elided ↑ open up ↑
  34   35  #include "nisdb_mt.h"
  35   36  
  36   37  #include "ldap_util.h"
  37   38  #include "ldap_structs.h"
  38   39  #include "ldap_val.h"
  39   40  #include "ldap_ruleval.h"
  40   41  #include "ldap_op.h"
  41   42  #include "ldap_nisdbquery.h"
  42   43  #include "ldap_attr.h"
  43   44  #include "ldap_xdr.h"
       45 +#include "ldap_ldap.h"
  44   46  
  45   47  
  46   48  item *
  47   49  buildItem(int len, void *value) {
  48   50          char    *myself = "buildItem";
  49   51          item    *i = am(myself, sizeof (*i));
  50   52          int     mlen = len;
  51   53  
  52   54          if (i == 0)
  53   55                  return (0);
↓ open down ↓ 163 lines elided ↑ open up ↑
 217  219   * name/value pairs are used to retrieve copies of the corresponding NIS+
 218  220   * entries, and '*rvP' is initialized with the current entry values
 219  221   * and object attributes. Names/values supplied in 'index' override
 220  222   * those from existing NIS+ entries.
 221  223   */
 222  224  db_query **
 223  225  createQuery(int num, char **index, __nis_table_mapping_t *t,
 224  226                  __nis_rule_value_t **rvP, int *numVals) {
 225  227          db_query                **q;
 226  228          db_qcomp                *qc;
 227      -        int                     i, j, n, a, nv, niv, stat, sinum;
      229 +        int                     i, j, n, a, nv, niv;
 228  230          __nis_rule_value_t      *rvq;
 229  231          __nis_buffer_t          b = {0, 0};
 230  232          char                    *table = 0;
 231  233          char                    *myself = "createQuery";
 232  234  
 233  235          rvq = initRuleValue(1, 0);
 234  236          if (rvq == 0)
 235  237                  return (0);
 236  238  
 237  239          if (numVals == 0)
↓ open down ↓ 12 lines elided ↑ open up ↑
 250  252                          logmsg(MSG_NOTIMECHECK, LOG_ERR,
 251  253                                  "%s: Error converting \"%s\" to FQ object name",
 252  254                                  myself, NIL(t->objName));
 253  255                          freeRuleValue(rvq, 1);
 254  256                          return (0);
 255  257                  }
 256  258          }
 257  259  
 258  260          /* Create a rule-value from the col=val pairs */
 259  261          for (n = 0; n < num; n++) {
 260      -                char    *name;
 261  262                  char    *value;
 262  263  
 263  264                  if ((value = strchr(index[n], '=')) == 0) {
 264  265                          logmsg(MSG_NOTIMECHECK, LOG_WARNING,
 265  266                                  "%s: no '=' in \"%s\"",
 266  267                                  myself, index[n]);
 267  268                          continue;
 268  269                  }
 269  270  
 270  271                  *value = '\0';
 271  272                  value++;
 272  273  
 273  274                  for (a = 0; a < t->numColumns; a++) {
 274  275                          if (strcmp(index[n], t->column[a]) == 0) {
 275      -                                int             i, len = slen(value)+1;
 276  276  
 277  277                                  /* Add col=val pair to 'rvq' */
 278  278                                  if (addSCol2RuleValue(index[n], value, rvq)) {
 279  279                                          freeRuleValue(rvq, 1);
 280  280                                          sfree(table);
 281  281                                          return (0);
 282  282                                  }
 283  283  
 284  284                                  break;
 285  285                          }
↓ open down ↓ 399 lines elided ↑ open up ↑
 685  685  
 686  686  db_query **
 687  687  createNisPlusEntry(__nis_table_mapping_t *t, __nis_rule_value_t *rv,
 688  688                          db_query *qin, __nis_obj_attr_t ***objAttr,
 689  689                          int *numQueries) {
 690  690          db_query                **query = 0;
 691  691          int                     r, i, j, ir;
 692  692          __nis_value_t           *rval, *lval;
 693  693          __nis_mapping_item_t    *litem;
 694  694          int                     numItems;
 695      -        int                     nq, iqc;
      695 +        int                     nq;
 696  696          __nis_obj_attr_t        **attr = 0;
 697  697          char                    **dn = 0;
 698  698          int                     numDN = 0;
 699  699          char                    *myself = "createNisPlusEntry";
 700  700  
 701  701          if (t == 0 || t->objectDN == 0 || rv == 0)
 702  702                  return (0);
 703  703  
 704  704          /* Establish default, per-thread, search base */
 705  705          __nisdb_get_tsd()->searchBase = t->objectDN->read.base;
↓ open down ↓ 522 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX