This commit is contained in:
Todd C. Miller
1999-04-05 20:29:54 +00:00
parent 4f6f75ae35
commit 094a29a66b
2 changed files with 429 additions and 377 deletions

371
lex.yy.c
View File

@@ -284,27 +284,29 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
*yy_cp = '\0'; \ *yy_cp = '\0'; \
yy_c_buf_p = yy_cp; yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 26 #define YY_NUM_RULES 27
#define YY_END_OF_BUFFER 27 #define YY_END_OF_BUFFER 28
static yyconst short int yy_accept[162] = static yyconst short int yy_accept[182] =
{ 0, { 0,
0, 0, 0, 0, 0, 0, 27, 25, 1, 5, 0, 0, 0, 0, 0, 0, 28, 26, 1, 5,
9, 25, 25, 18, 25, 8, 12, 25, 24, 11, 9, 26, 26, 19, 26, 8, 12, 26, 25, 11,
10, 23, 23, 25, 24, 7, 4, 7, 7, 7, 10, 24, 24, 24, 26, 25, 7, 4, 7, 7,
4, 7, 7, 7, 4, 4, 7, 7, 25, 7, 7, 4, 7, 7, 7, 4, 4, 7, 7, 7,
25, 21, 20, 20, 19, 19, 20, 1, 0, 6, 26, 7, 26, 22, 21, 21, 20, 20, 20, 21,
15, 14, 22, 24, 0, 24, 24, 0, 23, 23, 1, 0, 6, 16, 15, 23, 25, 0, 25, 25,
0, 2, 7, 7, 7, 7, 7, 7, 7, 7, 0, 24, 24, 24, 0, 2, 7, 7, 7, 7,
7, 7, 7, 3, 3, 20, 20, 20, 20, 19, 7, 7, 7, 7, 7, 7, 7, 7, 3, 3,
19, 0, 24, 17, 23, 7, 7, 7, 7, 20, 21, 21, 21, 21, 20, 20, 20, 0, 25, 18,
19, 0, 0, 23, 7, 7, 7, 19, 0, 0, 24, 24, 7, 7, 7, 7, 7, 21, 20, 20,
23, 7, 7, 7, 19, 0, 0, 23, 7, 7, 0, 0, 24, 24, 7, 7, 7, 7, 20, 20,
7, 19, 16, 0, 23, 7, 7, 7, 19, 0, 0, 0, 24, 24, 7, 7, 7, 7, 20, 20,
16, 23, 7, 7, 7, 19, 0, 16, 0, 13, 0, 0, 24, 24, 7, 7, 7, 7, 20, 20,
17, 0, 24, 0, 14, 7, 7, 7, 20, 0,
17, 24, 7, 7, 7, 20, 0, 17, 0, 13,
7, 7, 0, 0, 7, 7, 0, 0, 7, 7, 7, 7, 0, 0, 7, 7, 0, 0, 7, 7,
0, 0, 7, 7, 0, 0, 7, 7, 0, 0, 0, 0, 7, 7, 0, 0, 7, 7, 0, 0,
7, 7, 16, 0, 7, 7, 16, 7, 16, 7, 7, 7, 17, 0, 7, 7, 17, 7, 17, 7,
0 0
} ; } ;
@@ -347,105 +349,115 @@ static yyconst int yy_meta[28] =
4, 4, 4, 4, 2, 4, 4 4, 4, 4, 4, 2, 4, 4
} ; } ;
static yyconst short int yy_base[177] = static yyconst short int yy_base[197] =
{ 0, { 0,
0, 0, 27, 0, 54, 0, 412, 413, 409, 413, 0, 0, 27, 0, 54, 0, 445, 446, 442, 446,
413, 407, 0, 413, 0, 413, 413, 0, 70, 413, 446, 440, 0, 446, 0, 446, 446, 0, 70, 446,
413, 74, 76, 87, 397, 0, 413, 0, 103, 130, 446, 74, 76, 72, 88, 430, 0, 446, 0, 103,
413, 0, 78, 157, 413, 0, 184, 387, 89, 198, 130, 446, 0, 78, 157, 446, 0, 184, 420, 423,
0, 413, 0, 81, 202, 214, 395, 404, 402, 413, 93, 198, 0, 446, 0, 86, 202, 214, 85, 427,
0, 0, 0, 392, 389, 84, 390, 0, 380, 78, 436, 434, 446, 0, 0, 0, 424, 421, 216, 422,
103, 413, 0, 0, 0, 97, 216, 386, 385, 0, 0, 412, 111, 210, 157, 446, 0, 0, 0, 218,
241, 0, 376, 130, 413, 0, 385, 219, 384, 374, 224, 418, 417, 0, 241, 0, 408, 406, 184, 446,
138, 220, 382, 381, 165, 224, 378, 379, 373, 377, 0, 416, 225, 415, 405, 222, 248, 258, 413, 412,
206, 374, 225, 248, 373, 258, 363, 252, 262, 373, 256, 253, 266, 409, 410, 404, 397, 407, 258, 260,
404, 270, 264, 265, 403, 276, 393, 391, 270, 271,
282, 402, 276, 279, 289, 401, 389, 392, 281, 286,
396, 294, 288, 308, 395, 299, 377, 90, 293, 313,
305, 388, 301, 225, 446, 311, 387, 374, 311, 373,
313, 329, 363, 322, 331, 335, 326, 363, 337, 446,
329, 335, 328, 333, 307, 337, 341, 304, 342, 254,
242, 345, 237, 346, 349, 220, 350, 197, 185, 353,
180, 354, 168, 160, 153, 143, 131, 126, 446, 0,
446, 368, 124, 114, 374, 376, 378, 380, 385, 391,
396, 109, 399, 401, 403, 95
256, 266, 372, 360, 260, 368, 270, 219, 367, 273,
356, 265, 277, 360, 273, 282, 359, 351, 278, 350,
287, 291, 344, 289, 296, 302, 293, 335, 306, 413,
301, 334, 324, 302, 305, 306, 310, 298, 313, 297,
274, 314, 252, 317, 318, 244, 321, 239, 230, 322,
195, 325, 185, 182, 173, 160, 153, 141, 413, 0,
413, 339, 141, 136, 345, 347, 349, 351, 356, 362,
367, 124, 370, 372, 374, 114
} ; } ;
static yyconst short int yy_def[177] = static yyconst short int yy_def[197] =
{ 0, { 0,
161, 1, 161, 3, 161, 5, 161, 161, 161, 161, 181, 1, 181, 3, 181, 5, 181, 181, 181, 181,
161, 162, 163, 161, 164, 161, 161, 165, 166, 161, 181, 182, 183, 181, 184, 181, 181, 185, 186, 181,
161, 167, 167, 161, 168, 169, 161, 169, 161, 161, 181, 187, 187, 23, 181, 188, 189, 181, 189, 181,
161, 169, 170, 161, 161, 169, 161, 37, 171, 37, 181, 181, 189, 190, 181, 181, 189, 181, 38, 38,
172, 161, 172, 173, 174, 174, 175, 161, 162, 161, 191, 38, 192, 181, 192, 193, 194, 194, 48, 195,
163, 164, 165, 166, 161, 166, 168, 176, 23, 23, 181, 182, 181, 183, 184, 185, 186, 181, 186, 188,
161, 161, 169, 29, 30, 170, 34, 169, 34, 40, 196, 23, 23, 23, 181, 181, 189, 30, 31, 190,
161, 37, 37, 161, 161, 172, 173, 173, 175, 46, 35, 189, 35, 42, 181, 38, 38, 38, 181, 181,
46, 161, 166, 176, 23, 169, 34, 71, 37, 173, 192, 193, 193, 195, 48, 48, 48, 181, 186, 196,
46, 161, 161, 23, 169, 169, 37, 46, 161, 161, 23, 23, 189, 35, 75, 38, 38, 193, 48, 48,
181, 181, 23, 23, 189, 189, 38, 38, 48, 48,
181, 181, 23, 23, 189, 189, 38, 38, 48, 48,
181, 181, 23, 23, 189, 189, 38, 38, 48, 48,
181, 181, 23, 181, 181, 189, 189, 38, 48, 181,
181, 124, 189, 189, 38, 130, 181, 181, 181, 181,
189, 189, 181, 181, 189, 189, 181, 181, 189, 189,
181, 181, 189, 189, 181, 181, 189, 189, 181, 181,
189, 189, 181, 181, 189, 189, 181, 189, 181, 189,
0, 181, 181, 181, 181, 181, 181, 181, 181, 181,
181, 181, 181, 181, 181, 181
23, 169, 169, 37, 46, 161, 161, 23, 169, 169,
37, 46, 161, 161, 23, 169, 169, 37, 46, 161,
161, 23, 169, 169, 37, 46, 161, 161, 161, 161,
169, 169, 161, 161, 169, 169, 161, 161, 169, 169,
161, 161, 169, 169, 161, 161, 169, 169, 161, 161,
169, 169, 161, 161, 169, 169, 161, 169, 161, 169,
0, 161, 161, 161, 161, 161, 161, 161, 161, 161,
161, 161, 161, 161, 161, 161
} ; } ;
static yyconst short int yy_nxt[441] = static yyconst short int yy_nxt[474] =
{ 0, { 0,
8, 9, 10, 11, 12, 13, 14, 8, 15, 16, 8, 9, 10, 11, 12, 13, 14, 8, 15, 16,
8, 17, 18, 19, 20, 21, 22, 22, 22, 23, 8, 17, 18, 19, 20, 21, 22, 22, 22, 23,
22, 22, 22, 22, 24, 8, 25, 26, 9, 27, 22, 24, 22, 22, 25, 8, 26, 27, 9, 28,
28, 26, 29, 26, 26, 30, 31, 26, 32, 33, 29, 27, 30, 27, 27, 31, 32, 27, 33, 34,
34, 35, 36, 37, 37, 37, 38, 37, 37, 37, 35, 36, 37, 38, 38, 38, 39, 38, 40, 38,
37, 39, 26, 40, 8, 9, 10, 11, 41, 13, 38, 41, 27, 42, 8, 9, 10, 11, 43, 13,
8, 42, 15, 16, 43, 17, 18, 44, 20, 21, 8, 44, 15, 16, 45, 17, 18, 46, 20, 21,
45, 45, 45, 46, 45, 45, 45, 45, 24, 43, 47, 47, 47, 48, 47, 49, 47, 47, 25, 45,
47, 55, 63, 56, 57, 58, 57, 58, 61, 62, 50, 58, 67, 59, 60, 61, 60, 61, 64, 65,
74, 62, 55, 63, 78, 55, 60, 83, 59, 85, 66, 134, 62, 67, 79, 66, 63, 58, 90, 83,
57, 63, 57, 63, 61, 62, 63, 63, 63, 63, 60, 87, 60, 67, 135, 85, 67, 67, 67, 67,
63, 63, 63, 64, 63, 63, 64, 84, 63, 64, 67, 67, 81, 68, 67, 67, 68, 55, 67, 68,
64, 64, 64, 64, 64, 64, 64, 76, 64, 64, 68, 68, 68, 68, 68, 68, 68, 54, 68, 68,
63, 61, 62, 63, 63, 63, 63, 63, 63, 52, 67, 62, 91, 67, 67, 67, 67, 67, 67, 180,
65, 63, 63, 65, 51, 63, 65, 65, 65, 65, 69, 67, 67, 69, 179, 67, 69, 69, 69, 69,
65, 65, 65, 65, 160, 65, 65, 63, 80, 91, 69, 69, 69, 69, 171, 69, 69, 67, 65, 66,
63, 63, 63, 63, 63, 63, 159, 67, 68, 63, 67, 67, 67, 67, 67, 67, 178, 71, 72, 67,
69, 151, 63, 67, 67, 67, 67, 67, 67, 67, 73, 169, 67, 71, 71, 71, 71, 71, 71, 71,
67, 94, 67, 67, 63, 59, 158, 63, 63, 63, 71, 177, 71, 71, 67, 65, 66, 67, 67, 67,
63, 63, 63, 149, 70, 71, 63, 72, 157, 63, 67, 67, 67, 175, 74, 75, 67, 76, 173, 67,
72, 72, 72, 72, 72, 72, 72, 72, 155, 72, 76, 76, 76, 76, 76, 76, 76, 76, 163, 76,
70, 70, 79, 58, 70, 70, 70, 70, 70, 70, 74, 74, 84, 61, 74, 74, 74, 74, 74, 74,
70, 70, 98, 70, 79, 58, 80, 63, 79, 67, 74, 74, 67, 74, 84, 61, 134, 58, 84, 89,
55, 92, 90, 93, 81, 95, 92, 96, 100, 59, 62, 161, 92, 67, 86, 67, 58, 71, 98, 135,
79, 63, 115, 153, 63, 63, 63, 63, 63, 63, 84, 67, 85, 99, 67, 67, 67, 67, 67, 67,
143, 88, 63, 63, 88, 141, 63, 88, 88, 88, 167, 95, 67, 67, 95, 165, 67, 95, 95, 95,
88, 88, 88, 88, 88, 147, 88, 88, 59, 95, 95, 95, 95, 95, 95, 155, 95, 95, 85, 101,
101, 103, 80, 106, 105, 107, 59, 109, 108, 110, 100, 102, 103, 62, 109, 104, 62, 105, 85, 106,
80, 106, 112, 114, 109, 80, 117, 145, 119, 120, 85, 101, 110, 112, 62, 62, 113, 105, 114, 116,
121, 122, 129, 59, 123, 124, 126, 129, 80, 120, 85, 85, 119, 121, 120, 122, 62, 124, 123, 62,
128, 123, 132, 129, 133, 130, 134, 129, 135, 133, 125, 85, 126, 129, 130, 121, 85, 132, 62, 134,
130, 59, 135, 133, 136, 138, 130, 135, 139, 140, 125, 133, 137, 85, 134, 153, 139, 140, 141, 142,
130, 141, 80, 142, 143, 141, 144, 146, 143, 149, 159, 62, 135, 143, 144, 140, 148, 135, 62, 146,
148, 150, 151, 149, 152, 154, 151, 137, 156, 49, 149, 85, 149, 85, 143, 152, 149, 153, 149, 154,
49, 49, 49, 49, 49, 53, 123, 120, 53, 53, 155, 157, 156, 150, 153, 150, 158, 143, 155, 150,
54, 54, 59, 59, 57, 57, 63, 131, 63, 63, 160, 150, 161, 163, 162, 164, 161, 163, 166, 168,
63, 63, 66, 127, 66, 66, 66, 66, 75, 125, 169, 171, 170, 172, 169, 171, 174, 176, 52, 52,
109, 106, 75, 77, 77, 80, 80, 79, 79, 118, 52, 52, 52, 52, 56, 140, 151, 56, 56, 57,
116, 113, 111, 95, 92, 104, 102, 99, 55, 97, 57, 62, 62, 60, 60, 67, 147, 67, 67, 67,
71, 67, 58, 55, 80, 58, 161, 89, 87, 86, 67, 70, 145, 70, 70, 70, 70, 80, 125, 121,
59, 58, 82, 161, 50, 48, 58, 73, 58, 50, 138, 80, 82, 82, 85, 85, 84, 84, 136, 131,
48, 161, 7, 161, 161, 161, 161, 161, 161, 161, 128, 127, 105, 101, 118, 117, 115, 111, 58, 108,
161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 107, 75, 71, 61, 58, 85, 61, 181, 97, 96,
161, 161, 161, 161, 161, 161, 161, 161, 161, 161 94, 93, 62, 61, 88, 181, 53, 51, 61, 78,
77, 61, 53, 51, 181, 7, 181, 181, 181, 181,
181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
181, 181, 181
} ; } ;
static yyconst short int yy_chk[441] = static yyconst short int yy_chk[474] =
{ 0, { 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,
@@ -455,46 +467,50 @@ static yyconst short int yy_chk[441] =
3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 19, 33, 19, 22, 22, 23, 23, 24, 24, 5, 19, 34, 19, 22, 22, 23, 23, 24, 25,
39, 39, 44, 33, 44, 56, 23, 56, 60, 60, 25, 128, 24, 34, 41, 41, 23, 46, 196, 46,
22, 66, 23, 29, 61, 61, 29, 29, 29, 29, 22, 49, 23, 30, 128, 49, 30, 30, 30, 30,
29, 29, 66, 29, 29, 29, 29, 176, 29, 29, 30, 30, 192, 30, 30, 30, 30, 184, 30, 30,
29, 29, 29, 29, 29, 29, 29, 172, 29, 29, 30, 30, 30, 30, 30, 30, 30, 183, 30, 30,
30, 74, 74, 30, 30, 30, 30, 30, 30, 164, 31, 63, 63, 31, 31, 31, 31, 31, 31, 178,
30, 30, 30, 30, 163, 30, 30, 30, 30, 30, 31, 31, 31, 31, 177, 31, 31, 31, 31, 31,
30, 30, 30, 30, 158, 30, 30, 34, 81, 81, 31, 31, 31, 31, 176, 31, 31, 35, 65, 65,
34, 34, 34, 34, 34, 34, 157, 34, 34, 34, 35, 35, 35, 35, 35, 35, 175, 35, 35, 35,
34, 156, 34, 34, 34, 34, 34, 34, 34, 34, 35, 174, 35, 35, 35, 35, 35, 35, 35, 35,
34, 85, 34, 34, 37, 85, 155, 37, 37, 37, 35, 173, 35, 35, 38, 79, 79, 38, 38, 38,
37, 37, 37, 154, 37, 37, 37, 37, 153, 37, 38, 38, 38, 171, 38, 38, 38, 38, 169, 38,
37, 37, 37, 37, 37, 37, 37, 37, 151, 37, 38, 38, 38, 38, 38, 38, 38, 38, 168, 38,
37, 40, 45, 45, 40, 40, 40, 40, 40, 40, 38, 42, 47, 47, 42, 42, 42, 42, 42, 42,
40, 40, 91, 40, 46, 46, 91, 67, 45, 67, 42, 42, 70, 42, 48, 48, 134, 59, 47, 59,
78, 82, 78, 82, 46, 86, 93, 86, 93, 108, 64, 166, 64, 70, 48, 71, 83, 71, 83, 134,
46, 71, 108, 149, 71, 71, 71, 71, 71, 71, 48, 75, 86, 86, 75, 75, 75, 75, 75, 75,
148, 71, 71, 71, 71, 146, 71, 71, 71, 71, 163, 75, 75, 75, 75, 161, 75, 75, 75, 75,
71, 71, 71, 71, 71, 143, 71, 71, 94, 96, 75, 75, 75, 75, 75, 160, 75, 75, 87, 88,
94, 96, 98, 99, 98, 99, 101, 102, 101, 102, 87, 88, 91, 92, 99, 92, 91, 93, 99, 93,
105, 107, 105, 107, 110, 112, 110, 141, 112, 113, 100, 102, 100, 102, 103, 104, 103, 106, 104, 106,
113, 115, 122, 115, 116, 116, 119, 125, 119, 121, 109, 110, 109, 111, 110, 111, 113, 114, 113, 114,
121, 124, 124, 126, 127, 122, 127, 129, 140, 138, 115, 119, 115, 119, 120, 122, 120, 122, 123, 124,
125, 122, 131, 134, 131, 134, 126, 136, 135, 136, 126, 123, 126, 129, 130, 158, 129, 131, 131, 133,
129, 137, 126, 137, 139, 142, 139, 142, 144, 145, 155, 133, 124, 136, 136, 141, 141, 130, 124, 139,
144, 145, 147, 150, 147, 150, 152, 133, 152, 162, 142, 139, 145, 130, 144, 144, 146, 147, 149, 147,
162, 162, 162, 162, 162, 165, 132, 128, 165, 165, 151, 153, 151, 142, 154, 145, 154, 152, 156, 146,
166, 166, 167, 167, 168, 168, 169, 123, 169, 169, 156, 149, 157, 159, 157, 159, 162, 164, 162, 164,
169, 169, 170, 120, 170, 170, 170, 170, 171, 118, 165, 167, 165, 167, 170, 172, 170, 172, 182, 182,
117, 114, 171, 173, 173, 174, 174, 175, 175, 111, 182, 182, 182, 182, 185, 148, 143, 185, 185, 186,
109, 106, 104, 103, 100, 97, 95, 92, 90, 89, 186, 187, 187, 188, 188, 189, 140, 189, 189, 189,
88, 87, 84, 83, 80, 79, 77, 73, 69, 68, 189, 190, 138, 190, 190, 190, 190, 191, 137, 132,
59, 57, 55, 54, 49, 48, 47, 38, 25, 12, 127, 191, 193, 193, 194, 194, 195, 195, 125, 121,
9, 7, 161, 161, 161, 161, 161, 161, 161, 161, 118, 117, 116, 112, 108, 107, 105, 101, 98, 97,
161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 96, 95, 94, 90, 89, 85, 84, 82, 78, 77,
161, 161, 161, 161, 161, 161, 161, 161, 161, 161 73, 72, 62, 60, 58, 57, 52, 51, 50, 40,
39, 26, 12, 9, 7, 181, 181, 181, 181, 181,
181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
181, 181, 181
} ; } ;
static yy_state_type yy_last_accepting_state; static yy_state_type yy_last_accepting_state;
@@ -590,7 +606,7 @@ extern void yyerror __P((char *));
#define GOTRUNAS 2 #define GOTRUNAS 2
#line 594 "lex.yy.c" #line 610 "lex.yy.c"
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
@@ -743,7 +759,7 @@ YY_DECL
#line 90 "parse.lex" #line 90 "parse.lex"
#line 747 "lex.yy.c" #line 763 "lex.yy.c"
if ( yy_init ) if ( yy_init )
{ {
@@ -794,13 +810,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 162 ) if ( yy_current_state >= 182 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp; ++yy_cp;
} }
while ( yy_base[yy_current_state] != 413 ); while ( yy_base[yy_current_state] != 446 );
yy_find_action: yy_find_action:
yy_act = yy_accept[yy_current_state]; yy_act = yy_accept[yy_current_state];
@@ -937,28 +953,28 @@ YY_RULE_SETUP
case 14: case 14:
YY_RULE_SETUP YY_RULE_SETUP
#line 160 "parse.lex" #line 160 "parse.lex"
{ {
/* netgroup */ /* cmnd requires passwd for this user */
fill(yytext, yyleng); LEXTRACE("PASSWD ");
return(NETGROUP); return(PASSWD);
} }
YY_BREAK YY_BREAK
case 15: case 15:
YY_RULE_SETUP YY_RULE_SETUP
#line 166 "parse.lex" #line 166 "parse.lex"
{ {
/* UN*X group */ /* netgroup */
fill(yytext, yyleng); fill(yytext, yyleng);
return(USERGROUP); return(NETGROUP);
} }
YY_BREAK YY_BREAK
case 16: case 16:
YY_RULE_SETUP YY_RULE_SETUP
#line 172 "parse.lex" #line 172 "parse.lex"
{ {
/* UN*X group */
fill(yytext, yyleng); fill(yytext, yyleng);
LEXTRACE("NTWKADDR "); return(USERGROUP);
return(NTWKADDR);
} }
YY_BREAK YY_BREAK
case 17: case 17:
@@ -966,22 +982,31 @@ YY_RULE_SETUP
#line 178 "parse.lex" #line 178 "parse.lex"
{ {
fill(yytext, yyleng); fill(yytext, yyleng);
LEXTRACE("FQHOST "); LEXTRACE("NTWKADDR ");
return(FQHOST); return(NTWKADDR);
} }
YY_BREAK YY_BREAK
case 18: case 18:
YY_RULE_SETUP YY_RULE_SETUP
#line 184 "parse.lex" #line 184 "parse.lex"
{ {
BEGIN GOTRUNAS; fill(yytext, yyleng);
LEXTRACE("RUNAS "); LEXTRACE("FQHOST ");
return (RUNAS); return(FQHOST);
} }
YY_BREAK YY_BREAK
case 19: case 19:
YY_RULE_SETUP YY_RULE_SETUP
#line 190 "parse.lex" #line 190 "parse.lex"
{
BEGIN GOTRUNAS;
LEXTRACE("RUNAS ");
return (RUNAS);
}
YY_BREAK
case 20:
YY_RULE_SETUP
#line 196 "parse.lex"
{ {
/* Runas_Alias that user can run command as or ALL */ /* Runas_Alias that user can run command as or ALL */
fill(yytext, yyleng); fill(yytext, yyleng);
@@ -994,9 +1019,9 @@ YY_RULE_SETUP
} }
} }
YY_BREAK YY_BREAK
case 20: case 21:
YY_RULE_SETUP YY_RULE_SETUP
#line 202 "parse.lex" #line 208 "parse.lex"
{ {
/* username/uid that user can run command as */ /* username/uid that user can run command as */
fill(yytext, yyleng); fill(yytext, yyleng);
@@ -1004,14 +1029,14 @@ YY_RULE_SETUP
return(NAME); return(NAME);
} }
YY_BREAK YY_BREAK
case 21:
YY_RULE_SETUP
#line 209 "parse.lex"
BEGIN INITIAL;
YY_BREAK
case 22: case 22:
YY_RULE_SETUP YY_RULE_SETUP
#line 212 "parse.lex" #line 215 "parse.lex"
BEGIN INITIAL;
YY_BREAK
case 23:
YY_RULE_SETUP
#line 218 "parse.lex"
{ {
/* directories can't have args... */ /* directories can't have args... */
if (yytext[yyleng - 1] == '/') { if (yytext[yyleng - 1] == '/') {
@@ -1025,9 +1050,9 @@ YY_RULE_SETUP
} }
} /* a pathname */ } /* a pathname */
YY_BREAK YY_BREAK
case 23: case 24:
YY_RULE_SETUP YY_RULE_SETUP
#line 225 "parse.lex" #line 231 "parse.lex"
{ {
fill(yytext, yyleng); fill(yytext, yyleng);
if (strcmp(yytext, "ALL") == 0) { if (strcmp(yytext, "ALL") == 0) {
@@ -1038,9 +1063,9 @@ YY_RULE_SETUP
return(ALIAS); return(ALIAS);
} }
YY_BREAK YY_BREAK
case 24: case 25:
YY_RULE_SETUP YY_RULE_SETUP
#line 235 "parse.lex" #line 241 "parse.lex"
{ {
fill(yytext, yyleng); fill(yytext, yyleng);
if (strcmp(yytext, "Host_Alias") == 0) { if (strcmp(yytext, "Host_Alias") == 0) {
@@ -1065,19 +1090,19 @@ YY_RULE_SETUP
return(NAME); return(NAME);
} }
YY_BREAK YY_BREAK
case 25: case 26:
YY_RULE_SETUP YY_RULE_SETUP
#line 259 "parse.lex" #line 265 "parse.lex"
{ {
return(ERROR); return(ERROR);
} /* parse error */ } /* parse error */
YY_BREAK YY_BREAK
case 26: case 27:
YY_RULE_SETUP YY_RULE_SETUP
#line 263 "parse.lex" #line 269 "parse.lex"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 1081 "lex.yy.c" #line 1106 "lex.yy.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(GOTCMND): case YY_STATE_EOF(GOTCMND):
case YY_STATE_EOF(GOTRUNAS): case YY_STATE_EOF(GOTRUNAS):
@@ -1371,7 +1396,7 @@ static yy_state_type yy_get_previous_state()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 162 ) if ( yy_current_state >= 182 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1406,11 +1431,11 @@ yy_state_type yy_current_state;
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 162 ) if ( yy_current_state >= 182 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 161); yy_is_jam = (yy_current_state == 181);
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
@@ -1965,7 +1990,7 @@ int main()
return 0; return 0;
} }
#endif #endif
#line 263 "parse.lex" #line 269 "parse.lex"
static void fill(s, len) static void fill(s, len)
char *s; char *s;

View File

@@ -120,6 +120,20 @@ int top = 0, stacksize = 0;
top++; \ top++; \
} }
#define pushcp \
{ \
if (top >= stacksize) { \
while ((stacksize += STACKINCREMENT) < top); \
match = (struct matchstack *) erealloc(match, sizeof(struct matchstack) * stacksize); \
} \
match[top].user = match[top-1].user; \
match[top].cmnd = match[top-1].cmnd; \
match[top].host = match[top-1].host; \
match[top].runas = match[top-1].runas; \
match[top].nopass = match[top-1].nopass; \
top++; \
}
#define pop \ #define pop \
{ \ { \
if (top == 0) \ if (top == 0) \
@@ -171,14 +185,14 @@ void yyerror(s)
#endif #endif
parse_error = TRUE; parse_error = TRUE;
} }
#line 158 "parse.yacc" #line 172 "parse.yacc"
typedef union { typedef union {
char *string; char *string;
int BOOLEAN; int BOOLEAN;
struct sudo_command command; struct sudo_command command;
int tok; int tok;
} YYSTYPE; } YYSTYPE;
#line 182 "sudo.tab.c" #line 196 "sudo.tab.c"
#define ALIAS 257 #define ALIAS 257
#define NTWKADDR 258 #define NTWKADDR 258
#define FQHOST 259 #define FQHOST 259
@@ -187,175 +201,178 @@ typedef union {
#define NAME 262 #define NAME 262
#define RUNAS 263 #define RUNAS 263
#define NOPASSWD 264 #define NOPASSWD 264
#define COMMAND 265 #define PASSWD 265
#define COMMENT 266 #define COMMAND 266
#define ALL 267 #define COMMENT 267
#define HOSTALIAS 268 #define ALL 268
#define CMNDALIAS 269 #define HOSTALIAS 269
#define USERALIAS 270 #define CMNDALIAS 270
#define RUNASALIAS 271 #define USERALIAS 271
#define ERROR 272 #define RUNASALIAS 272
#define ERROR 273
#define YYERRCODE 256 #define YYERRCODE 256
short yylhs[] = { -1, short yylhs[] = { -1,
0, 0, 7, 7, 9, 7, 7, 7, 7, 7, 0, 0, 7, 7, 9, 7, 7, 7, 7, 7,
10, 10, 15, 16, 16, 16, 16, 16, 16, 17, 10, 10, 15, 16, 16, 16, 16, 16, 16, 17,
17, 19, 18, 2, 20, 2, 3, 3, 4, 4, 17, 19, 18, 2, 20, 2, 3, 3, 4, 4,
5, 5, 5, 5, 5, 6, 6, 1, 1, 1, 5, 5, 5, 5, 5, 6, 6, 6, 1, 1,
12, 12, 22, 21, 23, 23, 13, 13, 25, 24, 1, 12, 12, 22, 21, 23, 23, 13, 13, 25,
26, 26, 14, 14, 28, 27, 11, 11, 30, 29, 24, 26, 26, 14, 14, 28, 27, 11, 11, 30,
31, 31, 8, 8, 8, 8, 8, 29, 31, 31, 8, 8, 8, 8, 8,
}; };
short yylen[] = { 2, short yylen[] = { 2,
1, 2, 1, 2, 0, 3, 2, 2, 2, 2, 1, 2, 1, 2, 0, 3, 2, 2, 2, 2,
1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1,
3, 0, 4, 1, 0, 3, 0, 2, 1, 3, 3, 0, 4, 1, 0, 3, 0, 2, 1, 3,
1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
1, 3, 0, 4, 1, 3, 1, 3, 0, 4, 1, 1, 3, 0, 4, 1, 3, 1, 3, 0,
1, 3, 1, 3, 0, 4, 1, 3, 0, 4, 4, 1, 3, 1, 3, 0, 4, 1, 3, 0,
1, 3, 1, 1, 1, 1, 1, 4, 1, 3, 1, 1, 1, 1, 1,
}; };
short yydefred[] = { 0, short yydefred[] = { 0,
0, 3, 0, 0, 0, 0, 0, 1, 0, 4, 0, 3, 0, 0, 0, 0, 0, 1, 0, 4,
43, 0, 41, 49, 0, 47, 59, 0, 57, 55, 44, 0, 42, 50, 0, 48, 60, 0, 58, 56,
0, 53, 2, 66, 65, 64, 63, 67, 0, 0, 0, 54, 2, 67, 66, 65, 64, 68, 0, 0,
0, 0, 0, 0, 0, 0, 0, 19, 15, 18, 0, 0, 0, 0, 0, 0, 0, 19, 15, 18,
16, 17, 14, 0, 11, 0, 0, 42, 0, 48, 16, 17, 14, 0, 11, 0, 0, 43, 0, 49,
0, 58, 0, 54, 0, 22, 45, 0, 39, 40, 0, 59, 0, 55, 0, 22, 46, 0, 40, 41,
38, 51, 0, 61, 0, 34, 33, 32, 31, 35, 39, 52, 0, 62, 0, 34, 33, 32, 31, 35,
0, 29, 12, 0, 20, 0, 0, 0, 0, 0, 0, 29, 12, 0, 20, 0, 0, 0, 0, 0,
22, 0, 0, 46, 52, 62, 30, 21, 0, 37, 22, 0, 0, 47, 53, 63, 30, 21, 0, 37,
0, 25, 24, 23, 0, 26, 38, 0, 25, 24, 23, 0, 26,
}; };
short yydgoto[] = { 7, short yydgoto[] = { 7,
93, 94, 83, 71, 72, 91, 8, 29, 9, 44, 94, 95, 83, 71, 72, 92, 8, 29, 9, 44,
18, 12, 15, 21, 45, 46, 74, 75, 76, 95, 18, 12, 15, 21, 45, 46, 74, 75, 76, 96,
13, 30, 58, 16, 32, 63, 22, 36, 19, 34, 13, 30, 58, 16, 32, 63, 22, 36, 19, 34,
65, 65,
}; };
short yysindex[] = { -248, short yysindex[] = { -248,
-259, 0, -247, -246, -245, -244, -248, 0, -221, 0, -258, 0, -246, -245, -243, -241, -248, 0, -211, 0,
0, -44, 0, 0, -42, 0, 0, -39, 0, 0, 0, -41, 0, 0, -38, 0, 0, -31, 0, 0,
-30, 0, 0, 0, 0, 0, 0, 0, -233, -46, -30, 0, 0, 0, 0, 0, 0, 0, -220, -32,
-247, -31, -246, -23, -245, -19, -244, 0, 0, 0, -246, -20, -245, -18, -243, -17, -241, 0, 0, 0,
0, 0, 0, -21, 0, -18, -233, 0, -212, 0, 0, 0, 0, -25, 0, -16, -220, 0, -253, 0,
-221, 0, -210, 0, -233, 0, 0, 4, 0, 0, -211, 0, -197, 0, -220, 0, 0, -14, 0, 0,
0, 0, 10, 0, 12, 0, 0, 0, 0, 0, 0, 0, -10, 0, 3, 0, 0, 0, 0, 0,
16, 0, 0, 20, 0, -219, -233, -212, -221, -210, 9, 0, 0, 10, 0, -208, -220, -253, -211, -197,
0, -210, -198, 0, 0, 0, 0, 0, 16, 0, 0, -197, -239, 0, 0, 0, 0, 0, 9, 0,
-28, 0, 0, 0, -28, 0, 0, -27, 0, 0, 0, -27, 0,
}; };
short yyrindex[] = { -199, short yyrindex[] = { -187,
0, 0, 0, 0, 0, 0, -199, 0, 0, 0, 0, 0, 0, 0, 0, 0, -187, 0, 0, 0,
0, 81, 0, 0, 97, 0, 0, 113, 0, 0, 0, 86, 0, 0, 103, 0, 0, 120, 0, 0,
129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 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, 0, 0, 0,
0, 0, 0, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 154, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 17, 0, 33, 0, 0, 0, 0, 0, 0, 0, 18, 0, 35, 0, 0, 0, 0, 0,
49, 0, 0, 65, 0, -33, 0, 0, 0, 0, 52, 0, 0, 69, 0, -33, 0, 0, 0, 0,
0, 0, -24, 0, 0, 0, 0, 0, -29, 0, 0, 0, -23, 0, 0, 0, 0, 0, -28, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}; };
short yygindex[] = { 0, short yygindex[] = { 0,
-43, -26, 0, -15, -10, 0, 64, -48, 0, 0, -42, -40, 0, -24, -19, 0, 55, -48, 0, 0,
0, 0, 0, 0, 18, -45, 0, -9, 0, 0, 0, 0, 0, 0, 11, -45, 0, -13, 0, 0,
43, 0, 0, 44, 0, 0, 39, 0, 45, 0, 36, 0, 0, 39, 0, 0, 40, 0, 43, 0,
0, 0,
}; };
#define YYTABLESIZE 416 #define YYTABLESIZE 426
short yytable[] = { 27, short yytable[] = { 27,
44, 57, 64, 28, 92, 62, 10, 1, 36, 11, 45, 57, 64, 59, 28, 93, 62, 1, 10, 36,
14, 17, 20, 31, 47, 33, 50, 2, 35, 3, 11, 14, 60, 17, 61, 20, 31, 51, 2, 33,
4, 5, 6, 38, 39, 40, 41, 37, 42, 49, 3, 4, 5, 6, 90, 91, 35, 37, 47, 77,
86, 84, 60, 43, 85, 24, 55, 51, 25, 26, 86, 84, 55, 78, 61, 85, 38, 39, 40, 41,
27, 53, 56, 82, 59, 28, 66, 77, 56, 67, 49, 42, 51, 53, 56, 24, 79, 43, 25, 26,
68, 69, 60, 78, 61, 79, 70, 5, 44, 80, 27, 57, 80, 81, 82, 97, 28, 89, 45, 66,
5, 5, 5, 81, 13, 90, 89, 5, 96, 87, 87, 23, 67, 68, 69, 73, 48, 88, 13, 5,
23, 88, 73, 48, 50, 54, 50, 0, 0, 52, 70, 50, 5, 5, 5, 51, 54, 52, 0, 0,
8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 8, 0, 0, 0, 0,
60, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 57,
0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
0, 0, 13, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0,
0, 0, 0, 0, 0, 0, 10, 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, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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,
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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 28, 59,
0, 0, 0, 27, 0, 0, 0, 28, 59, 0, 27, 27, 27, 36, 27, 28, 28, 28, 60, 28,
27, 27, 36, 27, 28, 28, 60, 28, 61, 0, 61, 0, 36, 0, 36, 0, 0, 0, 0, 0,
36, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 45, 0, 0,
0, 0, 0, 0, 0, 0, 44, 44, 0, 0, 45, 45, 45, 0, 0, 0, 0, 45, 45, 45,
44, 44, 44, 0, 0, 0, 44, 44, 44, 44, 45, 45, 45, 51, 51, 0, 0, 51, 51, 51,
44, 44, 50, 50, 0, 0, 50, 50, 50, 0, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51,
0, 0, 50, 50, 50, 50, 50, 50, 60, 60, 61, 61, 0, 0, 61, 61, 61, 0, 0, 0,
0, 0, 60, 60, 60, 0, 0, 0, 60, 60, 0, 61, 61, 61, 61, 61, 61, 57, 57, 0,
60, 60, 60, 60, 56, 56, 0, 0, 56, 56, 0, 57, 57, 57, 0, 0, 0, 0, 57, 57,
56, 0, 0, 0, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 13, 13, 0, 0, 13, 13,
13, 13, 0, 0, 13, 13, 13, 0, 0, 0, 13, 0, 0, 0, 0, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 8, 8, 0, 0, 13, 8, 8, 0, 0, 8, 8, 8, 0, 0,
8, 8, 8, 0, 0, 0, 8, 8, 8, 8, 0, 0, 8, 8, 8, 8, 8, 8, 9, 9,
8, 8, 9, 9, 0, 0, 9, 9, 9, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 9,
0, 0, 9, 9, 9, 9, 9, 9, 7, 7, 9, 9, 9, 9, 9, 7, 7, 0, 0, 7,
0, 0, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7,
7, 7, 7, 7, 10, 10, 0, 0, 10, 10, 7, 7, 10, 10, 0, 0, 10, 10, 10, 0,
10, 0, 0, 0, 10, 10, 10, 10, 10, 10, 0, 0, 0, 10, 10, 10, 10, 10, 10, 6,
6, 6, 0, 0, 6, 6, 6, 0, 0, 0, 6, 0, 0, 6, 6, 6, 0, 0, 0, 0,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
}; };
short yycheck[] = { 33, short yycheck[] = { 33,
0, 47, 51, 33, 33, 49, 266, 256, 33, 257, 0, 47, 51, 257, 33, 33, 49, 256, 267, 33,
257, 257, 257, 58, 61, 58, 0, 266, 58, 268, 257, 257, 266, 257, 268, 257, 58, 0, 267, 58,
269, 270, 271, 257, 258, 259, 260, 58, 262, 61, 269, 270, 271, 272, 264, 265, 58, 58, 61, 44,
79, 77, 0, 267, 78, 257, 58, 61, 260, 261, 79, 77, 58, 44, 0, 78, 257, 258, 259, 260,
262, 61, 61, 263, 257, 267, 257, 44, 0, 260, 61, 262, 61, 61, 61, 257, 44, 268, 260, 261,
261, 262, 265, 44, 267, 44, 267, 257, 58, 44, 262, 0, 44, 44, 263, 96, 268, 82, 58, 257,
260, 261, 262, 44, 0, 264, 82, 267, 95, 80, 80, 7, 260, 261, 262, 55, 31, 81, 0, 257,
7, 81, 55, 31, 58, 37, 33, -1, -1, 35, 268, 33, 260, 261, 262, 58, 37, 35, -1, -1,
0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 268, -1, -1, -1, -1, 0, -1, -1, -1, -1,
58, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 0, -1, -1, -1, -1, -1, -1, 58,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
-1, -1, -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, -1,
-1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
-1, -1, 58, -1, -1, -1, -1, -1, 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, 0, -1, -1, -1, -1, -1, -1, -1, -1, 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, -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, 257, -1, -1, -1, -1, 257, 257,
-1, -1, -1, 257, -1, -1, -1, 257, 257, -1, 264, 265, 266, 257, 268, 264, 265, 266, 266, 268,
264, 265, 257, 267, 264, 265, 265, 267, 267, -1, 268, -1, 266, -1, 268, -1, -1, -1, -1, -1,
265, -1, 267, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 256, 257, -1, -1, -1, -1, -1, -1, -1, -1, 256, 257, -1, -1,
260, 261, 262, -1, -1, -1, 266, 267, 268, 269, 260, 261, 262, -1, -1, -1, -1, 267, 268, 269,
270, 271, 256, 257, -1, -1, 260, 261, 262, -1, 270, 271, 272, 256, 257, -1, -1, 260, 261, 262,
-1, -1, 266, 267, 268, 269, 270, 271, 256, 257, -1, -1, -1, -1, 267, 268, 269, 270, 271, 272,
-1, -1, 260, 261, 262, -1, -1, -1, 266, 267,
268, 269, 270, 271, 256, 257, -1, -1, 260, 261,
262, -1, -1, -1, 266, 267, 268, 269, 270, 271,
256, 257, -1, -1, 260, 261, 262, -1, -1, -1, 256, 257, -1, -1, 260, 261, 262, -1, -1, -1,
266, 267, 268, 269, 270, 271, 256, 257, -1, -1, -1, 267, 268, 269, 270, 271, 272, 256, 257, -1,
260, 261, 262, -1, -1, -1, 266, 267, 268, 269, -1, 260, 261, 262, -1, -1, -1, -1, 267, 268,
270, 271, 256, 257, -1, -1, 260, 261, 262, -1, 269, 270, 271, 272, 256, 257, -1, -1, 260, 261,
-1, -1, 266, 267, 268, 269, 270, 271, 256, 257, 262, -1, -1, -1, -1, 267, 268, 269, 270, 271,
-1, -1, 260, 261, 262, -1, -1, -1, 266, 267, 272, 256, 257, -1, -1, 260, 261, 262, -1, -1,
268, 269, 270, 271, 256, 257, -1, -1, 260, 261, -1, -1, 267, 268, 269, 270, 271, 272, 256, 257,
262, -1, -1, -1, 266, 267, 268, 269, 270, 271, -1, -1, 260, 261, 262, -1, -1, -1, -1, 267,
256, 257, -1, -1, 260, 261, 262, -1, -1, -1, 268, 269, 270, 271, 272, 256, 257, -1, -1, 260,
266, 267, 268, 269, 270, 271, 261, 262, -1, -1, -1, -1, 267, 268, 269, 270,
271, 272, 256, 257, -1, -1, 260, 261, 262, -1,
-1, -1, -1, 267, 268, 269, 270, 271, 272, 256,
257, -1, -1, 260, 261, 262, -1, -1, -1, -1,
267, 268, 269, 270, 271, 272,
}; };
#define YYFINAL 7 #define YYFINAL 7
#ifndef YYDEBUG #ifndef YYDEBUG
#define YYDEBUG 0 #define YYDEBUG 0
#endif #endif
#define YYMAXTOKEN 272 #define YYMAXTOKEN 273
#if YYDEBUG #if YYDEBUG
char *yyname[] = { char *yyname[] = {
"end-of-file",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,0,0,0,0,0,0, "end-of-file",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,0,0,0,0,0,0,
@@ -365,8 +382,9 @@ char *yyname[] = {
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,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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,"ALIAS", 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,0,0,0,0,0,0,0,0,"ALIAS",
"NTWKADDR","FQHOST","NETGROUP","USERGROUP","NAME","RUNAS","NOPASSWD","COMMAND", "NTWKADDR","FQHOST","NETGROUP","USERGROUP","NAME","RUNAS","NOPASSWD","PASSWD",
"COMMENT","ALL","HOSTALIAS","CMNDALIAS","USERALIAS","RUNASALIAS","ERROR", "COMMAND","COMMENT","ALL","HOSTALIAS","CMNDALIAS","USERALIAS","RUNASALIAS",
"ERROR",
}; };
char *yyrule[] = { char *yyrule[] = {
"$accept : file", "$accept : file",
@@ -407,6 +425,7 @@ char *yyrule[] = {
"runasuser : ALL", "runasuser : ALL",
"nopasswd :", "nopasswd :",
"nopasswd : NOPASSWD", "nopasswd : NOPASSWD",
"nopasswd : PASSWD",
"cmnd : ALL", "cmnd : ALL",
"cmnd : ALIAS", "cmnd : ALIAS",
"cmnd : COMMAND", "cmnd : COMMAND",
@@ -463,7 +482,7 @@ short *yyss;
short *yysslim; short *yysslim;
YYSTYPE *yyvs; YYSTYPE *yyvs;
int yystacksize; int yystacksize;
#line 609 "parse.yacc" #line 629 "parse.yacc"
typedef struct { typedef struct {
@@ -840,7 +859,7 @@ void init_parser()
if (printmatches == TRUE) if (printmatches == TRUE)
expand_match_list(); expand_match_list();
} }
#line 844 "sudo.tab.c" #line 863 "sudo.tab.c"
/* allocate initial stack or double stack size, up to YYMAXDEPTH */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */
#if defined(__cplusplus) || __STDC__ #if defined(__cplusplus) || __STDC__
static int yygrowstack(void) static int yygrowstack(void)
@@ -1021,19 +1040,19 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 3: case 3:
#line 199 "parse.yacc" #line 214 "parse.yacc"
{ ; } { ; }
break; break;
case 4: case 4:
#line 201 "parse.yacc" #line 216 "parse.yacc"
{ yyerrok; } { yyerrok; }
break; break;
case 5: case 5:
#line 202 "parse.yacc" #line 217 "parse.yacc"
{ push; } { push; }
break; break;
case 6: case 6:
#line 202 "parse.yacc" #line 217 "parse.yacc"
{ {
while (top && user_matches != TRUE) { while (top && user_matches != TRUE) {
pop; pop;
@@ -1041,23 +1060,23 @@ case 6:
} }
break; break;
case 7: case 7:
#line 208 "parse.yacc" #line 223 "parse.yacc"
{ ; } { ; }
break; break;
case 8: case 8:
#line 210 "parse.yacc" #line 225 "parse.yacc"
{ ; } { ; }
break; break;
case 9: case 9:
#line 212 "parse.yacc" #line 227 "parse.yacc"
{ ; } { ; }
break; break;
case 10: case 10:
#line 214 "parse.yacc" #line 229 "parse.yacc"
{ ; } { ; }
break; break;
case 13: case 13:
#line 222 "parse.yacc" #line 237 "parse.yacc"
{ {
if (user_matches == TRUE) { if (user_matches == TRUE) {
push; push;
@@ -1069,13 +1088,13 @@ case 13:
} }
break; break;
case 14: case 14:
#line 233 "parse.yacc" #line 248 "parse.yacc"
{ {
host_matches = TRUE; host_matches = TRUE;
} }
break; break;
case 15: case 15:
#line 236 "parse.yacc" #line 251 "parse.yacc"
{ {
if (addr_matches(yyvsp[0].string)) if (addr_matches(yyvsp[0].string))
host_matches = TRUE; host_matches = TRUE;
@@ -1083,7 +1102,7 @@ case 15:
} }
break; break;
case 16: case 16:
#line 241 "parse.yacc" #line 256 "parse.yacc"
{ {
if (netgr_matches(yyvsp[0].string, host, NULL)) if (netgr_matches(yyvsp[0].string, host, NULL))
host_matches = TRUE; host_matches = TRUE;
@@ -1091,7 +1110,7 @@ case 16:
} }
break; break;
case 17: case 17:
#line 246 "parse.yacc" #line 261 "parse.yacc"
{ {
if (strcasecmp(shost, yyvsp[0].string) == 0) if (strcasecmp(shost, yyvsp[0].string) == 0)
host_matches = TRUE; host_matches = TRUE;
@@ -1099,7 +1118,7 @@ case 17:
} }
break; break;
case 18: case 18:
#line 251 "parse.yacc" #line 266 "parse.yacc"
{ {
if (strcasecmp(host, yyvsp[0].string) == 0) if (strcasecmp(host, yyvsp[0].string) == 0)
host_matches = TRUE; host_matches = TRUE;
@@ -1107,7 +1126,7 @@ case 18:
} }
break; break;
case 19: case 19:
#line 256 "parse.yacc" #line 271 "parse.yacc"
{ {
/* could be an all-caps hostname */ /* could be an all-caps hostname */
if (find_alias(yyvsp[0].string, HOST_ALIAS) == TRUE || if (find_alias(yyvsp[0].string, HOST_ALIAS) == TRUE ||
@@ -1117,27 +1136,18 @@ case 19:
} }
break; break;
case 22: case 22:
#line 269 "parse.yacc" #line 284 "parse.yacc"
{ /* Push a new entry onto the stack if needed */ { /* Push a new entry onto the stack if needed */
if (user_matches == TRUE && host_matches == TRUE && if (user_matches == TRUE && host_matches == TRUE &&
cmnd_matches != -1 && runas_matches == TRUE) { cmnd_matches != -1 && runas_matches == TRUE)
push; pushcp;
user_matches = TRUE; cmnd_matches = -1;
host_matches = TRUE;
} else {
cmnd_matches = -1;
runas_matches = -1;
no_passwd = -1;
}
} }
break; break;
case 23: case 23:
#line 280 "parse.yacc" #line 289 "parse.yacc"
{ {
if (yyvsp[-2].BOOLEAN > 0) /* XXX - test runas_matches and cmnd_matches instead? */
runas_matches = TRUE;
if (yyvsp[-1].BOOLEAN == TRUE)
no_passwd = TRUE;
if ((yyvsp[-2].BOOLEAN == -1 || yyvsp[0].BOOLEAN == -1) && printmatches == TRUE) { if ((yyvsp[-2].BOOLEAN == -1 || yyvsp[0].BOOLEAN == -1) && printmatches == TRUE) {
cm_list[cm_list_len].runas_len = 0; cm_list[cm_list_len].runas_len = 0;
cm_list[cm_list_len].cmnd_len = 0; cm_list[cm_list_len].cmnd_len = 0;
@@ -1146,11 +1156,11 @@ case 23:
} }
break; break;
case 24: case 24:
#line 293 "parse.yacc" #line 299 "parse.yacc"
{ ; } { ; }
break; break;
case 25: case 25:
#line 294 "parse.yacc" #line 300 "parse.yacc"
{ {
if (printmatches == TRUE && host_matches == TRUE && if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE) { user_matches == TRUE) {
@@ -1166,7 +1176,7 @@ case 25:
} }
break; break;
case 26: case 26:
#line 306 "parse.yacc" #line 312 "parse.yacc"
{ {
int cmnd_matched = cmnd_matches; int cmnd_matched = cmnd_matches;
pop; pop;
@@ -1178,31 +1188,39 @@ case 26:
} }
break; break;
case 27: case 27:
#line 317 "parse.yacc" #line 323 "parse.yacc"
{ {
yyval.BOOLEAN = (strcmp(RUNAS_DEFAULT, runas_user) == 0); /*
* If this is the first entry in a command list
* then check against RUNAS_DEFAULT.
*/
if (runas_matches == -1)
runas_matches =
(strcmp(RUNAS_DEFAULT, runas_user) == 0);
yyval.BOOLEAN = runas_matches;
} }
break; break;
case 28: case 28:
#line 320 "parse.yacc" #line 333 "parse.yacc"
{ {
yyval.BOOLEAN = yyvsp[0].BOOLEAN; runas_matches = (yyvsp[0].BOOLEAN > 0);
yyval.BOOLEAN = runas_matches;
} }
break; break;
case 29: case 29:
#line 325 "parse.yacc" #line 339 "parse.yacc"
{ {
yyval.BOOLEAN = yyvsp[0].BOOLEAN; yyval.BOOLEAN = yyvsp[0].BOOLEAN;
} }
break; break;
case 30: case 30:
#line 328 "parse.yacc" #line 342 "parse.yacc"
{ {
yyval.BOOLEAN = yyvsp[-2].BOOLEAN + yyvsp[0].BOOLEAN; yyval.BOOLEAN = yyvsp[-2].BOOLEAN + yyvsp[0].BOOLEAN;
} }
break; break;
case 31: case 31:
#line 334 "parse.yacc" #line 348 "parse.yacc"
{ {
yyval.BOOLEAN = (strcmp(yyvsp[0].string, runas_user) == 0); yyval.BOOLEAN = (strcmp(yyvsp[0].string, runas_user) == 0);
if (printmatches == TRUE && in_alias == TRUE) if (printmatches == TRUE && in_alias == TRUE)
@@ -1218,7 +1236,7 @@ case 31:
} }
break; break;
case 32: case 32:
#line 347 "parse.yacc" #line 361 "parse.yacc"
{ {
yyval.BOOLEAN = usergr_matches(yyvsp[0].string, runas_user); yyval.BOOLEAN = usergr_matches(yyvsp[0].string, runas_user);
if (printmatches == TRUE && in_alias == TRUE) if (printmatches == TRUE && in_alias == TRUE)
@@ -1238,7 +1256,7 @@ case 32:
} }
break; break;
case 33: case 33:
#line 364 "parse.yacc" #line 378 "parse.yacc"
{ {
yyval.BOOLEAN = netgr_matches(yyvsp[0].string, NULL, runas_user); yyval.BOOLEAN = netgr_matches(yyvsp[0].string, NULL, runas_user);
if (printmatches == TRUE && in_alias == TRUE) if (printmatches == TRUE && in_alias == TRUE)
@@ -1258,7 +1276,7 @@ case 33:
} }
break; break;
case 34: case 34:
#line 381 "parse.yacc" #line 395 "parse.yacc"
{ {
/* could be an all-caps username */ /* could be an all-caps username */
if (find_alias(yyvsp[0].string, RUNAS_ALIAS) == TRUE || if (find_alias(yyvsp[0].string, RUNAS_ALIAS) == TRUE ||
@@ -1279,7 +1297,7 @@ case 34:
} }
break; break;
case 35: case 35:
#line 399 "parse.yacc" #line 413 "parse.yacc"
{ {
yyval.BOOLEAN = TRUE; yyval.BOOLEAN = TRUE;
if (printmatches == TRUE && in_alias == TRUE) if (printmatches == TRUE && in_alias == TRUE)
@@ -1294,22 +1312,31 @@ case 35:
} }
break; break;
case 36: case 36:
#line 413 "parse.yacc" #line 427 "parse.yacc"
{ {
yyval.BOOLEAN = FALSE; ;
} }
break; break;
case 37: case 37:
#line 416 "parse.yacc" #line 430 "parse.yacc"
{ {
yyval.BOOLEAN = TRUE; no_passwd = yyval.BOOLEAN = TRUE;
if (printmatches == TRUE && host_matches == TRUE && if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE) user_matches == TRUE)
cm_list[cm_list_len].nopasswd = TRUE; cm_list[cm_list_len].nopasswd = TRUE;
} }
break; break;
case 38: case 38:
#line 424 "parse.yacc" #line 436 "parse.yacc"
{
no_passwd = yyval.BOOLEAN = FALSE;
if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE)
cm_list[cm_list_len].nopasswd = FALSE;
}
break;
case 39:
#line 444 "parse.yacc"
{ {
if (printmatches == TRUE && in_alias == TRUE) { if (printmatches == TRUE && in_alias == TRUE) {
append("ALL", &ga_list[ga_list_len-1].entries, append("ALL", &ga_list[ga_list_len-1].entries,
@@ -1328,8 +1355,8 @@ case 38:
yyval.BOOLEAN = TRUE; yyval.BOOLEAN = TRUE;
} }
break; break;
case 39: case 40:
#line 441 "parse.yacc" #line 461 "parse.yacc"
{ {
if (printmatches == TRUE && in_alias == TRUE) { if (printmatches == TRUE && in_alias == TRUE) {
append(yyvsp[0].string, &ga_list[ga_list_len-1].entries, append(yyvsp[0].string, &ga_list[ga_list_len-1].entries,
@@ -1350,8 +1377,8 @@ case 39:
(void) free(yyvsp[0].string); (void) free(yyvsp[0].string);
} }
break; break;
case 40: case 41:
#line 460 "parse.yacc" #line 480 "parse.yacc"
{ {
if (printmatches == TRUE && in_alias == TRUE) { if (printmatches == TRUE && in_alias == TRUE) {
append(yyvsp[0].command.cmnd, &ga_list[ga_list_len-1].entries, append(yyvsp[0].command.cmnd, &ga_list[ga_list_len-1].entries,
@@ -1386,12 +1413,12 @@ case 40:
(void) free(yyvsp[0].command.args); (void) free(yyvsp[0].command.args);
} }
break; break;
case 43: case 44:
#line 499 "parse.yacc" #line 519 "parse.yacc"
{ push; } { push; }
break; break;
case 44: case 45:
#line 499 "parse.yacc" #line 519 "parse.yacc"
{ {
if (host_matches == TRUE && if (host_matches == TRUE &&
add_alias(yyvsp[-3].string, HOST_ALIAS) == FALSE) add_alias(yyvsp[-3].string, HOST_ALIAS) == FALSE)
@@ -1399,8 +1426,8 @@ case 44:
pop; pop;
} }
break; break;
case 49: case 50:
#line 515 "parse.yacc" #line 535 "parse.yacc"
{ {
push; push;
if (printmatches == TRUE) { if (printmatches == TRUE) {
@@ -1411,8 +1438,8 @@ case 49:
} }
} }
break; break;
case 50: case 51:
#line 523 "parse.yacc" #line 543 "parse.yacc"
{ {
if (cmnd_matches == TRUE && if (cmnd_matches == TRUE &&
add_alias(yyvsp[-3].string, CMND_ALIAS) == FALSE) add_alias(yyvsp[-3].string, CMND_ALIAS) == FALSE)
@@ -1424,12 +1451,12 @@ case 50:
in_alias = FALSE; in_alias = FALSE;
} }
break; break;
case 51: case 52:
#line 536 "parse.yacc" #line 556 "parse.yacc"
{ ; } { ; }
break; break;
case 55: case 56:
#line 544 "parse.yacc" #line 564 "parse.yacc"
{ {
push; push;
if (printmatches == TRUE) { if (printmatches == TRUE) {
@@ -1440,8 +1467,8 @@ case 55:
} }
} }
break; break;
case 56: case 57:
#line 552 "parse.yacc" #line 572 "parse.yacc"
{ {
if (yyvsp[0].BOOLEAN > 0 && add_alias(yyvsp[-3].string, RUNAS_ALIAS) == FALSE) if (yyvsp[0].BOOLEAN > 0 && add_alias(yyvsp[-3].string, RUNAS_ALIAS) == FALSE)
YYERROR; YYERROR;
@@ -1452,12 +1479,12 @@ case 56:
in_alias = FALSE; in_alias = FALSE;
} }
break; break;
case 59: case 60:
#line 567 "parse.yacc" #line 587 "parse.yacc"
{ push; } { push; }
break; break;
case 60: case 61:
#line 567 "parse.yacc" #line 587 "parse.yacc"
{ {
if (user_matches == TRUE && if (user_matches == TRUE &&
add_alias(yyvsp[-3].string, USER_ALIAS) == FALSE) add_alias(yyvsp[-3].string, USER_ALIAS) == FALSE)
@@ -1466,36 +1493,36 @@ case 60:
(void) free(yyvsp[-3].string); (void) free(yyvsp[-3].string);
} }
break; break;
case 61: case 62:
#line 577 "parse.yacc" #line 597 "parse.yacc"
{ ; } { ; }
break; break;
case 63: case 64:
#line 581 "parse.yacc" #line 601 "parse.yacc"
{ {
if (strcmp(yyvsp[0].string, user_name) == 0) if (strcmp(yyvsp[0].string, user_name) == 0)
user_matches = TRUE; user_matches = TRUE;
(void) free(yyvsp[0].string); (void) free(yyvsp[0].string);
} }
break; break;
case 64: case 65:
#line 586 "parse.yacc" #line 606 "parse.yacc"
{ {
if (usergr_matches(yyvsp[0].string, user_name)) if (usergr_matches(yyvsp[0].string, user_name))
user_matches = TRUE; user_matches = TRUE;
(void) free(yyvsp[0].string); (void) free(yyvsp[0].string);
} }
break; break;
case 65: case 66:
#line 591 "parse.yacc" #line 611 "parse.yacc"
{ {
if (netgr_matches(yyvsp[0].string, NULL, user_name)) if (netgr_matches(yyvsp[0].string, NULL, user_name))
user_matches = TRUE; user_matches = TRUE;
(void) free(yyvsp[0].string); (void) free(yyvsp[0].string);
} }
break; break;
case 66: case 67:
#line 596 "parse.yacc" #line 616 "parse.yacc"
{ {
/* could be an all-caps username */ /* could be an all-caps username */
if (find_alias(yyvsp[0].string, USER_ALIAS) == TRUE || if (find_alias(yyvsp[0].string, USER_ALIAS) == TRUE ||
@@ -1504,13 +1531,13 @@ case 66:
(void) free(yyvsp[0].string); (void) free(yyvsp[0].string);
} }
break; break;
case 67: case 68:
#line 603 "parse.yacc" #line 623 "parse.yacc"
{ {
user_matches = TRUE; user_matches = TRUE;
} }
break; break;
#line 1514 "sudo.tab.c" #line 1541 "sudo.tab.c"
} }
yyssp -= yym; yyssp -= yym;
yystate = *yyssp; yystate = *yyssp;