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


   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*

  22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #pragma ident   "%Z%%M% %I%     %E% SMI"
  27 
  28 /*
  29  * DESCRIPTION: Contains the top level shim hook functions. These must have
  30  *              identical interfaces to the equivalent standard dbm calls.
  31  *
  32  *              Unfortunately many of these will do a copy of a datum structure
  33  *              on return. This is a side effect of the original DBM function
  34  *              being written to pass structures rather than pointers.
  35  *
  36  * NOTE :       There is a major bug/feature in dbm. A key obtained by
  37  *              dbm_nextkey() of dbm_firstkey() cannot be passed to dbm_store().
  38  *              When the store occurs dbm's internal memory get's reorganized
  39  *              and the static strings pointed to by the key are destroyed. The
  40  *              data is then stored in the wrong place. We attempt to get round
  41  *              this by dbm_firstkey() and dbm_nextkey() making a copy of the
  42  *              key data in malloced memory. This is freed when map_ctrl is
  43  *              freed.
  44  */
  45 
  46 #include <unistd.h>
  47 #include <syslog.h>
  48 #include <ndbm.h>
  49 #include <strings.h>
  50 #include "ypsym.h"
  51 #include "ypdefs.h"
  52 #include "shim.h"
  53 #include "yptol.h"

  54 #include "../ldap_parse.h"
  55 #include "../ldap_util.h"
  56 
  57 /*
  58  * Globals
  59  */
  60 bool_t yptol_mode = FALSE;      /* Set if in N2L mode */
  61 bool_t yptol_newlock = FALSE;
  62                                 /*
  63                                  * Set if in N2L mode and we want to use the new
  64                                  * lock mapping mechanism
  65                                  */
  66 bool_t ypxfrd_flag = FALSE;     /* Set if called from ypxfrd */
  67 pid_t parent_pid;                       /* ID of calling parent process */
  68 
  69 
  70 /*
  71  * Decs
  72  */
  73 void check_old_map_date(map_ctrl *);




   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2015 Gary Mills
  23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 


  27 /*
  28  * DESCRIPTION: Contains the top level shim hook functions. These must have
  29  *              identical interfaces to the equivalent standard dbm calls.
  30  *
  31  *              Unfortunately many of these will do a copy of a datum structure
  32  *              on return. This is a side effect of the original DBM function
  33  *              being written to pass structures rather than pointers.
  34  *
  35  * NOTE :       There is a major bug/feature in dbm. A key obtained by
  36  *              dbm_nextkey() of dbm_firstkey() cannot be passed to dbm_store().
  37  *              When the store occurs dbm's internal memory get's reorganized
  38  *              and the static strings pointed to by the key are destroyed. The
  39  *              data is then stored in the wrong place. We attempt to get round
  40  *              this by dbm_firstkey() and dbm_nextkey() making a copy of the
  41  *              key data in malloced memory. This is freed when map_ctrl is
  42  *              freed.
  43  */
  44 
  45 #include <unistd.h>
  46 #include <syslog.h>
  47 #include <ndbm.h>
  48 #include <strings.h>
  49 #include "ypsym.h"
  50 #include "ypdefs.h"
  51 #include "shim.h"
  52 #include "yptol.h"
  53 #include "stubs.h"
  54 #include "../ldap_parse.h"
  55 #include "../ldap_util.h"
  56 
  57 /*
  58  * Globals
  59  */
  60 bool_t yptol_mode = FALSE;      /* Set if in N2L mode */
  61 bool_t yptol_newlock = FALSE;
  62                                 /*
  63                                  * Set if in N2L mode and we want to use the new
  64                                  * lock mapping mechanism
  65                                  */
  66 bool_t ypxfrd_flag = FALSE;     /* Set if called from ypxfrd */
  67 pid_t parent_pid;                       /* ID of calling parent process */
  68 
  69 
  70 /*
  71  * Decs
  72  */
  73 void check_old_map_date(map_ctrl *);