Print this page
4211 Some syslog facility names and symbols are missing
1762 Syslogd man page: missing reference.

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/logger/logger.c
          +++ new/usr/src/cmd/logger/logger.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
  22   23   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
  26   27  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   28  /*        All Rights Reserved   */
  28   29  
  29   30  /*
  30   31   * University Copyright- Copyright (c) 1982, 1986, 1988
  31   32   * The Regents of the University of California
  32   33   * All Rights Reserved
  33   34   *
  34   35   * University Acknowledgment- Portions of this document are derived from
  35   36   * software developed by the University of California, Berkeley, and its
  36   37   * contributors.
  37   38   */
  38   39  
  39      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  40   40  
  41   41  #include <sys/types.h>
  42   42  #include <unistd.h>
  43   43  #include <stdio.h>
  44   44  #include <syslog.h>
  45   45  #include <ctype.h>
  46   46  #include <stdlib.h>
  47   47  #include <string.h>
  48   48  #include <locale.h>
  49   49  #include <limits.h>
↓ open down ↓ 28 lines elided ↑ open up ↑
  78   78          "user",         LOG_USER,
  79   79          "mail",         LOG_MAIL,
  80   80          "daemon",       LOG_DAEMON,
  81   81          "auth",         LOG_AUTH,
  82   82          "security",     LOG_AUTH,
  83   83          "mark",         LOG_MARK,
  84   84          "syslog",       LOG_SYSLOG,
  85   85          "lpr",          LOG_LPR,
  86   86          "news",         LOG_NEWS,
  87   87          "uucp",         LOG_UUCP,
  88      -        "cron",         LOG_CRON,
       88 +        "bsdcron",      LOG_BSDCRON,
       89 +        "authpriv",     LOG_AUTHPRIV,
       90 +        "ftp",          LOG_FTP,
       91 +        "ntp",          LOG_NTP,
  89   92          "audit",        LOG_AUDIT,
       93 +        "console",      LOG_CONSOLE,
       94 +        "cron",         LOG_CRON,
  90   95          "local0",       LOG_LOCAL0,
  91   96          "local1",       LOG_LOCAL1,
  92   97          "local2",       LOG_LOCAL2,
  93   98          "local3",       LOG_LOCAL3,
  94   99          "local4",       LOG_LOCAL4,
  95  100          "local5",       LOG_LOCAL5,
  96  101          "local6",       LOG_LOCAL6,
  97  102          "local7",       LOG_LOCAL7,
  98  103          NULL,           -1
  99  104  };
↓ open down ↓ 33 lines elided ↑ open up ↑
 133  138          (void) setlocale(LC_ALL, "");
 134  139  #if !defined(TEXT_DOMAIN)       /* Should be defined by cc -D */
 135  140  #define TEXT_DOMAIN "SYS_TEST"  /* Use this only if it weren't */
 136  141  #endif
 137  142          (void) textdomain(TEXT_DOMAIN);
 138  143          /* initialize */
 139  144  
 140  145          while ((opt = getopt(argc, argv, "it:p:f:")) != EOF)
 141  146                  switch (opt) {
 142  147  
 143      -                    case 't':           /* tag */
      148 +                case 't':               /* tag */
 144  149                          tag = optarg;
 145  150                          break;
 146  151  
 147      -                    case 'p':           /* priority */
      152 +                case 'p':               /* priority */
 148  153                          pri = pencode(optarg);
 149  154                          break;
 150  155  
 151      -                    case 'i':           /* log process id also */
      156 +                case 'i':               /* log process id also */
 152  157                          logflags |= LOG_PID;
 153  158                          pid_len = sprintf(tmp, "%ld", (long)getpid());
 154  159                          pid_len = (pid_len <= 0) ? 0 : pid_len +2;
 155  160                          break;
 156  161  
 157      -                    case 'f':           /* file to log */
      162 +                case 'f':               /* file to log */
 158  163                          if (strcmp(optarg, "-") == 0)
 159  164                                  break;
 160  165                          infile = optarg;
 161  166                          if (freopen(infile, "r", stdin) == NULL) {
 162  167                                  (void) fprintf(stderr, gettext("logger: "));
 163  168                                  perror(infile);
 164  169                                  exit(1);
 165  170                          }
 166  171                          break;
 167  172  
 168      -                    default:
      173 +                default:
 169  174                          usage();
 170  175                  }
 171  176  
 172  177                  argc -= optind;
 173  178                  argv = &argv[optind];
 174  179  
 175  180          if ((tag == NULL) && ((tag = getlogin()) == NULL)) {
 176  181                  u = getuid();
 177  182                  if ((pw = getpwuid(u)) == NULL) {
 178  183                          (void) sprintf(fmt_uid, "%u", u);
↓ open down ↓ 173 lines elided ↑ open up ↑
 352  357          exit(1);
 353  358  }
 354  359  
 355  360  
 356  361  static void
 357  362  usage(void)
 358  363  {
 359  364          (void) fprintf(stderr, gettext(
 360  365              "Usage:\tlogger string\n"
 361  366              "\tlogger [-i] [-f filename] [-p priority] [-t tag] "
 362      -                "[message] ...\n"));
      367 +            "[message] ...\n"));
 363  368          exit(1);
 364  369  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX