1 /* $OpenBSD: flex.skl,v 1.8 2004/02/09 11:38:31 espie Exp $ */
3 /* A lexical scanner generated by flex */
5 /* Scanner skeleton version:
6 * $Header: /home/cvs/courtesan/sudo/lex.yy.c,v 1.46 2004/05/17 22:10:20 millert Exp $
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
17 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
30 /* Use prototypes in function declarations. */
33 /* The "const" storage-class-modifier is valid. */
36 #else /* ! __cplusplus */
44 #endif /* ! __cplusplus */
63 #define YY_PROTO(proto) proto
65 #define YY_PROTO(proto) ()
68 /* Returned upon end-of-file. */
71 /* Promotes a possibly negative, possibly signed char to an unsigned
72 * integer for use as an array index. If the signed char is negative,
73 * we want to instead treat it as an 8-bit unsigned char, hence the
76 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
78 /* Enter a start condition. This macro really ought to take a parameter,
79 * but we do it the disgusting crufty way forced on us by the ()-less
80 * definition of BEGIN.
82 #define BEGIN yy_start = 1 + 2 *
84 /* Translate the current start state into a value that can be later handed
85 * to BEGIN to return to the state. The YYSTATE alias is for lex
88 #define YY_START ((yy_start - 1) / 2)
89 #define YYSTATE YY_START
91 /* Action number for EOF rule of a given start state. */
92 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
94 /* Special action meaning "start processing a new file". */
95 #define YY_NEW_FILE yyrestart( yyin )
97 #define YY_END_OF_BUFFER_CHAR 0
99 /* Size of default input buffer. */
100 #define YY_BUF_SIZE 16384
102 typedef struct yy_buffer_state *YY_BUFFER_STATE;
105 extern FILE *yyin, *yyout;
107 #define EOB_ACT_CONTINUE_SCAN 0
108 #define EOB_ACT_END_OF_FILE 1
109 #define EOB_ACT_LAST_MATCH 2
111 /* The funky do-while in the following #define is used to turn the definition
112 * int a single C statement (which needs a semi-colon terminator). This
113 * avoids problems with code like:
115 * if ( condition_holds )
118 * do_something_else();
120 * Prior to using the do-while the compiler would get upset at the
121 * "else" because it interpreted the "if" statement as being all
122 * done when it reached the ';' after the yyless() call.
125 /* Return all but the first 'n' matched characters back to the input stream. */
130 /* Undo effects of setting up yytext. */ \
131 *yy_cp = yy_hold_char; \
132 YY_RESTORE_YY_MORE_OFFSET \
133 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
134 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
138 #define unput(c) yyunput( c, yytext_ptr )
140 /* The following is because we cannot portably get our hands on size_t
141 * (without autoconf's help, which isn't available because we want
142 * flex-generated scanners to compile on their own).
144 typedef unsigned int yy_size_t;
147 struct yy_buffer_state
151 char *yy_ch_buf; /* input buffer */
152 char *yy_buf_pos; /* current position in input buffer */
154 /* Size of input buffer in bytes, not including room for EOB
157 yy_size_t yy_buf_size;
159 /* Number of characters read into yy_ch_buf, not including EOB
164 /* Whether we "own" the buffer - i.e., we know we created it,
165 * and can realloc() it to grow it, and should free() it to
168 int yy_is_our_buffer;
170 /* Whether this is an "interactive" input source; if so, and
171 * if we're using stdio for input, then we want to use getc()
172 * instead of fread(), to make sure we stop fetching input after
175 int yy_is_interactive;
177 /* Whether we're considered to be at the beginning of a line.
178 * If so, '^' rules will be active on the next match, otherwise
183 /* Whether to try to fill the input buffer when we reach the
188 int yy_buffer_status;
189 #define YY_BUFFER_NEW 0
190 #define YY_BUFFER_NORMAL 1
191 /* When an EOF's been seen but there's still some text to process
192 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
193 * shouldn't try reading from the input source any more. We might
194 * still have a bunch of tokens to match, though, because of
195 * possible backing-up.
197 * When we actually see the EOF, we change the status to "new"
198 * (via yyrestart()), so that the user can continue scanning by
199 * just pointing yyin at a new input file.
201 #define YY_BUFFER_EOF_PENDING 2
204 static YY_BUFFER_STATE yy_current_buffer = 0;
206 /* We provide macros for accessing buffer states in case in the
207 * future we want to put the buffer states in a more general
210 #define YY_CURRENT_BUFFER yy_current_buffer
213 /* yy_hold_char holds the character lost when yytext is formed. */
214 static char yy_hold_char;
216 static int yy_n_chars; /* number of characters read into yy_ch_buf */
221 /* Points to current character in buffer. */
222 static char *yy_c_buf_p = (char *) 0;
223 static int yy_init = 1; /* whether we need to initialize */
224 static int yy_start = 0; /* start state number */
226 /* Flag which is used to allow yywrap()'s to do buffer switches
227 * instead of setting up a fresh yyin. A bit of a hack ...
229 static int yy_did_buffer_switch_on_eof;
231 void yyrestart YY_PROTO(( FILE *input_file ));
233 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
234 void yy_load_buffer_state YY_PROTO(( void ));
235 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
236 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
238 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
239 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
241 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
242 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
243 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
245 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
246 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
247 static void yy_flex_free YY_PROTO(( void * ));
249 #define yy_new_buffer yy_create_buffer
251 #define yy_set_interactive(is_interactive) \
253 if ( ! yy_current_buffer ) \
254 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
255 yy_current_buffer->yy_is_interactive = is_interactive; \
258 #define yy_set_bol(at_bol) \
260 if ( ! yy_current_buffer ) \
261 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
262 yy_current_buffer->yy_at_bol = at_bol; \
265 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
267 typedef unsigned char YY_CHAR;
268 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
269 typedef int yy_state_type;
271 #define yytext_ptr yytext
273 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
274 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
275 static int yy_get_next_buffer YY_PROTO(( void ));
276 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
278 /* Done after the current pattern has been matched and before the
279 * corresponding action - sets up yytext.
281 #define YY_DO_BEFORE_ACTION \
282 yytext_ptr = yy_bp; \
283 yyleng = (int) (yy_cp - yy_bp); \
284 yy_hold_char = *yy_cp; \
288 #define YY_NUM_RULES 39
289 #define YY_END_OF_BUFFER 40
290 static yyconst short int yy_accept[336] =
292 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
293 0, 0, 40, 29, 35, 34, 33, 38, 29, 23,
294 38, 29, 30, 29, 29, 29, 29, 32, 31, 24,
295 24, 24, 24, 38, 29, 24, 24, 24, 24, 24,
296 25, 38, 25, 26, 25, 25, 25, 25, 25, 24,
297 24, 24, 24, 38, 25, 1, 12, 11, 12, 11,
298 11, 38, 38, 2, 8, 8, 8, 3, 8, 4,
299 38, 29, 0, 35, 33, 0, 37, 20, 0, 19,
300 0, 28, 28, 0, 29, 29, 29, 29, 29, 24,
301 24, 24, 24, 29, 36, 29, 29, 29, 29, 29,
303 29, 25, 0, 25, 20, 0, 19, 0, 25, 0,
304 25, 25, 25, 25, 25, 24, 24, 24, 24, 25,
305 25, 1, 12, 12, 10, 9, 10, 0, 2, 8,
306 0, 8, 0, 0, 5, 6, 8, 8, 0, 29,
307 29, 29, 24, 24, 24, 24, 29, 29, 29, 29,
308 29, 29, 25, 25, 25, 24, 24, 24, 24, 25,
309 7, 7, 0, 7, 8, 29, 29, 29, 29, 29,
310 24, 24, 24, 24, 29, 29, 29, 29, 25, 25,
311 25, 25, 25, 24, 24, 24, 24, 25, 7, 29,
312 29, 29, 0, 18, 24, 24, 24, 29, 29, 29,
314 25, 25, 25, 24, 24, 24, 25, 29, 29, 29,
315 29, 29, 24, 24, 24, 29, 29, 29, 25, 25,
316 25, 25, 25, 24, 24, 24, 25, 21, 21, 21,
317 0, 17, 24, 0, 16, 29, 29, 29, 21, 21,
318 21, 24, 25, 29, 21, 21, 21, 21, 24, 27,
319 29, 13, 25, 21, 21, 21, 21, 24, 25, 29,
320 22, 22, 22, 0, 15, 29, 13, 25, 22, 22,
321 22, 29, 29, 22, 22, 22, 22, 22, 14, 25,
322 25, 22, 22, 22, 22, 22, 29, 29, 29, 22,
323 22, 25, 25, 25, 22, 22, 29, 29, 29, 29,
325 29, 25, 25, 25, 25, 25, 29, 29, 29, 25,
326 25, 25, 29, 29, 29, 29, 29, 25, 25, 25,
327 25, 25, 21, 21, 21, 21, 21, 21, 21, 21,
331 static yyconst int yy_ec[256] =
333 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 2, 4, 5, 6, 1, 7, 1, 1, 8,
337 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
338 19, 20, 21, 22, 22, 22, 22, 23, 1, 1,
339 24, 25, 10, 25, 26, 27, 28, 29, 30, 27,
340 27, 31, 27, 27, 27, 27, 27, 32, 33, 34,
341 27, 35, 36, 27, 37, 27, 38, 39, 27, 27,
342 10, 40, 10, 1, 41, 1, 42, 43, 43, 44,
344 45, 46, 43, 43, 47, 43, 43, 48, 49, 50,
345 51, 43, 43, 52, 53, 54, 55, 43, 43, 43,
346 43, 43, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
356 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
357 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 static yyconst int yy_meta[56] =
365 1, 2, 2, 3, 1, 4, 1, 3, 3, 1,
366 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
367 1, 1, 5, 4, 3, 1, 1, 1, 1, 1,
368 1, 1, 1, 1, 1, 1, 1, 1, 1, 6,
369 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
373 static yyconst short int yy_base[355] =
375 0, 28, 65, 0, 56, 119, 120, 127, 166, 220,
376 274, 313, 1244, 1195, 1224, 1708, 1211, 1211, 1166, 1708,
377 1708, 1157, 1708, 133, 340, 158, 136, 1708, 1708, 380,
378 1153, 1150, 1148, 434, 94, 1116, 1111, 1096, 1074, 1065,
379 1077, 168, 1073, 1708, 1064, 157, 446, 182, 175, 486,
380 1049, 1046, 1044, 540, 107, 1059, 0, 1708, 1048, 0,
381 1708, 564, 58, 0, 992, 287, 124, 1708, 201, 1708,
382 133, 982, 603, 1016, 1003, 989, 1708, 951, 627, 935,
383 651, 296, 924, 675, 211, 131, 0, 0, 928, 0,
384 904, 129, 873, 241, 1708, 194, 88, 100, 195, 196,
386 197, 853, 699, 236, 844, 723, 835, 747, 298, 771,
387 312, 268, 0, 0, 844, 0, 827, 254, 812, 307,
388 251, 837, 0, 810, 237, 1708, 1708, 294, 0, 758,
389 339, 364, 254, 337, 1708, 1708, 753, 310, 449, 460,
390 537, 561, 764, 742, 752, 738, 295, 299, 205, 324,
391 261, 331, 575, 600, 624, 729, 699, 711, 700, 304,
392 694, 1708, 344, 666, 690, 699, 308, 744, 768, 783,
393 363, 703, 677, 671, 328, 334, 399, 339, 790, 430,
394 799, 815, 824, 380, 674, 652, 647, 405, 443, 833,
395 842, 851, 467, 1708, 652, 594, 571, 409, 445, 444,
397 860, 869, 878, 544, 514, 466, 412, 885, 531, 894,
398 910, 919, 486, 456, 487, 522, 550, 507, 926, 546,
399 935, 951, 960, 583, 437, 600, 561, 968, 806, 724,
400 601, 1708, 418, 611, 1708, 607, 585, 458, 994, 901,
401 942, 412, 608, 977, 649, 0, 0, 383, 635, 349,
402 614, 642, 984, 651, 0, 0, 350, 647, 280, 1009,
403 1019, 1028, 1037, 671, 1708, 657, 1708, 1046, 1055, 1064,
404 1073, 1080, 559, 1089, 1105, 1114, 1123, 1098, 243, 1132,
405 570, 1141, 1150, 1159, 1168, 1177, 1182, 1191, 1202, 1211,
406 751, 1220, 1229, 1238, 1247, 1003, 1254, 672, 1263, 1279,
408 1288, 1295, 712, 1304, 1320, 1329, 1338, 1347, 1356, 1365,
409 1374, 1383, 1392, 714, 1401, 1410, 1419, 1428, 736, 1437,
410 1446, 1455, 1464, 1473, 1482, 1491, 1500, 1509, 210, 1516,
411 1523, 165, 1529, 1541, 1708, 1581, 1588, 1595, 1602, 1609,
412 1616, 1623, 1630, 1637, 1644, 1651, 1658, 1665, 176, 1672,
413 1679, 1686, 1693, 1700
416 static yyconst short int yy_def[355] =
418 335, 1, 335, 3, 1, 1, 336, 336, 337, 337,
419 338, 338, 335, 339, 335, 335, 335, 340, 341, 335,
420 335, 342, 335, 343, 339, 25, 25, 335, 335, 335,
421 30, 30, 30, 339, 339, 30, 30, 30, 30, 30,
422 344, 335, 345, 335, 346, 347, 344, 47, 47, 335,
423 50, 50, 50, 344, 344, 335, 348, 335, 348, 348,
424 335, 335, 335, 349, 350, 351, 350, 335, 350, 335,
425 352, 339, 339, 335, 335, 340, 335, 341, 341, 342,
426 342, 343, 353, 339, 339, 339, 25, 25, 25, 30,
427 30, 30, 30, 339, 335, 339, 339, 339, 339, 339,
429 339, 344, 344, 335, 345, 345, 346, 346, 347, 344,
430 344, 344, 47, 47, 47, 50, 50, 50, 50, 344,
431 344, 335, 348, 348, 335, 335, 335, 335, 349, 350,
432 350, 351, 354, 351, 335, 335, 350, 350, 335, 25,
433 25, 25, 30, 30, 30, 30, 339, 339, 339, 339,
434 339, 339, 47, 47, 47, 50, 50, 50, 50, 344,
435 350, 335, 354, 351, 351, 339, 339, 25, 25, 25,
436 30, 30, 30, 30, 339, 339, 339, 339, 344, 344,
437 47, 47, 47, 50, 50, 50, 50, 344, 354, 25,
438 25, 25, 335, 335, 30, 30, 30, 339, 339, 339,
440 47, 47, 47, 50, 50, 50, 344, 339, 339, 25,
441 25, 25, 30, 30, 30, 339, 339, 339, 344, 344,
442 47, 47, 47, 50, 50, 50, 344, 339, 228, 228,
443 335, 335, 30, 335, 335, 339, 339, 339, 344, 239,
444 239, 50, 344, 339, 339, 228, 228, 228, 30, 339,
445 339, 339, 344, 344, 239, 239, 239, 50, 344, 25,
446 25, 25, 25, 335, 335, 339, 335, 47, 47, 47,
447 47, 339, 339, 25, 25, 25, 25, 339, 339, 47,
448 344, 47, 47, 47, 47, 344, 25, 25, 25, 25,
449 339, 47, 47, 47, 47, 344, 339, 339, 25, 25,
451 25, 344, 344, 47, 47, 47, 25, 25, 25, 47,
452 47, 47, 25, 339, 25, 25, 25, 47, 344, 47,
453 47, 47, 25, 25, 25, 47, 47, 47, 339, 339,
454 339, 344, 344, 344, 0, 335, 335, 335, 335, 335,
455 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
459 static yyconst short int yy_nxt[1764] =
461 14, 15, 16, 17, 14, 18, 19, 20, 21, 14,
462 22, 23, 14, 14, 24, 25, 26, 27, 25, 25,
463 25, 25, 28, 29, 21, 30, 30, 30, 30, 31,
464 30, 32, 30, 33, 30, 30, 30, 30, 30, 34,
465 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
466 14, 14, 35, 14, 14, 36, 37, 56, 38, 128,
467 95, 21, 39, 21, 40, 41, 15, 16, 17, 41,
468 42, 43, 21, 44, 41, 45, 23, 41, 41, 46,
469 47, 48, 49, 47, 47, 47, 47, 28, 29, 21,
470 50, 50, 50, 50, 51, 50, 52, 50, 53, 50,
472 50, 50, 50, 50, 54, 41, 41, 41, 41, 41,
473 41, 41, 41, 41, 41, 41, 41, 55, 41, 41,
474 56, 15, 58, 59, 21, 60, 21, 73, 15, 58,
475 59, 61, 60, 73, 138, 95, 83, 148, 61, 73,
476 83, 83, 61, 60, 85, 149, 103, 135, 96, 61,
477 60, 88, 88, 88, 88, 88, 89, 83, 144, 62,
478 83, 121, 145, 131, 83, 83, 62, 15, 16, 17,
479 73, 18, 84, 87, 87, 87, 87, 87, 87, 87,
480 104, 83, 129, 104, 104, 104, 104, 104, 104, 104,
481 114, 114, 114, 114, 114, 115, 110, 113, 113, 113,
483 113, 113, 113, 113, 103, 63, 64, 64, 64, 64,
484 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
485 64, 15, 16, 17, 136, 18, 140, 141, 142, 140,
486 140, 140, 140, 73, 73, 73, 73, 147, 128, 95,
487 131, 152, 128, 95, 73, 151, 177, 150, 104, 73,
488 73, 104, 104, 104, 104, 104, 104, 104, 162, 63,
489 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
490 64, 64, 64, 64, 64, 15, 16, 17, 66, 18,
491 73, 111, 73, 157, 67, 68, 69, 158, 133, 133,
492 103, 130, 133, 163, 160, 128, 95, 70, 133, 83,
494 73, 83, 178, 83, 83, 83, 83, 103, 128, 95,
495 133, 128, 95, 71, 15, 16, 17, 66, 18, 103,
496 83, 166, 83, 67, 68, 69, 134, 153, 154, 155,
497 153, 153, 153, 153, 73, 84, 70, 110, 73, 133,
498 130, 164, 176, 103, 130, 175, 103, 73, 189, 131,
499 130, 103, 71, 85, 188, 86, 86, 86, 86, 86,
500 86, 86, 130, 73, 193, 133, 133, 73, 161, 133,
501 73, 102, 198, 73, 199, 133, 165, 176, 73, 73,
502 72, 193, 176, 163, 72, 194, 72, 133, 73, 72,
503 72, 176, 72, 72, 72, 90, 90, 90, 90, 90,
505 90, 90, 194, 134, 72, 90, 90, 90, 90, 90,
506 90, 90, 90, 90, 90, 90, 90, 90, 90, 73,
507 90, 72, 72, 72, 72, 72, 72, 72, 72, 72,
508 72, 72, 72, 72, 72, 94, 95, 72, 73, 72,
509 258, 72, 72, 179, 103, 72, 249, 162, 73, 207,
510 83, 103, 216, 200, 83, 227, 72, 72, 72, 111,
511 83, 112, 112, 112, 112, 112, 112, 112, 193, 103,
512 217, 83, 83, 166, 242, 167, 167, 167, 167, 167,
513 167, 167, 163, 73, 73, 103, 102, 231, 234, 194,
514 102, 218, 102, 233, 226, 102, 102, 73, 102, 102,
516 102, 116, 116, 116, 116, 116, 116, 116, 232, 235,
517 252, 116, 116, 116, 116, 116, 116, 116, 116, 116,
518 116, 116, 116, 116, 116, 103, 116, 102, 102, 102,
519 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
520 102, 120, 95, 102, 208, 102, 73, 102, 102, 225,
521 166, 102, 168, 168, 168, 168, 168, 168, 168, 219,
522 238, 73, 102, 102, 102, 125, 95, 126, 236, 127,
523 73, 224, 272, 126, 166, 127, 169, 169, 169, 169,
524 169, 170, 167, 280, 231, 103, 127, 127, 179, 73,
525 180, 180, 180, 180, 180, 180, 180, 237, 73, 215,
527 103, 234, 231, 127, 72, 232, 72, 243, 72, 103,
528 72, 72, 234, 179, 72, 181, 181, 181, 181, 181,
529 181, 181, 235, 232, 73, 72, 72, 72, 78, 214,
530 78, 251, 78, 235, 78, 78, 264, 179, 78, 182,
531 182, 182, 182, 182, 183, 180, 73, 103, 264, 78,
532 78, 78, 80, 73, 80, 266, 80, 265, 80, 80,
533 250, 259, 80, 244, 267, 253, 267, 133, 133, 265,
534 161, 133, 264, 80, 80, 80, 82, 133, 72, 213,
535 82, 73, 72, 72, 206, 297, 82, 205, 73, 133,
536 103, 133, 133, 265, 164, 133, 73, 82, 82, 72,
538 102, 133, 102, 204, 102, 134, 102, 102, 197, 279,
539 102, 73, 196, 133, 190, 191, 192, 190, 190, 190,
540 190, 102, 102, 102, 105, 302, 105, 313, 105, 134,
541 105, 105, 195, 131, 105, 187, 186, 185, 73, 247,
542 247, 247, 247, 247, 248, 105, 105, 105, 107, 318,
543 107, 103, 107, 73, 107, 107, 184, 166, 107, 167,
544 167, 167, 167, 167, 167, 167, 291, 291, 291, 107,
545 107, 107, 109, 174, 102, 103, 109, 173, 102, 102,
546 172, 166, 109, 167, 167, 167, 167, 167, 167, 167,
547 73, 171, 131, 109, 109, 102, 166, 131, 167, 167,
549 167, 167, 167, 167, 72, 201, 202, 203, 201, 201,
550 201, 201, 179, 124, 180, 180, 180, 180, 180, 180,
551 180, 246, 246, 246, 246, 246, 246, 246, 179, 103,
552 180, 180, 180, 180, 180, 180, 180, 179, 122, 180,
553 180, 180, 180, 180, 180, 102, 208, 159, 209, 209,
554 209, 209, 209, 209, 209, 208, 156, 210, 210, 210,
555 210, 210, 210, 210, 208, 102, 211, 211, 211, 211,
556 211, 212, 209, 219, 108, 220, 220, 220, 220, 220,
557 220, 220, 219, 106, 221, 221, 221, 221, 221, 221,
558 221, 219, 103, 222, 222, 222, 222, 222, 223, 220,
560 228, 229, 230, 228, 228, 228, 228, 208, 146, 209,
561 209, 209, 209, 209, 209, 209, 255, 255, 255, 255,
562 255, 255, 255, 208, 73, 209, 209, 209, 209, 209,
563 209, 209, 208, 143, 209, 209, 209, 209, 209, 209,
564 72, 239, 240, 241, 239, 239, 239, 239, 219, 72,
565 220, 220, 220, 220, 220, 220, 220, 256, 256, 256,
566 256, 256, 257, 139, 219, 103, 220, 220, 220, 220,
567 220, 220, 220, 219, 81, 220, 220, 220, 220, 220,
568 220, 102, 244, 245, 245, 245, 245, 245, 245, 245,
569 79, 77, 260, 261, 262, 263, 260, 260, 260, 268,
571 269, 270, 271, 268, 268, 268, 75, 73, 253, 254,
572 254, 254, 254, 254, 254, 254, 73, 74, 296, 296,
573 296, 73, 272, 103, 273, 273, 273, 273, 273, 273,
574 273, 131, 272, 103, 274, 274, 274, 274, 274, 274,
575 274, 272, 103, 275, 275, 275, 275, 275, 276, 277,
576 272, 124, 278, 278, 278, 273, 273, 273, 273, 280,
577 122, 281, 281, 281, 281, 281, 281, 281, 280, 119,
578 282, 282, 282, 282, 282, 282, 282, 280, 118, 283,
579 283, 283, 283, 283, 284, 285, 280, 117, 286, 286,
580 286, 281, 281, 281, 281, 287, 288, 289, 287, 287,
582 287, 287, 272, 108, 277, 277, 277, 277, 277, 277,
583 277, 272, 106, 291, 291, 291, 103, 101, 272, 73,
584 277, 277, 277, 277, 277, 277, 277, 272, 100, 277,
585 277, 277, 277, 277, 277, 290, 272, 73, 290, 290,
586 290, 290, 290, 290, 290, 102, 99, 292, 293, 294,
587 292, 292, 292, 292, 280, 98, 285, 285, 285, 285,
588 285, 285, 285, 280, 97, 285, 285, 285, 285, 285,
589 285, 285, 280, 93, 285, 285, 285, 285, 285, 285,
590 295, 280, 92, 295, 295, 295, 295, 295, 295, 295,
591 280, 91, 296, 296, 296, 297, 81, 298, 298, 298,
593 298, 298, 298, 298, 297, 79, 299, 299, 299, 299,
594 299, 299, 299, 77, 75, 297, 103, 300, 300, 300,
595 300, 300, 301, 298, 72, 74, 290, 290, 290, 290,
596 290, 290, 290, 302, 73, 303, 303, 303, 303, 303,
597 303, 303, 302, 335, 304, 304, 304, 304, 304, 304,
598 304, 302, 335, 305, 305, 305, 305, 305, 306, 303,
599 102, 335, 295, 295, 295, 295, 295, 295, 295, 307,
600 308, 309, 307, 307, 307, 307, 297, 335, 298, 298,
601 298, 298, 298, 298, 298, 335, 335, 335, 335, 335,
602 335, 335, 297, 73, 298, 298, 298, 298, 298, 298,
604 298, 297, 335, 298, 298, 298, 298, 298, 298, 72,
605 310, 311, 312, 310, 310, 310, 310, 302, 335, 303,
606 303, 303, 303, 303, 303, 303, 335, 335, 335, 335,
607 335, 335, 335, 302, 103, 303, 303, 303, 303, 303,
608 303, 303, 302, 335, 303, 303, 303, 303, 303, 303,
609 102, 313, 335, 314, 314, 314, 314, 314, 314, 314,
610 313, 335, 315, 315, 315, 315, 315, 315, 315, 313,
611 335, 316, 316, 316, 316, 316, 317, 314, 318, 335,
612 319, 319, 319, 319, 319, 319, 319, 318, 335, 320,
613 320, 320, 320, 320, 320, 320, 318, 335, 321, 321,
615 321, 321, 321, 322, 319, 72, 335, 323, 324, 325,
616 323, 323, 323, 323, 313, 335, 314, 314, 314, 314,
617 314, 314, 314, 313, 335, 314, 314, 314, 314, 314,
618 314, 314, 313, 335, 314, 314, 314, 314, 314, 314,
619 72, 102, 335, 326, 327, 328, 326, 326, 326, 326,
620 318, 335, 319, 319, 319, 319, 319, 319, 319, 318,
621 335, 319, 319, 319, 319, 319, 319, 319, 318, 335,
622 319, 319, 319, 319, 319, 319, 102, 72, 335, 329,
623 329, 329, 329, 329, 329, 329, 72, 335, 323, 323,
624 323, 323, 323, 323, 323, 72, 335, 330, 330, 330,
626 330, 330, 331, 329, 102, 335, 332, 332, 332, 332,
627 332, 332, 332, 102, 335, 326, 326, 326, 326, 326,
628 326, 326, 102, 335, 333, 333, 333, 333, 333, 334,
629 332, 329, 329, 329, 329, 329, 329, 329, 329, 329,
630 329, 329, 329, 329, 332, 332, 332, 332, 332, 332,
631 332, 335, 335, 335, 335, 73, 332, 332, 332, 332,
632 332, 332, 73, 335, 335, 335, 335, 335, 103, 335,
633 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
634 103, 57, 57, 57, 57, 57, 57, 57, 21, 21,
635 21, 21, 21, 21, 21, 65, 65, 65, 65, 65,
637 65, 65, 72, 335, 335, 335, 335, 72, 72, 76,
638 76, 76, 76, 76, 76, 76, 78, 335, 335, 335,
639 335, 78, 78, 80, 335, 335, 335, 335, 80, 80,
640 82, 335, 82, 335, 335, 82, 82, 102, 335, 335,
641 335, 335, 102, 102, 105, 335, 335, 335, 335, 105,
642 105, 107, 335, 335, 335, 335, 107, 107, 109, 335,
643 109, 335, 335, 109, 109, 123, 335, 123, 123, 335,
644 335, 123, 130, 335, 130, 335, 130, 130, 130, 132,
645 132, 132, 132, 132, 132, 132, 137, 137, 137, 137,
646 137, 137, 137, 83, 335, 83, 335, 335, 83, 83,
648 133, 133, 133, 133, 133, 133, 133, 13, 335, 335,
649 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
650 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
651 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
652 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
653 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
657 static yyconst short int yy_chk[1764] =
659 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
660 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
661 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
662 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
663 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
664 1, 1, 1, 1, 1, 2, 2, 5, 2, 63,
665 63, 5, 2, 5, 2, 3, 3, 3, 3, 3,
666 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
667 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
668 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
670 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
671 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
672 6, 7, 7, 7, 6, 7, 6, 97, 8, 8,
673 8, 7, 8, 35, 71, 71, 24, 97, 8, 98,
674 24, 24, 7, 7, 86, 98, 55, 67, 35, 8,
675 8, 27, 27, 27, 27, 27, 27, 24, 92, 7,
676 46, 55, 92, 67, 46, 46, 8, 9, 9, 9,
677 86, 9, 24, 26, 26, 26, 26, 26, 26, 26,
678 42, 46, 349, 42, 42, 42, 42, 42, 42, 42,
679 49, 49, 49, 49, 49, 49, 46, 48, 48, 48,
681 48, 48, 48, 48, 332, 9, 9, 9, 9, 9,
682 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
683 9, 10, 10, 10, 69, 10, 85, 85, 85, 85,
684 85, 85, 85, 96, 99, 100, 101, 96, 125, 125,
685 69, 101, 94, 94, 149, 100, 149, 99, 104, 329,
686 85, 104, 104, 104, 104, 104, 104, 104, 133, 10,
687 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
688 10, 10, 10, 10, 10, 11, 11, 11, 11, 11,
689 94, 112, 279, 118, 11, 11, 11, 118, 66, 66,
690 121, 66, 66, 133, 121, 128, 128, 11, 66, 82,
692 151, 109, 151, 82, 82, 109, 109, 112, 120, 120,
693 66, 138, 138, 11, 12, 12, 12, 12, 12, 259,
694 82, 167, 109, 12, 12, 12, 66, 111, 111, 111,
695 111, 111, 111, 111, 147, 82, 12, 109, 148, 134,
696 131, 134, 148, 160, 131, 147, 120, 167, 163, 138,
697 131, 111, 12, 25, 160, 25, 25, 25, 25, 25,
698 25, 25, 131, 150, 171, 132, 132, 175, 132, 132,
699 152, 257, 175, 176, 176, 132, 134, 150, 178, 25,
700 30, 184, 152, 163, 30, 171, 30, 132, 250, 30,
701 30, 178, 30, 30, 30, 30, 30, 30, 30, 30,
703 30, 30, 184, 132, 248, 30, 30, 30, 30, 30,
704 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
705 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
706 30, 30, 30, 30, 30, 34, 34, 34, 177, 34,
707 242, 34, 34, 180, 188, 34, 233, 189, 198, 188,
708 139, 207, 198, 177, 139, 207, 34, 34, 34, 47,
709 139, 47, 47, 47, 47, 47, 47, 47, 193, 180,
710 199, 139, 139, 140, 225, 140, 140, 140, 140, 140,
711 140, 140, 189, 200, 199, 47, 50, 213, 215, 193,
712 50, 200, 50, 214, 206, 50, 50, 238, 50, 50,
714 50, 50, 50, 50, 50, 50, 50, 50, 213, 215,
715 238, 50, 50, 50, 50, 50, 50, 50, 50, 50,
716 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
717 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
718 50, 54, 54, 54, 209, 54, 218, 54, 54, 205,
719 141, 54, 141, 141, 141, 141, 141, 141, 141, 220,
720 218, 216, 54, 54, 54, 62, 62, 62, 216, 62,
721 209, 204, 273, 62, 142, 62, 142, 142, 142, 142,
722 142, 142, 142, 281, 224, 220, 62, 62, 153, 217,
723 153, 153, 153, 153, 153, 153, 153, 217, 273, 197,
725 227, 226, 231, 62, 73, 224, 73, 227, 73, 281,
726 73, 73, 234, 154, 73, 154, 154, 154, 154, 154,
727 154, 154, 226, 231, 237, 73, 73, 73, 79, 196,
728 79, 237, 79, 234, 79, 79, 249, 155, 79, 155,
729 155, 155, 155, 155, 155, 155, 236, 243, 258, 79,
730 79, 79, 81, 251, 81, 251, 81, 249, 81, 81,
731 236, 243, 81, 245, 252, 254, 252, 164, 164, 258,
732 164, 164, 264, 81, 81, 81, 84, 164, 84, 195,
733 84, 252, 84, 84, 187, 298, 84, 186, 245, 164,
734 254, 165, 165, 264, 165, 165, 266, 84, 84, 84,
736 103, 165, 103, 185, 103, 164, 103, 103, 174, 266,
737 103, 298, 173, 165, 166, 166, 166, 166, 166, 166,
738 166, 103, 103, 103, 106, 303, 106, 314, 106, 165,
739 106, 106, 172, 161, 106, 159, 158, 157, 166, 230,
740 230, 230, 230, 230, 230, 106, 106, 106, 108, 319,
741 108, 303, 108, 314, 108, 108, 156, 168, 108, 168,
742 168, 168, 168, 168, 168, 168, 291, 291, 291, 108,
743 108, 108, 110, 146, 110, 319, 110, 145, 110, 110,
744 144, 169, 110, 169, 169, 169, 169, 169, 169, 169,
745 291, 143, 137, 110, 110, 110, 170, 130, 170, 170,
747 170, 170, 170, 170, 170, 179, 179, 179, 179, 179,
748 179, 179, 181, 124, 181, 181, 181, 181, 181, 181,
749 181, 229, 229, 229, 229, 229, 229, 229, 182, 179,
750 182, 182, 182, 182, 182, 182, 182, 183, 122, 183,
751 183, 183, 183, 183, 183, 183, 190, 119, 190, 190,
752 190, 190, 190, 190, 190, 191, 117, 191, 191, 191,
753 191, 191, 191, 191, 192, 115, 192, 192, 192, 192,
754 192, 192, 192, 201, 107, 201, 201, 201, 201, 201,
755 201, 201, 202, 105, 202, 202, 202, 202, 202, 202,
756 202, 203, 102, 203, 203, 203, 203, 203, 203, 203,
758 208, 208, 208, 208, 208, 208, 208, 210, 93, 210,
759 210, 210, 210, 210, 210, 210, 240, 240, 240, 240,
760 240, 240, 240, 211, 208, 211, 211, 211, 211, 211,
761 211, 211, 212, 91, 212, 212, 212, 212, 212, 212,
762 212, 219, 219, 219, 219, 219, 219, 219, 221, 89,
763 221, 221, 221, 221, 221, 221, 221, 241, 241, 241,
764 241, 241, 241, 83, 222, 219, 222, 222, 222, 222,
765 222, 222, 222, 223, 80, 223, 223, 223, 223, 223,
766 223, 223, 228, 228, 228, 228, 228, 228, 228, 228,
767 78, 76, 244, 244, 244, 244, 244, 244, 244, 253,
769 253, 253, 253, 253, 253, 253, 75, 228, 239, 239,
770 239, 239, 239, 239, 239, 239, 244, 74, 296, 296,
771 296, 72, 260, 253, 260, 260, 260, 260, 260, 260,
772 260, 65, 261, 239, 261, 261, 261, 261, 261, 261,
773 261, 262, 296, 262, 262, 262, 262, 262, 262, 262,
774 263, 59, 263, 263, 263, 263, 263, 263, 263, 268,
775 56, 268, 268, 268, 268, 268, 268, 268, 269, 53,
776 269, 269, 269, 269, 269, 269, 269, 270, 52, 270,
777 270, 270, 270, 270, 270, 270, 271, 51, 271, 271,
778 271, 271, 271, 271, 271, 272, 272, 272, 272, 272,
780 272, 272, 274, 45, 274, 274, 274, 274, 274, 274,
781 274, 278, 43, 278, 278, 278, 41, 40, 275, 272,
782 275, 275, 275, 275, 275, 275, 275, 276, 39, 276,
783 276, 276, 276, 276, 276, 276, 277, 278, 277, 277,
784 277, 277, 277, 277, 277, 280, 38, 280, 280, 280,
785 280, 280, 280, 280, 282, 37, 282, 282, 282, 282,
786 282, 282, 282, 283, 36, 283, 283, 283, 283, 283,
787 283, 283, 284, 33, 284, 284, 284, 284, 284, 284,
788 284, 285, 32, 285, 285, 285, 285, 285, 285, 285,
789 286, 31, 286, 286, 286, 287, 22, 287, 287, 287,
791 287, 287, 287, 287, 288, 19, 288, 288, 288, 288,
792 288, 288, 288, 18, 17, 289, 286, 289, 289, 289,
793 289, 289, 289, 289, 290, 15, 290, 290, 290, 290,
794 290, 290, 290, 292, 14, 292, 292, 292, 292, 292,
795 292, 292, 293, 13, 293, 293, 293, 293, 293, 293,
796 293, 294, 0, 294, 294, 294, 294, 294, 294, 294,
797 295, 0, 295, 295, 295, 295, 295, 295, 295, 297,
798 297, 297, 297, 297, 297, 297, 299, 0, 299, 299,
799 299, 299, 299, 299, 299, 0, 0, 0, 0, 0,
800 0, 0, 300, 297, 300, 300, 300, 300, 300, 300,
802 300, 301, 0, 301, 301, 301, 301, 301, 301, 301,
803 302, 302, 302, 302, 302, 302, 302, 304, 0, 304,
804 304, 304, 304, 304, 304, 304, 0, 0, 0, 0,
805 0, 0, 0, 305, 302, 305, 305, 305, 305, 305,
806 305, 305, 306, 0, 306, 306, 306, 306, 306, 306,
807 306, 307, 0, 307, 307, 307, 307, 307, 307, 307,
808 308, 0, 308, 308, 308, 308, 308, 308, 308, 309,
809 0, 309, 309, 309, 309, 309, 309, 309, 310, 0,
810 310, 310, 310, 310, 310, 310, 310, 311, 0, 311,
811 311, 311, 311, 311, 311, 311, 312, 0, 312, 312,
813 312, 312, 312, 312, 312, 313, 0, 313, 313, 313,
814 313, 313, 313, 313, 315, 0, 315, 315, 315, 315,
815 315, 315, 315, 316, 0, 316, 316, 316, 316, 316,
816 316, 316, 317, 0, 317, 317, 317, 317, 317, 317,
817 317, 318, 0, 318, 318, 318, 318, 318, 318, 318,
818 320, 0, 320, 320, 320, 320, 320, 320, 320, 321,
819 0, 321, 321, 321, 321, 321, 321, 321, 322, 0,
820 322, 322, 322, 322, 322, 322, 322, 323, 0, 323,
821 323, 323, 323, 323, 323, 323, 324, 0, 324, 324,
822 324, 324, 324, 324, 324, 325, 0, 325, 325, 325,
824 325, 325, 325, 325, 326, 0, 326, 326, 326, 326,
825 326, 326, 326, 327, 0, 327, 327, 327, 327, 327,
826 327, 327, 328, 0, 328, 328, 328, 328, 328, 328,
827 328, 330, 330, 330, 330, 330, 330, 330, 331, 331,
828 331, 331, 331, 331, 333, 333, 333, 333, 333, 333,
829 333, 0, 0, 0, 0, 330, 334, 334, 334, 334,
830 334, 334, 331, 0, 0, 0, 0, 0, 333, 0,
831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
832 334, 336, 336, 336, 336, 336, 336, 336, 337, 337,
833 337, 337, 337, 337, 337, 338, 338, 338, 338, 338,
835 338, 338, 339, 0, 0, 0, 0, 339, 339, 340,
836 340, 340, 340, 340, 340, 340, 341, 0, 0, 0,
837 0, 341, 341, 342, 0, 0, 0, 0, 342, 342,
838 343, 0, 343, 0, 0, 343, 343, 344, 0, 0,
839 0, 0, 344, 344, 345, 0, 0, 0, 0, 345,
840 345, 346, 0, 0, 0, 0, 346, 346, 347, 0,
841 347, 0, 0, 347, 347, 348, 0, 348, 348, 0,
842 0, 348, 350, 0, 350, 0, 350, 350, 350, 351,
843 351, 351, 351, 351, 351, 351, 352, 352, 352, 352,
844 352, 352, 352, 353, 0, 353, 0, 0, 353, 353,
846 354, 354, 354, 354, 354, 354, 354, 335, 335, 335,
847 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
848 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
849 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
850 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
851 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
855 static yy_state_type yy_last_accepting_state;
856 static char *yy_last_accepting_cpos;
858 /* The intent behind this definition is that it'll catch
859 * any uses of REJECT which flex missed.
861 #define REJECT reject_used_but_not_detected
862 #define yymore() yymore_used_but_not_detected
863 #define YY_MORE_ADJ 0
864 #define YY_RESTORE_YY_MORE_OFFSET
870 * Copyright (c) 1996, 1998-2004 Todd C. Miller <Todd.Miller@courtesan.com>
872 * Permission to use, copy, modify, and distribute this software for any
873 * purpose with or without fee is hereby granted, provided that the above
874 * copyright notice and this permission notice appear in all copies.
876 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
877 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
878 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
879 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
880 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
881 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
882 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
883 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
884 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
885 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
887 * Sponsored in part by the Defense Advanced Research Projects
888 * Agency (DARPA) and Air Force Research Laboratory, Air Force
889 * Materiel Command, USAF, under agreement number F39502-99-1-0512.
894 #include <sys/types.h>
895 #include <sys/param.h>
901 # ifdef HAVE_STDLIB_H
904 #endif /* STDC_HEADERS */
908 # ifdef HAVE_STRINGS_H
909 # include <strings.h>
911 #endif /* HAVE_STRING_H */
914 #endif /* HAVE_UNISTD_H */
915 #if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
917 #endif /* HAVE_MALLOC_H && !STDC_HEADERS */
921 #include <sudo.tab.h>
924 static const char rcsid[] = "$Sudo: lex.yy.c,v 1.46 2004/05/17 22:10:20 millert Exp $";
927 #undef yywrap /* guard against a yywrap macro */
929 extern YYSTYPE yylval;
930 extern int clearaliases;
932 static int sawspace = 0;
933 static int arg_len = 0;
934 static int arg_size = 0;
936 static void fill __P((char *, int));
937 static void fill_cmnd __P((char *, int));
938 static void fill_args __P((char *, int, int));
939 extern void reset_aliases __P((void));
940 extern void yyerror __P((char *));
942 /* realloc() to size + COMMANDARGINC to make room for command args */
943 #define COMMANDARGINC 64
946 #define LEXTRACE(msg) fputs(msg, stderr)
948 #define LEXTRACE(msg)
950 /* XXX - convert GOTRUNAS to exclusive state (GOTDEFS cannot be) */
963 /* Macros after this point can all be overridden by user definitions in
967 #ifndef YY_SKIP_YYWRAP
969 extern "C" int yywrap YY_PROTO(( void ));
971 extern int yywrap YY_PROTO(( void ));
976 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
980 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
983 #ifdef YY_NEED_STRLEN
984 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
989 static int yyinput YY_PROTO(( void ));
991 static int input YY_PROTO(( void ));
996 static int yy_start_stack_ptr = 0;
997 static int yy_start_stack_depth = 0;
998 static int *yy_start_stack = 0;
999 #ifndef YY_NO_PUSH_STATE
1000 static void yy_push_state YY_PROTO(( int new_state ));
1002 #ifndef YY_NO_POP_STATE
1003 static void yy_pop_state YY_PROTO(( void ));
1005 #ifndef YY_NO_TOP_STATE
1006 static int yy_top_state YY_PROTO(( void ));
1010 #define YY_NO_PUSH_STATE 1
1011 #define YY_NO_POP_STATE 1
1012 #define YY_NO_TOP_STATE 1
1015 #ifdef YY_MALLOC_DECL
1023 /* Just try to get by without declaring the routines. This will fail
1024 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1025 * or sizeof(void*) != sizeof(int).
1030 /* Amount of stuff to slurp up with each read. */
1031 #ifndef YY_READ_BUF_SIZE
1032 #define YY_READ_BUF_SIZE 8192
1035 /* Copy whatever the last rule matched to the standard output. */
1038 /* This used to be an fputs(), but since the string might contain NUL's,
1039 * we now use fwrite().
1041 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1044 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1045 * is returned in "result".
1048 #define YY_INPUT(buf,result,max_size) \
1049 if ( yy_current_buffer->yy_is_interactive ) \
1052 for ( n = 0; n < max_size && \
1053 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1054 buf[n] = (char) c; \
1056 buf[n++] = (char) c; \
1057 if ( c == EOF && ferror( yyin ) ) \
1058 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1061 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1062 && ferror( yyin ) ) \
1063 YY_FATAL_ERROR( "input in flex scanner failed" );
1066 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1067 * we don't want an extra ';' after the "return" because that will cause
1068 * some compilers to complain about unreachable statements.
1071 #define yyterminate() return YY_NULL
1074 /* Number of entries by which start-condition stack grows. */
1075 #ifndef YY_START_STACK_INCR
1076 #define YY_START_STACK_INCR 25
1079 /* Report a fatal error. */
1080 #ifndef YY_FATAL_ERROR
1081 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1084 /* Default declaration of generated scanner - a define so the user can
1085 * easily add parameters.
1088 #define YY_DECL int yylex YY_PROTO(( void ))
1091 /* Code executed at the beginning of each rule, after yytext and yyleng
1094 #ifndef YY_USER_ACTION
1095 #define YY_USER_ACTION
1098 /* Code executed at the end of each rule. */
1100 #define YY_BREAK break;
1103 #define YY_RULE_SETUP \
1105 yy_current_buffer->yy_at_bol = \
1106 (yytext[yyleng - 1] == '\n'); \
1111 register yy_state_type yy_current_state;
1112 register char *yy_cp, *yy_bp;
1113 register int yy_act;
1115 #line 99 "parse.lex"
1117 #line 1118 "lex.yy.c"
1128 yy_start = 1; /* first start state */
1136 if ( ! yy_current_buffer )
1138 yy_create_buffer( yyin, YY_BUF_SIZE );
1140 yy_load_buffer_state();
1143 while ( 1 ) /* loops until end-of-file is reached */
1147 /* Support of yytext. */
1148 *yy_cp = yy_hold_char;
1150 /* yy_bp points to the position in yy_ch_buf of the start of
1155 yy_current_state = yy_start;
1156 yy_current_state += YY_AT_BOL();
1160 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1161 if ( yy_accept[yy_current_state] )
1163 yy_last_accepting_state = yy_current_state;
1164 yy_last_accepting_cpos = yy_cp;
1166 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1168 yy_current_state = (int) yy_def[yy_current_state];
1169 if ( yy_current_state >= 336 )
1170 yy_c = yy_meta[(unsigned int) yy_c];
1172 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1175 while ( yy_base[yy_current_state] != 1708 );
1178 yy_act = yy_accept[yy_current_state];
1180 { /* have to back up */
1181 yy_cp = yy_last_accepting_cpos;
1182 yy_current_state = yy_last_accepting_state;
1183 yy_act = yy_accept[yy_current_state];
1186 YY_DO_BEFORE_ACTION;
1189 do_action: /* This label is used only to access EOF actions. */
1193 { /* beginning of action switch */
1194 case 0: /* must back up */
1195 /* undo the effects of YY_DO_BEFORE_ACTION */
1196 *yy_cp = yy_hold_char;
1197 yy_cp = yy_last_accepting_cpos;
1198 yy_current_state = yy_last_accepting_state;
1199 goto yy_find_action;
1203 #line 100 "parse.lex"
1208 #line 102 "parse.lex"
1211 LEXTRACE("DEFVAR ");
1212 fill(yytext, yyleng);
1219 #line 110 "parse.lex"
1228 #line 116 "parse.lex"
1236 #line 121 "parse.lex"
1244 #line 126 "parse.lex"
1252 #line 131 "parse.lex"
1254 LEXTRACE("WORD(1) ");
1255 fill(yytext + 1, yyleng - 2);
1261 #line 137 "parse.lex"
1263 LEXTRACE("WORD(2) ");
1264 fill(yytext, yyleng);
1272 #line 145 "parse.lex"
1274 /* quoted fnmatch glob char, pass verbatim */
1275 LEXTRACE("QUOTEDCHAR ");
1276 fill_args(yytext, 2, sawspace);
1282 #line 152 "parse.lex"
1284 /* quoted sudoers special char, strip backslash */
1285 LEXTRACE("QUOTEDCHAR ");
1286 fill_args(yytext + 1, 1, sawspace);
1292 #line 159 "parse.lex"
1297 } /* end of command line args */
1301 #line 165 "parse.lex"
1304 fill_args(yytext, yyleng, sawspace);
1306 } /* a command line arg */
1311 #line 172 "parse.lex"
1314 switch (yytext[8]) {
1316 LEXTRACE("DEFAULTS_USER ");
1317 return(DEFAULTS_USER);
1319 LEXTRACE("DEFAULTS_RUNAS ");
1320 return(DEFAULTS_RUNAS);
1322 LEXTRACE("DEFAULTS_HOST ");
1323 return(DEFAULTS_HOST);
1325 LEXTRACE("DEFAULTS ");
1332 #line 190 "parse.lex"
1334 fill(yytext, yyleng);
1337 LEXTRACE("HOSTALIAS ");
1340 LEXTRACE("CMNDALIAS ");
1343 LEXTRACE("USERALIAS ");
1346 LEXTRACE("RUNASALIAS ");
1354 #line 209 "parse.lex"
1356 /* cmnd does not require passwd for this user */
1357 LEXTRACE("NOPASSWD ");
1363 #line 215 "parse.lex"
1365 /* cmnd requires passwd for this user */
1366 LEXTRACE("PASSWD ");
1372 #line 221 "parse.lex"
1374 LEXTRACE("NOEXEC ");
1380 #line 226 "parse.lex"
1388 #line 231 "parse.lex"
1391 fill(yytext, yyleng);
1392 LEXTRACE("NETGROUP ");
1398 #line 238 "parse.lex"
1401 fill(yytext, yyleng);
1408 #line 245 "parse.lex"
1410 fill(yytext, yyleng);
1411 LEXTRACE("NTWKADDR ");
1417 #line 251 "parse.lex"
1419 fill(yytext, yyleng);
1420 LEXTRACE("NTWKADDR ");
1426 #line 257 "parse.lex"
1435 #line 263 "parse.lex"
1437 if (strcmp(yytext, "ALL") == 0) {
1441 fill(yytext, yyleng);
1449 #line 274 "parse.lex"
1451 /* username/uid that user can run command as */
1452 fill(yytext, yyleng);
1453 LEXTRACE("WORD(3) ");
1459 #line 281 "parse.lex"
1466 #line 285 "parse.lex"
1469 LEXTRACE("COMMAND ");
1470 fill_cmnd(yytext, yyleng);
1475 #line 291 "parse.lex"
1477 /* directories can't have args... */
1478 if (yytext[yyleng - 1] == '/') {
1479 LEXTRACE("COMMAND ");
1480 fill_cmnd(yytext, yyleng);
1484 LEXTRACE("COMMAND ");
1485 fill_cmnd(yytext, yyleng);
1491 #line 304 "parse.lex"
1494 fill(yytext, yyleng);
1495 LEXTRACE("WORD(4) ");
1501 #line 311 "parse.lex"
1509 #line 316 "parse.lex"
1517 #line 321 "parse.lex"
1525 #line 326 "parse.lex"
1527 if (yyleng % 2 == 1)
1528 return('!'); /* return '!' */
1533 #line 331 "parse.lex"
1539 } /* return newline */
1543 #line 338 "parse.lex"
1544 { /* throw away space/tabs */
1545 sawspace = TRUE; /* but remember for fill_args */
1550 #line 342 "parse.lex"
1552 sawspace = TRUE; /* remember for fill_args */
1555 } /* throw away EOL after \ */
1559 #line 348 "parse.lex"
1565 } /* return comments */
1569 #line 355 "parse.lex"
1575 case YY_STATE_EOF(INITIAL):
1576 case YY_STATE_EOF(GOTRUNAS):
1577 case YY_STATE_EOF(GOTDEFS):
1578 case YY_STATE_EOF(GOTCMND):
1579 case YY_STATE_EOF(STARTDEFS):
1580 case YY_STATE_EOF(INDEFS):
1581 #line 360 "parse.lex"
1583 if (YY_START != INITIAL) {
1593 #line 369 "parse.lex"
1596 #line 1597 "lex.yy.c"
1598 case YY_END_OF_BUFFER:
1600 /* Amount of text matched not including the EOB char. */
1601 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1603 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1604 *yy_cp = yy_hold_char;
1605 YY_RESTORE_YY_MORE_OFFSET
1607 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1609 /* We're scanning a new file or input source. It's
1610 * possible that this happened because the user
1611 * just pointed yyin at a new source and called
1612 * yylex(). If so, then we have to assure
1613 * consistency between yy_current_buffer and our
1614 * globals. Here is the right place to do so, because
1615 * this is the first action (other than possibly a
1616 * back-up) that will match for the new input source.
1618 yy_n_chars = yy_current_buffer->yy_n_chars;
1619 yy_current_buffer->yy_input_file = yyin;
1620 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1623 /* Note that here we test for yy_c_buf_p "<=" to the position
1624 * of the first EOB in the buffer, since yy_c_buf_p will
1625 * already have been incremented past the NUL character
1626 * (since all states make transitions on EOB to the
1627 * end-of-buffer state). Contrast this with the test
1630 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1631 { /* This was really a NUL. */
1632 yy_state_type yy_next_state;
1634 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1636 yy_current_state = yy_get_previous_state();
1638 /* Okay, we're now positioned to make the NUL
1639 * transition. We couldn't have
1640 * yy_get_previous_state() go ahead and do it
1641 * for us because it doesn't know how to deal
1642 * with the possibility of jamming (and we don't
1643 * want to build jamming into it because then it
1644 * will run more slowly).
1647 yy_next_state = yy_try_NUL_trans( yy_current_state );
1649 yy_bp = yytext_ptr + YY_MORE_ADJ;
1651 if ( yy_next_state )
1653 /* Consume the NUL. */
1654 yy_cp = ++yy_c_buf_p;
1655 yy_current_state = yy_next_state;
1662 goto yy_find_action;
1666 else switch ( yy_get_next_buffer() )
1668 case EOB_ACT_END_OF_FILE:
1670 yy_did_buffer_switch_on_eof = 0;
1674 /* Note: because we've taken care in
1675 * yy_get_next_buffer() to have set up
1676 * yytext, we can now set up
1677 * yy_c_buf_p so that if some total
1678 * hoser (like flex itself) wants to
1679 * call the scanner after we return the
1680 * YY_NULL, it'll still work - another
1681 * YY_NULL will get returned.
1683 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1685 yy_act = YY_STATE_EOF(YY_START);
1691 if ( ! yy_did_buffer_switch_on_eof )
1697 case EOB_ACT_CONTINUE_SCAN:
1699 yytext_ptr + yy_amount_of_matched_text;
1701 yy_current_state = yy_get_previous_state();
1704 yy_bp = yytext_ptr + YY_MORE_ADJ;
1707 case EOB_ACT_LAST_MATCH:
1709 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1711 yy_current_state = yy_get_previous_state();
1714 yy_bp = yytext_ptr + YY_MORE_ADJ;
1715 goto yy_find_action;
1722 "fatal flex scanner internal error--no action found" );
1723 } /* end of action switch */
1724 } /* end of scanning one token */
1725 } /* end of yylex */
1728 /* yy_get_next_buffer - try to read in a new buffer
1730 * Returns a code representing an action:
1731 * EOB_ACT_LAST_MATCH -
1732 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1733 * EOB_ACT_END_OF_FILE - end of file
1736 static int yy_get_next_buffer()
1738 register char *dest = yy_current_buffer->yy_ch_buf;
1739 register char *source = yytext_ptr;
1740 register int number_to_move, i;
1743 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1745 "fatal flex scanner internal error--end of buffer missed" );
1747 if ( yy_current_buffer->yy_fill_buffer == 0 )
1748 { /* Don't try to fill the buffer, so this is an EOF. */
1749 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1751 /* We matched a single character, the EOB, so
1752 * treat this as a final EOF.
1754 return EOB_ACT_END_OF_FILE;
1759 /* We matched some text prior to the EOB, first
1762 return EOB_ACT_LAST_MATCH;
1766 /* Try to read more data. */
1768 /* First move last chars to start of buffer. */
1769 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1771 for ( i = 0; i < number_to_move; ++i )
1772 *(dest++) = *(source++);
1774 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1775 /* don't do the read, it's not guaranteed to return an EOF,
1778 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1783 yy_current_buffer->yy_buf_size - number_to_move - 1;
1785 while ( num_to_read <= 0 )
1786 { /* Not enough room in the buffer - grow it. */
1787 #ifdef YY_USES_REJECT
1789 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1792 /* just a shorter name for the current buffer */
1793 YY_BUFFER_STATE b = yy_current_buffer;
1795 int yy_c_buf_p_offset =
1796 (int) (yy_c_buf_p - b->yy_ch_buf);
1798 if ( b->yy_is_our_buffer )
1800 int new_size = b->yy_buf_size * 2;
1802 if ( new_size <= 0 )
1803 b->yy_buf_size += b->yy_buf_size / 8;
1805 b->yy_buf_size *= 2;
1807 b->yy_ch_buf = (char *)
1808 /* Include room in for 2 EOB chars. */
1809 yy_flex_realloc( (void *) b->yy_ch_buf,
1810 b->yy_buf_size + 2 );
1813 /* Can't grow it, we don't own it. */
1816 if ( ! b->yy_ch_buf )
1818 "fatal error - scanner input buffer overflow" );
1820 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1822 num_to_read = yy_current_buffer->yy_buf_size -
1827 if ( num_to_read > YY_READ_BUF_SIZE )
1828 num_to_read = YY_READ_BUF_SIZE;
1830 /* Read in more data. */
1831 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1832 yy_n_chars, num_to_read );
1834 yy_current_buffer->yy_n_chars = yy_n_chars;
1837 if ( yy_n_chars == 0 )
1839 if ( number_to_move == YY_MORE_ADJ )
1841 ret_val = EOB_ACT_END_OF_FILE;
1847 ret_val = EOB_ACT_LAST_MATCH;
1848 yy_current_buffer->yy_buffer_status =
1849 YY_BUFFER_EOF_PENDING;
1854 ret_val = EOB_ACT_CONTINUE_SCAN;
1856 yy_n_chars += number_to_move;
1857 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1858 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1860 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1866 /* yy_get_previous_state - get the state just before the EOB char was reached */
1868 static yy_state_type yy_get_previous_state()
1870 register yy_state_type yy_current_state;
1871 register char *yy_cp;
1873 yy_current_state = yy_start;
1874 yy_current_state += YY_AT_BOL();
1876 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1878 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1879 if ( yy_accept[yy_current_state] )
1881 yy_last_accepting_state = yy_current_state;
1882 yy_last_accepting_cpos = yy_cp;
1884 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1886 yy_current_state = (int) yy_def[yy_current_state];
1887 if ( yy_current_state >= 336 )
1888 yy_c = yy_meta[(unsigned int) yy_c];
1890 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1893 return yy_current_state;
1897 /* yy_try_NUL_trans - try to make a transition on the NUL character
1900 * next_state = yy_try_NUL_trans( current_state );
1903 #ifdef YY_USE_PROTOS
1904 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1906 static yy_state_type yy_try_NUL_trans( yy_current_state )
1907 yy_state_type yy_current_state;
1910 register int yy_is_jam;
1911 register char *yy_cp = yy_c_buf_p;
1913 register YY_CHAR yy_c = 1;
1914 if ( yy_accept[yy_current_state] )
1916 yy_last_accepting_state = yy_current_state;
1917 yy_last_accepting_cpos = yy_cp;
1919 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1921 yy_current_state = (int) yy_def[yy_current_state];
1922 if ( yy_current_state >= 336 )
1923 yy_c = yy_meta[(unsigned int) yy_c];
1925 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1926 yy_is_jam = (yy_current_state == 335);
1928 return yy_is_jam ? 0 : yy_current_state;
1933 #ifdef YY_USE_PROTOS
1934 static void yyunput( int c, register char *yy_bp )
1936 static void yyunput( c, yy_bp )
1938 register char *yy_bp;
1941 register char *yy_cp = yy_c_buf_p;
1943 /* undo effects of setting up yytext */
1944 *yy_cp = yy_hold_char;
1946 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1947 { /* need to shift things up to make room */
1948 /* +2 for EOB chars. */
1949 register int number_to_move = yy_n_chars + 2;
1950 register char *dest = &yy_current_buffer->yy_ch_buf[
1951 yy_current_buffer->yy_buf_size + 2];
1952 register char *source =
1953 &yy_current_buffer->yy_ch_buf[number_to_move];
1955 while ( source > yy_current_buffer->yy_ch_buf )
1956 *--dest = *--source;
1958 yy_cp += (int) (dest - source);
1959 yy_bp += (int) (dest - source);
1960 yy_current_buffer->yy_n_chars =
1961 yy_n_chars = yy_current_buffer->yy_buf_size;
1963 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1964 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1967 *--yy_cp = (char) c;
1971 yy_hold_char = *yy_cp;
1974 #endif /* ifndef YY_NO_UNPUT */
1978 static int yyinput()
1985 *yy_c_buf_p = yy_hold_char;
1987 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1989 /* yy_c_buf_p now points to the character we want to return.
1990 * If this occurs *before* the EOB characters, then it's a
1991 * valid NUL; if not, then we've hit the end of the buffer.
1993 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1994 /* This was really a NUL. */
1998 { /* need more input */
1999 int offset = yy_c_buf_p - yytext_ptr;
2002 switch ( yy_get_next_buffer() )
2004 case EOB_ACT_LAST_MATCH:
2005 /* This happens because yy_g_n_b()
2006 * sees that we've accumulated a
2007 * token and flags that we need to
2008 * try matching the token before
2009 * proceeding. But for input(),
2010 * there's no matching to consider.
2011 * So convert the EOB_ACT_LAST_MATCH
2012 * to EOB_ACT_END_OF_FILE.
2015 /* Reset buffer status. */
2020 case EOB_ACT_END_OF_FILE:
2025 if ( ! yy_did_buffer_switch_on_eof )
2034 case EOB_ACT_CONTINUE_SCAN:
2035 yy_c_buf_p = yytext_ptr + offset;
2041 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2042 *yy_c_buf_p = '\0'; /* preserve yytext */
2043 yy_hold_char = *++yy_c_buf_p;
2045 yy_current_buffer->yy_at_bol = (c == '\n');
2051 #ifdef YY_USE_PROTOS
2052 void yyrestart( FILE *input_file )
2054 void yyrestart( input_file )
2058 if ( ! yy_current_buffer )
2059 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2061 yy_init_buffer( yy_current_buffer, input_file );
2062 yy_load_buffer_state();
2066 #ifdef YY_USE_PROTOS
2067 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2069 void yy_switch_to_buffer( new_buffer )
2070 YY_BUFFER_STATE new_buffer;
2073 if ( yy_current_buffer == new_buffer )
2076 if ( yy_current_buffer )
2078 /* Flush out information for old buffer. */
2079 *yy_c_buf_p = yy_hold_char;
2080 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2081 yy_current_buffer->yy_n_chars = yy_n_chars;
2084 yy_current_buffer = new_buffer;
2085 yy_load_buffer_state();
2087 /* We don't actually know whether we did this switch during
2088 * EOF (yywrap()) processing, but the only time this flag
2089 * is looked at is after yywrap() is called, so it's safe
2090 * to go ahead and always set it.
2092 yy_did_buffer_switch_on_eof = 1;
2096 #ifdef YY_USE_PROTOS
2097 void yy_load_buffer_state( void )
2099 void yy_load_buffer_state()
2102 yy_n_chars = yy_current_buffer->yy_n_chars;
2103 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2104 yyin = yy_current_buffer->yy_input_file;
2105 yy_hold_char = *yy_c_buf_p;
2109 #ifdef YY_USE_PROTOS
2110 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2112 YY_BUFFER_STATE yy_create_buffer( file, size )
2119 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2121 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2123 b->yy_buf_size = size;
2125 /* yy_ch_buf has to be 2 characters longer than the size given because
2126 * we need to put in 2 end-of-buffer characters.
2128 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2129 if ( ! b->yy_ch_buf )
2130 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2132 b->yy_is_our_buffer = 1;
2134 yy_init_buffer( b, file );
2140 #ifdef YY_USE_PROTOS
2141 void yy_delete_buffer( YY_BUFFER_STATE b )
2143 void yy_delete_buffer( b )
2150 if ( b == yy_current_buffer )
2151 yy_current_buffer = (YY_BUFFER_STATE) 0;
2153 if ( b->yy_is_our_buffer )
2154 yy_flex_free( (void *) b->yy_ch_buf );
2156 yy_flex_free( (void *) b );
2160 #ifndef YY_ALWAYS_INTERACTIVE
2161 #ifndef YY_NEVER_INTERACTIVE
2166 #ifdef YY_USE_PROTOS
2167 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2169 void yy_init_buffer( b, file )
2178 yy_flush_buffer( b );
2180 b->yy_input_file = file;
2181 b->yy_fill_buffer = 1;
2183 #if YY_ALWAYS_INTERACTIVE
2184 b->yy_is_interactive = 1;
2186 #if YY_NEVER_INTERACTIVE
2187 b->yy_is_interactive = 0;
2189 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2196 #ifdef YY_USE_PROTOS
2197 void yy_flush_buffer( YY_BUFFER_STATE b )
2199 void yy_flush_buffer( b )
2209 /* We always need two end-of-buffer characters. The first causes
2210 * a transition to the end-of-buffer state. The second causes
2211 * a jam in that state.
2213 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2214 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2216 b->yy_buf_pos = &b->yy_ch_buf[0];
2219 b->yy_buffer_status = YY_BUFFER_NEW;
2221 if ( b == yy_current_buffer )
2222 yy_load_buffer_state();
2226 #ifndef YY_NO_SCAN_BUFFER
2227 #ifdef YY_USE_PROTOS
2228 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2230 YY_BUFFER_STATE yy_scan_buffer( base, size )
2238 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2239 base[size-1] != YY_END_OF_BUFFER_CHAR )
2240 /* They forgot to leave room for the EOB's. */
2243 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2245 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2247 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2248 b->yy_buf_pos = b->yy_ch_buf = base;
2249 b->yy_is_our_buffer = 0;
2250 b->yy_input_file = 0;
2251 b->yy_n_chars = b->yy_buf_size;
2252 b->yy_is_interactive = 0;
2254 b->yy_fill_buffer = 0;
2255 b->yy_buffer_status = YY_BUFFER_NEW;
2257 yy_switch_to_buffer( b );
2264 #ifndef YY_NO_SCAN_STRING
2265 #ifdef YY_USE_PROTOS
2266 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2268 YY_BUFFER_STATE yy_scan_string( yy_str )
2269 yyconst char *yy_str;
2273 for ( len = 0; yy_str[len]; ++len )
2276 return yy_scan_bytes( yy_str, len );
2281 #ifndef YY_NO_SCAN_BYTES
2282 #ifdef YY_USE_PROTOS
2283 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2285 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2286 yyconst char *bytes;
2295 /* Get memory for full buffer, including space for trailing EOB's. */
2297 buf = (char *) yy_flex_alloc( n );
2299 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2301 for ( i = 0; i < len; ++i )
2304 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2306 b = yy_scan_buffer( buf, n );
2308 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2310 /* It's okay to grow etc. this buffer, and we should throw it
2311 * away when we're done.
2313 b->yy_is_our_buffer = 1;
2320 #ifndef YY_NO_PUSH_STATE
2321 #ifdef YY_USE_PROTOS
2322 static void yy_push_state( int new_state )
2324 static void yy_push_state( new_state )
2328 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2332 yy_start_stack_depth += YY_START_STACK_INCR;
2333 new_size = yy_start_stack_depth * sizeof( int );
2335 if ( ! yy_start_stack )
2336 yy_start_stack = (int *) yy_flex_alloc( new_size );
2339 yy_start_stack = (int *) yy_flex_realloc(
2340 (void *) yy_start_stack, new_size );
2342 if ( ! yy_start_stack )
2344 "out of memory expanding start-condition stack" );
2347 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2354 #ifndef YY_NO_POP_STATE
2355 static void yy_pop_state()
2357 if ( --yy_start_stack_ptr < 0 )
2358 YY_FATAL_ERROR( "start-condition stack underflow" );
2360 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2365 #ifndef YY_NO_TOP_STATE
2366 static int yy_top_state()
2368 return yy_start_stack[yy_start_stack_ptr - 1];
2372 #ifndef YY_EXIT_FAILURE
2373 #define YY_EXIT_FAILURE 2
2376 #ifdef YY_USE_PROTOS
2377 static void yy_fatal_error( yyconst char msg[] )
2379 static void yy_fatal_error( msg )
2383 (void) fprintf( stderr, "%s\n", msg );
2384 exit( YY_EXIT_FAILURE );
2389 /* Redefine yyless() so it works in section 3 code. */
2395 /* Undo effects of setting up yytext. */ \
2396 yytext[yyleng] = yy_hold_char; \
2397 yy_c_buf_p = yytext + n; \
2398 yy_hold_char = *yy_c_buf_p; \
2399 *yy_c_buf_p = '\0'; \
2405 /* Internal utility routines. */
2408 #ifdef YY_USE_PROTOS
2409 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2411 static void yy_flex_strncpy( s1, s2, n )
2418 for ( i = 0; i < n; ++i )
2423 #ifdef YY_NEED_STRLEN
2424 #ifdef YY_USE_PROTOS
2425 static int yy_flex_strlen( yyconst char *s )
2427 static int yy_flex_strlen( s )
2432 for ( n = 0; s[n]; ++n )
2440 #ifdef YY_USE_PROTOS
2441 static void *yy_flex_alloc( yy_size_t size )
2443 static void *yy_flex_alloc( size )
2447 return (void *) malloc( size );
2450 #ifdef YY_USE_PROTOS
2451 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2453 static void *yy_flex_realloc( ptr, size )
2458 /* The cast to (char *) in the following accommodates both
2459 * implementations that use char* generic pointers, and those
2460 * that use void* generic pointers. It works with the latter
2461 * because both ANSI C and C++ allow castless assignment from
2462 * any pointer type to void*, and deal with argument conversions
2463 * as though doing an assignment.
2465 return (void *) realloc( (char *) ptr, size );
2468 #ifdef YY_USE_PROTOS
2469 static void yy_flex_free( void *ptr )
2471 static void yy_flex_free( ptr )
2485 #line 369 "parse.lex"
2494 yylval.string = (char *) malloc(len + 1);
2495 if (yylval.string == NULL) {
2496 yyerror("unable to allocate memory");
2500 /* Copy the string and collapse any escaped characters. */
2501 for (i = 0, j = 0; i < len; i++, j++) {
2502 if (s[i] == '\\' && i != len - 1)
2503 yylval.string[j] = s[++i];
2505 yylval.string[j] = s[i];
2507 yylval.string[j] = '\0';
2515 arg_len = arg_size = 0;
2517 yylval.command.cmnd = (char *) malloc(++len);
2518 if (yylval.command.cmnd == NULL) {
2519 yyerror("unable to allocate memory");
2523 /* copy the string and NULL-terminate it (escapes handled by fnmatch) */
2524 (void) strlcpy(yylval.command.cmnd, s, len);
2526 yylval.command.args = NULL;
2530 fill_args(s, len, addspace)
2538 if (yylval.command.args == NULL) {
2542 new_len = arg_len + len + addspace;
2544 if (new_len >= arg_size) {
2545 /* Allocate more space than we need for subsequent args */
2546 while (new_len >= (arg_size += COMMANDARGINC))
2549 p = yylval.command.args ?
2550 (char *) realloc(yylval.command.args, arg_size) :
2551 (char *) malloc(arg_size);
2553 if (yylval.command.args != NULL)
2554 free(yylval.command.args);
2555 yyerror("unable to allocate memory");
2558 yylval.command.args = p;
2561 /* Efficiently append the arg (with a leading space if needed). */
2562 p = yylval.command.args + arg_len;
2565 if (strlcpy(p, s, arg_size - (p - yylval.command.args)) != len)
2566 yyerror("fill_args: buffer overflow"); /* paranoia */
2574 /* Free space used by the aliases unless called by testsudoers. */