Print this page
4078 groupadd execs getent unnecessarily
Reviewed by: Rich Lowe <richlowe@richlowe.net>
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: Milan Jurik <milan.jurik@xylab.cz>
Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/oamuser/user/val_lprj.c
          +++ new/usr/src/cmd/oamuser/user/val_lprj.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
       27 +/*
       28 + * Copyright (c) 2013 RackTop Systems.
       29 + */
  28   30  
  29   31  #include        <sys/types.h>
  30   32  #include        <stdio.h>
  31   33  #include        <strings.h>
  32   34  #include        <sys/param.h>
  33   35  #include        <users.h>
  34   36  #include        <userdefs.h>
  35   37  #include        <project.h>
  36   38  #include        <errno.h>
  37   39  #include        "messages.h"
↓ open down ↓ 10 lines elided ↑ open up ↑
  48   50          int i = 0;
  49   51          int j;
  50   52          char *ptr;
  51   53          struct project projent;
  52   54          int warning;
  53   55          char mybuf[PROJECT_BUFSZ];
  54   56  
  55   57          if (!list || !*list)
  56   58                  return ((int **)NULL);
  57   59  
  58      -        while (ptr = strtok(((i || n_invalid) ? NULL : list), ",")) {
       60 +        while ((ptr = strtok((i || n_invalid) ? NULL : list, ","))) {
  59   61  
  60   62                  switch (valid_project(ptr, &projent, mybuf, sizeof (mybuf),
  61   63                      &warning)) {
  62   64                  case INVALID:
  63   65                          errmsg(M_INVALID, ptr, "project id");
  64   66                          n_invalid++;
  65   67                          break;
  66   68                  case TOOBIG:
  67   69                          errmsg(M_TOOBIG, "projid", ptr);
  68   70                          n_invalid++;
↓ open down ↓ 38 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX