home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / sendmail-5.65c+IDA-1.4.4.1 / src / RCS / trace.c,v < prev    next >
Encoding:
Text File  |  1991-06-25  |  3.5 KB  |  208 lines

  1. head    5.6;
  2. branch    5.6.0;
  3. access;
  4. symbols
  5.     RELEASE:5.6.0.3
  6.     BETA:5.6.0.3
  7.     UICSO:5.6.0
  8.     VANILLA:5.6;
  9. locks; strict;
  10. comment    @ * @;
  11.  
  12.  
  13. 5.6
  14. date    90.06.20.08.37.12;    author paul;    state Exp;
  15. branches
  16.     5.6.0.1;
  17. next    ;
  18.  
  19. 5.6.0.1
  20. date    90.11.05.14.38.18;    author paul;    state Exp;
  21. branches;
  22. next    5.6.0.2;
  23.  
  24. 5.6.0.2
  25. date    91.03.04.21.48.23;    author paul;    state Exp;
  26. branches;
  27. next    5.6.0.3;
  28.  
  29. 5.6.0.3
  30. date    91.04.05.14.55.15;    author paul;    state Exp;
  31. branches;
  32. next    ;
  33.  
  34.  
  35. desc
  36. @@
  37.  
  38.  
  39.  
  40. 5.6
  41. log
  42. @5.64 Berkeley release
  43. @
  44. text
  45. @/*
  46.  * Copyright (c) 1983 Eric P. Allman
  47.  * Copyright (c) 1988 Regents of the University of California.
  48.  * All rights reserved.
  49.  *
  50.  * Redistribution and use in source and binary forms are permitted provided
  51.  * that: (1) source distributions retain this entire copyright notice and
  52.  * comment, and (2) distributions including binaries display the following
  53.  * acknowledgement:  ``This product includes software developed by the
  54.  * University of California, Berkeley and its contributors'' in the
  55.  * documentation or other materials provided with the distribution and in
  56.  * all advertising materials mentioning features or use of this software.
  57.  * Neither the name of the University nor the names of its contributors may
  58.  * be used to endorse or promote products derived from this software without
  59.  * specific prior written permission.
  60.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  61.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  62.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  63.  */
  64.  
  65. #ifndef lint
  66. static char sccsid[] = "@@(#)trace.c    5.6 (Berkeley) 6/1/90";
  67. #endif /* not lint */
  68.  
  69. # include "sendmail.h"
  70.  
  71. /*
  72. **  TtSETUP -- set up for trace package.
  73. **
  74. **    Parameters:
  75. **        vect -- pointer to trace vector.
  76. **        size -- number of flags in trace vector.
  77. **        defflags -- flags to set if no value given.
  78. **
  79. **    Returns:
  80. **        none
  81. **
  82. **    Side Effects:
  83. **        environment is set up.
  84. */
  85.  
  86. u_char        *tTvect;
  87. int        tTsize;
  88. static char    *DefFlags;
  89.  
  90. tTsetup(vect, size, defflags)
  91.     u_char *vect;
  92.     int size;
  93.     char *defflags;
  94. {
  95.     tTvect = vect;
  96.     tTsize = size;
  97.     DefFlags = defflags;
  98. }
  99. /*
  100. **  TtFLAG -- process an external trace flag description.
  101. **
  102. **    Parameters:
  103. **        s -- the trace flag.
  104. **
  105. **    Returns:
  106. **        none.
  107. **
  108. **    Side Effects:
  109. **        sets/clears trace flags.
  110. */
  111.  
  112. tTflag(s)
  113.     register char *s;
  114. {
  115.     int first, last;
  116.     register int i;
  117.  
  118.     if (*s == '\0')
  119.         s = DefFlags;
  120.  
  121.     for (;;)
  122.     {
  123.         /* find first flag to set */
  124.         i = 0;
  125.         while (isdigit(*s))
  126.             i = i * 10 + (*s++ - '0');
  127.         first = i;
  128.  
  129.         /* find last flag to set */
  130.         if (*s == '-')
  131.         {
  132.             i = 0;
  133.             while (isdigit(*++s))
  134.                 i = i * 10 + (*s - '0');
  135.         }
  136.         last = i;
  137.  
  138.         /* find the level to set it to */
  139.         i = 1;
  140.         if (*s == '.')
  141.         {
  142.             i = 0;
  143.             while (isdigit(*++s))
  144.                 i = i * 10 + (*s - '0');
  145.         }
  146.  
  147.         /* clean up args */
  148.         if (first >= tTsize)
  149.             first = tTsize - 1;
  150.         if (last >= tTsize)
  151.             last = tTsize - 1;
  152.  
  153.         /* set the flags */
  154.         while (first <= last)
  155.             tTvect[first++] = i;
  156.  
  157.         /* more arguments? */
  158.         if (*s++ == '\0')
  159.             return;
  160.     }
  161. }
  162. @
  163.  
  164.  
  165. 5.6.0.1
  166. log
  167. @Change auto variables in tTflag() to unsigned int.  This closes a nasty
  168. security hole.  Reported by Robert Ehrlich via Francis Dupont
  169. (dupont@@inria.inria.fr).
  170. @
  171. text
  172. @d71 2
  173. a72 2
  174.     unsigned int first, last;
  175.     register unsigned int i;
  176. @
  177.  
  178.  
  179. 5.6.0.2
  180. log
  181. @ANSIfied.
  182. @
  183. text
  184. @d44 1
  185. a44 1
  186. static const char *DefFlags;
  187. a45 1
  188. void
  189. d49 1
  190. a49 1
  191.     const char *defflags;
  192. a67 1
  193. void
  194. d69 1
  195. a69 1
  196.     register const char *s;
  197. @
  198.  
  199.  
  200. 5.6.0.3
  201. log
  202. @Added RCS ID string
  203. @
  204. text
  205. @a22 1
  206. static char  rcsid[] = "@@(#)$Id$";
  207. @
  208.