2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00
Todd C. Miller 35375a2b7e Initial implementation of checksum support in sudoers.
Currently supports SHA-224, SHA-256, SHA-384, SHA-512.
TODO: checksum format validation in parser and base64 support.
      checksum support for ldap sudoers
2013-04-14 07:00:21 -04:00

3873 lines
125 KiB
C

#include <config.h>
#define yy_create_buffer sudoers_create_buffer
#define yy_delete_buffer sudoers_delete_buffer
#define yy_scan_buffer sudoers_scan_buffer
#define yy_scan_string sudoers_scan_string
#define yy_scan_bytes sudoers_scan_bytes
#define yy_flex_debug sudoers_flex_debug
#define yy_init_buffer sudoers_init_buffer
#define yy_flush_buffer sudoers_flush_buffer
#define yy_load_buffer_state sudoers_load_buffer_state
#define yy_switch_to_buffer sudoers_switch_to_buffer
#define yyin sudoersin
#define yyleng sudoersleng
#define yylex sudoerslex
#define yyout sudoersout
#define yyrestart sudoersrestart
#define yytext sudoerstext
/* $OpenBSD: flex.skl,v 1.11 2010/08/04 18:24:50 millert Exp $ */
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /home/cvs/openbsd/src/usr.bin/lex/flex.skl,v 1.11 2010/08/04 18:24:50 millert Exp $
*/
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#include <stdio.h>
#include <errno.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#include <stdlib.h>
#include <unistd.h>
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
#ifdef __STDC__
#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
#ifdef __TURBOC__
#pragma warn -rch
#pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#define YY_BUF_SIZE 16384
typedef struct yy_buffer_state *YY_BUFFER_STATE;
extern int yyleng;
extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* The funky do-while in the following #define is used to turn the definition
* int a single C statement (which needs a semi-colon terminator). This
* avoids problems with code like:
*
* if ( condition_holds )
* yyless( 5 );
* else
* do_something_else();
*
* Prior to using the do-while the compiler would get upset at the
* "else" because it interpreted the "if" statement as being all
* done when it reached the ';' after the yyless() call.
*/
/* Return all but the first 'n' matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, yytext_ptr )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
typedef unsigned int yy_size_t;
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
static YY_BUFFER_STATE yy_current_buffer = 0;
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*/
#define YY_CURRENT_BUFFER yy_current_buffer
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
#define yywrap() 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yytext_ptr = yy_bp; \
yyleng = (int) (yy_cp - yy_bp); \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 65
#define YY_END_OF_BUFFER 66
static yyconst short int yy_accept[635] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 66, 53, 61, 60, 59, 52, 64, 32,
54, 55, 32, 56, 53, 53, 53, 53, 58, 57,
64, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 64, 53, 53, 61, 64, 44, 44, 44, 44,
44, 2, 64, 1, 53, 44, 44, 53, 17, 16,
17, 16, 16, 64, 64, 64, 3, 9, 8, 9,
4, 9, 5, 64, 13, 13, 13, 11, 12, 53,
0, 61, 59, 0, 63, 0, 53, 34, 0, 32,
0, 33, 0, 51, 51, 0, 53, 53, 0, 53,
53, 53, 53, 0, 37, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 53, 62, 53,
53, 61, 0, 0, 0, 0, 0, 0, 53, 53,
53, 53, 53, 2, 1, 0, 1, 45, 45, 0,
53, 17, 17, 15, 14, 15, 0, 0, 3, 9,
0, 6, 7, 9, 9, 13, 0, 13, 13, 0,
10, 0, 0, 0, 34, 34, 0, 0, 53, 53,
53, 53, 53, 0, 0, 37, 37, 44, 39, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 53, 53, 0, 0, 0, 0, 0, 0, 53,
53, 53, 53, 53, 0, 53, 10, 0, 53, 53,
53, 53, 53, 53, 0, 38, 38, 38, 0, 0,
37, 37, 37, 37, 37, 37, 37, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 40, 44, 41,
53, 53, 53, 53, 0, 0, 0, 0, 0, 0,
53, 53, 53, 53, 53, 53, 53, 0, 0, 38,
38, 38, 0, 37, 37, 0, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 0, 25, 44,
44, 44, 44, 44, 44, 44, 44, 42, 44, 53,
53, 53, 53, 53, 0, 0, 0, 0, 53, 53,
53, 53, 53, 53, 53, 53, 0, 38, 0, 37,
37, 37, 0, 0, 0, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 44, 44,
44, 44, 44, 44, 44, 44, 44, 46, 47, 48,
49, 53, 0, 0, 0, 53, 53, 53, 35, 35,
35, 0, 0, 37, 37, 37, 37, 37, 37, 37,
0, 0, 0, 0, 0, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 44,
44, 44, 0, 24, 44, 44, 44, 44, 0, 23,
0, 26, 53, 0, 0, 0, 53, 53, 53, 53,
35, 35, 35, 35, 0, 37, 0, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
0, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 44, 44, 44, 44, 44, 44,
44, 50, 0, 0, 0, 53, 20, 45, 36, 36,
36, 36, 37, 0, 0, 0, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
0, 0, 0, 0, 37, 37, 37, 37, 37, 37,
37, 37, 44, 44, 44, 44, 44, 0, 22, 0,
27, 0, 20, 0, 0, 53, 0, 53, 53, 53,
36, 36, 36, 36, 0, 0, 0, 0, 0, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 43,
0, 30, 44, 44, 44, 0, 0, 0, 18, 0,
21, 20, 0, 0, 0, 0, 0, 20, 0, 53,
53, 53, 0, 0, 0, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 0, 28, 44, 44, 21, 0, 0,
20, 53, 53, 53, 53, 53, 0, 0, 0, 0,
0, 37, 37, 37, 37, 37, 37, 37, 37, 0,
31, 44, 0, 53, 53, 53, 37, 37, 37, 37,
37, 37, 0, 29, 0, 0, 19, 53, 53, 53,
53, 53, 37, 37, 37, 37, 37, 35, 35, 35,
35, 35, 35, 0
} ;
static yyconst int yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 4, 5, 6, 1, 7, 1, 1, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 1, 1,
27, 28, 10, 29, 30, 31, 32, 33, 34, 31,
35, 36, 37, 38, 38, 39, 40, 41, 42, 43,
38, 44, 45, 46, 47, 48, 49, 50, 51, 38,
10, 52, 10, 1, 53, 1, 54, 55, 56, 57,
58, 59, 60, 61, 62, 60, 60, 63, 64, 65,
66, 60, 60, 67, 68, 69, 70, 60, 60, 60,
60, 60, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst int yy_meta[71] =
{ 0,
1, 2, 3, 4, 5, 6, 1, 7, 7, 1,
1, 8, 9, 10, 11, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 13, 14, 7, 1, 15,
15, 15, 15, 15, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 16, 17, 18, 18, 18, 18, 18, 18, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17
} ;
static yyconst short int yy_base[714] =
{ 0,
0, 69, 71, 79, 94, 124, 175, 244, 153, 197,
85, 130, 3060, 3007, 3056, 3925, 3053, 3925, 312, 86,
3925, 3925, 3004, 3925, 140, 324, 195, 153, 3029, 3925,
3925, 383, 3015, 43, 438, 37, 3011, 65, 3010, 3017,
2999, 496, 511, 91, 151, 534, 39, 41, 2983, 34,
2980, 117, 3034, 3044, 264, 2992, 3003, 136, 0, 3925,
3028, 3925, 0, 359, 594, 105, 0, 2979, 3925, 115,
3925, 133, 3925, 138, 2946, 152, 171, 3925, 188, 2934,
249, 2972, 2958, 2917, 3925, 262, 462, 265, 2895, 215,
536, 2844, 563, 572, 2832, 621, 634, 671, 2836, 2836,
493, 618, 302, 2812, 181, 715, 0, 2791, 2795, 2788,
2792, 325, 2781, 2788, 2785, 2777, 2779, 287, 3925, 208,
137, 629, 2742, 2747, 2738, 2733, 2724, 121, 200, 211,
299, 301, 236, 254, 2782, 690, 2781, 594, 2730, 749,
207, 0, 2756, 160, 3925, 3925, 762, 324, 0, 2707,
581, 3925, 3925, 2706, 487, 2694, 2729, 272, 469, 370,
2720, 2707, 2672, 772, 782, 468, 806, 658, 821, 803,
661, 860, 2647, 2633, 904, 362, 949, 993, 0, 2611,
2605, 2588, 2590, 2573, 2584, 2579, 2561, 2551, 2564, 2563,
2551, 648, 308, 2512, 2517, 2485, 2487, 2493, 463, 335,
2485, 474, 241, 343, 845, 323, 2531, 2525, 1037, 451,
0, 0, 694, 536, 2492, 2488, 1074, 588, 2487, 2468,
534, 842, 1087, 879, 746, 1132, 1178, 2467, 465, 2437,
524, 2442, 2435, 2424, 2422, 2418, 2399, 0, 2395, 0,
834, 518, 557, 521, 2378, 2380, 2364, 2375, 2345, 581,
423, 672, 526, 543, 1190, 1202, 1214, 2385, 2384, 1224,
2367, 2365, 2364, 2362, 606, 923, 657, 968, 1005, 1237,
0, 1018, 1283, 1047, 889, 1328, 1374, 673, 3925, 2344,
2344, 2337, 2351, 2329, 2330, 2334, 2334, 0, 2318, 700,
976, 796, 645, 760, 2301, 2276, 2277, 884, 691, 977,
779, 1384, 568, 1423, 1435, 1062, 2318, 2314, 2296, 2295,
1445, 1015, 2306, 2294, 1491, 1058, 1060, 1101, 1112, 1145,
1503, 0, 1158, 1549, 1256, 1266, 1594, 1640, 2252, 2250,
2243, 742, 812, 2238, 2245, 827, 886, 2233, 2221, 2220,
2219, 698, 2240, 2182, 665, 1025, 576, 1118, 1651, 1302,
1312, 2211, 2204, 2194, 1347, 1690, 1394, 1357, 1734, 1780,
1404, 2198, 2197, 2196, 1466, 1167, 1466, 1480, 1516, 1527,
1562, 1792, 0, 1575, 1838, 1613, 1414, 1883, 1929, 2154,
2120, 2123, 887, 3925, 2124, 2094, 2088, 2072, 929, 3925,
930, 3925, 761, 2056, 2047, 853, 1327, 881, 925, 1939,
211, 0, 0, 928, 2089, 2088, 1661, 58, 1671, 1112,
1978, 0, 1711, 2024, 1753, 1623, 2068, 2114, 2099, 2083,
2126, 1571, 1572, 1769, 1805, 1816, 1851, 2138, 0, 1864,
2184, 1902, 1681, 2230, 2048, 2049, 2030, 2031, 2024, 974,
976, 2017, 2006, 1999, 1871, 816, 1883, 2001, 2242, 1949,
1959, 979, 2026, 2025, 2017, 2281, 1998, 1155, 1191, 1997,
1424, 2293, 0, 2045, 2339, 2087, 1722, 2383, 2429, 2157,
1993, 1992, 1922, 2009, 1860, 1918, 2103, 492, 1007, 2441,
0, 2169, 1889, 1159, 1885, 1883, 1867, 1262, 3925, 1263,
3925, 1813, 2047, 1040, 1121, 1071, 2217, 2222, 2485, 1073,
0, 0, 1466, 1526, 2259, 1830, 1814, 1807, 2215, 1760,
1736, 1527, 1691, 2312, 1816, 2524, 0, 2360, 2570, 2402,
1969, 2614, 2660, 1711, 1640, 2671, 2242, 1631, 1031, 0,
1264, 3925, 1308, 1575, 1555, 1471, 1490, 1165, 3925, 1471,
1421, 2286, 2337, 2426, 2475, 1367, 2503, 2480, 2508, 2683,
2695, 2707, 1215, 1126, 2719, 1096, 1059, 1862, 1979, 2543,
2046, 2731, 0, 2591, 2777, 2633, 2471, 0, 942, 860,
854, 2554, 835, 1309, 3925, 1310, 763, 3925, 1353, 2750,
2796, 2823, 1570, 2835, 2847, 2646, 2857, 709, 660, 578,
2505, 559, 520, 2199, 474, 377, 2869, 0, 2602, 1355,
3925, 1470, 1495, 2881, 2893, 2905, 2915, 2925, 2935, 326,
0, 208, 1530, 3925, 128, 1552, 3925, 2947, 1571, 2959,
2971, 2983, 3925, 2989, 2999, 2760, 3925, 3020, 3057, 3094,
59, 3131, 3009, 3925, 3183, 3201, 3219, 3237, 3255, 3273,
3291, 3309, 3327, 3334, 747, 3352, 3370, 1582, 3388, 3406,
3424, 3442, 3460, 1724, 3478, 3496, 3503, 3511, 3529, 3547,
3554, 3562, 3569, 3576, 3583, 3591, 3598, 3605, 3612, 3620,
3629, 3636, 3643, 3650, 989, 1635, 3658, 3667, 3674, 3681,
3689, 3698, 3705, 3714, 1751, 1769, 3722, 3731, 1770, 1775,
3738, 3747, 1817, 3755, 3764, 3782, 3800, 3818, 3825, 3834,
1707, 1723, 3842, 1920, 1833, 1879, 3849, 3858, 3865, 3872,
3881, 3899, 3906
} ;
static yyconst short int yy_def[714] =
{ 0,
634, 1, 1, 1, 635, 635, 636, 636, 637, 637,
638, 638, 634, 639, 634, 634, 634, 634, 640, 641,
634, 634, 642, 634, 643, 639, 26, 26, 644, 634,
634, 634, 32, 32, 32, 35, 35, 35, 35, 35,
35, 639, 26, 639, 634, 640, 32, 32, 35, 35,
35, 634, 645, 634, 646, 35, 35, 639, 647, 634,
647, 634, 647, 634, 640, 634, 648, 649, 634, 649,
634, 649, 634, 650, 651, 651, 651, 634, 634, 639,
639, 634, 634, 652, 634, 653, 634, 641, 654, 655,
641, 642, 642, 643, 656, 639, 639, 26, 644, 98,
98, 98, 98, 657, 658, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 639, 634, 639,
639, 634, 634, 634, 634, 634, 634, 652, 639, 98,
639, 639, 639, 634, 634, 634, 634, 646, 659, 639,
639, 647, 647, 634, 634, 634, 653, 634, 648, 649,
649, 634, 634, 649, 649, 651, 634, 651, 651, 634,
634, 652, 660, 634, 634, 655, 655, 634, 639, 169,
169, 98, 172, 661, 634, 662, 634, 106, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 639, 639, 634, 634, 634, 634, 634, 652, 639,
172, 639, 639, 639, 634, 639, 634, 660, 639, 639,
169, 169, 169, 639, 663, 664, 664, 217, 665, 664,
666, 177, 634, 223, 223, 634, 223, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
639, 639, 639, 639, 634, 634, 634, 634, 634, 652,
639, 639, 639, 639, 169, 169, 169, 634, 667, 667,
260, 667, 668, 669, 670, 634, 671, 226, 671, 634,
270, 671, 634, 273, 273, 634, 273, 634, 634, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 639,
639, 639, 639, 639, 634, 634, 634, 652, 639, 639,
639, 639, 639, 169, 169, 639, 672, 672, 673, 674,
634, 634, 675, 676, 634, 677, 677, 678, 276, 678,
634, 321, 678, 634, 324, 324, 634, 324, 35, 35,
35, 35, 35, 35, 35, 35, 35, 639, 639, 639,
639, 639, 634, 634, 652, 639, 639, 639, 639, 349,
349, 634, 679, 680, 311, 634, 356, 356, 634, 356,
634, 634, 675, 675, 634, 634, 681, 681, 682, 327,
682, 634, 372, 682, 634, 375, 375, 634, 375, 35,
35, 35, 634, 634, 35, 35, 35, 35, 634, 634,
634, 634, 639, 634, 634, 652, 639, 639, 639, 639,
639, 349, 349, 349, 634, 683, 634, 684, 359, 684,
634, 411, 684, 634, 414, 414, 634, 414, 685, 686,
634, 634, 687, 687, 688, 378, 688, 634, 428, 688,
634, 431, 431, 431, 35, 35, 35, 35, 35, 35,
35, 639, 634, 634, 652, 639, 639, 639, 639, 449,
449, 449, 634, 689, 690, 634, 691, 691, 692, 417,
692, 634, 462, 692, 634, 465, 465, 634, 465, 634,
634, 693, 693, 634, 634, 694, 694, 695, 695, 634,
480, 695, 35, 35, 35, 35, 35, 634, 634, 634,
634, 634, 634, 696, 652, 639, 697, 698, 639, 639,
449, 449, 449, 639, 634, 634, 689, 689, 634, 634,
699, 699, 700, 468, 700, 634, 516, 700, 634, 519,
519, 634, 519, 701, 702, 634, 634, 703, 703, 35,
634, 634, 35, 35, 35, 634, 696, 696, 634, 652,
639, 697, 697, 697, 697, 704, 697, 698, 698, 449,
449, 449, 705, 706, 634, 634, 707, 707, 708, 522,
708, 634, 562, 708, 634, 565, 565, 709, 634, 701,
701, 634, 634, 634, 634, 35, 35, 634, 652, 634,
634, 449, 639, 449, 449, 639, 634, 634, 705, 705,
634, 634, 710, 710, 711, 711, 711, 597, 711, 634,
634, 35, 712, 449, 449, 449, 634, 634, 634, 634,
713, 713, 634, 634, 712, 712, 634, 449, 639, 449,
449, 639, 634, 634, 634, 634, 634, 639, 639, 639,
639, 639, 639, 0, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634
} ;
static yyconst short int yy_nxt[3996] =
{ 0,
14, 15, 16, 17, 18, 19, 20, 21, 22, 14,
23, 24, 14, 14, 25, 26, 27, 28, 26, 26,
26, 26, 26, 26, 26, 29, 30, 31, 14, 32,
33, 33, 33, 34, 35, 35, 35, 35, 36, 35,
37, 35, 38, 39, 40, 41, 35, 35, 35, 35,
35, 42, 14, 43, 43, 43, 43, 43, 43, 14,
14, 14, 14, 14, 14, 14, 14, 44, 14, 14,
45, 407, 52, 110, 46, 115, 53, 107, 111, 107,
52, 107, 54, 409, 53, 55, 76, 16, 77, 78,
54, 89, 109, 55, 113, 15, 60, 61, 130, 62,
47, 48, 129, 132, 49, 62, 148, 119, 114, 56,
81, 90, 50, 57, 35, 51, 35, 56, 134, 62,
63, 57, 35, 85, 35, 15, 60, 61, 135, 62,
617, 76, 16, 77, 78, 62, 79, 91, 58, 155,
119, 152, 81, 95, 95, 64, 58, 95, 95, 62,
63, 120, 122, 158, 15, 16, 17, 69, 65, 153,
121, 148, 119, 70, 71, 72, 151, 95, 102, 102,
102, 102, 102, 103, 159, 64, 15, 16, 17, 73,
65, 79, 123, 124, 151, 199, 125, 81, 81, 160,
161, 96, 156, 193, 126, 175, 120, 127, 15, 16,
17, 69, 65, 157, 74, 141, 177, 70, 71, 72,
101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
89, 407, 157, 73, 80, 400, 66, 67, 67, 67,
67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
67, 67, 67, 67, 67, 15, 16, 17, 74, 65,
80, 81, 80, 80, 80, 134, 80, 80, 81, 81,
80, 192, 81, 206, 200, 135, 167, 139, 139, 201,
634, 139, 139, 158, 80, 80, 80, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 81, 148, 119,
634, 139, 81, 204, 253, 66, 67, 67, 67, 67,
67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
67, 67, 67, 67, 85, 140, 91, 173, 173, 173,
173, 173, 173, 157, 86, 148, 119, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 97, 81, 98,
98, 98, 98, 98, 98, 98, 98, 98, 98, 99,
81, 560, 81, 100, 100, 100, 100, 100, 183, 81,
144, 119, 145, 184, 146, 203, 202, 185, 145, 186,
146, 160, 161, 244, 81, 81, 175, 100, 100, 100,
100, 100, 100, 80, 146, 146, 81, 222, 254, 80,
634, 251, 80, 80, 81, 80, 80, 80, 106, 106,
106, 106, 106, 106, 106, 106, 106, 106, 99, 251,
146, 80, 106, 106, 106, 106, 106, 107, 107, 107,
107, 108, 107, 107, 107, 107, 107, 107, 107, 107,
107, 107, 107, 107, 81, 107, 100, 100, 100, 100,
100, 100, 80, 80, 80, 80, 80, 80, 80, 80,
80, 80, 80, 107, 107, 107, 107, 107, 107, 107,
107, 107, 107, 634, 209, 85, 278, 107, 107, 107,
107, 107, 159, 634, 81, 299, 107, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 407, 148, 119,
279, 80, 80, 80, 80, 80, 80, 118, 119, 80,
80, 80, 81, 80, 80, 266, 175, 80, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 250, 167,
157, 80, 80, 80, 80, 81, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 85, 88, 151, 88,
88, 292, 251, 88, 88, 560, 86, 88, 175, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 222,
281, 99, 88, 88, 92, 282, 92, 92, 92, 81,
92, 92, 81, 293, 92, 95, 95, 81, 294, 95,
95, 302, 150, 85, 514, 150, 150, 81, 92, 92,
92, 587, 150, 251, 81, 128, 85, 139, 139, 95,
301, 139, 139, 262, 262, 262, 147, 150, 81, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 81,
175, 139, 94, 96, 80, 80, 94, 81, 80, 80,
122, 222, 94, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 298, 398, 140, 94, 94, 80, 169,
170, 171, 169, 169, 169, 169, 169, 169, 169, 95,
123, 124, 341, 95, 125, 241, 242, 85, 243, 95,
266, 175, 126, 587, 278, 127, 212, 212, 212, 212,
212, 213, 268, 95, 95, 81, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 81, 99, 279, 81,
172, 172, 172, 172, 172, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 80, 80, 80, 80, 338,
346, 396, 587, 81, 172, 172, 172, 172, 172, 172,
178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
99, 300, 81, 383, 178, 178, 178, 178, 178, 81,
138, 81, 80, 80, 138, 87, 80, 80, 87, 393,
138, 271, 271, 271, 271, 271, 272, 384, 172, 172,
172, 172, 172, 172, 138, 138, 80, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 165, 165, 165,
165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
165, 165, 165, 165, 165, 165, 165, 166, 602, 166,
166, 81, 81, 166, 166, 340, 342, 166, 211, 211,
211, 211, 211, 211, 211, 211, 211, 211, 389, 442,
81, 166, 166, 166, 209, 348, 210, 210, 210, 210,
210, 210, 210, 210, 210, 210, 139, 81, 385, 175,
139, 290, 390, 386, 291, 85, 139, 227, 227, 227,
227, 227, 227, 227, 227, 227, 227, 81, 175, 496,
139, 139, 81, 80, 175, 214, 214, 214, 214, 214,
214, 214, 214, 214, 214, 81, 85, 391, 383, 214,
214, 214, 214, 214, 270, 270, 270, 270, 270, 270,
270, 270, 270, 270, 322, 322, 322, 322, 322, 323,
445, 392, 384, 214, 214, 214, 214, 214, 214, 216,
217, 218, 218, 218, 218, 218, 218, 218, 218, 219,
389, 391, 81, 220, 220, 220, 220, 220, 313, 314,
315, 313, 313, 313, 313, 313, 313, 313, 447, 80,
80, 80, 80, 345, 390, 392, 175, 220, 220, 220,
220, 220, 220, 175, 223, 224, 225, 223, 223, 223,
223, 223, 223, 223, 226, 488, 81, 490, 227, 227,
227, 227, 227, 277, 277, 277, 277, 277, 277, 277,
277, 277, 277, 448, 504, 504, 504, 339, 362, 489,
362, 491, 227, 227, 227, 227, 227, 227, 228, 228,
228, 228, 228, 228, 228, 228, 228, 228, 634, 175,
634, 175, 228, 228, 228, 228, 228, 81, 81, 175,
268, 266, 175, 317, 317, 317, 317, 317, 317, 347,
222, 538, 539, 268, 266, 175, 214, 214, 214, 214,
214, 214, 255, 256, 257, 255, 255, 255, 255, 255,
255, 255, 321, 321, 321, 321, 321, 321, 321, 321,
321, 321, 175, 266, 175, 302, 81, 303, 303, 303,
303, 303, 303, 268, 514, 268, 499, 397, 81, 260,
260, 261, 262, 262, 262, 262, 262, 262, 262, 219,
266, 175, 267, 267, 267, 267, 267, 267, 267, 267,
267, 267, 268, 81, 266, 175, 269, 269, 269, 269,
269, 460, 81, 85, 81, 634, 319, 328, 328, 328,
328, 328, 328, 328, 328, 328, 328, 409, 541, 587,
269, 269, 269, 269, 269, 269, 175, 273, 274, 275,
273, 273, 273, 273, 273, 273, 273, 276, 634, 175,
531, 277, 277, 277, 277, 277, 538, 539, 407, 81,
319, 266, 175, 368, 368, 368, 368, 368, 368, 399,
409, 175, 540, 319, 532, 277, 277, 277, 277, 277,
277, 634, 268, 269, 269, 269, 269, 269, 269, 269,
269, 269, 269, 302, 407, 303, 303, 303, 303, 303,
303, 303, 303, 303, 303, 302, 460, 304, 304, 304,
304, 304, 304, 304, 304, 304, 304, 302, 587, 305,
305, 305, 305, 305, 306, 303, 303, 303, 303, 308,
308, 308, 308, 308, 308, 308, 308, 308, 308, 219,
266, 175, 317, 317, 317, 317, 317, 317, 317, 317,
317, 317, 268, 488, 490, 531, 316, 316, 316, 316,
316, 372, 372, 372, 372, 372, 372, 372, 372, 372,
372, 373, 373, 373, 373, 373, 374, 489, 491, 532,
316, 316, 316, 316, 316, 316, 266, 175, 318, 318,
318, 318, 318, 318, 318, 318, 318, 318, 319, 574,
574, 600, 320, 320, 320, 320, 320, 402, 402, 402,
402, 402, 402, 402, 402, 402, 402, 403, 403, 403,
403, 403, 404, 575, 575, 601, 320, 320, 320, 320,
320, 320, 175, 324, 325, 326, 324, 324, 324, 324,
324, 324, 324, 327, 603, 85, 600, 328, 328, 328,
328, 328, 360, 360, 360, 360, 360, 360, 360, 360,
360, 360, 412, 412, 412, 412, 412, 413, 81, 580,
601, 328, 328, 328, 328, 328, 328, 634, 446, 320,
320, 320, 320, 320, 320, 320, 320, 320, 320, 349,
350, 351, 349, 349, 349, 349, 349, 349, 349, 411,
411, 411, 411, 411, 411, 411, 411, 411, 411, 419,
420, 421, 419, 419, 419, 419, 419, 419, 419, 429,
429, 429, 429, 429, 430, 81, 302, 634, 303, 303,
303, 303, 303, 303, 303, 303, 303, 303, 302, 460,
303, 303, 303, 303, 303, 303, 303, 303, 303, 303,
356, 357, 358, 356, 356, 356, 356, 356, 356, 356,
359, 613, 81, 85, 360, 360, 360, 360, 360, 361,
175, 362, 362, 362, 362, 362, 362, 80, 80, 80,
80, 319, 539, 266, 175, 614, 616, 617, 360, 360,
360, 360, 360, 360, 361, 319, 364, 364, 364, 364,
364, 365, 362, 362, 362, 362, 266, 175, 368, 368,
368, 368, 368, 368, 368, 368, 368, 368, 319, 266,
175, 613, 367, 367, 367, 367, 367, 579, 578, 499,
407, 370, 379, 379, 379, 379, 379, 379, 379, 379,
379, 379, 460, 616, 617, 614, 367, 367, 367, 367,
367, 367, 266, 175, 369, 369, 369, 369, 369, 369,
369, 369, 369, 369, 370, 634, 175, 81, 371, 371,
371, 371, 371, 582, 618, 175, 175, 370, 266, 175,
424, 424, 424, 424, 424, 424, 319, 370, 149, 149,
370, 577, 371, 371, 371, 371, 371, 371, 175, 375,
376, 377, 375, 375, 375, 375, 375, 375, 375, 378,
576, 81, 81, 379, 379, 379, 379, 379, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 463, 463,
463, 463, 463, 464, 363, 175, 363, 379, 379, 379,
379, 379, 379, 634, 175, 371, 371, 371, 371, 371,
371, 371, 371, 371, 371, 400, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 454, 455, 456, 454,
454, 454, 454, 454, 454, 454, 418, 418, 418, 418,
418, 418, 418, 418, 418, 418, 481, 481, 481, 481,
481, 482, 81, 407, 407, 408, 408, 408, 408, 408,
408, 408, 408, 408, 408, 409, 514, 569, 569, 410,
410, 410, 410, 410, 407, 175, 458, 458, 458, 458,
458, 458, 165, 570, 570, 165, 409, 517, 517, 517,
517, 517, 518, 410, 410, 410, 410, 410, 410, 414,
415, 416, 414, 414, 414, 414, 414, 414, 414, 417,
471, 460, 471, 418, 418, 418, 418, 418, 462, 462,
462, 462, 462, 462, 462, 462, 462, 462, 472, 506,
472, 506, 266, 175, 507, 409, 507, 418, 418, 418,
418, 418, 418, 634, 370, 410, 410, 410, 410, 410,
410, 410, 410, 410, 410, 266, 175, 424, 424, 424,
424, 424, 424, 424, 424, 424, 424, 370, 266, 175,
505, 423, 423, 423, 423, 423, 471, 505, 471, 634,
426, 434, 434, 434, 434, 434, 434, 434, 434, 434,
434, 514, 588, 505, 588, 423, 423, 423, 423, 423,
423, 266, 175, 425, 425, 425, 425, 425, 425, 425,
425, 425, 425, 426, 634, 175, 536, 427, 427, 427,
427, 427, 494, 85, 175, 407, 426, 266, 175, 477,
477, 477, 477, 477, 477, 370, 497, 514, 589, 426,
589, 427, 427, 427, 427, 427, 427, 175, 431, 432,
433, 431, 431, 431, 431, 431, 431, 431, 497, 535,
497, 498, 434, 434, 434, 434, 434, 480, 480, 480,
480, 480, 480, 480, 480, 480, 480, 495, 581, 534,
533, 581, 175, 530, 81, 470, 434, 434, 434, 434,
434, 434, 634, 426, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 449, 450, 451, 452, 449, 449,
449, 449, 449, 449, 501, 501, 501, 501, 501, 501,
501, 501, 501, 501, 502, 502, 502, 502, 502, 503,
504, 504, 504, 504, 563, 563, 563, 563, 563, 564,
81, 407, 407, 458, 458, 458, 458, 458, 458, 458,
458, 458, 458, 409, 560, 470, 470, 457, 457, 457,
457, 457, 469, 469, 469, 469, 469, 469, 469, 469,
469, 469, 470, 409, 471, 471, 471, 471, 471, 471,
505, 457, 457, 457, 457, 457, 457, 407, 505, 459,
459, 459, 459, 459, 459, 459, 459, 459, 459, 460,
497, 355, 81, 461, 461, 461, 461, 461, 407, 634,
512, 512, 512, 512, 512, 512, 493, 492, 81, 487,
460, 560, 497, 486, 497, 497, 485, 461, 461, 461,
461, 461, 461, 465, 466, 467, 465, 465, 465, 465,
465, 465, 465, 468, 484, 483, 470, 469, 469, 469,
469, 469, 516, 516, 516, 516, 516, 516, 516, 516,
516, 516, 470, 355, 264, 444, 266, 175, 443, 441,
440, 469, 469, 469, 469, 469, 469, 634, 426, 461,
461, 461, 461, 461, 461, 461, 461, 461, 461, 470,
439, 473, 473, 473, 473, 473, 474, 471, 471, 471,
471, 266, 175, 477, 477, 477, 477, 477, 477, 477,
477, 477, 477, 426, 438, 437, 436, 476, 476, 476,
476, 476, 524, 525, 526, 524, 524, 524, 524, 524,
524, 524, 266, 175, 529, 529, 529, 529, 529, 529,
435, 476, 476, 476, 476, 476, 476, 266, 175, 478,
478, 478, 478, 478, 478, 478, 478, 478, 478, 361,
361, 361, 407, 479, 479, 479, 479, 479, 543, 355,
544, 545, 546, 543, 560, 544, 545, 546, 505, 264,
506, 506, 506, 506, 506, 506, 219, 479, 479, 479,
479, 479, 479, 634, 395, 479, 479, 479, 479, 479,
479, 479, 479, 479, 479, 499, 175, 500, 500, 500,
500, 500, 500, 500, 500, 500, 500, 426, 547, 394,
81, 81, 81, 549, 553, 554, 555, 553, 553, 553,
553, 553, 553, 553, 81, 388, 387, 634, 382, 634,
634, 634, 381, 81, 505, 380, 508, 508, 508, 508,
508, 509, 506, 506, 506, 506, 407, 361, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 460, 361,
355, 264, 511, 511, 511, 511, 511, 523, 523, 523,
523, 523, 523, 523, 523, 523, 523, 547, 543, 219,
544, 545, 546, 219, 295, 344, 511, 511, 511, 511,
511, 511, 407, 343, 513, 513, 513, 513, 513, 513,
513, 513, 513, 513, 514, 337, 336, 335, 515, 515,
515, 515, 515, 407, 334, 558, 558, 558, 558, 558,
558, 333, 332, 331, 330, 514, 329, 311, 547, 264,
219, 307, 515, 515, 515, 515, 515, 515, 519, 520,
521, 519, 519, 519, 519, 519, 519, 519, 522, 219,
105, 295, 523, 523, 523, 523, 523, 562, 562, 562,
562, 562, 562, 562, 562, 562, 562, 634, 297, 544,
545, 546, 295, 296, 295, 289, 523, 523, 523, 523,
523, 523, 634, 288, 515, 515, 515, 515, 515, 515,
515, 515, 515, 515, 266, 175, 529, 529, 529, 529,
529, 529, 529, 529, 529, 529, 287, 286, 285, 284,
528, 528, 528, 528, 528, 283, 634, 547, 634, 634,
546, 634, 280, 634, 634, 634, 598, 598, 598, 598,
598, 599, 99, 219, 528, 528, 528, 528, 528, 528,
550, 551, 552, 550, 550, 550, 550, 550, 550, 550,
542, 542, 264, 219, 542, 548, 548, 105, 587, 548,
588, 588, 588, 588, 588, 588, 547, 85, 542, 542,
542, 549, 207, 548, 548, 548, 81, 407, 252, 558,
558, 558, 558, 558, 558, 558, 558, 558, 558, 514,
249, 248, 247, 557, 557, 557, 557, 557, 568, 568,
568, 568, 568, 568, 568, 568, 568, 568, 175, 569,
569, 569, 569, 569, 569, 246, 245, 557, 557, 557,
557, 557, 557, 407, 240, 559, 559, 559, 559, 559,
559, 559, 559, 559, 559, 560, 239, 238, 237, 561,
561, 561, 561, 561, 407, 236, 594, 594, 594, 594,
594, 594, 235, 234, 233, 407, 560, 612, 612, 612,
612, 612, 612, 561, 561, 561, 561, 561, 561, 565,
566, 567, 565, 565, 565, 565, 565, 565, 565, 232,
231, 230, 229, 568, 568, 568, 568, 568, 597, 597,
597, 597, 597, 597, 597, 597, 597, 597, 105, 582,
97, 583, 583, 583, 583, 583, 583, 568, 568, 568,
568, 568, 568, 634, 85, 561, 561, 561, 561, 561,
561, 561, 561, 561, 561, 175, 571, 571, 571, 571,
571, 572, 569, 569, 569, 569, 582, 81, 583, 583,
583, 583, 583, 583, 583, 583, 583, 583, 582, 85,
584, 584, 584, 584, 584, 584, 584, 584, 584, 584,
582, 207, 585, 585, 585, 585, 585, 586, 583, 583,
583, 583, 587, 156, 590, 590, 590, 590, 590, 591,
588, 588, 588, 588, 407, 157, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 560, 151, 151, 143,
593, 593, 593, 593, 593, 581, 581, 581, 581, 581,
581, 581, 581, 581, 581, 623, 623, 623, 623, 623,
623, 205, 137, 137, 593, 593, 593, 593, 593, 593,
407, 198, 595, 595, 595, 595, 595, 595, 595, 595,
595, 595, 197, 196, 195, 194, 596, 596, 596, 596,
596, 581, 581, 581, 581, 581, 581, 581, 581, 581,
581, 191, 190, 189, 188, 187, 182, 181, 180, 179,
596, 596, 596, 596, 596, 596, 80, 105, 604, 605,
606, 604, 604, 604, 604, 604, 604, 604, 582, 80,
583, 583, 583, 583, 583, 583, 583, 583, 583, 583,
582, 105, 583, 583, 583, 583, 583, 583, 583, 583,
583, 583, 607, 608, 609, 607, 607, 607, 607, 607,
607, 607, 407, 168, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 618, 93, 619, 619, 619, 619,
619, 619, 619, 619, 619, 619, 618, 164, 620, 620,
620, 620, 620, 620, 620, 620, 620, 620, 618, 85,
621, 621, 621, 621, 621, 622, 619, 619, 619, 619,
623, 623, 623, 623, 623, 623, 623, 623, 623, 623,
624, 624, 624, 624, 624, 624, 624, 624, 624, 624,
625, 625, 625, 625, 625, 626, 623, 623, 623, 623,
80, 83, 628, 629, 630, 628, 628, 628, 628, 628,
628, 628, 618, 82, 619, 619, 619, 619, 619, 619,
619, 619, 619, 619, 618, 81, 619, 619, 619, 619,
619, 619, 619, 619, 619, 619, 618, 157, 619, 619,
619, 619, 619, 619, 623, 623, 623, 623, 623, 623,
623, 623, 623, 623, 623, 623, 623, 623, 623, 623,
623, 623, 623, 623, 631, 631, 631, 631, 631, 631,
151, 143, 113, 111, 81, 631, 631, 631, 631, 631,
631, 631, 631, 631, 631, 137, 136, 133, 131, 117,
116, 115, 112, 107, 105, 93, 83, 82, 81, 634,
81, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 81, 628, 628, 628, 628, 628, 628, 628, 628,
628, 628, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 81, 632,
632, 632, 632, 632, 633, 631, 631, 631, 631, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 81, 631, 631, 631, 631,
631, 631, 631, 631, 631, 631, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 81, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 68,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 80, 634, 634, 634, 634,
634, 634, 634, 80, 80, 80, 80, 634, 634, 80,
80, 80, 80, 84, 84, 84, 84, 84, 84, 84,
84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
84, 88, 634, 634, 634, 634, 88, 634, 634, 88,
88, 88, 88, 88, 634, 88, 88, 88, 88, 92,
634, 634, 634, 634, 634, 634, 634, 92, 92, 92,
92, 634, 634, 92, 92, 92, 92, 94, 634, 634,
94, 94, 634, 94, 634, 94, 94, 94, 94, 634,
634, 94, 94, 94, 94, 104, 104, 634, 104, 634,
634, 104, 138, 634, 634, 138, 138, 634, 138, 634,
138, 138, 138, 138, 634, 634, 138, 138, 138, 138,
142, 634, 634, 142, 142, 634, 142, 634, 142, 142,
142, 142, 634, 142, 142, 634, 142, 142, 150, 634,
634, 150, 634, 634, 150, 634, 150, 150, 150, 150,
150, 634, 150, 150, 150, 150, 154, 154, 154, 154,
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 156, 156, 634, 156, 634, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
163, 163, 634, 163, 163, 163, 163, 163, 163, 163,
163, 163, 163, 163, 163, 163, 163, 163, 166, 634,
634, 634, 634, 166, 634, 634, 166, 166, 166, 166,
634, 634, 166, 166, 166, 166, 95, 634, 634, 95,
95, 634, 95, 634, 95, 95, 95, 95, 634, 634,
95, 95, 95, 95, 174, 174, 634, 174, 634, 634,
174, 176, 176, 176, 634, 176, 634, 634, 176, 139,
634, 634, 139, 139, 634, 139, 634, 139, 139, 139,
139, 634, 634, 139, 139, 139, 139, 208, 208, 208,
208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
208, 208, 208, 208, 208, 215, 215, 634, 215, 634,
634, 215, 221, 221, 221, 634, 221, 634, 634, 221,
258, 258, 634, 258, 634, 634, 258, 259, 259, 634,
259, 634, 634, 259, 263, 263, 634, 263, 634, 634,
263, 265, 265, 265, 634, 265, 634, 634, 265, 307,
307, 634, 307, 634, 634, 307, 309, 309, 634, 309,
634, 634, 309, 310, 310, 634, 310, 634, 634, 310,
312, 312, 312, 634, 312, 634, 634, 312, 316, 316,
316, 316, 634, 316, 634, 634, 316, 352, 352, 634,
352, 634, 634, 352, 353, 353, 634, 353, 634, 634,
353, 354, 354, 634, 354, 634, 634, 354, 366, 366,
366, 634, 366, 634, 634, 366, 367, 367, 367, 367,
634, 367, 634, 634, 367, 405, 405, 634, 405, 634,
634, 405, 406, 406, 634, 406, 634, 634, 406, 422,
422, 422, 634, 422, 634, 634, 422, 423, 423, 423,
423, 634, 423, 634, 634, 423, 453, 453, 634, 453,
634, 634, 453, 457, 634, 457, 457, 634, 457, 634,
634, 457, 475, 475, 475, 634, 475, 634, 634, 475,
476, 476, 476, 476, 634, 476, 634, 634, 476, 510,
510, 634, 510, 634, 634, 510, 511, 634, 511, 511,
634, 511, 634, 634, 511, 527, 527, 527, 634, 527,
634, 634, 527, 528, 528, 528, 634, 634, 528, 634,
634, 528, 537, 537, 537, 537, 537, 537, 537, 537,
537, 537, 537, 537, 537, 537, 537, 537, 537, 537,
542, 542, 634, 542, 542, 542, 634, 634, 542, 542,
542, 542, 634, 634, 542, 542, 542, 542, 548, 548,
634, 548, 548, 548, 634, 634, 548, 548, 548, 548,
634, 634, 548, 548, 548, 548, 556, 556, 634, 556,
634, 634, 556, 557, 634, 557, 557, 634, 557, 634,
634, 557, 573, 573, 634, 634, 573, 634, 634, 573,
592, 592, 634, 592, 634, 634, 592, 593, 634, 593,
593, 634, 593, 634, 634, 593, 596, 634, 634, 596,
634, 634, 596, 610, 610, 634, 610, 634, 634, 610,
611, 634, 611, 634, 634, 611, 634, 634, 611, 615,
615, 615, 615, 615, 615, 615, 615, 615, 615, 615,
615, 615, 615, 615, 615, 615, 615, 627, 634, 634,
627, 634, 634, 627, 13, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634
} ;
static yyconst short int yy_chk[3996] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 408, 3, 36, 2, 50, 3, 47, 36, 48,
4, 34, 3, 408, 4, 3, 11, 11, 11, 11,
4, 20, 34, 4, 38, 5, 5, 5, 48, 5,
2, 2, 47, 50, 2, 5, 66, 66, 38, 3,
631, 20, 2, 3, 3, 2, 3, 4, 52, 5,
5, 4, 4, 128, 4, 6, 6, 6, 52, 6,
615, 12, 12, 12, 12, 6, 11, 20, 3, 74,
74, 70, 44, 25, 25, 5, 4, 25, 25, 6,
6, 44, 45, 76, 9, 9, 9, 9, 9, 72,
44, 144, 144, 9, 9, 9, 70, 25, 28, 28,
28, 28, 28, 28, 77, 6, 7, 7, 7, 9,
7, 12, 45, 45, 72, 128, 45, 58, 121, 79,
79, 25, 79, 121, 45, 105, 58, 45, 10, 10,
10, 10, 10, 76, 9, 58, 105, 10, 10, 10,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
90, 612, 77, 10, 130, 401, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 8, 8, 8, 10, 8,
81, 129, 81, 81, 81, 134, 81, 81, 141, 120,
81, 120, 401, 141, 129, 134, 90, 55, 55, 130,
88, 55, 55, 158, 81, 81, 81, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 133, 118, 118,
88, 55, 203, 133, 203, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 19, 55, 88, 103, 103, 103,
103, 103, 103, 158, 19, 148, 148, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 26, 118, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
131, 610, 132, 26, 26, 26, 26, 26, 112, 193,
64, 64, 64, 112, 64, 132, 131, 112, 64, 112,
64, 160, 160, 193, 206, 26, 176, 26, 26, 26,
26, 26, 26, 32, 64, 64, 200, 176, 206, 32,
596, 200, 32, 32, 204, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 204,
64, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 210, 199, 229, 35, 35, 35,
35, 35, 159, 166, 251, 251, 35, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 595, 155, 155,
229, 35, 35, 35, 35, 35, 35, 42, 42, 42,
42, 42, 210, 42, 42, 478, 478, 42, 101, 101,
101, 101, 101, 101, 101, 101, 101, 101, 199, 166,
159, 42, 42, 42, 43, 202, 43, 43, 43, 43,
43, 43, 43, 43, 43, 43, 46, 91, 155, 91,
91, 242, 202, 91, 91, 593, 46, 91, 221, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 221,
231, 214, 91, 91, 93, 231, 93, 93, 93, 242,
93, 93, 244, 243, 93, 94, 94, 253, 244, 94,
94, 303, 151, 250, 592, 151, 151, 214, 93, 93,
93, 590, 151, 253, 254, 46, 65, 138, 138, 94,
254, 138, 138, 218, 218, 218, 65, 151, 243, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 303,
265, 138, 96, 94, 96, 96, 96, 347, 96, 96,
122, 265, 96, 102, 102, 102, 102, 102, 102, 102,
102, 102, 102, 250, 347, 138, 96, 96, 96, 97,
97, 97, 97, 97, 97, 97, 97, 97, 97, 168,
122, 122, 293, 168, 122, 192, 192, 345, 192, 168,
267, 267, 122, 589, 278, 122, 171, 171, 171, 171,
171, 171, 267, 168, 168, 97, 98, 98, 98, 98,
98, 98, 98, 98, 98, 98, 293, 252, 278, 192,
98, 98, 98, 98, 98, 136, 136, 136, 136, 136,
136, 136, 136, 136, 136, 213, 213, 213, 213, 290,
299, 345, 588, 252, 98, 98, 98, 98, 98, 98,
106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
106, 252, 299, 332, 106, 106, 106, 106, 106, 342,
140, 290, 140, 140, 140, 645, 140, 140, 645, 342,
140, 225, 225, 225, 225, 225, 225, 332, 106, 106,
106, 106, 106, 106, 140, 140, 140, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 165, 165, 165,
165, 165, 165, 165, 165, 165, 165, 167, 577, 167,
167, 294, 393, 167, 167, 292, 294, 167, 170, 170,
170, 170, 170, 170, 170, 170, 170, 170, 336, 393,
301, 167, 167, 167, 169, 301, 169, 169, 169, 169,
169, 169, 169, 169, 169, 169, 205, 292, 333, 573,
205, 241, 336, 333, 241, 396, 205, 222, 222, 222,
222, 222, 222, 222, 222, 222, 222, 446, 571, 446,
205, 205, 169, 172, 570, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 241, 298, 337, 383, 172,
172, 172, 172, 172, 224, 224, 224, 224, 224, 224,
224, 224, 224, 224, 275, 275, 275, 275, 275, 275,
396, 337, 383, 172, 172, 172, 172, 172, 172, 175,
175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
389, 391, 398, 175, 175, 175, 175, 175, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 398, 404,
404, 404, 404, 298, 389, 391, 569, 175, 175, 175,
175, 175, 175, 177, 177, 177, 177, 177, 177, 177,
177, 177, 177, 177, 177, 440, 399, 441, 177, 177,
177, 177, 177, 268, 268, 268, 268, 268, 268, 268,
268, 268, 268, 399, 452, 452, 452, 291, 675, 440,
675, 441, 177, 177, 177, 177, 177, 177, 178, 178,
178, 178, 178, 178, 178, 178, 178, 178, 269, 269,
479, 479, 178, 178, 178, 178, 178, 291, 300, 312,
269, 272, 272, 272, 272, 272, 272, 272, 272, 300,
312, 494, 494, 272, 529, 529, 178, 178, 178, 178,
178, 178, 209, 209, 209, 209, 209, 209, 209, 209,
209, 209, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 316, 317, 317, 306, 346, 306, 306, 306,
306, 306, 306, 316, 557, 317, 500, 346, 209, 217,
217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
223, 223, 223, 223, 223, 223, 223, 223, 223, 223,
223, 223, 223, 306, 318, 318, 223, 223, 223, 223,
223, 556, 496, 495, 500, 410, 318, 319, 319, 319,
319, 319, 319, 319, 319, 319, 319, 410, 496, 554,
223, 223, 223, 223, 223, 223, 226, 226, 226, 226,
226, 226, 226, 226, 226, 226, 226, 226, 320, 320,
484, 226, 226, 226, 226, 226, 538, 538, 458, 348,
320, 323, 323, 323, 323, 323, 323, 323, 323, 348,
458, 366, 495, 323, 484, 226, 226, 226, 226, 226,
226, 227, 366, 227, 227, 227, 227, 227, 227, 227,
227, 227, 227, 255, 459, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 256, 459, 256, 256, 256,
256, 256, 256, 256, 256, 256, 256, 257, 553, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 260,
260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
270, 270, 270, 488, 490, 531, 270, 270, 270, 270,
270, 325, 325, 325, 325, 325, 325, 325, 325, 325,
325, 326, 326, 326, 326, 326, 326, 488, 490, 531,
270, 270, 270, 270, 270, 270, 273, 273, 273, 273,
273, 273, 273, 273, 273, 273, 273, 273, 273, 533,
574, 576, 273, 273, 273, 273, 273, 350, 350, 350,
350, 350, 350, 350, 350, 350, 350, 351, 351, 351,
351, 351, 351, 533, 574, 576, 273, 273, 273, 273,
273, 273, 276, 276, 276, 276, 276, 276, 276, 276,
276, 276, 276, 276, 579, 579, 600, 276, 276, 276,
276, 276, 355, 355, 355, 355, 355, 355, 355, 355,
355, 355, 358, 358, 358, 358, 358, 358, 397, 546,
600, 276, 276, 276, 276, 276, 276, 277, 397, 277,
277, 277, 277, 277, 277, 277, 277, 277, 277, 302,
302, 302, 302, 302, 302, 302, 302, 302, 302, 357,
357, 357, 357, 357, 357, 357, 357, 357, 357, 361,
361, 361, 361, 361, 361, 361, 361, 361, 361, 377,
377, 377, 377, 377, 377, 302, 304, 461, 304, 304,
304, 304, 304, 304, 304, 304, 304, 304, 305, 461,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 602, 541, 540, 311, 311, 311, 311, 311, 365,
367, 365, 365, 365, 365, 365, 365, 503, 503, 503,
503, 367, 537, 368, 368, 602, 603, 603, 311, 311,
311, 311, 311, 311, 315, 368, 315, 315, 315, 315,
315, 315, 315, 315, 315, 315, 321, 321, 321, 321,
321, 321, 321, 321, 321, 321, 321, 321, 321, 369,
369, 613, 321, 321, 321, 321, 321, 540, 536, 504,
512, 369, 370, 370, 370, 370, 370, 370, 370, 370,
370, 370, 512, 616, 616, 613, 321, 321, 321, 321,
321, 321, 324, 324, 324, 324, 324, 324, 324, 324,
324, 324, 324, 324, 324, 371, 371, 504, 324, 324,
324, 324, 324, 583, 619, 422, 423, 371, 374, 374,
374, 374, 374, 374, 374, 374, 422, 423, 648, 648,
374, 535, 324, 324, 324, 324, 324, 324, 327, 327,
327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
534, 583, 619, 327, 327, 327, 327, 327, 376, 376,
376, 376, 376, 376, 376, 376, 376, 376, 416, 416,
416, 416, 416, 416, 676, 528, 676, 327, 327, 327,
327, 327, 327, 328, 525, 328, 328, 328, 328, 328,
328, 328, 328, 328, 328, 349, 349, 349, 349, 349,
349, 349, 349, 349, 349, 349, 407, 407, 407, 407,
407, 407, 407, 407, 407, 407, 409, 409, 409, 409,
409, 409, 409, 409, 409, 409, 433, 433, 433, 433,
433, 433, 349, 356, 513, 356, 356, 356, 356, 356,
356, 356, 356, 356, 356, 356, 513, 701, 701, 356,
356, 356, 356, 356, 413, 524, 413, 413, 413, 413,
413, 413, 654, 702, 702, 654, 413, 467, 467, 467,
467, 467, 467, 356, 356, 356, 356, 356, 356, 359,
359, 359, 359, 359, 359, 359, 359, 359, 359, 359,
685, 511, 685, 359, 359, 359, 359, 359, 415, 415,
415, 415, 415, 415, 415, 415, 415, 415, 686, 689,
686, 689, 424, 424, 690, 510, 690, 359, 359, 359,
359, 359, 359, 360, 424, 360, 360, 360, 360, 360,
360, 360, 360, 360, 360, 372, 372, 372, 372, 372,
372, 372, 372, 372, 372, 372, 372, 372, 425, 425,
508, 372, 372, 372, 372, 372, 693, 507, 693, 515,
425, 426, 426, 426, 426, 426, 426, 426, 426, 426,
426, 515, 705, 506, 705, 372, 372, 372, 372, 372,
372, 375, 375, 375, 375, 375, 375, 375, 375, 375,
375, 375, 375, 375, 427, 427, 492, 375, 375, 375,
375, 375, 445, 445, 475, 558, 427, 430, 430, 430,
430, 430, 430, 430, 430, 475, 447, 558, 706, 430,
706, 375, 375, 375, 375, 375, 375, 378, 378, 378,
378, 378, 378, 378, 378, 378, 378, 378, 447, 487,
447, 447, 378, 378, 378, 378, 378, 432, 432, 432,
432, 432, 432, 432, 432, 432, 432, 445, 704, 486,
485, 704, 476, 483, 447, 473, 378, 378, 378, 378,
378, 378, 379, 476, 379, 379, 379, 379, 379, 379,
379, 379, 379, 379, 400, 400, 400, 400, 400, 400,
400, 400, 400, 400, 450, 450, 450, 450, 450, 450,
450, 450, 450, 450, 451, 451, 451, 451, 451, 451,
451, 451, 451, 451, 521, 521, 521, 521, 521, 521,
400, 411, 559, 411, 411, 411, 411, 411, 411, 411,
411, 411, 411, 411, 559, 472, 471, 411, 411, 411,
411, 411, 460, 460, 460, 460, 460, 460, 460, 460,
460, 460, 474, 457, 474, 474, 474, 474, 474, 474,
455, 411, 411, 411, 411, 411, 411, 414, 454, 414,
414, 414, 414, 414, 414, 414, 414, 414, 414, 414,
493, 453, 448, 414, 414, 414, 414, 414, 464, 561,
464, 464, 464, 464, 464, 464, 444, 443, 442, 439,
464, 561, 493, 438, 493, 493, 437, 414, 414, 414,
414, 414, 414, 417, 417, 417, 417, 417, 417, 417,
417, 417, 417, 417, 436, 435, 420, 417, 417, 417,
417, 417, 466, 466, 466, 466, 466, 466, 466, 466,
466, 466, 419, 406, 405, 395, 477, 477, 394, 388,
387, 417, 417, 417, 417, 417, 417, 418, 477, 418,
418, 418, 418, 418, 418, 418, 418, 418, 418, 421,
386, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 385, 382, 381, 428, 428, 428,
428, 428, 470, 470, 470, 470, 470, 470, 470, 470,
470, 470, 482, 482, 482, 482, 482, 482, 482, 482,
380, 428, 428, 428, 428, 428, 428, 431, 431, 431,
431, 431, 431, 431, 431, 431, 431, 431, 431, 364,
363, 362, 594, 431, 431, 431, 431, 431, 497, 354,
497, 497, 497, 498, 594, 498, 498, 498, 509, 353,
509, 509, 509, 509, 509, 509, 352, 431, 431, 431,
431, 431, 431, 434, 344, 434, 434, 434, 434, 434,
434, 434, 434, 434, 434, 449, 527, 449, 449, 449,
449, 449, 449, 449, 449, 449, 449, 527, 497, 343,
341, 340, 339, 498, 505, 505, 505, 505, 505, 505,
505, 505, 505, 505, 338, 335, 334, 542, 331, 542,
542, 542, 330, 449, 456, 329, 456, 456, 456, 456,
456, 456, 456, 456, 456, 456, 462, 314, 462, 462,
462, 462, 462, 462, 462, 462, 462, 462, 462, 313,
310, 309, 462, 462, 462, 462, 462, 514, 514, 514,
514, 514, 514, 514, 514, 514, 514, 542, 543, 308,
543, 543, 543, 307, 297, 296, 462, 462, 462, 462,
462, 462, 465, 295, 465, 465, 465, 465, 465, 465,
465, 465, 465, 465, 465, 289, 287, 286, 465, 465,
465, 465, 465, 518, 285, 518, 518, 518, 518, 518,
518, 284, 283, 282, 281, 518, 280, 264, 543, 263,
262, 261, 465, 465, 465, 465, 465, 465, 468, 468,
468, 468, 468, 468, 468, 468, 468, 468, 468, 259,
258, 249, 468, 468, 468, 468, 468, 520, 520, 520,
520, 520, 520, 520, 520, 520, 520, 544, 248, 544,
544, 544, 247, 246, 245, 239, 468, 468, 468, 468,
468, 468, 469, 237, 469, 469, 469, 469, 469, 469,
469, 469, 469, 469, 480, 480, 480, 480, 480, 480,
480, 480, 480, 480, 480, 480, 236, 235, 234, 233,
480, 480, 480, 480, 480, 232, 545, 544, 545, 545,
545, 548, 230, 548, 548, 548, 567, 567, 567, 567,
567, 567, 228, 220, 480, 480, 480, 480, 480, 480,
499, 499, 499, 499, 499, 499, 499, 499, 499, 499,
547, 547, 219, 216, 547, 549, 549, 215, 591, 549,
591, 591, 591, 591, 591, 591, 545, 208, 547, 547,
547, 548, 207, 549, 549, 549, 499, 516, 201, 516,
516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
198, 197, 196, 516, 516, 516, 516, 516, 560, 560,
560, 560, 560, 560, 560, 560, 560, 560, 572, 572,
572, 572, 572, 572, 572, 195, 194, 516, 516, 516,
516, 516, 516, 519, 191, 519, 519, 519, 519, 519,
519, 519, 519, 519, 519, 519, 190, 189, 188, 519,
519, 519, 519, 519, 564, 187, 564, 564, 564, 564,
564, 564, 186, 185, 184, 599, 564, 599, 599, 599,
599, 599, 599, 519, 519, 519, 519, 519, 519, 522,
522, 522, 522, 522, 522, 522, 522, 522, 522, 183,
182, 181, 180, 522, 522, 522, 522, 522, 566, 566,
566, 566, 566, 566, 566, 566, 566, 566, 174, 586,
173, 586, 586, 586, 586, 586, 586, 522, 522, 522,
522, 522, 522, 523, 163, 523, 523, 523, 523, 523,
523, 523, 523, 523, 523, 526, 526, 526, 526, 526,
526, 526, 526, 526, 526, 526, 550, 586, 550, 550,
550, 550, 550, 550, 550, 550, 550, 550, 551, 162,
551, 551, 551, 551, 551, 551, 551, 551, 551, 551,
552, 161, 552, 552, 552, 552, 552, 552, 552, 552,
552, 552, 555, 157, 555, 555, 555, 555, 555, 555,
555, 555, 555, 555, 562, 156, 562, 562, 562, 562,
562, 562, 562, 562, 562, 562, 562, 154, 150, 143,
562, 562, 562, 562, 562, 580, 580, 580, 580, 580,
580, 580, 580, 580, 580, 626, 626, 626, 626, 626,
626, 139, 137, 135, 562, 562, 562, 562, 562, 562,
565, 127, 565, 565, 565, 565, 565, 565, 565, 565,
565, 565, 126, 125, 124, 123, 565, 565, 565, 565,
565, 581, 581, 581, 581, 581, 581, 581, 581, 581,
581, 117, 116, 115, 114, 113, 111, 110, 109, 108,
565, 565, 565, 565, 565, 565, 582, 104, 582, 582,
582, 582, 582, 582, 582, 582, 582, 582, 584, 100,
584, 584, 584, 584, 584, 584, 584, 584, 584, 584,
585, 99, 585, 585, 585, 585, 585, 585, 585, 585,
585, 585, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 597, 95, 597, 597, 597, 597, 597, 597,
597, 597, 597, 597, 604, 92, 604, 604, 604, 604,
604, 604, 604, 604, 604, 604, 605, 89, 605, 605,
605, 605, 605, 605, 605, 605, 605, 605, 606, 84,
606, 606, 606, 606, 606, 606, 606, 606, 606, 606,
607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
608, 608, 608, 608, 608, 608, 608, 608, 608, 608,
609, 609, 609, 609, 609, 609, 609, 609, 609, 609,
618, 83, 618, 618, 618, 618, 618, 618, 618, 618,
618, 618, 620, 82, 620, 620, 620, 620, 620, 620,
620, 620, 620, 620, 621, 80, 621, 621, 621, 621,
621, 621, 621, 621, 621, 621, 622, 75, 622, 622,
622, 622, 622, 622, 624, 624, 624, 624, 624, 624,
624, 624, 624, 624, 625, 625, 625, 625, 625, 625,
625, 625, 625, 625, 633, 633, 633, 633, 633, 633,
68, 61, 57, 56, 622, 628, 628, 628, 628, 628,
628, 628, 628, 628, 628, 54, 53, 51, 49, 41,
40, 39, 37, 33, 29, 23, 17, 15, 14, 13,
633, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 628, 629, 629, 629, 629, 629, 629, 629, 629,
629, 629, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 629, 630,
630, 630, 630, 630, 630, 630, 630, 630, 630, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 630, 632, 632, 632, 632,
632, 632, 632, 632, 632, 632, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 632, 635, 635, 635, 635, 635, 635, 635,
635, 635, 635, 635, 635, 635, 635, 635, 635, 635,
635, 636, 636, 636, 636, 636, 636, 636, 636, 636,
636, 636, 636, 636, 636, 636, 636, 636, 636, 637,
637, 637, 637, 637, 637, 637, 637, 637, 637, 637,
637, 637, 637, 637, 637, 637, 637, 638, 638, 638,
638, 638, 638, 638, 638, 638, 638, 638, 638, 638,
638, 638, 638, 638, 638, 639, 0, 0, 0, 0,
0, 0, 0, 639, 639, 639, 639, 0, 0, 639,
639, 639, 639, 640, 640, 640, 640, 640, 640, 640,
640, 640, 640, 640, 640, 640, 640, 640, 640, 640,
640, 641, 0, 0, 0, 0, 641, 0, 0, 641,
641, 641, 641, 641, 0, 641, 641, 641, 641, 642,
0, 0, 0, 0, 0, 0, 0, 642, 642, 642,
642, 0, 0, 642, 642, 642, 642, 643, 0, 0,
643, 643, 0, 643, 0, 643, 643, 643, 643, 0,
0, 643, 643, 643, 643, 644, 644, 0, 644, 0,
0, 644, 646, 0, 0, 646, 646, 0, 646, 0,
646, 646, 646, 646, 0, 0, 646, 646, 646, 646,
647, 0, 0, 647, 647, 0, 647, 0, 647, 647,
647, 647, 0, 647, 647, 0, 647, 647, 649, 0,
0, 649, 0, 0, 649, 0, 649, 649, 649, 649,
649, 0, 649, 649, 649, 649, 650, 650, 650, 650,
650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
650, 650, 650, 650, 651, 651, 0, 651, 0, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 652, 652, 652, 652, 652, 652, 652, 652,
652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
653, 653, 0, 653, 653, 653, 653, 653, 653, 653,
653, 653, 653, 653, 653, 653, 653, 653, 655, 0,
0, 0, 0, 655, 0, 0, 655, 655, 655, 655,
0, 0, 655, 655, 655, 655, 656, 0, 0, 656,
656, 0, 656, 0, 656, 656, 656, 656, 0, 0,
656, 656, 656, 656, 657, 657, 0, 657, 0, 0,
657, 658, 658, 658, 0, 658, 0, 0, 658, 659,
0, 0, 659, 659, 0, 659, 0, 659, 659, 659,
659, 0, 0, 659, 659, 659, 659, 660, 660, 660,
660, 660, 660, 660, 660, 660, 660, 660, 660, 660,
660, 660, 660, 660, 660, 661, 661, 0, 661, 0,
0, 661, 662, 662, 662, 0, 662, 0, 0, 662,
663, 663, 0, 663, 0, 0, 663, 664, 664, 0,
664, 0, 0, 664, 665, 665, 0, 665, 0, 0,
665, 666, 666, 666, 0, 666, 0, 0, 666, 667,
667, 0, 667, 0, 0, 667, 668, 668, 0, 668,
0, 0, 668, 669, 669, 0, 669, 0, 0, 669,
670, 670, 670, 0, 670, 0, 0, 670, 671, 671,
671, 671, 0, 671, 0, 0, 671, 672, 672, 0,
672, 0, 0, 672, 673, 673, 0, 673, 0, 0,
673, 674, 674, 0, 674, 0, 0, 674, 677, 677,
677, 0, 677, 0, 0, 677, 678, 678, 678, 678,
0, 678, 0, 0, 678, 679, 679, 0, 679, 0,
0, 679, 680, 680, 0, 680, 0, 0, 680, 681,
681, 681, 0, 681, 0, 0, 681, 682, 682, 682,
682, 0, 682, 0, 0, 682, 683, 683, 0, 683,
0, 0, 683, 684, 0, 684, 684, 0, 684, 0,
0, 684, 687, 687, 687, 0, 687, 0, 0, 687,
688, 688, 688, 688, 0, 688, 0, 0, 688, 691,
691, 0, 691, 0, 0, 691, 692, 0, 692, 692,
0, 692, 0, 0, 692, 694, 694, 694, 0, 694,
0, 0, 694, 695, 695, 695, 0, 0, 695, 0,
0, 695, 696, 696, 696, 696, 696, 696, 696, 696,
696, 696, 696, 696, 696, 696, 696, 696, 696, 696,
697, 697, 0, 697, 697, 697, 0, 0, 697, 697,
697, 697, 0, 0, 697, 697, 697, 697, 698, 698,
0, 698, 698, 698, 0, 0, 698, 698, 698, 698,
0, 0, 698, 698, 698, 698, 699, 699, 0, 699,
0, 0, 699, 700, 0, 700, 700, 0, 700, 0,
0, 700, 703, 703, 0, 0, 703, 0, 0, 703,
707, 707, 0, 707, 0, 0, 707, 708, 0, 708,
708, 0, 708, 0, 0, 708, 709, 0, 0, 709,
0, 0, 709, 710, 710, 0, 710, 0, 0, 710,
711, 0, 711, 0, 0, 711, 0, 0, 711, 712,
712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
712, 712, 712, 712, 712, 712, 712, 713, 0, 0,
713, 0, 0, 713, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634, 634, 634, 634, 634, 634,
634, 634, 634, 634, 634
} ;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "toke.l"
#define INITIAL 0
#line 2 "toke.l"
/*
* Copyright (c) 1996, 1998-2005, 2007-2012
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Sponsored in part by the Defense Advanced Research Projects
* Agency (DARPA) and Air Force Research Laboratory, Air Force
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
#ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif
#endif
#include <errno.h>
#include <ctype.h>
#include "sudoers.h"
#include "parse.h"
#include "toke.h"
#include <gram.h>
#include "lbuf.h"
#include "secure_path.h"
extern YYSTYPE sudoerslval;
extern bool parse_error;
extern bool sudoers_warnings;
int sudolineno;
int last_token;
char *sudoers;
/* Default sudoers path, mode and owner (may be set via sudo.conf) */
const char *sudoers_file = _PATH_SUDOERS;
mode_t sudoers_mode = SUDOERS_MODE;
uid_t sudoers_uid = SUDOERS_UID;
gid_t sudoers_gid = SUDOERS_GID;
static bool continued, sawspace;
static int prev_state;
static bool _push_include(char *, bool);
static bool pop_include(void);
static char *parse_include(char *);
int (*trace_print)(const char *msg) = sudoers_trace_print;
#define LEXRETURN(n) do { \
last_token = (n); \
return (n); \
} while (0)
#define ECHO ignore_result(fwrite(sudoerstext, sudoersleng, 1, sudoersout))
#define push_include(_p) (_push_include((_p), false))
#define push_includedir(_p) (_push_include((_p), true))
#define YY_NO_INPUT 1
#define YY_NO_UNPUT 1
#define GOTDEFS 1
#define GOTCMND 2
#define STARTDEFS 3
#define INDEFS 4
#define INSTR 5
#line 1613 "lex.sudoers.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap YY_PROTO(( void ));
#else
extern int yywrap YY_PROTO(( void ));
#endif
#endif
#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif
#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
#endif
#if defined(YY_STACK_USED) && YY_STACK_USED
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void yy_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
#endif
#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif
#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#ifdef __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines. This will fail
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
* or sizeof(void*) != sizeof(int).
*/
#endif
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( yy_current_buffer->yy_is_interactive ) \
{ \
int c = '*', n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
&& ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#endif
/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif
#define YY_RULE_SETUP \
if ( yyleng > 0 ) \
yy_current_buffer->yy_at_bol = \
(yytext[yyleng - 1] == '\n'); \
YY_USER_ACTION
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 132 "toke.l"
#line 1769 "lex.sudoers.c"
if ( yy_init )
{
yy_init = 0;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! yy_start )
yy_start = 1; /* first start state */
if ( ! yyin )
yyin = stdin;
if ( ! yyout )
yyout = stdout;
if ( ! yy_current_buffer )
yy_current_buffer =
yy_create_buffer( yyin, YY_BUF_SIZE );
yy_load_buffer_state();
}
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = yy_c_buf_p;
/* Support of yytext. */
*yy_cp = yy_hold_char;
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
yy_current_state = yy_start;
yy_current_state += YY_AT_BOL();
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 635 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 3925 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
{ /* have to back up */
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
goto yy_find_action;
case 1:
YY_RULE_SETUP
#line 133 "toke.l"
{
LEXTRACE(", ");
LEXRETURN(',');
} /* return ',' */
YY_BREAK
case 2:
YY_RULE_SETUP
#line 138 "toke.l"
BEGIN STARTDEFS;
YY_BREAK
case 3:
YY_RULE_SETUP
#line 140 "toke.l"
{
BEGIN INDEFS;
LEXTRACE("DEFVAR ");
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXRETURN(DEFVAR);
}
YY_BREAK
case 4:
YY_RULE_SETUP
#line 149 "toke.l"
{
BEGIN STARTDEFS;
LEXTRACE(", ");
LEXRETURN(',');
} /* return ',' */
YY_BREAK
case 5:
YY_RULE_SETUP
#line 155 "toke.l"
{
LEXTRACE("= ");
LEXRETURN('=');
} /* return '=' */
YY_BREAK
case 6:
YY_RULE_SETUP
#line 160 "toke.l"
{
LEXTRACE("+= ");
LEXRETURN('+');
} /* return '+' */
YY_BREAK
case 7:
YY_RULE_SETUP
#line 165 "toke.l"
{
LEXTRACE("-= ");
LEXRETURN('-');
} /* return '-' */
YY_BREAK
case 8:
YY_RULE_SETUP
#line 170 "toke.l"
{
LEXTRACE("BEGINSTR ");
sudoerslval.string = NULL;
prev_state = YY_START;
BEGIN INSTR;
}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 177 "toke.l"
{
LEXTRACE("WORD(2) ");
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXRETURN(WORD);
}
YY_BREAK
case 10:
YY_RULE_SETUP
#line 186 "toke.l"
{
/* Line continuation char followed by newline. */
sudolineno++;
continued = true;
}
YY_BREAK
case 11:
YY_RULE_SETUP
#line 192 "toke.l"
{
LEXTRACE("ENDSTR ");
BEGIN prev_state;
if (sudoerslval.string == NULL) {
LEXTRACE("ERROR "); /* empty string */
LEXRETURN(ERROR);
}
if (prev_state == INITIAL) {
switch (sudoerslval.string[0]) {
case '%':
if (sudoerslval.string[1] == '\0' ||
(sudoerslval.string[1] == ':' &&
sudoerslval.string[2] == '\0')) {
LEXTRACE("ERROR "); /* empty group */
LEXRETURN(ERROR);
}
LEXTRACE("USERGROUP ");
LEXRETURN(USERGROUP);
case '+':
if (sudoerslval.string[1] == '\0') {
LEXTRACE("ERROR "); /* empty netgroup */
LEXRETURN(ERROR);
}
LEXTRACE("NETGROUP ");
LEXRETURN(NETGROUP);
}
}
LEXTRACE("WORD(4) ");
LEXRETURN(WORD);
}
YY_BREAK
case 12:
YY_RULE_SETUP
#line 224 "toke.l"
{
LEXTRACE("BACKSLASH ");
if (!append(sudoerstext, sudoersleng))
yyterminate();
}
YY_BREAK
case 13:
YY_RULE_SETUP
#line 230 "toke.l"
{
LEXTRACE("STRBODY ");
if (!append(sudoerstext, sudoersleng))
yyterminate();
}
YY_BREAK
case 14:
YY_RULE_SETUP
#line 238 "toke.l"
{
/* quoted fnmatch glob char, pass verbatim */
LEXTRACE("QUOTEDCHAR ");
if (!fill_args(sudoerstext, 2, sawspace))
yyterminate();
sawspace = false;
}
YY_BREAK
case 15:
YY_RULE_SETUP
#line 246 "toke.l"
{
/* quoted sudoers special char, strip backslash */
LEXTRACE("QUOTEDCHAR ");
if (!fill_args(sudoerstext + 1, 1, sawspace))
yyterminate();
sawspace = false;
}
YY_BREAK
case 16:
YY_RULE_SETUP
#line 254 "toke.l"
{
BEGIN INITIAL;
yyless(0);
LEXRETURN(COMMAND);
} /* end of command line args */
YY_BREAK
case 17:
YY_RULE_SETUP
#line 260 "toke.l"
{
LEXTRACE("ARG ");
if (!fill_args(sudoerstext, sudoersleng, sawspace))
yyterminate();
sawspace = false;
} /* a command line arg */
YY_BREAK
case 18:
YY_RULE_SETUP
#line 268 "toke.l"
{
char *path;
if (continued) {
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
}
if ((path = parse_include(sudoerstext)) == NULL)
yyterminate();
LEXTRACE("INCLUDE\n");
/* Push current buffer and switch to include file */
if (!push_include(path))
yyterminate();
}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 286 "toke.l"
{
char *path;
if (continued) {
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
}
if ((path = parse_include(sudoerstext)) == NULL)
yyterminate();
LEXTRACE("INCLUDEDIR\n");
/*
* Push current buffer and switch to include file.
* We simply ignore empty directories.
*/
if (!push_includedir(path) && parse_error)
yyterminate();
}
YY_BREAK
case 20:
YY_RULE_SETUP
#line 307 "toke.l"
{
char deftype;
int n;
if (continued) {
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
}
for (n = 0; isblank((unsigned char)sudoerstext[n]); n++)
continue;
n += sizeof("Defaults") - 1;
if ((deftype = sudoerstext[n++]) != '\0') {
while (isblank((unsigned char)sudoerstext[n]))
n++;
}
BEGIN GOTDEFS;
switch (deftype) {
case ':':
yyless(n);
LEXTRACE("DEFAULTS_USER ");
LEXRETURN(DEFAULTS_USER);
case '>':
yyless(n);
LEXTRACE("DEFAULTS_RUNAS ");
LEXRETURN(DEFAULTS_RUNAS);
case '@':
yyless(n);
LEXTRACE("DEFAULTS_HOST ");
LEXRETURN(DEFAULTS_HOST);
case '!':
yyless(n);
LEXTRACE("DEFAULTS_CMND ");
LEXRETURN(DEFAULTS_CMND);
default:
LEXTRACE("DEFAULTS ");
LEXRETURN(DEFAULTS);
}
}
YY_BREAK
case 21:
YY_RULE_SETUP
#line 347 "toke.l"
{
int n;
if (continued) {
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
}
for (n = 0; isblank((unsigned char)sudoerstext[n]); n++)
continue;
switch (sudoerstext[n]) {
case 'H':
LEXTRACE("HOSTALIAS ");
LEXRETURN(HOSTALIAS);
case 'C':
LEXTRACE("CMNDALIAS ");
LEXRETURN(CMNDALIAS);
case 'U':
LEXTRACE("USERALIAS ");
LEXRETURN(USERALIAS);
case 'R':
LEXTRACE("RUNASALIAS ");
LEXRETURN(RUNASALIAS);
}
}
YY_BREAK
case 22:
YY_RULE_SETUP
#line 373 "toke.l"
{
/* cmnd does not require passwd for this user */
LEXTRACE("NOPASSWD ");
LEXRETURN(NOPASSWD);
}
YY_BREAK
case 23:
YY_RULE_SETUP
#line 379 "toke.l"
{
/* cmnd requires passwd for this user */
LEXTRACE("PASSWD ");
LEXRETURN(PASSWD);
}
YY_BREAK
case 24:
YY_RULE_SETUP
#line 385 "toke.l"
{
LEXTRACE("NOEXEC ");
LEXRETURN(NOEXEC);
}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 390 "toke.l"
{
LEXTRACE("EXEC ");
LEXRETURN(EXEC);
}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 395 "toke.l"
{
LEXTRACE("SETENV ");
LEXRETURN(SETENV);
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 400 "toke.l"
{
LEXTRACE("NOSETENV ");
LEXRETURN(NOSETENV);
}
YY_BREAK
case 28:
YY_RULE_SETUP
#line 405 "toke.l"
{
LEXTRACE("LOG_OUTPUT ");
LEXRETURN(LOG_OUTPUT);
}
YY_BREAK
case 29:
YY_RULE_SETUP
#line 410 "toke.l"
{
LEXTRACE("NOLOG_OUTPUT ");
LEXRETURN(NOLOG_OUTPUT);
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 415 "toke.l"
{
LEXTRACE("LOG_INPUT ");
LEXRETURN(LOG_INPUT);
}
YY_BREAK
case 31:
YY_RULE_SETUP
#line 420 "toke.l"
{
LEXTRACE("NOLOG_INPUT ");
LEXRETURN(NOLOG_INPUT);
}
YY_BREAK
case 32:
YY_RULE_SETUP
#line 425 "toke.l"
{
/* empty group or netgroup */
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
}
YY_BREAK
case 33:
YY_RULE_SETUP
#line 431 "toke.l"
{
/* netgroup */
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("NETGROUP ");
LEXRETURN(NETGROUP);
}
YY_BREAK
case 34:
YY_RULE_SETUP
#line 439 "toke.l"
{
/* group */
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("USERGROUP ");
LEXRETURN(USERGROUP);
}
YY_BREAK
case 35:
YY_RULE_SETUP
#line 447 "toke.l"
{
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("NTWKADDR ");
LEXRETURN(NTWKADDR);
}
YY_BREAK
case 36:
YY_RULE_SETUP
#line 454 "toke.l"
{
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("NTWKADDR ");
LEXRETURN(NTWKADDR);
}
YY_BREAK
case 37:
YY_RULE_SETUP
#line 461 "toke.l"
{
if (!ipv6_valid(sudoerstext)) {
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
}
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("NTWKADDR ");
LEXRETURN(NTWKADDR);
}
YY_BREAK
case 38:
YY_RULE_SETUP
#line 472 "toke.l"
{
if (!ipv6_valid(sudoerstext)) {
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
}
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("NTWKADDR ");
LEXRETURN(NTWKADDR);
}
YY_BREAK
case 39:
YY_RULE_SETUP
#line 483 "toke.l"
{
LEXTRACE("ALL ");
LEXRETURN(ALL);
}
YY_BREAK
case 40:
YY_RULE_SETUP
#line 489 "toke.l"
{
#ifdef HAVE_SELINUX
LEXTRACE("ROLE ");
LEXRETURN(ROLE);
#else
goto got_alias;
#endif
}
YY_BREAK
case 41:
YY_RULE_SETUP
#line 498 "toke.l"
{
#ifdef HAVE_SELINUX
LEXTRACE("TYPE ");
LEXRETURN(TYPE);
#else
goto got_alias;
#endif
}
YY_BREAK
case 42:
YY_RULE_SETUP
#line 506 "toke.l"
{
#ifdef HAVE_PRIV_SET
LEXTRACE("PRIVS ");
LEXRETURN(PRIVS);
#else
goto got_alias;
#endif
}
YY_BREAK
case 43:
YY_RULE_SETUP
#line 515 "toke.l"
{
#ifdef HAVE_PRIV_SET
LEXTRACE("LIMITPRIVS ");
LEXRETURN(LIMITPRIVS);
#else
goto got_alias;
#endif
}
YY_BREAK
case 44:
YY_RULE_SETUP
#line 524 "toke.l"
{
got_alias:
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("ALIAS ");
LEXRETURN(ALIAS);
}
YY_BREAK
case 45:
YY_RULE_SETUP
#line 532 "toke.l"
{
/* XXX - no way to specify digest for command */
/* no command args allowed for Defaults!/path */
if (!fill_cmnd(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("COMMAND ");
LEXRETURN(COMMAND);
}
YY_BREAK
case 46:
YY_RULE_SETUP
#line 541 "toke.l"
{
LEXTRACE("SHA224 ");
LEXRETURN(SHA224);
}
YY_BREAK
case 47:
YY_RULE_SETUP
#line 546 "toke.l"
{
LEXTRACE("SHA256 ");
LEXRETURN(SHA256);
}
YY_BREAK
case 48:
YY_RULE_SETUP
#line 551 "toke.l"
{
LEXTRACE("SHA384 ");
LEXRETURN(SHA384);
}
YY_BREAK
case 49:
YY_RULE_SETUP
#line 556 "toke.l"
{
LEXTRACE("SHA512 ");
LEXRETURN(SHA512);
}
YY_BREAK
case 50:
YY_RULE_SETUP
#line 561 "toke.l"
{
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
if (!fill_cmnd(sudoerstext, sudoersleng))
yyterminate();
} /* sudo -e */
YY_BREAK
case 51:
YY_RULE_SETUP
#line 568 "toke.l"
{
/* directories can't have args... */
if (sudoerstext[sudoersleng - 1] == '/') {
LEXTRACE("COMMAND ");
if (!fill_cmnd(sudoerstext, sudoersleng))
yyterminate();
LEXRETURN(COMMAND);
} else {
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
if (!fill_cmnd(sudoerstext, sudoersleng))
yyterminate();
}
} /* a pathname */
YY_BREAK
case 52:
YY_RULE_SETUP
#line 583 "toke.l"
{
LEXTRACE("BEGINSTR ");
sudoerslval.string = NULL;
prev_state = YY_START;
BEGIN INSTR;
}
YY_BREAK
case 53:
YY_RULE_SETUP
#line 590 "toke.l"
{
/* a word */
if (!fill(sudoerstext, sudoersleng))
yyterminate();
LEXTRACE("WORD(5) ");
LEXRETURN(WORD);
}
YY_BREAK
case 54:
YY_RULE_SETUP
#line 598 "toke.l"
{
LEXTRACE("( ");
LEXRETURN('(');
}
YY_BREAK
case 55:
YY_RULE_SETUP
#line 603 "toke.l"
{
LEXTRACE(") ");
LEXRETURN(')');
}
YY_BREAK
case 56:
YY_RULE_SETUP
#line 608 "toke.l"
{
LEXTRACE(", ");
LEXRETURN(',');
} /* return ',' */
YY_BREAK
case 57:
YY_RULE_SETUP
#line 613 "toke.l"
{
LEXTRACE("= ");
LEXRETURN('=');
} /* return '=' */
YY_BREAK
case 58:
YY_RULE_SETUP
#line 618 "toke.l"
{
LEXTRACE(": ");
LEXRETURN(':');
} /* return ':' */
YY_BREAK
case 59:
YY_RULE_SETUP
#line 623 "toke.l"
{
if (sudoersleng & 1) {
LEXTRACE("!");
LEXRETURN('!'); /* return '!' */
}
}
YY_BREAK
case 60:
YY_RULE_SETUP
#line 630 "toke.l"
{
if (YY_START == INSTR) {
LEXTRACE("ERROR ");
LEXRETURN(ERROR); /* line break in string */
}
BEGIN INITIAL;
sudolineno++;
continued = false;
LEXTRACE("\n");
LEXRETURN(COMMENT);
} /* return newline */
YY_BREAK
case 61:
YY_RULE_SETUP
#line 642 "toke.l"
{ /* throw away space/tabs */
sawspace = true; /* but remember for fill_args */
}
YY_BREAK
case 62:
YY_RULE_SETUP
#line 646 "toke.l"
{
sawspace = true; /* remember for fill_args */
sudolineno++;
continued = true;
} /* throw away EOL after \ */
YY_BREAK
case 63:
YY_RULE_SETUP
#line 652 "toke.l"
{
BEGIN INITIAL;
sudolineno++;
continued = false;
LEXTRACE("#\n");
LEXRETURN(COMMENT);
} /* comment, not uid/gid */
YY_BREAK
case 64:
YY_RULE_SETUP
#line 660 "toke.l"
{
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
} /* parse error */
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(GOTDEFS):
case YY_STATE_EOF(GOTCMND):
case YY_STATE_EOF(STARTDEFS):
case YY_STATE_EOF(INDEFS):
case YY_STATE_EOF(INSTR):
#line 665 "toke.l"
{
if (YY_START != INITIAL) {
BEGIN INITIAL;
LEXTRACE("ERROR ");
LEXRETURN(ERROR);
}
if (!pop_include())
yyterminate();
}
YY_BREAK
case 65:
YY_RULE_SETUP
#line 675 "toke.l"
ECHO;
YY_BREAK
#line 2600 "lex.sudoers.c"
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = yy_hold_char;
YY_RESTORE_YY_MORE_OFFSET
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
* yylex(). If so, then we have to assure
* consistency between yy_current_buffer and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
yy_n_chars = yy_current_buffer->yy_n_chars;
yy_current_buffer->yy_input_file = yyin;
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state();
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
*/
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = yytext_ptr + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
yy_cp = ++yy_c_buf_p;
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
yy_cp = yy_c_buf_p;
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
yy_did_buffer_switch_on_eof = 0;
if ( yywrap() )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* yytext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p =
yytext_ptr + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
yy_c_buf_p =
&yy_current_buffer->yy_ch_buf[yy_n_chars];
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer()
{
register char *dest = yy_current_buffer->yy_ch_buf;
register char *source = yytext_ptr;
register int number_to_move, i;
int ret_val;
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( yy_current_buffer->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
}
else
{
/* We matched some text prior to the EOB, first
* process it.
*/
return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
else
{
int num_to_read =
yy_current_buffer->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = yy_current_buffer;
int yy_c_buf_p_offset =
(int) (yy_c_buf_p - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
else
b->yy_buf_size *= 2;
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
yy_flex_realloc( (void *) b->yy_ch_buf,
b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = yy_current_buffer->yy_buf_size -
number_to_move - 1;
#endif
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
yy_n_chars, num_to_read );
yy_current_buffer->yy_n_chars = yy_n_chars;
}
if ( yy_n_chars == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
yyrestart( yyin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
yy_current_buffer->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
yy_n_chars += number_to_move;
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state()
{
register yy_state_type yy_current_state;
register char *yy_cp;
yy_current_state = yy_start;
yy_current_state += YY_AT_BOL();
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 635 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
{
register int yy_is_jam;
register char *yy_cp = yy_c_buf_p;
register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 635 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 634);
return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
{
register char *yy_cp = yy_c_buf_p;
/* undo effects of setting up yytext */
*yy_cp = yy_hold_char;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = yy_n_chars + 2;
register char *dest = &yy_current_buffer->yy_ch_buf[
yy_current_buffer->yy_buf_size + 2];
register char *source =
&yy_current_buffer->yy_ch_buf[number_to_move];
while ( source > yy_current_buffer->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
yy_current_buffer->yy_n_chars =
yy_n_chars = yy_current_buffer->yy_buf_size;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
yytext_ptr = yy_bp;
yy_hold_char = *yy_cp;
yy_c_buf_p = yy_cp;
}
#endif /* ifndef YY_NO_UNPUT */
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif
{
int c;
*yy_c_buf_p = yy_hold_char;
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* This was really a NUL. */
*yy_c_buf_p = '\0';
else
{ /* need more input */
int offset = yy_c_buf_p - yytext_ptr;
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
yyrestart( yyin );
/* fall through */
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
return EOF;
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
#else
return input();
#endif
}
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yytext_ptr + offset;
break;
}
}
}
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
*yy_c_buf_p = '\0'; /* preserve yytext */
yy_hold_char = *++yy_c_buf_p;
yy_current_buffer->yy_at_bol = (c == '\n');
return c;
}
#endif /* ifndef YY_NO_INPUT */
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
{
if ( ! yy_current_buffer )
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
yy_init_buffer( yy_current_buffer, input_file );
yy_load_buffer_state();
}
#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
{
if ( yy_current_buffer == new_buffer )
return;
if ( yy_current_buffer )
{
/* Flush out information for old buffer. */
*yy_c_buf_p = yy_hold_char;
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
yy_current_buffer->yy_n_chars = yy_n_chars;
}
yy_current_buffer = new_buffer;
yy_load_buffer_state();
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
* is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yy_did_buffer_switch_on_eof = 1;
}
#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif
{
yy_n_chars = yy_current_buffer->yy_n_chars;
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
yyin = yy_current_buffer->yy_input_file;
yy_hold_char = *yy_c_buf_p;
}
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
yy_init_buffer( b, file );
return b;
}
#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
if ( b == yy_current_buffer )
yy_current_buffer = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
yy_flex_free( (void *) b->yy_ch_buf );
yy_flex_free( (void *) b );
}
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
#include <unistd.h>
#endif
#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif
{
int oerrno = errno;
yy_flush_buffer( b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
#if defined(YY_ALWAYS_INTERACTIVE) && YY_ALWAYS_INTERACTIVE
b->yy_is_interactive = 1;
#else
#if defined(YY_NEVER_INTERACTIVE) && YY_NEVER_INTERACTIVE
b->yy_is_interactive = 0;
#else
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
errno = oerrno;
}
#ifdef YY_USE_PROTOS
void yy_flush_buffer( YY_BUFFER_STATE b )
#else
void yy_flush_buffer( b )
YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == yy_current_buffer )
yy_load_buffer_state();
}
#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
#else
YY_BUFFER_STATE yy_scan_buffer( base, size )
char *base;
yy_size_t size;
#endif
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
yy_switch_to_buffer( b );
return b;
}
#endif
#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_str;
#endif
{
int len;
for ( len = 0; yy_str[len]; ++len )
;
return yy_scan_bytes( yy_str, len );
}
#endif
#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
#else
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
yyconst char *bytes;
int len;
#endif
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = len + 2;
buf = (char *) yy_flex_alloc( n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
for ( i = 0; i < len; ++i )
buf[i] = bytes[i];
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
b = yy_scan_buffer( buf, n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
*/
b->yy_is_our_buffer = 1;
return b;
}
#endif
#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
static void yy_push_state( new_state )
int new_state;
#endif
{
if ( yy_start_stack_ptr >= yy_start_stack_depth )
{
yy_size_t new_size;
yy_start_stack_depth += YY_START_STACK_INCR;
new_size = yy_start_stack_depth * sizeof( int );
if ( ! yy_start_stack )
yy_start_stack = (int *) yy_flex_alloc( new_size );
else
yy_start_stack = (int *) yy_flex_realloc(
(void *) yy_start_stack, new_size );
if ( ! yy_start_stack )
YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
}
yy_start_stack[yy_start_stack_ptr++] = YY_START;
BEGIN(new_state);
}
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state()
{
if ( --yy_start_stack_ptr < 0 )
YY_FATAL_ERROR( "start-condition stack underflow" );
BEGIN(yy_start_stack[yy_start_stack_ptr]);
}
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state()
{
return yy_start_stack[yy_start_stack_ptr - 1];
}
#endif
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
#ifdef YY_USE_PROTOS
static void yy_fatal_error( yyconst char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
yytext[yyleng] = yy_hold_char; \
yy_c_buf_p = yytext + n; \
yy_hold_char = *yy_c_buf_p; \
*yy_c_buf_p = '\0'; \
yyleng = n; \
} \
while ( 0 )
/* Internal utility routines. */
#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
yyconst char *s2;
int n;
#endif
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int yy_flex_strlen( yyconst char *s )
#else
static int yy_flex_strlen( s )
yyconst char *s;
#endif
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
#else
static void *yy_flex_alloc( size )
yy_size_t size;
#endif
{
return (void *) malloc( size );
}
#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, yy_size_t size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
yy_size_t size;
#endif
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
}
#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
{
free( ptr );
}
#if defined(YY_MAIN) && YY_MAIN
int main()
{
yylex();
return 0;
}
#endif
#line 675 "toke.l"
struct path_list {
char *path;
struct path_list *next;
};
struct include_stack {
YY_BUFFER_STATE bs;
char *path;
struct path_list *more; /* more files in case of includedir */
int lineno;
bool keepopen;
};
static int
pl_compare(const void *v1, const void *v2)
{
const struct path_list * const *p1 = v1;
const struct path_list * const *p2 = v2;
return strcmp((*p1)->path, (*p2)->path);
}
static char *
switch_dir(struct include_stack *stack, char *dirpath)
{
DIR *dir;
int i, count = 0;
char *path = NULL;
struct dirent *dent;
struct stat sb;
struct path_list *pl, *first = NULL;
struct path_list **sorted = NULL;
debug_decl(switch_dir, SUDO_DEBUG_PARSER)
if (!(dir = opendir(dirpath))) {
if (errno != ENOENT) {
warning("%s", dirpath);
sudoerserror(NULL);
}
goto done;
}
while ((dent = readdir(dir))) {
/* Ignore files that end in '~' or have a '.' in them. */
if (dent->d_name[0] == '\0' || dent->d_name[NAMLEN(dent) - 1] == '~'
|| strchr(dent->d_name, '.') != NULL) {
continue;
}
if (asprintf(&path, "%s/%s", dirpath, dent->d_name) == -1) {
closedir(dir);
goto bad;
}
if (stat(path, &sb) != 0 || !S_ISREG(sb.st_mode)) {
efree(path);
path = NULL;
continue;
}
pl = malloc(sizeof(*pl));
if (pl == NULL)
goto bad;
pl->path = path;
pl->next = first;
first = pl;
path = NULL;
count++;
}
closedir(dir);
if (count == 0)
goto done;
/* Sort the list as an array. */
sorted = malloc(sizeof(*sorted) * count);
if (sorted == NULL)
goto bad;
pl = first;
for (i = 0; i < count; i++) {
sorted[i] = pl;
pl = pl->next;
}
qsort(sorted, count, sizeof(*sorted), pl_compare);
/* Apply sorting to the list. */
first = sorted[0];
sorted[count - 1]->next = NULL;
for (i = 1; i < count; i++)
sorted[i - 1]->next = sorted[i];
efree(sorted);
/* Pull out the first element for parsing, leave the rest for later. */
if (count) {
path = first->path;
pl = first->next;
efree(first);
stack->more = pl;
} else {
path = NULL;
}
done:
efree(dirpath);
debug_return_str(path);
bad:
while (first != NULL) {
pl = first;
first = pl->next;
efree(pl->path);
efree(pl);
}
efree(sorted);
efree(dirpath);
efree(path);
debug_return_str(NULL);
}
#define MAX_SUDOERS_DEPTH 128
#define SUDOERS_STACK_INCREMENT 16
static size_t istacksize, idepth;
static struct include_stack *istack;
static bool keepopen;
void
init_lexer(void)
{
struct path_list *pl;
debug_decl(init_lexer, SUDO_DEBUG_PARSER)
while (idepth) {
idepth--;
while ((pl = istack[idepth].more) != NULL) {
istack[idepth].more = pl->next;
efree(pl->path);
efree(pl);
}
efree(istack[idepth].path);
if (idepth && !istack[idepth].keepopen)
fclose(istack[idepth].bs->yy_input_file);
sudoers_delete_buffer(istack[idepth].bs);
}
efree(istack);
istack = NULL;
istacksize = idepth = 0;
sudolineno = 1;
keepopen = false;
sawspace = false;
continued = false;
prev_state = INITIAL;
debug_return;
}
static bool
_push_include(char *path, bool isdir)
{
struct path_list *pl;
FILE *fp;
debug_decl(_push_include, SUDO_DEBUG_PARSER)
/* push current state onto stack */
if (idepth >= istacksize) {
if (idepth > MAX_SUDOERS_DEPTH) {
sudoerserror(N_("too many levels of includes"));
debug_return_bool(false);
}
istacksize += SUDOERS_STACK_INCREMENT;
istack = (struct include_stack *) realloc(istack,
sizeof(*istack) * istacksize);
if (istack == NULL) {
warning(NULL);
sudoerserror(NULL);
debug_return_bool(false);
}
}
if (isdir) {
struct stat sb;
switch (sudo_secure_dir(path, sudoers_uid, sudoers_gid, &sb)) {
case SUDO_PATH_SECURE:
break;
case SUDO_PATH_MISSING:
debug_return_bool(false);
case SUDO_PATH_BAD_TYPE:
errno = ENOTDIR;
if (sudoers_warnings) {
warning("%s", path);
}
debug_return_bool(false);
case SUDO_PATH_WRONG_OWNER:
if (sudoers_warnings) {
warningx(_("%s is owned by uid %u, should be %u"),
path, (unsigned int) sb.st_uid,
(unsigned int) sudoers_uid);
}
debug_return_bool(false);
case SUDO_PATH_WORLD_WRITABLE:
if (sudoers_warnings) {
warningx(_("%s is world writable"), path);
}
debug_return_bool(false);
case SUDO_PATH_GROUP_WRITABLE:
if (sudoers_warnings) {
warningx(_("%s is owned by gid %u, should be %u"),
path, (unsigned int) sb.st_gid,
(unsigned int) sudoers_gid);
}
debug_return_bool(false);
default:
/* NOTREACHED */
debug_return_bool(false);
}
if (!(path = switch_dir(&istack[idepth], path))) {
/* switch_dir() called sudoerserror() for us */
debug_return_bool(false);
}
while ((fp = open_sudoers(path, false, &keepopen)) == NULL) {
/* Unable to open path in includedir, go to next one, if any. */
efree(path);
if ((pl = istack[idepth].more) == NULL)
debug_return_bool(false);
path = pl->path;
istack[idepth].more = pl->next;
efree(pl);
}
} else {
if ((fp = open_sudoers(path, true, &keepopen)) == NULL) {
/* The error was already printed by open_sudoers() */
sudoerserror(NULL);
debug_return_bool(false);
}
istack[idepth].more = NULL;
}
/* Push the old (current) file and open the new one. */
istack[idepth].path = sudoers; /* push old path */
istack[idepth].bs = YY_CURRENT_BUFFER;
istack[idepth].lineno = sudolineno;
istack[idepth].keepopen = keepopen;
idepth++;
sudolineno = 1;
sudoers = path;
sudoers_switch_to_buffer(sudoers_create_buffer(fp, YY_BUF_SIZE));
debug_return_bool(true);
}
static bool
pop_include(void)
{
struct path_list *pl;
FILE *fp;
debug_decl(pop_include, SUDO_DEBUG_PARSER)
if (idepth == 0)
debug_return_bool(false);
if (!keepopen)
fclose(YY_CURRENT_BUFFER->yy_input_file);
sudoers_delete_buffer(YY_CURRENT_BUFFER);
/* If we are in an include dir, move to the next file. */
while ((pl = istack[idepth - 1].more) != NULL) {
fp = open_sudoers(pl->path, false, &keepopen);
if (fp != NULL) {
istack[idepth - 1].more = pl->next;
efree(sudoers);
sudoers = pl->path;
sudolineno = 1;
sudoers_switch_to_buffer(sudoers_create_buffer(fp, YY_BUF_SIZE));
efree(pl);
break;
}
/* Unable to open path in include dir, go to next one. */
istack[idepth - 1].more = pl->next;
efree(pl->path);
efree(pl);
}
/* If no path list, just pop the last dir on the stack. */
if (pl == NULL) {
idepth--;
sudoers_switch_to_buffer(istack[idepth].bs);
efree(sudoers);
sudoers = istack[idepth].path;
sudolineno = istack[idepth].lineno;
keepopen = istack[idepth].keepopen;
}
debug_return_bool(true);
}
static char *
parse_include(char *base)
{
char *cp, *ep, *path, *pp;
int dirlen = 0, len = 0, subst = 0;
size_t shost_len = 0;
debug_decl(parse_include, SUDO_DEBUG_PARSER)
/* Pull out path from #include line. */
cp = base + sizeof("#include");
if (*cp == 'i')
cp += 3; /* includedir */
while (isblank((unsigned char) *cp))
cp++;
ep = cp;
while (*ep != '\0' && !isspace((unsigned char) *ep)) {
if (ep[0] == '%' && ep[1] == 'h') {
shost_len = strlen(user_shost);
len += shost_len - 2;
subst = 1;
}
ep++;
}
/* Relative paths are located in the same dir as the sudoers file. */
if (*cp != '/') {
char *dirend = strrchr(sudoers, '/');
if (dirend != NULL)
dirlen = (int)(dirend - sudoers) + 1;
}
/* Make a copy of the fully-qualified path and return it. */
len += (int)(ep - cp);
path = pp = malloc(len + dirlen + 1);
if (path == NULL) {
warning(NULL);
sudoerserror(NULL);
debug_return_str(NULL);
}
if (dirlen) {
memcpy(path, sudoers, dirlen);
pp += dirlen;
}
if (subst) {
/* substitute for %h */
while (cp < ep) {
if (cp[0] == '%' && cp[1] == 'h') {
memcpy(pp, user_shost, shost_len);
pp += shost_len;
cp += 2;
continue;
}
*pp++ = *cp++;
}
*pp = '\0';
} else {
memcpy(pp, cp, len);
pp[len] = '\0';
}
/* Push any excess characters (e.g. comment, newline) back to the lexer */
if (*ep != '\0')
yyless((int)(ep - base));
debug_return_str(path);
}
#ifdef TRACELEXER
int
sudoers_trace_print(const char *msg)
{
return fputs(msg, stderr);
}
#else
int
sudoers_trace_print(const char *msg)
{
static bool initialized;
static struct lbuf lbuf;
if (!initialized) {
initialized = true;
lbuf_init(&lbuf, NULL, 0, NULL, 0);
}
lbuf_append(&lbuf, "%s", msg);
/* XXX - assumes a final newline */
if (strchr(msg, '\n') != NULL)
{
sudo_debug_printf2(NULL, NULL, 0, SUDO_DEBUG_PARSER|SUDO_DEBUG_DEBUG,
"%s:%d %s", sudoers, sudolineno, lbuf.buf);
lbuf.len = 0;
}
return 0;
}
#endif /* TRACELEXER */