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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnisdb/yptol/shim_changepasswd.c
          +++ new/usr/src/lib/libnisdb/yptol/shim_changepasswd.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 2006 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   27  /*
  29   28   * DESCRIPTION: This is the N2L equivalent of changepasswd.c. The traditional
  30   29   *              version modifies the NIS source files and then initiates a
  31   30   *              ypmake to make the maps and push them.
  32   31   *
  33   32   *              For N2L there are no source files and the policy is that the
  34   33   *              definitive information is that contained in the DIT. Old
  35   34   *              information is read from LDAP. Assuming this authenticates, and
  36   35   *              the change is acceptable, this information is modified and
  37   36   *              written back to LDAP.
↓ open down ↓ 25 lines elided ↑ open up ↑
  63   62  #include <rpcsvc/yppasswd.h>
  64   63  #include <utmpx.h>
  65   64  #include <shadow.h>
  66   65  
  67   66  #include <ndbm.h>
  68   67  /* DO NOT INCLUDE SHIM_HOOKS.H */
  69   68  #include "shim.h"
  70   69  #include "yptol.h"
  71   70  #include "../ldap_util.h"
  72   71  
       72 +/*
       73 + * Undocumented external function in libnsl
       74 + */
       75 +extern int  getdomainname(char *, int);
       76 +
  73   77  /* Constants */
  74   78  #define CRYPTPWSIZE CRYPT_MAXCIPHERTEXTLEN
  75   79  #define STRSIZE 100
  76   80  #define FINGERSIZE (4 * STRSIZE - 4)
  77   81  #define SHELLSIZE (STRSIZE - 2)
  78   82  
  79   83  #define UTUSERLEN (sizeof (((struct utmpx *)0)->ut_user))
  80   84  #define COLON_CHAR ':'
  81   85  
  82   86  /*
↓ open down ↓ 343 lines elided ↑ open up ↑
 426  430   */
 427  431  int
 428  432  proc_map_list(char **map_list, char *domain,
 429  433                                  struct passwd_entry *pwd, bool_t adjunct_flag)
 430  434  {
 431  435          char    *myself = "proc_map_list";
 432  436          char    *map_name;
 433  437          char    cmdbuf[BUFSIZ];
 434  438          int     map_name_len = 0;
 435  439          int     index, ans = 0;
 436      -        int     res;
 437  440  
 438  441          /* If this is a adjunct list check LDAP had some adjunct info */
 439  442          if ((adjunct_flag) && (!pwd->adjunct)) {
 440  443                  logmsg(MSG_NOTIMECHECK, LOG_INFO,
 441  444                          "Have adjunct map list but no adjunct data in DIT");
 442  445                  /* Not a disaster */
 443  446                  return (0);
 444  447          }
 445  448  
 446  449          /* Allocate enough buffer to take longest map name */
↓ open down ↓ 600 lines elided ↑ open up ↑
1047 1050   *              Domain
1048 1051   *
1049 1052   * OUTPUT:      The info in malloced space. To be freed by caller.
1050 1053   *              NULL on failure.
1051 1054   */
1052 1055  struct passwd_entry *
1053 1056  get_old_info(char *name, char *domain)
1054 1057  {
1055 1058          char *myself = "get_old_info";
1056 1059          struct passwd_entry *old_passwd;
1057      -        char    *p;
1058 1060          datum   key, data;
1059 1061          suc_code res;
1060 1062  
1061 1063          /* Get the password entry */
1062 1064          key.dptr = name;
1063 1065          key.dsize = strlen(key.dptr);
1064 1066          read_from_dit(PASSWD_MAPPING, domain, &key, &data);
1065 1067          if (NULL == data.dptr) {
1066 1068                  logmsg(MSG_NOTIMECHECK, LOG_ERR,
1067 1069                                          "Could not read old pwd for %s", name);
↓ open down ↓ 276 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX