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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnisdb/yptol/dit_access_utils.c
          +++ new/usr/src/lib/libnisdb/yptol/dit_access_utils.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 (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  23   24   */
  24   25  
  25   26  /*
  26   27   * DESCRIPTION: Contains dit_access interface support functions.
  27   28   */
  28   29  #include <sys/systeminfo.h>
  29   30  #include <unistd.h>
  30   31  #include <stdlib.h>
  31   32  #include <sys/types.h>
  32   33  #include <sys/stat.h>
  33   34  #include <sys/systeminfo.h>
  34   35  #include <unistd.h>
  35   36  #include <stdlib.h>
  36   37  #include <syslog.h>
  37   38  #include <ndbm.h>
  38   39  #include <strings.h>
  39   40  #include <errno.h>
       41 +#include <ctype.h>
  40   42  #include "../ldap_util.h"
  41   43  #include "../ldap_map.h"
  42   44  #include "../ldap_parse.h"
  43   45  #include "../ldap_structs.h"
  44   46  #include "../ldap_val.h"
  45   47  #include "../ldap_ruleval.h"
  46   48  #include "../ldap_op.h"
  47   49  #include "../ldap_attr.h"
  48   50  #include "../ldap_nisdbquery.h"
  49   51  #include "../nisdb_mt.h"
↓ open down ↓ 67 lines elided ↑ open up ↑
 117  119  /*
 118  120   * Returns an array of rule-values corresponding to the
 119  121   * splitfields.
 120  122   */
 121  123  __nis_rule_value_t *
 122  124  processSplitField(__nis_table_mapping_t *sf, __nis_value_t *inVal,
 123  125                          int *nv, int *statP) {
 124  126  
 125  127          char                    *sepset;
 126  128          __nis_rule_value_t      *rvq;
 127      -        __nis_mapping_format_t  *ftmp;
 128  129          __nis_value_t           **valA, *tempVal;
 129  130          int                     i, j, res, numVals, oldlen, count;
 130  131          char                    *str, *oldstr;
 131      -        char                    *myself = "processSplitField";
 132  132  
 133  133          /* sf will be non NULL */
 134  134  
 135  135          if (inVal == 0 || inVal->type != vt_string) {
 136  136                  *statP =  MAP_PARAM_ERROR;
 137  137                  return (0);
 138  138          }
 139  139  
 140  140          /* Get the separator list */
 141  141          sepset = sf->separatorStr;
↓ open down ↓ 105 lines elided ↑ open up ↑
 247  247   */
 248  248  __nis_rule_value_t *
 249  249  datumToRuleValue(datum *key, datum *value, __nis_table_mapping_t *t,
 250  250                          int *nv, char *domain, bool_t readonly, int *statP) {
 251  251  
 252  252          __nis_rule_value_t      *rvq, *subrvq, *newrvq;
 253  253          __nis_value_t           *val;
 254  254          __nis_value_t           **valA;
 255  255          __nis_table_mapping_t   *sf;
 256  256          int                     valueLen, comLen, numVals, nr, count = 1;
 257      -        int                     i, j, k, l, af;
      257 +        int                     i, j, k, l;
 258  258          char                    *ipaddr, *ipvalue;
 259  259  
 260  260          /*  At this point, 't' is always non NULL */
 261  261  
 262  262          /* Initialize rule-value */
 263  263          if ((rvq = initRuleValue(1, 0)) == 0) {
 264  264                  *statP = MAP_INTERNAL_ERROR;
 265  265                  return (0);
 266  266          }
 267  267  
↓ open down ↓ 370 lines elided ↑ open up ↑
 638  638   * Updates 'rv' with NIS name=value pairs suitable to
 639  639   * construct datum from namefield information.
 640  640   * Some part based on createNisPlusEntry (from ldap_nisdbquery.c)
 641  641   * This code assumes that from a given LDAP entry, applying the
 642  642   * mapping rules, would give us one or more NIS entries, differing
 643  643   * only in key.
 644  644   */
 645  645  suc_code
 646  646  buildNISRuleValue(__nis_table_mapping_t *t, __nis_rule_value_t *rv,
 647  647                                          char *domain) {
 648      -        int                     r, i, j, k, l, index, nrq, res, len;
      648 +        int                     r, i, j, k, l, nrq, res, len;
 649  649          int                     numItems, splitname, count, statP;
 650  650          __nis_value_t           *rval;
 651  651          __nis_mapping_item_t    *litem;
 652  652          __nis_mapping_rule_t    *rl;
 653  653          __nis_rule_value_t      *rvq;
 654  654          char                    *value, *emptystr = "";
 655  655  
 656  656          statP = SUCCESS;
 657  657  
 658  658          /* Initialize default base */
↓ open down ↓ 344 lines elided ↑ open up ↑
1003 1003  /*
1004 1004   * Read (i.e get and map) a single NIS entry from the LDAP DIT
1005 1005   */
1006 1006  bool_t
1007 1007  singleReadFromDIT(char *map, char *domain, datum *key, datum *value,
1008 1008                                                          int *statP) {
1009 1009          __nis_table_mapping_t   *t;
1010 1010          __nis_rule_value_t      *rv_request = 0, *rv_result = 0;
1011 1011          __nis_ldap_search_t     *ls;
1012 1012          __nis_object_dn_t       *objectDN = NULL;
1013      -        int                     i, rc, nr = 0, nv = 0;
     1013 +        int                     i, rc, nr = 0;
1014 1014          datum                   *datval = 0;
1015      -        char                    *skey, *str, *sipkey;
     1015 +        char                    *skey, *str;
1016 1016          char                    *myself = "singleReadFromDIT";
1017 1017  
1018 1018          *statP = SUCCESS;
1019 1019  
1020 1020          if (!map || !domain || !key || !value) {
1021 1021                  *statP = MAP_PARAM_ERROR;
1022 1022                  return (FALSE);
1023 1023          }
1024 1024  
1025 1025  
↓ open down ↓ 976 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX