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 ↓ 1201 lines elided ↑ open up ↑
1233 1235   * additional ways in which the command could fail, and we'd prefer to avoid
1234 1236   * that.
1235 1237   */
1236 1238  static char **
1237 1239  prep_env_noninteractive(const char *user_cmd, char **env)
1238 1240  {
1239 1241          size_t size;
1240 1242          char **new_env;
1241 1243          int e, i;
1242 1244          char *estr;
1243      -        char varmail[LOGNAME_MAX + 11]; /* strlen(/var/mail/) = 10, NUL */
     1245 +        char varmail[LOGNAME_MAX_ILLUMOS + 11]; /* strlen(/var/mail/) = */
     1246 +                                                /* 10, NUL */
1244 1247          char pwbuf[NSS_BUFLEN_PASSWD + 1];
1245 1248          struct passwd pwent;
1246 1249          struct passwd *pw = NULL;
1247 1250  
1248 1251          assert(env != NULL);
1249 1252          assert(failsafe == 0);
1250 1253  
1251 1254          /*
1252 1255           * Exec the "user_cmd" brand hook to get a pwent for the
1253 1256           * login user.  If this fails, HOME will be set to "/", SHELL
↓ open down ↓ 975 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX