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/oamuser/user/useradd.c
          +++ new/usr/src/cmd/oamuser/user/useradd.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 2008 Sun Microsystems, Inc.  All rights reserved.
  23   25   * Use is subject to license terms.
  24   26   */
  25   27  
  26   28  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   29  /*        All Rights Reserved   */
  28   30  
  29   31  
  30   32  #include        <sys/types.h>
  31   33  #include        <sys/stat.h>
↓ open down ↓ 354 lines elided ↑ open up ↑
 386  388          switch (valid_login(logname, (struct passwd **)NULL, &warning)) {
 387  389          case INVALID:
 388  390                  errmsg(M_INVALID, logname, "login name");
 389  391                  exit(EX_BADARG);
 390  392                  /*NOTREACHED*/
 391  393  
 392  394          case NOTUNIQUE:
 393  395                  errmsg(M_USED, logname);
 394  396                  exit(EX_NAME_EXISTS);
 395  397                  /*NOTREACHED*/
      398 +
      399 +        case LONGNAME:
      400 +                errmsg(M_TOO_LONG, logname);
      401 +                exit(EX_BADARG);
      402 +                /*NOTREACHED*/
 396  403          }
 397  404  
 398  405          if (warning)
 399  406                  warningmsg(warning, logname);
 400  407          if (uidstr != NULL) {
 401  408                  /* convert uidstr to integer */
 402  409                  errno = 0;
 403  410                  uid = (uid_t)strtol(uidstr, &ptr, (int)10);
 404  411                  if (*ptr || errno == ERANGE) {
 405  412                          errmsg(M_INVALID, uidstr, "user id");
↓ open down ↓ 350 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX