Print this page
2989 Eliminate use of LOGNAME_MAX in ON
1166 useradd have warning with name more 8 chars

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zlogin/zlogin.c
          +++ new/usr/src/cmd/zlogin/zlogin.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 (c) 2013 Gary Mills
       23 + *
  22   24   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  23   25   */
  24   26  
  25   27  /*
  26   28   * zlogin provides three types of login which allow users in the global
  27   29   * zone to access non-global zones.
  28   30   *
  29   31   * - "interactive login" is similar to rlogin(1); for example, the user could
  30   32   *   issue 'zlogin my-zone' or 'zlogin -e ^ -l me my-zone'.   The user is
  31   33   *   granted a new pty (which is then shoved into the zone), and an I/O
↓ open down ↓ 49 lines elided ↑ open up ↑
  81   83  #include <libdevinfo.h>
  82   84  #include <libintl.h>
  83   85  #include <locale.h>
  84   86  #include <libzonecfg.h>
  85   87  #include <libcontract.h>
  86   88  #include <libbrand.h>
  87   89  #include <auth_list.h>
  88   90  #include <auth_attr.h>
  89   91  #include <secdb.h>
  90   92  
       93 +#ifdef  LOGNAME_MAX_ILLUMOS
       94 +#define _LOGNAME_MAX    LOGNAME_MAX_ILLUMOS
       95 +#else /* LOGNAME_MAX_ILLUMOS */
       96 +#define _LOGNAME_MAX    LOGNAME_MAX
       97 +#endif /* LOGNAME_MAX_ILLUMOS */
       98 +
  91   99  static int masterfd;
  92  100  static struct termios save_termios;
  93  101  static struct termios effective_termios;
  94  102  static int save_fd;
  95  103  static struct winsize winsize;
  96  104  static volatile int dead;
  97  105  static volatile pid_t child_pid = -1;
  98  106  static int interactive = 0;
  99  107  static priv_set_t *dropprivs;
 100  108  
↓ open down ↓ 1132 lines elided ↑ open up ↑
1233 1241   * additional ways in which the command could fail, and we'd prefer to avoid
1234 1242   * that.
1235 1243   */
1236 1244  static char **
1237 1245  prep_env_noninteractive(const char *user_cmd, char **env)
1238 1246  {
1239 1247          size_t size;
1240 1248          char **new_env;
1241 1249          int e, i;
1242 1250          char *estr;
1243      -        char varmail[LOGNAME_MAX + 11]; /* strlen(/var/mail/) = 10, NUL */
     1251 +        char varmail[_LOGNAME_MAX + 11]; /* strlen(/var/mail/) = 10, NUL */
1244 1252          char pwbuf[NSS_BUFLEN_PASSWD + 1];
1245 1253          struct passwd pwent;
1246 1254          struct passwd *pw = NULL;
1247 1255  
1248 1256          assert(env != NULL);
1249 1257          assert(failsafe == 0);
1250 1258  
1251 1259          /*
1252 1260           * Exec the "user_cmd" brand hook to get a pwent for the
1253 1261           * login user.  If this fails, HOME will be set to "/", SHELL
↓ open down ↓ 975 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX