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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.c
          +++ new/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   *
  14   14   * When distributing Covered Code, include this CDDL HEADER in each
  15   15   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16   * If applicable, add the following below this CDDL HEADER, with the
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
       23 + * Copyright 2015 Gary Mills
  23   24   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24   25   * Use is subject to license terms.
  25   26   */
  26   27  
  27   28  #include <stdio.h>
  28   29  #include <string.h>
  29   30  #include <stdlib.h>
  30   31  #include <ctype.h>
  31   32  #include <fcntl.h>
  32   33  #include <errno.h>
  33   34  #include <syslog.h>
  34   35  
  35   36  #include "ldap_parse.h"
  36   37  #include "nis_parse_ldap_conf.h"
  37      -#include "nis_parse_ldap_err.h"
       38 +#include "nis_parse_ldap_util.h"
  38   39  #include "ldap_util.h"
  39   40  
  40      -extern __nis_mapping_rule_t **dup_mapping_rules(
  41      -        __nis_mapping_rule_t **rules, int n_rules);
  42      -extern __nis_mapping_rule_t *dup_mapping_rule(
  43      -        __nis_mapping_rule_t *in);
       41 +/* Forward declarations */
       42 +int getfullmapname(char **, const char *);
       43 +int checkfullmapname(const char *, const char *, __nis_table_mapping_t **,
       44 +    __nis_table_mapping_t **);
       45 +int append_domainContext(__nis_table_mapping_t **, char *, char *);
  44   46  
  45   47  static int      merge_table_mapping(__nis_table_mapping_t *in,
  46   48          __nis_table_mapping_t *out);
  47   49  __nis_table_mapping_t *new_merged_mapping(const char *,
  48   50          __nis_table_mapping_t *intbl);
  49   51  static int append_mapping_rule(__nis_mapping_rule_t *src_rule,
  50   52          __nis_table_mapping_t *tbl, int flag);
  51   53  
  52   54  
  53   55  static int copy_object_dn(__nis_object_dn_t     *in,
↓ open down ↓ 77 lines elided ↑ open up ↑
 131  133   * INPUT: Source and Destination table_mapping structs.
 132  134   * RETURN: 0 on success and > 0 on error.
 133  135   */
 134  136  
 135  137  static int
 136  138  merge_table_mapping(
 137  139          __nis_table_mapping_t *in,
 138  140          __nis_table_mapping_t *out)
 139  141  {
 140  142          int i;
 141      -        int len;
 142  143          int orig_num_rules;
 143  144          int append;
 144  145  
 145  146          if (in == NULL)
 146  147                  return (1);
 147  148  
 148  149          if (in->dbId == NULL)
 149  150                  return (1);
 150  151  
 151  152          /*
↓ open down ↓ 275 lines elided ↑ open up ↑
 427  428   * as necessary. Also adds dummy objectDN info. for splitField's.
 428  429   *
 429  430   * RETURN VALUE: 0 on success, > 0 on failure.
 430  431   */
 431  432  int
 432  433  second_parser_pass(__nis_table_mapping_t **table_mapping)
 433  434  {
 434  435          __nis_table_mapping_t   *t, *t2;
 435  436          __nis_table_mapping_t   *t_new = NULL, *tg;
 436  437          __nis_table_mapping_t   *prev = NULL;
 437      -        __nis_object_dn_t   *objectDN;
 438  438          char    *objs, *dom;
 439  439          char    *objName = NULL;
 440  440          char    *lasts;
 441  441          char    *tobj, *alias, *dupalias, *tmp;
 442  442          char    *myself = "second_parser_pass";
 443  443          int     i = 0, len;
 444      -        int     remove_t = 0;
 445      -        int     add_t = 0;
 446  444  
 447  445          prev = NULL;
 448  446          for (t = *table_mapping; t != NULL; ) {
 449  447                  /*
 450  448                   * Temporarily using this field to flag deletion.
 451  449                   * 0 : don't delete
 452  450                   * 1 : delete
 453  451                   * The mapping structure will be deleted in final_parser_pass
 454  452                   */
 455  453                  t->isMaster = 0;
↓ open down ↓ 884 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX