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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnisdb/ldap_map.c
          +++ new/usr/src/lib/libnisdb/ldap_map.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  #include <strings.h>
  27   28  #include <sys/types.h>
  28   29  #include <sys/stat.h>
  29   30  #include <errno.h>
  30   31  #include <stdio.h>
  31   32  #include <rpcsvc/nis.h>
↓ open down ↓ 1201 lines elided ↑ open up ↑
1233 1234   * If 'wantObj' is set, we want object mappings only (i.e., _not_
1234 1235   * those used to map entries in tables).
1235 1236   *
1236 1237   * If 'dbId' is non-NULL, we select mappings with a matching dbId field.
1237 1238   */
1238 1239  __nis_table_mapping_t **
1239 1240  selectTableMapping(__nis_table_mapping_t *t, db_query *q,
1240 1241                          int wantWrite, int wantObj, char *dbId,
1241 1242                          int *numMatches) {
1242 1243          __nis_table_mapping_t   *r, *x, **tp;
1243      -        int                     i, j, k, nm, numap;
     1244 +        int                     i, nm, numap;
1244 1245          char                    *myself = "selectTableMapping";
1245 1246  
1246 1247          if (numMatches == 0)
1247 1248                  numMatches = &nm;
1248 1249  
1249 1250          /*
1250 1251           * Count the number of possible mappings, so that we can
1251 1252           * allocate the 'tp' array up front.
1252 1253           */
1253 1254          for (numap = 0, x = t; x != 0; numap++, x = x->next);
↓ open down ↓ 158 lines elided ↑ open up ↑
1412 1413  extern bool_t   xdr_nis_object(register XDR *xdrs, nis_object *objp);
1413 1414  
1414 1415  /*
1415 1416   * Copy an XDR:ed version of the NIS+ object 'o' (or the one indicated
1416 1417   * by 't->objName' if 'o' is NULL) to the place indicated by
1417 1418   * 't->objectDN->write'. Return an appropriate LDAP status code.
1418 1419   */
1419 1420  int
1420 1421  objToLDAP(__nis_table_mapping_t *t, nis_object *o, entry_obj **ea, int numEa) {
1421 1422          __nis_table_mapping_t   **tp;
1422      -        XDR                     xdr;
1423      -        char                    *objName;
1424 1423          int                     stat, osize, n, numMatches = 0;
1425 1424          void                    *buf;
1426 1425          __nis_rule_value_t      *rv;
1427 1426          __nis_value_t           *val;
1428 1427          __nis_single_value_t    *sv;
1429 1428          char                    **attrName, *dn;
1430 1429          char                    *myself = "objToLDAP";
1431 1430  
1432 1431          if (t == 0)
1433 1432                  return (LDAP_PARAM_ERROR);
↓ open down ↓ 104 lines elided ↑ open up ↑
1538 1537   * Un-XDR the object, and return a pointer to it in '*obj'; it's the
1539 1538   * responsibility of the caller to free the object when it's no
1540 1539   * longer needed.
1541 1540   *
1542 1541   * Returns an appropriate LDAP status.
1543 1542   */
1544 1543  int
1545 1544  objFromLDAP(__nis_table_mapping_t *t, nis_object **obj,
1546 1545                  entry_obj ***eaP, int *numEaP) {
1547 1546          __nis_table_mapping_t   **tp;
1548      -        XDR                     xdr;
1549 1547          nis_object              *o;
1550 1548          __nis_rule_value_t      *rv;
1551 1549          __nis_ldap_search_t     *ls;
1552 1550          char                    *attrs[2], *filter, **fc = 0;
1553 1551          void                    *buf;
1554 1552          int                     i, j, nfc, nrv, blen, stat = LDAP_SUCCESS;
1555 1553          int                     n, numMatches;
1556 1554          char                    *myself = "objFromLDAP";
1557 1555  
1558 1556          if (t == 0)
↓ open down ↓ 268 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX