From 879c46e4dd72a6de07ab91eafe44d2a8fd844599 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 23 Jun 2007 23:58:54 +0000 Subject: [PATCH] Add support for setting environment variables on the command line. This is only allowed if the setenv sudoers options is enabled or if the command is prefixed with the SETENV tag. --- def_data.c | 4 + def_data.h | 2 + def_data.in | 3 + env.c | 6 +- gram.c | 631 +++++++++++----------- gram.h | 16 +- gram.y | 19 +- logging.c | 54 +- parse.c | 13 +- parse.h | 4 +- sudo.c | 330 ++++++------ sudo.h | 37 +- sudo.pod | 23 +- sudoers.pod | 28 +- toke.c | 1436 ++++++++++++++++++++++++++------------------------- toke.l | 13 +- 16 files changed, 1405 insertions(+), 1214 deletions(-) diff --git a/def_data.c b/def_data.c index a4d9520b2..cd04c8c6b 100644 --- a/def_data.c +++ b/def_data.c @@ -271,6 +271,10 @@ struct sudo_defs_types sudo_defs_table[] = { "env_keep", T_LIST|T_BOOL, "Environment variables to preserve:", NULL, + }, { + "setenv", T_FLAG, + "Allow users to set arbitrary environment variables", + NULL, }, { NULL, 0, NULL } diff --git a/def_data.h b/def_data.h index e3ae94330..0db62d33d 100644 --- a/def_data.h +++ b/def_data.h @@ -122,6 +122,8 @@ #define I_ENV_DELETE 60 #define def_env_keep (sudo_defs_table[61].sd_un.list) #define I_ENV_KEEP 61 +#define def_setenv (sudo_defs_table[62].sd_un.flag) +#define I_SETENV 62 enum def_tupple { never, diff --git a/def_data.in b/def_data.in index 7396cdfd3..d392b6d60 100644 --- a/def_data.in +++ b/def_data.in @@ -200,3 +200,6 @@ env_delete env_keep T_LIST|T_BOOL "Environment variables to preserve:" +setenv + T_FLAG + "Allow users to set arbitrary environment variables" diff --git a/env.c b/env.c index 7e295e056..bfc1dde5a 100644 --- a/env.c +++ b/env.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2005 Todd C. Miller + * Copyright (c) 2000-2007 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -551,6 +551,10 @@ rebuild_env(envp, sudo_mode, noexec) easprintf(&cp, "SUDO_GID=%lu", (unsigned long) user_gid); insert_env(cp, &env, 1); + /* Add user-specified environment variables. */ + for (cur = sudo_user.env_vars; cur != NULL; cur = cur->next) + insert_env(cur->value, &env, 1); + return(env.envp); } diff --git a/gram.c b/gram.c index 5c32568b8..326f0d1df 100644 --- a/gram.c +++ b/gram.c @@ -4,7 +4,7 @@ static char yyrcsid[] #if __GNUC__ >= 2 __attribute__ ((unused)) #endif /* __GNUC__ >= 2 */ - = "$OpenBSD: skeleton.c,v 1.23 2004/03/12 13:39:50 henning Exp $"; + = "$OpenBSD: skeleton.c,v 1.26 2006/04/20 16:51:32 deraadt Exp $"; #endif #include #define YYBYACC 1 @@ -18,7 +18,8 @@ static char yyrcsid[] #define YYPREFIX "yy" #line 2 "gram.y" /* - * Copyright (c) 1996, 1998-2005 Todd C. Miller + * Copyright (c) 1996, 1998-2005, 2007 + * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -113,7 +114,7 @@ yyerror(s) } parse_error = TRUE; } -#line 100 "gram.y" +#line 101 "gram.y" #ifndef YYSTYPE_DEFINED #define YYSTYPE_DEFINED typedef union { @@ -127,7 +128,7 @@ typedef union { int tok; } YYSTYPE; #endif /* YYSTYPE_DEFINED */ -#line 131 "gram.c" +#line 132 "y.tab.c" #define COMMAND 257 #define ALIAS 258 #define DEFVAR 259 @@ -147,13 +148,15 @@ typedef union { #define EXEC 273 #define MONITOR 274 #define NOMONITOR 275 -#define ALL 276 -#define COMMENT 277 -#define HOSTALIAS 278 -#define CMNDALIAS 279 -#define USERALIAS 280 -#define RUNASALIAS 281 -#define ERROR 282 +#define SETENV 276 +#define NOSETENV 277 +#define ALL 278 +#define COMMENT 279 +#define HOSTALIAS 280 +#define CMNDALIAS 281 +#define USERALIAS 282 +#define RUNASALIAS 283 +#define ERROR 284 #define YYERRCODE 256 #if defined(__cplusplus) || defined(__STDC__) const short yylhs[] = @@ -166,10 +169,10 @@ short yylhs[] = 3, 3, 3, 19, 19, 18, 10, 10, 8, 8, 8, 8, 8, 2, 2, 1, 6, 6, 14, 14, 13, 13, 11, 11, 15, 15, 15, 15, 15, 20, - 20, 20, 20, 20, 20, 20, 5, 5, 5, 24, - 24, 27, 9, 9, 25, 25, 28, 7, 7, 26, - 26, 29, 23, 23, 30, 17, 17, 12, 12, 16, - 16, 16, 16, 16, + 20, 20, 20, 20, 20, 20, 20, 20, 5, 5, + 5, 24, 24, 27, 9, 9, 25, 25, 28, 7, + 7, 26, 26, 29, 23, 23, 30, 17, 17, 12, + 12, 16, 16, 16, 16, 16, }; #if defined(__cplusplus) || defined(__STDC__) const short yylen[] = @@ -182,10 +185,10 @@ short yylen[] = 3, 3, 3, 1, 3, 3, 1, 2, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2, 0, 2, 1, 3, 1, 2, 1, 1, 1, 1, 1, 0, - 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, - 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, - 3, 3, 1, 3, 3, 1, 3, 1, 2, 1, - 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, + 1, 1, 3, 3, 1, 3, 1, 3, 3, 1, + 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, + 2, 1, 1, 1, 1, 1, }; #if defined(__cplusplus) || defined(__STDC__) const short yydefred[] = @@ -193,19 +196,20 @@ const short yydefred[] = short yydefred[] = #endif { 0, - 0, 80, 82, 83, 84, 0, 0, 0, 0, 0, - 81, 5, 0, 0, 0, 0, 0, 0, 76, 78, + 0, 82, 84, 85, 86, 0, 0, 0, 0, 0, + 83, 5, 0, 0, 0, 0, 0, 0, 78, 80, 0, 0, 3, 6, 0, 0, 17, 0, 29, 32, - 31, 33, 30, 0, 27, 0, 63, 0, 45, 47, - 48, 49, 46, 0, 41, 0, 43, 59, 58, 57, - 0, 37, 68, 0, 0, 0, 60, 0, 0, 65, - 0, 0, 73, 0, 0, 70, 79, 0, 0, 24, + 31, 33, 30, 0, 27, 0, 65, 0, 45, 47, + 48, 49, 46, 0, 41, 0, 43, 61, 60, 59, + 0, 37, 70, 0, 0, 0, 62, 0, 0, 67, + 0, 0, 75, 0, 0, 72, 81, 0, 0, 24, 0, 4, 0, 0, 0, 20, 0, 28, 0, 0, 0, 44, 0, 0, 38, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 77, 0, 0, 21, 22, - 23, 18, 64, 42, 69, 0, 61, 0, 66, 0, - 74, 0, 71, 0, 34, 0, 50, 25, 0, 0, - 0, 35, 51, 52, 53, 54, 55, 56, 36, + 0, 0, 0, 0, 0, 79, 0, 0, 21, 22, + 23, 18, 66, 42, 71, 0, 63, 0, 68, 0, + 76, 0, 73, 0, 34, 0, 50, 25, 0, 0, + 0, 35, 51, 52, 53, 54, 57, 58, 55, 56, + 36, }; #if defined(__cplusplus) || defined(__STDC__) const short yydgoto[] = @@ -222,245 +226,231 @@ const short yysindex[] = #else short yysindex[] = #endif - { -33, - -275, 0, 0, 0, 0, -10, -5, 265, 292, 253, - 0, 0, -253, -251, -250, -248, -243, 0, 0, 0, - -22, -33, 0, 0, -13, -242, 0, -28, 0, 0, - 0, 0, 0, -211, 0, -19, 0, -9, 0, 0, - 0, 0, 0, -222, 0, -7, 0, 0, 0, 0, - -245, 0, 0, 13, -40, -15, 0, -17, -3, 0, - 2, 3, 0, 6, 4, 0, 0, 265, -2, 0, - 10, 0, -212, -199, -194, 0, -10, 0, -5, -28, - -28, 0, 292, -28, 0, 253, -28, -5, -253, 253, - -251, 265, -250, 292, -248, 0, -198, -5, 0, 0, - 0, 0, 0, 0, 0, 26, 0, 28, 0, 29, - 0, 31, 0, 292, 0, 32, 0, 0, 31, -198, - 263, 0, 0, 0, 0, 0, 0, 0, 0,}; + { 466, + -266, 0, 0, 0, 0, -21, 513, -7, 517, 188, + 0, 0, -244, -239, -234, -233, -231, 0, 0, 0, + -29, 466, 0, 0, 9, -226, 0, -9, 0, 0, + 0, 0, 0, -219, 0, -26, 0, -24, 0, 0, + 0, 0, 0, -212, 0, -23, 0, 0, 0, 0, + -241, 0, 0, -22, -25, -18, 0, -13, -15, 0, + -5, 2, 0, -3, 3, 0, 0, -7, -38, 0, + 6, 0, -198, -196, -195, 0, -21, 0, 513, -9, + -9, 0, 517, -9, 0, 188, -9, 513, -244, 188, + -239, -7, -234, 517, -233, 0, -200, 513, 0, 0, + 0, 0, 0, 0, 0, 28, 0, 30, 0, 31, + 0, 32, 0, 517, 0, 33, 0, 0, 32, -200, + -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,}; #if defined(__cplusplus) || defined(__STDC__) const short yyrindex[] = #else short yyrindex[] = #endif - { 77, + { 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 78, 0, 0, 1, 0, 0, 157, 0, 0, + 0, 78, 0, 0, 1, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 183, 0, 0, 209, 0, - 0, 237, 0, 0, 458, 0, 0, 0, 0, 0, - 492, 0, 0, 0, 0, 0, 0, 0, 0, 519, - 545, 0, 0, 571, 0, 0, 597, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 289, 0, 0, 0, - 0, 0, 0, 0, 0, 27, 0, 53, 0, 79, - 0, 105, 0, 0, 0, 131, 0, 0, 315, 289, - 0, 0, 0, 0, 0, 0, 0, 0, 0,}; + 0, 0, 0, 0, 0, 197, 0, 0, 225, 0, + 0, 253, 0, 0, 298, 0, 0, 0, 0, 0, + 326, 0, 0, 0, 0, 0, 0, 0, 0, 354, + 382, 0, 0, 410, 0, 0, 438, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 267, 0, 0, 0, + 0, 0, 0, 0, 0, 29, 0, 57, 0, 85, + 0, 113, 0, 0, 0, 141, 0, 0, 480, 267, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,}; #if defined(__cplusplus) || defined(__STDC__) const short yygindex[] = #else short yygindex[] = #endif { 0, - -39, 0, 5, 20, 33, -83, 7, 46, -1, 11, - 8, 15, -85, 0, 45, 75, -4, 9, 0, 0, - 0, 71, 0, 0, 0, 0, 12, 17, 14, 21, + -41, 0, 4, 17, 37, -83, -10, 48, -2, 10, + 8, 15, -86, 0, 49, 75, -8, -4, 0, 0, + 0, 74, 0, 0, 0, 0, 11, 7, 12, 13, }; -#define YYTABLESIZE 878 +#define YYTABLESIZE 795 #if defined(__cplusplus) || defined(__STDC__) const short yytable[] = #else short yytable[] = #endif - { 17, - 19, 24, 105, 38, 55, 36, 58, 61, 112, 64, - 34, 48, 49, 26, 2, 77, 76, 3, 4, 5, - 88, 68, 26, 26, 79, 26, 62, 34, 119, 74, - 50, 75, 11, 19, 68, 39, 83, 129, 40, 41, - 42, 79, 89, 90, 19, 26, 29, 73, 30, 31, - 99, 32, 67, 43, 91, 80, 86, 81, 97, 62, - 93, 95, 92, 100, 33, 84, 94, 98, 101, 79, - 114, 86, 68, 87, 83, 120, 1, 2, 75, 78, - 122, 102, 96, 85, 62, 67, 106, 110, 82, 103, - 104, 67, 72, 0, 0, 0, 108, 0, 0, 0, - 107, 0, 0, 0, 72, 0, 118, 109, 113, 0, - 67, 75, 0, 111, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 26, 0, 0, 0, 0, 0, 75, 72, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, - 0, 0, 72, 26, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 9, 0, 0, 0, 0, 0, 26, 12, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, - 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, - 0, 0, 1, 0, 2, 0, 0, 3, 4, 5, - 6, 7, 8, 9, 10, 29, 8, 30, 31, 25, - 32, 10, 11, 12, 13, 14, 15, 16, 25, 25, - 0, 25, 29, 33, 30, 31, 19, 32, 19, 0, - 0, 19, 19, 19, 19, 19, 19, 19, 19, 8, - 33, 25, 0, 0, 0, 0, 19, 19, 19, 19, - 19, 19, 62, 0, 62, 51, 0, 62, 62, 62, - 62, 62, 62, 62, 62, 51, 0, 17, 0, 0, - 0, 0, 62, 62, 62, 62, 62, 62, 67, 0, - 67, 0, 0, 67, 67, 67, 67, 67, 67, 67, - 67, 39, 0, 0, 44, 0, 0, 0, 67, 67, - 67, 67, 67, 67, 75, 0, 75, 0, 0, 75, - 75, 75, 75, 75, 75, 75, 75, 40, 0, 0, - 0, 0, 0, 0, 75, 75, 75, 75, 75, 75, - 72, 0, 72, 0, 0, 72, 72, 72, 72, 72, - 72, 72, 72, 0, 0, 0, 0, 0, 0, 0, - 72, 72, 72, 72, 72, 72, 26, 0, 26, 0, - 0, 26, 26, 26, 26, 26, 26, 26, 26, 0, - 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, - 26, 26, 12, 0, 12, 0, 0, 12, 12, 12, - 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, - 0, 0, 12, 12, 12, 12, 12, 12, 9, 0, - 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, - 9, 0, 0, 0, 0, 0, 0, 11, 9, 9, - 9, 9, 9, 9, 10, 0, 10, 0, 0, 10, - 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, - 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, - 11, 7, 8, 0, 8, 0, 0, 8, 8, 8, - 8, 8, 8, 8, 8, 0, 0, 0, 0, 48, - 49, 0, 8, 8, 8, 8, 8, 8, 15, 48, - 49, 0, 2, 0, 7, 3, 4, 5, 50, 0, - 0, 0, 123, 124, 125, 126, 127, 128, 50, 0, - 11, 0, 0, 0, 13, 39, 39, 0, 0, 39, - 0, 15, 40, 41, 42, 0, 0, 0, 39, 39, - 39, 39, 39, 39, 39, 0, 0, 43, 0, 0, - 14, 40, 40, 0, 0, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 40, 40, 40, 40, 40, 40, - 40, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + { 38, + 19, 51, 105, 34, 36, 79, 26, 112, 26, 26, + 26, 26, 24, 55, 68, 48, 49, 79, 58, 68, + 83, 86, 97, 61, 64, 17, 2, 119, 64, 3, + 4, 5, 76, 19, 77, 88, 50, 131, 29, 89, + 30, 31, 91, 32, 19, 39, 11, 90, 40, 41, + 42, 74, 80, 75, 81, 92, 69, 94, 33, 93, + 95, 64, 84, 98, 99, 43, 100, 101, 114, 73, + 87, 79, 1, 86, 68, 83, 120, 2, 122, 108, + 102, 78, 96, 110, 77, 106, 64, 85, 103, 69, + 104, 67, 82, 118, 0, 72, 0, 109, 0, 107, + 0, 0, 0, 0, 0, 111, 113, 0, 0, 0, + 0, 0, 74, 0, 69, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 26, 0, 77, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, + 74, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9, 0, 26, 0, + 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 51, 0, 0, 0, 10, 48, 49, 0, 29, 9, + 30, 31, 25, 32, 25, 25, 25, 25, 123, 124, + 125, 126, 127, 128, 129, 130, 50, 0, 33, 0, + 2, 0, 8, 3, 4, 5, 19, 10, 19, 0, + 0, 19, 19, 19, 19, 19, 19, 19, 19, 0, + 11, 0, 0, 0, 0, 0, 0, 0, 19, 19, + 19, 19, 19, 19, 64, 8, 64, 0, 0, 64, + 64, 64, 64, 64, 64, 64, 64, 11, 0, 39, + 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, + 64, 64, 69, 0, 69, 0, 0, 69, 69, 69, + 69, 69, 69, 69, 69, 7, 0, 0, 0, 0, + 11, 0, 0, 0, 69, 69, 69, 69, 69, 69, + 77, 0, 77, 0, 0, 77, 77, 77, 77, 77, + 77, 77, 77, 15, 0, 0, 0, 0, 7, 0, + 0, 0, 77, 77, 77, 77, 77, 77, 74, 0, + 74, 0, 0, 74, 74, 74, 74, 74, 74, 74, + 74, 13, 0, 0, 0, 0, 15, 0, 0, 0, + 74, 74, 74, 74, 74, 74, 26, 0, 26, 0, + 0, 26, 26, 26, 26, 26, 26, 26, 26, 14, + 0, 0, 0, 0, 13, 0, 0, 0, 26, 26, + 26, 26, 26, 26, 12, 0, 12, 0, 0, 12, + 12, 12, 12, 12, 12, 12, 12, 16, 0, 0, + 0, 0, 14, 0, 48, 49, 12, 12, 12, 12, + 12, 12, 9, 0, 9, 0, 0, 9, 9, 9, + 9, 9, 9, 9, 9, 50, 0, 0, 0, 0, + 16, 0, 0, 0, 9, 9, 9, 9, 9, 9, + 10, 0, 10, 0, 0, 10, 10, 10, 10, 10, + 10, 10, 10, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 10, 10, 10, 10, 10, 10, 8, 0, + 8, 0, 40, 8, 8, 8, 8, 8, 8, 8, + 8, 0, 0, 39, 39, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 34, 0, 0, 0, 44, 0, 0, 0, 11, 0, 11, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, - 0, 0, 0, 11, 11, 11, 11, 11, 11, 0, - 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, - 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, - 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, - 7, 7, 7, 0, 15, 0, 15, 0, 0, 15, - 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, - 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, - 13, 0, 13, 0, 0, 13, 13, 13, 13, 13, - 13, 13, 13, 0, 0, 0, 0, 0, 0, 0, - 13, 13, 13, 13, 13, 13, 14, 0, 14, 0, - 0, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, - 14, 14, 16, 0, 16, 0, 0, 16, 16, 16, - 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, - 0, 0, 16, 16, 16, 16, 16, 16, + 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, + 11, 7, 0, 7, 0, 0, 7, 7, 7, 7, + 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 7, 7, 7, 7, 7, 15, + 0, 15, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 15, 15, 15, 15, 15, 13, 0, 13, + 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, + 13, 13, 13, 13, 13, 14, 0, 14, 0, 0, + 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, + 14, 14, 14, 16, 0, 16, 0, 0, 16, 16, + 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, + 16, 1, 0, 2, 0, 0, 3, 4, 5, 6, + 7, 8, 9, 10, 0, 0, 40, 40, 0, 0, + 0, 0, 0, 11, 12, 13, 14, 15, 16, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 30, 31, 39, 32, 0, 40, 41, 42, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 43, }; #if defined(__cplusplus) || defined(__STDC__) const short yycheck[] = #else short yycheck[] = #endif - { 33, - 0, 277, 86, 8, 258, 7, 258, 258, 94, 258, - 33, 257, 258, 33, 258, 44, 259, 261, 262, 263, - 61, 44, 33, 33, 44, 33, 0, 33, 114, 43, - 276, 45, 276, 33, 44, 258, 44, 121, 261, 262, - 263, 44, 58, 61, 44, 33, 258, 61, 260, 261, - 263, 263, 0, 276, 58, 36, 44, 38, 61, 33, - 58, 58, 61, 263, 276, 46, 61, 58, 263, 44, - 269, 44, 44, 54, 44, 44, 0, 0, 0, 34, - 120, 77, 68, 51, 58, 33, 88, 92, 44, 79, - 83, 17, 22, -1, -1, -1, 90, -1, -1, -1, - 89, -1, -1, -1, 0, -1, 98, 91, 95, -1, - 58, 33, -1, 93, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, -1, -1, -1, -1, -1, 58, 33, -1, -1, + { 8, + 0, 33, 86, 33, 7, 44, 33, 94, 33, 33, + 33, 33, 279, 258, 44, 257, 258, 44, 258, 44, + 44, 44, 61, 258, 258, 33, 258, 114, 0, 261, + 262, 263, 259, 33, 44, 61, 278, 121, 258, 58, + 260, 261, 58, 263, 44, 258, 278, 61, 261, 262, + 263, 43, 36, 45, 38, 61, 0, 61, 278, 58, + 58, 33, 46, 58, 263, 278, 263, 263, 269, 61, + 54, 44, 0, 44, 44, 44, 44, 0, 120, 90, + 77, 34, 68, 92, 0, 88, 58, 51, 79, 33, + 83, 17, 44, 98, -1, 22, -1, 91, -1, 89, + -1, -1, -1, -1, -1, 93, 95, -1, -1, -1, + -1, -1, 0, -1, 58, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, - -1, -1, 58, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 0, -1, -1, -1, -1, -1, 58, 33, + 0, -1, 58, -1, -1, 33, -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, 33, -1, -1, -1, -1, - -1, -1, 256, -1, 258, -1, -1, 261, 262, 263, - 264, 265, 266, 267, 268, 258, 0, 260, 261, 259, - 263, 33, 276, 277, 278, 279, 280, 281, 259, 259, - -1, 259, 258, 276, 260, 261, 256, 263, 258, -1, - -1, 261, 262, 263, 264, 265, 266, 267, 268, 33, - 276, 259, -1, -1, -1, -1, 276, 277, 278, 279, - 280, 281, 256, -1, 258, 33, -1, 261, 262, 263, - 264, 265, 266, 267, 268, 33, -1, 33, -1, -1, - -1, -1, 276, 277, 278, 279, 280, 281, 256, -1, - 258, -1, -1, 261, 262, 263, 264, 265, 266, 267, - 268, 33, -1, -1, 33, -1, -1, -1, 276, 277, - 278, 279, 280, 281, 256, -1, 258, -1, -1, 261, - 262, 263, 264, 265, 266, 267, 268, 33, -1, -1, - -1, -1, -1, -1, 276, 277, 278, 279, 280, 281, - 256, -1, 258, -1, -1, 261, 262, 263, 264, 265, - 266, 267, 268, -1, -1, -1, -1, -1, -1, -1, - 276, 277, 278, 279, 280, 281, 256, -1, 258, -1, - -1, 261, 262, 263, 264, 265, 266, 267, 268, -1, - -1, -1, -1, -1, -1, -1, 276, 277, 278, 279, - 280, 281, 256, -1, 258, -1, -1, 261, 262, 263, - 264, 265, 266, 267, 268, -1, -1, -1, -1, -1, - -1, -1, 276, 277, 278, 279, 280, 281, 256, -1, - 258, -1, -1, 261, 262, 263, 264, 265, 266, 267, - 268, -1, -1, -1, -1, -1, -1, 0, 276, 277, - 278, 279, 280, 281, 256, -1, 258, -1, -1, 261, - 262, 263, 264, 265, 266, 267, 268, -1, -1, -1, - -1, -1, -1, -1, 276, 277, 278, 279, 280, 281, - 33, 0, 256, -1, 258, -1, -1, 261, 262, 263, - 264, 265, 266, 267, 268, -1, -1, -1, -1, 257, - 258, -1, 276, 277, 278, 279, 280, 281, 0, 257, - 258, -1, 258, -1, 33, 261, 262, 263, 276, -1, - -1, -1, 270, 271, 272, 273, 274, 275, 276, -1, - 276, -1, -1, -1, 0, 257, 258, -1, -1, 258, - -1, 33, 261, 262, 263, -1, -1, -1, 270, 271, - 272, 273, 274, 275, 276, -1, -1, 276, -1, -1, - 0, 257, 258, -1, -1, -1, -1, 33, -1, -1, - -1, -1, -1, -1, 270, 271, 272, 273, 274, 275, - 276, -1, -1, -1, -1, -1, 0, -1, -1, -1, - -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 58, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0, -1, 58, -1, + -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 33, -1, -1, -1, 0, 257, 258, -1, 258, 33, + 260, 261, 259, 263, 259, 259, 259, 259, 270, 271, + 272, 273, 274, 275, 276, 277, 278, -1, 278, -1, + 258, -1, 0, 261, 262, 263, 256, 33, 258, -1, + -1, 261, 262, 263, 264, 265, 266, 267, 268, -1, + 278, -1, -1, -1, -1, -1, -1, -1, 278, 279, + 280, 281, 282, 283, 256, 33, 258, -1, -1, 261, + 262, 263, 264, 265, 266, 267, 268, 0, -1, 33, + -1, -1, -1, -1, -1, -1, 278, 279, 280, 281, + 282, 283, 256, -1, 258, -1, -1, 261, 262, 263, + 264, 265, 266, 267, 268, 0, -1, -1, -1, -1, + 33, -1, -1, -1, 278, 279, 280, 281, 282, 283, + 256, -1, 258, -1, -1, 261, 262, 263, 264, 265, + 266, 267, 268, 0, -1, -1, -1, -1, 33, -1, + -1, -1, 278, 279, 280, 281, 282, 283, 256, -1, + 258, -1, -1, 261, 262, 263, 264, 265, 266, 267, + 268, 0, -1, -1, -1, -1, 33, -1, -1, -1, + 278, 279, 280, 281, 282, 283, 256, -1, 258, -1, + -1, 261, 262, 263, 264, 265, 266, 267, 268, 0, + -1, -1, -1, -1, 33, -1, -1, -1, 278, 279, + 280, 281, 282, 283, 256, -1, 258, -1, -1, 261, + 262, 263, 264, 265, 266, 267, 268, 0, -1, -1, + -1, -1, 33, -1, 257, 258, 278, 279, 280, 281, + 282, 283, 256, -1, 258, -1, -1, 261, 262, 263, + 264, 265, 266, 267, 268, 278, -1, -1, -1, -1, + 33, -1, -1, -1, 278, 279, 280, 281, 282, 283, + 256, -1, 258, -1, -1, 261, 262, 263, 264, 265, + 266, 267, 268, -1, -1, -1, -1, -1, 33, -1, + -1, -1, 278, 279, 280, 281, 282, 283, 256, -1, + 258, -1, 33, 261, 262, 263, 264, 265, 266, 267, + 268, -1, -1, 257, 258, -1, -1, -1, -1, -1, + 278, 279, 280, 281, 282, 283, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 33, -1, -1, -1, 33, -1, -1, -1, 256, -1, 258, -1, -1, 261, 262, 263, 264, 265, 266, 267, 268, -1, -1, -1, -1, - -1, -1, -1, 276, 277, 278, 279, 280, 281, -1, - -1, -1, -1, -1, -1, -1, -1, 256, -1, 258, + -1, -1, -1, -1, -1, 278, 279, 280, 281, 282, + 283, 256, -1, 258, -1, -1, 261, 262, 263, 264, + 265, 266, 267, 268, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 278, 279, 280, 281, 282, 283, 256, + -1, 258, -1, -1, 261, 262, 263, 264, 265, 266, + 267, 268, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 278, 279, 280, 281, 282, 283, 256, -1, 258, -1, -1, 261, 262, 263, 264, 265, 266, 267, 268, - -1, -1, -1, -1, -1, -1, -1, 276, 277, 278, - 279, 280, 281, -1, 256, -1, 258, -1, -1, 261, - 262, 263, 264, 265, 266, 267, 268, -1, -1, -1, - -1, -1, -1, -1, 276, 277, 278, 279, 280, 281, - 256, -1, 258, -1, -1, 261, 262, 263, 264, 265, - 266, 267, 268, -1, -1, -1, -1, -1, -1, -1, - 276, 277, 278, 279, 280, 281, 256, -1, 258, -1, - -1, 261, 262, 263, 264, 265, 266, 267, 268, -1, - -1, -1, -1, -1, -1, -1, 276, 277, 278, 279, - 280, 281, 256, -1, 258, -1, -1, 261, 262, 263, - 264, 265, 266, 267, 268, -1, -1, -1, -1, -1, - -1, -1, 276, 277, 278, 279, 280, 281, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 278, + 279, 280, 281, 282, 283, 256, -1, 258, -1, -1, + 261, 262, 263, 264, 265, 266, 267, 268, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 278, 279, 280, + 281, 282, 283, 256, -1, 258, -1, -1, 261, 262, + 263, 264, 265, 266, 267, 268, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 278, 279, 280, 281, 282, + 283, 256, -1, 258, -1, -1, 261, 262, 263, 264, + 265, 266, 267, 268, -1, -1, 257, 258, -1, -1, + -1, -1, -1, 278, 279, 280, 281, 282, 283, 270, + 271, 272, 273, 274, 275, 276, 277, 278, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 258, -1, 260, 261, 258, 263, -1, 261, 262, 263, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 278, -1, -1, -1, 278, }; #define YYFINAL 18 #ifndef YYDEBUG #define YYDEBUG 0 #endif -#define YYMAXTOKEN 282 +#define YYMAXTOKEN 284 #if YYDEBUG #if defined(__cplusplus) || defined(__STDC__) const char * const yyname[] = @@ -477,8 +467,8 @@ 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, "COMMAND","ALIAS","DEFVAR","NTWKADDR","NETGROUP","USERGROUP","WORD","DEFAULTS", "DEFAULTS_HOST","DEFAULTS_USER","DEFAULTS_RUNAS","DEFAULTS_CMND","RUNAS", -"NOPASSWD","PASSWD","NOEXEC","EXEC","MONITOR","NOMONITOR","ALL","COMMENT", -"HOSTALIAS","CMNDALIAS","USERALIAS","RUNASALIAS","ERROR", +"NOPASSWD","PASSWD","NOEXEC","EXEC","MONITOR","NOMONITOR","SETENV","NOSETENV", +"ALL","COMMENT","HOSTALIAS","CMNDALIAS","USERALIAS","RUNASALIAS","ERROR", }; #if defined(__cplusplus) || defined(__STDC__) const char * const yyrule[] = @@ -540,6 +530,8 @@ char *yyrule[] = "cmndtag : cmndtag PASSWD", "cmndtag : cmndtag NOEXEC", "cmndtag : cmndtag EXEC", +"cmndtag : cmndtag SETENV", +"cmndtag : cmndtag NOSETENV", "cmndtag : cmndtag MONITOR", "cmndtag : cmndtag NOMONITOR", "cmnd : ALL", @@ -584,6 +576,7 @@ char *yyrule[] = #endif #endif #define YYINITSTACKSIZE 200 +/* LINTUSED */ int yydebug; int yynerrs; int yyerrflag; @@ -596,7 +589,7 @@ short *yyss; short *yysslim; YYSTYPE *yyvs; int yystacksize; -#line 498 "gram.y" +#line 511 "gram.y" /* * Add a list of defaults structures to the defaults list. * The binding, if non-NULL, specifies a list of hosts, users, or @@ -719,7 +712,7 @@ init_parser(path, quiet) sudolineno = 1; verbose = !quiet; } -#line 671 "gram.c" +#line 664 "y.tab.c" /* allocate initial stack or double stack size, up to YYMAXDEPTH */ #if defined(__cplusplus) || defined(__STDC__) static int yygrowstack(void) @@ -913,140 +906,143 @@ yyreduce: switch (yyn) { case 1: -#line 163 "gram.y" +#line 166 "gram.y" { ; } break; case 5: -#line 171 "gram.y" +#line 174 "gram.y" { ; } break; case 6: -#line 174 "gram.y" +#line 177 "gram.y" { yyerrok; } break; case 7: -#line 177 "gram.y" +#line 180 "gram.y" { add_userspec(yyvsp[-1].member, yyvsp[0].privilege); } break; case 8: -#line 180 "gram.y" +#line 183 "gram.y" { ; } break; case 9: -#line 183 "gram.y" +#line 186 "gram.y" { ; } break; case 10: -#line 186 "gram.y" +#line 189 "gram.y" { ; } break; case 11: -#line 189 "gram.y" +#line 192 "gram.y" { ; } break; case 12: -#line 192 "gram.y" +#line 195 "gram.y" { add_defaults(DEFAULTS, NULL, yyvsp[0].defaults); } break; case 13: -#line 195 "gram.y" +#line 198 "gram.y" { add_defaults(DEFAULTS_USER, yyvsp[-1].member, yyvsp[0].defaults); } break; case 14: -#line 198 "gram.y" +#line 201 "gram.y" { add_defaults(DEFAULTS_RUNAS, yyvsp[-1].member, yyvsp[0].defaults); } break; case 15: -#line 201 "gram.y" +#line 204 "gram.y" { add_defaults(DEFAULTS_HOST, yyvsp[-1].member, yyvsp[0].defaults); } break; case 16: -#line 204 "gram.y" +#line 207 "gram.y" { add_defaults(DEFAULTS_CMND, yyvsp[-1].member, yyvsp[0].defaults); } break; case 18: -#line 210 "gram.y" +#line 213 "gram.y" { LIST_APPEND(yyvsp[-2].defaults, yyvsp[0].defaults); yyval.defaults = yyvsp[-2].defaults; } break; case 19: -#line 216 "gram.y" +#line 219 "gram.y" { NEW_DEFAULT(yyval.defaults, yyvsp[0].string, NULL, TRUE); } break; case 20: -#line 219 "gram.y" +#line 222 "gram.y" { NEW_DEFAULT(yyval.defaults, yyvsp[0].string, NULL, FALSE); } break; case 21: -#line 222 "gram.y" +#line 225 "gram.y" { NEW_DEFAULT(yyval.defaults, yyvsp[-2].string, yyvsp[0].string, TRUE); } break; case 22: -#line 225 "gram.y" +#line 228 "gram.y" { NEW_DEFAULT(yyval.defaults, yyvsp[-2].string, yyvsp[0].string, '+'); } break; case 23: -#line 228 "gram.y" +#line 231 "gram.y" { NEW_DEFAULT(yyval.defaults, yyvsp[-2].string, yyvsp[0].string, '-'); } break; case 25: -#line 234 "gram.y" +#line 237 "gram.y" { LIST_APPEND(yyvsp[-2].privilege, yyvsp[0].privilege); yyval.privilege = yyvsp[-2].privilege; } break; case 26: -#line 240 "gram.y" +#line 243 "gram.y" { struct cmndtag tags; struct privilege *p = emalloc(sizeof(*p)); struct cmndspec *cs; p->hostlist = yyvsp[-2].member; p->cmndlist = yyvsp[0].cmndspec; - tags.nopasswd = tags.noexec = tags.monitor = UNSPEC; + tags.nopasswd = tags.noexec = tags.monitor = + tags.setenv = UNSPEC; /* propagate tags */ for (cs = yyvsp[0].cmndspec; cs != NULL; cs = cs->next) { if (cs->tags.nopasswd == UNSPEC) cs->tags.nopasswd = tags.nopasswd; if (cs->tags.noexec == UNSPEC) cs->tags.noexec = tags.noexec; + if (cs->tags.setenv == UNSPEC) + cs->tags.setenv = tags.setenv; if (cs->tags.monitor == UNSPEC) cs->tags.monitor = tags.monitor; memcpy(&tags, &cs->tags, sizeof(tags)); @@ -1057,58 +1053,58 @@ case 26: } break; case 27: -#line 263 "gram.y" +#line 269 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = FALSE; } break; case 28: -#line 267 "gram.y" +#line 273 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = TRUE; } break; case 29: -#line 273 "gram.y" +#line 279 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, ALIAS); } break; case 30: -#line 276 "gram.y" +#line 282 "gram.y" { NEW_MEMBER(yyval.member, NULL, ALL); } break; case 31: -#line 279 "gram.y" +#line 285 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, NETGROUP); } break; case 32: -#line 282 "gram.y" +#line 288 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, NTWKADDR); } break; case 33: -#line 285 "gram.y" +#line 291 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, WORD); } break; case 35: -#line 291 "gram.y" +#line 297 "gram.y" { LIST_APPEND(yyvsp[-2].cmndspec, yyvsp[0].cmndspec); yyval.cmndspec = yyvsp[-2].cmndspec; } break; case 36: -#line 297 "gram.y" +#line 303 "gram.y" { struct cmndspec *cs = emalloc(sizeof(*cs)); cs->runaslist = yyvsp[-2].member; @@ -1120,138 +1116,151 @@ case 36: } break; case 37: -#line 308 "gram.y" +#line 314 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = FALSE; } break; case 38: -#line 312 "gram.y" +#line 318 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = TRUE; } break; case 39: -#line 318 "gram.y" +#line 324 "gram.y" { yyval.member = NULL; } break; case 40: -#line 321 "gram.y" +#line 327 "gram.y" { yyval.member = yyvsp[0].member; } break; case 42: -#line 327 "gram.y" +#line 333 "gram.y" { LIST_APPEND(yyvsp[-2].member, yyvsp[0].member); yyval.member = yyvsp[-2].member; } break; case 43: -#line 333 "gram.y" +#line 339 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = FALSE; } break; case 44: -#line 337 "gram.y" +#line 343 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = TRUE; } break; case 45: -#line 343 "gram.y" +#line 349 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, ALIAS); } break; case 46: -#line 346 "gram.y" +#line 352 "gram.y" { NEW_MEMBER(yyval.member, NULL, ALL); } break; case 47: -#line 349 "gram.y" +#line 355 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, NETGROUP); } break; case 48: -#line 352 "gram.y" +#line 358 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, USERGROUP); } break; case 49: -#line 355 "gram.y" +#line 361 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, WORD); } break; case 50: -#line 360 "gram.y" +#line 366 "gram.y" { - yyval.tag.nopasswd = yyval.tag.noexec = yyval.tag.monitor = UNSPEC; + yyval.tag.nopasswd = yyval.tag.noexec = yyval.tag.monitor = + yyval.tag.setenv = UNSPEC; } break; case 51: -#line 363 "gram.y" +#line 370 "gram.y" { yyval.tag.nopasswd = TRUE; } break; case 52: -#line 366 "gram.y" +#line 373 "gram.y" { yyval.tag.nopasswd = FALSE; } break; case 53: -#line 369 "gram.y" +#line 376 "gram.y" { yyval.tag.noexec = TRUE; } break; case 54: -#line 372 "gram.y" +#line 379 "gram.y" { yyval.tag.noexec = FALSE; } break; case 55: -#line 375 "gram.y" +#line 382 "gram.y" { - yyval.tag.monitor = TRUE; + yyval.tag.setenv = TRUE; } break; case 56: -#line 378 "gram.y" +#line 385 "gram.y" { - yyval.tag.monitor = FALSE; + yyval.tag.setenv = FALSE; } break; case 57: -#line 383 "gram.y" +#line 388 "gram.y" { - NEW_MEMBER(yyval.member, NULL, ALL); + yyval.tag.monitor = TRUE; } break; case 58: -#line 386 "gram.y" +#line 391 "gram.y" { - NEW_MEMBER(yyval.member, yyvsp[0].string, ALIAS); + yyval.tag.monitor = FALSE; } break; case 59: -#line 389 "gram.y" +#line 396 "gram.y" +{ + NEW_MEMBER(yyval.member, NULL, ALL); + } +break; +case 60: +#line 399 "gram.y" +{ + NEW_MEMBER(yyval.member, yyvsp[0].string, ALIAS); + } +break; +case 61: +#line 402 "gram.y" { struct sudo_command *c = emalloc(sizeof(*c)); c->cmnd = yyvsp[0].command.cmnd; @@ -1259,8 +1268,8 @@ case 59: NEW_MEMBER(yyval.member, (char *)c, COMMAND); } break; -case 62: -#line 401 "gram.y" +case 64: +#line 414 "gram.y" { char *s; if ((s = alias_add(yyvsp[-2].string, HOSTALIAS, yyvsp[0].member)) != NULL) { @@ -1269,15 +1278,15 @@ case 62: } } break; -case 64: -#line 411 "gram.y" +case 66: +#line 424 "gram.y" { LIST_APPEND(yyvsp[-2].member, yyvsp[0].member); yyval.member = yyvsp[-2].member; } break; -case 67: -#line 421 "gram.y" +case 69: +#line 434 "gram.y" { char *s; if ((s = alias_add(yyvsp[-2].string, CMNDALIAS, yyvsp[0].member)) != NULL) { @@ -1286,15 +1295,15 @@ case 67: } } break; -case 69: -#line 431 "gram.y" +case 71: +#line 444 "gram.y" { LIST_APPEND(yyvsp[-2].member, yyvsp[0].member); yyval.member = yyvsp[-2].member; } break; -case 72: -#line 441 "gram.y" +case 74: +#line 454 "gram.y" { char *s; if ((s = alias_add(yyvsp[-2].string, RUNASALIAS, yyvsp[0].member)) != NULL) { @@ -1303,8 +1312,8 @@ case 72: } } break; -case 75: -#line 454 "gram.y" +case 77: +#line 467 "gram.y" { char *s; if ((s = alias_add(yyvsp[-2].string, USERALIAS, yyvsp[0].member)) != NULL) { @@ -1313,58 +1322,58 @@ case 75: } } break; -case 77: -#line 464 "gram.y" +case 79: +#line 477 "gram.y" { LIST_APPEND(yyvsp[-2].member, yyvsp[0].member); yyval.member = yyvsp[-2].member; } break; -case 78: -#line 470 "gram.y" +case 80: +#line 483 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = FALSE; } break; -case 79: -#line 474 "gram.y" +case 81: +#line 487 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = TRUE; } break; -case 80: -#line 480 "gram.y" +case 82: +#line 493 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, ALIAS); } break; -case 81: -#line 483 "gram.y" +case 83: +#line 496 "gram.y" { NEW_MEMBER(yyval.member, NULL, ALL); } break; -case 82: -#line 486 "gram.y" +case 84: +#line 499 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, NETGROUP); } break; -case 83: -#line 489 "gram.y" +case 85: +#line 502 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, USERGROUP); } break; -case 84: -#line 492 "gram.y" +case 86: +#line 505 "gram.y" { NEW_MEMBER(yyval.member, yyvsp[0].string, WORD); } break; -#line 1316 "gram.c" +#line 1325 "y.tab.c" } yyssp -= yym; yystate = *yyssp; diff --git a/gram.h b/gram.h index 1bb3372c6..c667b1103 100644 --- a/gram.h +++ b/gram.h @@ -17,13 +17,15 @@ #define EXEC 273 #define MONITOR 274 #define NOMONITOR 275 -#define ALL 276 -#define COMMENT 277 -#define HOSTALIAS 278 -#define CMNDALIAS 279 -#define USERALIAS 280 -#define RUNASALIAS 281 -#define ERROR 282 +#define SETENV 276 +#define NOSETENV 277 +#define ALL 278 +#define COMMENT 279 +#define HOSTALIAS 280 +#define CMNDALIAS 281 +#define USERALIAS 282 +#define RUNASALIAS 283 +#define ERROR 284 #ifndef YYSTYPE_DEFINED #define YYSTYPE_DEFINED typedef union { diff --git a/gram.y b/gram.y index c2e3267b3..bfc14938a 100644 --- a/gram.y +++ b/gram.y @@ -1,6 +1,7 @@ %{ /* - * Copyright (c) 1996, 1998-2005 Todd C. Miller + * Copyright (c) 1996, 1998-2005, 2007 + * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -128,6 +129,8 @@ yyerror(s) %token EXEC /* don't preload dummy execve() */ %token MONITOR /* monitor children of cmnd */ %token NOMONITOR /* disable monitoring of children */ +%token SETENV /* user may set environment for cmnd */ +%token NOSETENV /* user may not set environment */ %token ALL /* ALL keyword */ %token COMMENT /* comment and/or carriage return */ %token HOSTALIAS /* Host_Alias keyword */ @@ -243,13 +246,16 @@ privilege : hostlist '=' cmndspeclist { struct cmndspec *cs; p->hostlist = $1; p->cmndlist = $3; - tags.nopasswd = tags.noexec = tags.monitor = UNSPEC; + tags.nopasswd = tags.noexec = tags.monitor = + tags.setenv = UNSPEC; /* propagate tags */ for (cs = $3; cs != NULL; cs = cs->next) { if (cs->tags.nopasswd == UNSPEC) cs->tags.nopasswd = tags.nopasswd; if (cs->tags.noexec == UNSPEC) cs->tags.noexec = tags.noexec; + if (cs->tags.setenv == UNSPEC) + cs->tags.setenv = tags.setenv; if (cs->tags.monitor == UNSPEC) cs->tags.monitor = tags.monitor; memcpy(&tags, &cs->tags, sizeof(tags)); @@ -358,7 +364,8 @@ runasuser : ALIAS { ; cmndtag : /* empty */ { - $$.nopasswd = $$.noexec = $$.monitor = UNSPEC; + $$.nopasswd = $$.noexec = $$.monitor = + $$.setenv = UNSPEC; } | cmndtag NOPASSWD { $$.nopasswd = TRUE; @@ -372,6 +379,12 @@ cmndtag : /* empty */ { | cmndtag EXEC { $$.noexec = FALSE; } + | cmndtag SETENV { + $$.setenv = TRUE; + } + | cmndtag NOSETENV { + $$.setenv = FALSE; + } | cmndtag MONITOR { $$.monitor = TRUE; } diff --git a/logging.c b/logging.c index 29514c98a..29b784c9f 100644 --- a/logging.c +++ b/logging.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994-1996,1998-2005 Todd C. Miller + * Copyright (c) 1994-1996,1998-2007 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -275,6 +275,7 @@ log_auth(status, inform_user) int status; int inform_user; { + char *evstr = NULL; char *message; char *logline; int pri; @@ -296,9 +297,21 @@ log_auth(status, inform_user) else message = "unknown error ; "; - easprintf(&logline, "%sTTY=%s ; PWD=%s ; USER=%s ; COMMAND=%s%s%s", - message, user_tty, user_cwd, *user_runas, user_cmnd, - user_args ? " " : "", user_args ? user_args : ""); + if (sudo_user.env_vars != NULL) { + size_t len = 7; /* " ; ENV=" */ + struct list_member *cur; + for (cur = sudo_user.env_vars; cur != NULL; cur = cur->next) + len += strlen(cur->value) + 1; + evstr = emalloc(len); + strlcpy(evstr, " ; ENV=", len); + for (cur = sudo_user.env_vars; cur != NULL; cur = cur->next) { + strlcat(evstr, cur->value, len); + strlcat(evstr, " ", len); /* NOTE: last one will fail */ + } + } + easprintf(&logline, "%sTTY=%s ; PWD=%s ; USER=%s%s ; COMMAND=%s%s%s", + message, user_tty, user_cwd, *user_runas, evstr ? evstr : "", + user_cmnd, user_args ? " " : "", user_args ? user_args : ""); mail_auth(status, logline); /* send mail based on status */ @@ -329,6 +342,7 @@ log_auth(status, inform_user) if (def_logfile) do_logfile(logline); + efree(evstr); efree(logline); } @@ -345,6 +359,7 @@ log_error(flags, fmt, va_alist) int serrno = errno; char *message; char *logline; + char *evstr = NULL; va_list ap; #ifdef __STDC__ va_start(ap, fmt); @@ -360,28 +375,43 @@ log_error(flags, fmt, va_alist) evasprintf(&message, fmt, ap); va_end(ap); + if (sudo_user.env_vars != NULL) { + size_t len = 7; /* " ; ENV=" */ + struct list_member *cur; + for (cur = sudo_user.env_vars; cur != NULL; cur = cur->next) + len += strlen(cur->value) + 1; + evstr = emalloc(len); + strlcpy(evstr, " ; ENV=", len); + for (cur = sudo_user.env_vars; cur != NULL; cur = cur->next) { + strlcat(evstr, cur->value, len); + strlcat(evstr, " ", len); /* NOTE: last one will fail */ + } + } + if (ISSET(flags, MSG_ONLY)) logline = message; else if (ISSET(flags, USE_ERRNO)) { if (user_args) { easprintf(&logline, - "%s: %s ; TTY=%s ; PWD=%s ; USER=%s ; COMMAND=%s %s", + "%s: %s ; TTY=%s ; PWD=%s ; USER=%s%s ; COMMAND=%s %s", message, strerror(serrno), user_tty, user_cwd, *user_runas, - user_cmnd, user_args); + evstr ? evstr : "", user_cmnd, user_args); } else { easprintf(&logline, - "%s: %s ; TTY=%s ; PWD=%s ; USER=%s ; COMMAND=%s", message, - strerror(serrno), user_tty, user_cwd, *user_runas, user_cmnd); + "%s: %s ; TTY=%s ; PWD=%s ; USER=%s%s ; COMMAND=%s", message, + strerror(serrno), user_tty, user_cwd, *user_runas, + evstr ? evstr : "", user_cmnd); } } else { if (user_args) { easprintf(&logline, - "%s ; TTY=%s ; PWD=%s ; USER=%s ; COMMAND=%s %s", message, - user_tty, user_cwd, *user_runas, user_cmnd, user_args); + "%s ; TTY=%s ; PWD=%s ; USER=%s%s ; COMMAND=%s %s", message, + user_tty, user_cwd, *user_runas, evstr ? evstr : "", + user_cmnd, user_args); } else { easprintf(&logline, - "%s ; TTY=%s ; PWD=%s ; USER=%s ; COMMAND=%s", message, - user_tty, user_cwd, *user_runas, user_cmnd); + "%s ; TTY=%s ; PWD=%s ; USER=%s%s ; COMMAND=%s", message, + user_tty, user_cwd, *user_runas, evstr ? evstr : "", user_cmnd); } } diff --git a/parse.c b/parse.c index f14fe81a2..dd86d5572 100644 --- a/parse.c +++ b/parse.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 Todd C. Miller + * Copyright (c) 2004-2005, 2007 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -193,6 +193,8 @@ sudoers_lookup(pwflag) def_authenticate = !tags->nopasswd; if (tags->noexec != UNSPEC) def_noexec = tags->noexec; + if (tags->setenv != UNSPEC) + def_setenv = tags->setenv; if (tags->monitor != UNSPEC) def_monitor = tags->monitor; } @@ -244,6 +246,7 @@ display_privs(v, pw) for (priv = us->privileges; priv != NULL; priv = priv->next) { tags.monitor = def_monitor; tags.noexec = def_noexec; + tags.setenv = def_setenv; tags.nopasswd = !def_authenticate; for (cs = priv->cmndlist; cs != NULL; cs = cs->next) { if (cs != priv->cmndlist) @@ -261,12 +264,16 @@ display_privs(v, pw) print_priv(cs->tags.monitor ? "MONITOR: " : "NOMONITOR: "); tags.monitor = cs->tags.monitor; } + if (TAG_CHANGED(setenv)) { + print_priv(cs->tags.setenv ? "SETENV: " : "NOSETENV: "); + tags.setenv = cs->tags.setenv; + } if (TAG_CHANGED(noexec)) { - print_priv(cs->tags.monitor ? "EXEC: " : "NOEXEC: "); + print_priv(cs->tags.noexec ? "NOEXEC: " : "EXEC: "); tags.noexec = cs->tags.noexec; } if (TAG_CHANGED(nopasswd)) { - print_priv(cs->tags.monitor ? "PASSWD: " : "NOPASSWD: "); + print_priv(cs->tags.nopasswd ? "NOPASSWD: " : "PASSWD: "); tags.nopasswd = cs->tags.nopasswd; } m = cs->cmnd; diff --git a/parse.h b/parse.h index 55f9fe781..afa339bf2 100644 --- a/parse.h +++ b/parse.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 1996,1998-2000,2004 Todd C. Miller + * Copyright (c) 1996, 1998-2000, 2004, 2007 + * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -42,6 +43,7 @@ struct sudo_command { struct cmndtag { char nopasswd; char noexec; + char setenv; char monitor; char extra; }; diff --git a/sudo.c b/sudo.c index 35a4c558b..7fc529627 100644 --- a/sudo.c +++ b/sudo.c @@ -342,6 +342,14 @@ main(argc, argv) (void) close(fd); } + /* Build a new environment based on the rules in sudoers. */ + if (ISSET(sudo_mode, MODE_RUN)) { + /* User may have overrided environment resetting via the -E flag. */ + if (ISSET(sudo_mode, MODE_PRESERVE_ENV) && def_setenv) + def_env_reset = FALSE; + environ = rebuild_env(environ, sudo_mode, def_noexec); + } + /* Fill in passwd struct based on user we are authenticating as. */ auth_pw = get_authpw(); @@ -360,10 +368,6 @@ main(argc, argv) } } - /* Build a new environment based on the rules in sudoers. */ - if (ISSET(sudo_mode, MODE_RUN)) - environ = rebuild_env(environ, sudo_mode, def_noexec); - if (ISSET(validated, VALIDATE_OK)) { /* Finally tell the user if the command did not exist. */ if (cmnd_status == NOT_FOUND_DOT) { @@ -374,6 +378,16 @@ main(argc, argv) exit(1); } + /* If user specified env vars make sure sudoers allows it. */ + if (ISSET(sudo_mode, MODE_RUN) && !def_setenv) { + if (ISSET(sudo_mode, MODE_PRESERVE_ENV)) + log_error(NO_MAIL, + "sorry, you are not allowed to preserve the environment"); + else if (sudo_user.env_vars != NULL) + log_error(NO_MAIL, + "sorry, you are not allowed to set environment variables"); + } + log_auth(validated, 1); if (sudo_mode == MODE_VALIDATE) exit(0); @@ -745,160 +759,175 @@ parse_args(argc, argv) return(rval); } - while (NewArgc > 0 && NewArgv[0][0] == '-') { - if (NewArgv[0][1] != '\0' && NewArgv[0][2] != '\0') - warningx("please use single character options"); + while (NewArgc > 0) { + if (NewArgv[0][0] == '-') { + if (NewArgv[0][1] != '\0' && NewArgv[0][2] != '\0') + warningx("please use single character options"); - switch (NewArgv[0][1]) { - case 'p': - /* Must have an associated prompt. */ - if (NewArgv[1] == NULL) - usage(1); - - user_prompt = NewArgv[1]; - - NewArgc--; - NewArgv++; - break; - case 'u': - /* Must have an associated runas user. */ - if (NewArgv[1] == NULL) - usage(1); + switch (NewArgv[0][1]) { + case 'p': + /* Must have an associated prompt. */ + if (NewArgv[1] == NULL) + usage(1); - user_runas = &NewArgv[1]; + user_prompt = NewArgv[1]; - NewArgc--; - NewArgv++; - break; -#ifdef HAVE_BSD_AUTH_H - case 'a': - /* Must have an associated authentication style. */ - if (NewArgv[1] == NULL) - usage(1); + NewArgc--; + NewArgv++; + break; + case 'u': + /* Must have an associated runas user. */ + if (NewArgv[1] == NULL) + usage(1); - login_style = NewArgv[1]; + user_runas = &NewArgv[1]; - NewArgc--; - NewArgv++; - break; -#endif -#ifdef HAVE_LOGIN_CAP_H - case 'c': - /* Must have an associated login class. */ - if (NewArgv[1] == NULL) - usage(1); + NewArgc--; + NewArgv++; + break; + #ifdef HAVE_BSD_AUTH_H + case 'a': + /* Must have an associated authentication style. */ + if (NewArgv[1] == NULL) + usage(1); - login_class = NewArgv[1]; - def_use_loginclass = TRUE; + login_style = NewArgv[1]; - NewArgc--; - NewArgv++; - break; -#endif - case 'C': - if (NewArgv[1] == NULL) - usage(1); - if ((user_closefrom = atoi(NewArgv[1])) < 3) { - warningx("the argument to -C must be at least 3"); + NewArgc--; + NewArgv++; + break; + #endif + #ifdef HAVE_LOGIN_CAP_H + case 'c': + /* Must have an associated login class. */ + if (NewArgv[1] == NULL) + usage(1); + + login_class = NewArgv[1]; + def_use_loginclass = TRUE; + + NewArgc--; + NewArgv++; + break; + #endif + case 'C': + if (NewArgv[1] == NULL) + usage(1); + if ((user_closefrom = atoi(NewArgv[1])) < 3) { + warningx("the argument to -C must be at least 3"); + usage(1); + } + NewArgc--; + NewArgv++; + break; + case 'b': + SET(rval, MODE_BACKGROUND); + break; + case 'e': + rval = MODE_EDIT; + if (excl && excl != 'e') + usage_excl(1); + excl = 'e'; + break; + case 'v': + rval = MODE_VALIDATE; + if (excl && excl != 'v') + usage_excl(1); + excl = 'v'; + break; + case 'i': + SET(rval, (MODE_LOGIN_SHELL | MODE_SHELL)); + def_env_reset = TRUE; + if (excl && excl != 'i') + usage_excl(1); + excl = 'i'; + break; + case 'k': + rval = MODE_INVALIDATE; + if (excl && excl != 'k') + usage_excl(1); + excl = 'k'; + break; + case 'K': + rval = MODE_KILL; + if (excl && excl != 'K') + usage_excl(1); + excl = 'K'; + break; + case 'L': + rval = MODE_LISTDEFS; + if (excl && excl != 'L') + usage_excl(1); + excl = 'L'; + break; + case 'l': + rval = MODE_LIST; + if (excl && excl != 'l') + usage_excl(1); + excl = 'l'; + break; + case 'V': + rval = MODE_VERSION; + if (excl && excl != 'V') + usage_excl(1); + excl = 'V'; + break; + case 'h': + rval = MODE_HELP; + if (excl && excl != 'h') + usage_excl(1); + excl = 'h'; + break; + case 's': + SET(rval, MODE_SHELL); + if (excl && excl != 's') + usage_excl(1); + excl = 's'; + break; + case 'H': + SET(rval, MODE_RESET_HOME); + break; + case 'P': + SET(rval, MODE_PRESERVE_GROUPS); + break; + case 'S': + SET(tgetpass_flags, TGP_STDIN); + break; + case 'U': + /* Must have an associated list user. */ + if (NewArgv[1] == NULL) + usage(1); + if ((list_pw = sudo_getpwnam(NewArgv[1])) == NULL) + errorx(1, "unknown user %s", NewArgv[1]); + NewArgc--; + NewArgv++; + break; + case 'E': + SET(rval, MODE_PRESERVE_ENV); + break; + case '-': + NewArgc--; + NewArgv++; + if (rval == MODE_RUN) + SET(rval, (MODE_IMPLIED_SHELL | MODE_SHELL)); + return(rval); + case '\0': + warningx("'-' requires an argument"); usage(1); - } - NewArgc--; - NewArgv++; - break; - case 'b': - SET(rval, MODE_BACKGROUND); - break; - case 'e': - rval = MODE_EDIT; - if (excl && excl != 'e') - usage_excl(1); - excl = 'e'; - break; - case 'v': - rval = MODE_VALIDATE; - if (excl && excl != 'v') - usage_excl(1); - excl = 'v'; - break; - case 'i': - SET(rval, (MODE_LOGIN_SHELL | MODE_SHELL)); - def_env_reset = TRUE; - if (excl && excl != 'i') - usage_excl(1); - excl = 'i'; - break; - case 'k': - rval = MODE_INVALIDATE; - if (excl && excl != 'k') - usage_excl(1); - excl = 'k'; - break; - case 'K': - rval = MODE_KILL; - if (excl && excl != 'K') - usage_excl(1); - excl = 'K'; - break; - case 'L': - rval = MODE_LISTDEFS; - if (excl && excl != 'L') - usage_excl(1); - excl = 'L'; - break; - case 'l': - rval = MODE_LIST; - if (excl && excl != 'l') - usage_excl(1); - excl = 'l'; - break; - case 'V': - rval = MODE_VERSION; - if (excl && excl != 'V') - usage_excl(1); - excl = 'V'; - break; - case 'h': - rval = MODE_HELP; - if (excl && excl != 'h') - usage_excl(1); - excl = 'h'; - break; - case 's': - SET(rval, MODE_SHELL); - if (excl && excl != 's') - usage_excl(1); - excl = 's'; - break; - case 'H': - SET(rval, MODE_RESET_HOME); - break; - case 'P': - SET(rval, MODE_PRESERVE_GROUPS); - break; - case 'S': - SET(tgetpass_flags, TGP_STDIN); - break; - case 'U': - /* Must have an associated list user. */ - if (NewArgv[1] == NULL) + default: + warningx("illegal option `%s'", NewArgv[0]); usage(1); - if ((list_pw = sudo_getpwnam(NewArgv[1])) == NULL) - errorx(1, "unknown user %s", NewArgv[1]); - NewArgc--; - NewArgv++; - break; - case '-': - NewArgc--; - NewArgv++; - if (rval == MODE_RUN) - SET(rval, (MODE_IMPLIED_SHELL | MODE_SHELL)); - return(rval); - case '\0': - warningx("'-' requires an argument"); - usage(1); - default: - warningx("illegal option `%s'", NewArgv[0]); - usage(1); + } + } else if (NewArgv[0][0] != '/' && strchr(NewArgv[0], '=') != NULL) { + /* Could be an environment variable. */ + struct list_member *ev; + ev = emalloc(sizeof(*ev)); + ev->value = NewArgv[0]; + ev->next = sudo_user.env_vars; + sudo_user.env_vars = ev; + } else { + /* Not an arg */ + break; } NewArgc--; NewArgv++; @@ -1267,7 +1296,7 @@ usage(exit_val) char **p; int linelen, linemax, ulen; static char *uvec[] = { - " [-bHPS]", + " [-bEHPS]", #ifdef HAVE_BSD_AUTH_H " [-a auth_type]", #endif @@ -1277,6 +1306,7 @@ usage(exit_val) #endif " [-p prompt]", " [-u username|#uid]", + " [VAR=value]", " { -e file [...] | -i | -s | }", NULL }; diff --git a/sudo.h b/sudo.h index da514026c..290e1b527 100644 --- a/sudo.h +++ b/sudo.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 1993-1996,1998-2005 Todd C. Miller + * Copyright (c) 1993-1996, 1998-2005, 2007 + * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -51,6 +52,7 @@ struct sudo_user { char *class_name; int ngroups; gid_t *groups; + struct list_member *env_vars; char cwd[PATH_MAX]; }; @@ -85,22 +87,23 @@ struct sudo_user { /* * Various modes sudo can be in (based on arguments) in hex */ -#define MODE_RUN 0x0001 -#define MODE_EDIT 0x0002 -#define MODE_VALIDATE 0x0004 -#define MODE_INVALIDATE 0x0008 -#define MODE_KILL 0x0010 -#define MODE_VERSION 0x0020 -#define MODE_HELP 0x0040 -#define MODE_LIST 0x0080 -#define MODE_CHECK 0x0100 -#define MODE_LISTDEFS 0x0200 -#define MODE_BACKGROUND 0x0400 -#define MODE_SHELL 0x0800 -#define MODE_LOGIN_SHELL 0x1000 -#define MODE_IMPLIED_SHELL 0x2000 -#define MODE_RESET_HOME 0x4000 -#define MODE_PRESERVE_GROUPS 0x8000 +#define MODE_RUN 0x00001 +#define MODE_EDIT 0x00002 +#define MODE_VALIDATE 0x00004 +#define MODE_INVALIDATE 0x00008 +#define MODE_KILL 0x00010 +#define MODE_VERSION 0x00020 +#define MODE_HELP 0x00040 +#define MODE_LIST 0x00080 +#define MODE_CHECK 0x00100 +#define MODE_LISTDEFS 0x00200 +#define MODE_BACKGROUND 0x00400 +#define MODE_SHELL 0x00800 +#define MODE_LOGIN_SHELL 0x01000 +#define MODE_IMPLIED_SHELL 0x02000 +#define MODE_RESET_HOME 0x04000 +#define MODE_PRESERVE_GROUPS 0x08000 +#define MODE_PRESERVE_ENV 0x10000 /* * Used with set_perms() diff --git a/sudo.pod b/sudo.pod index 2f0f5eb14..0a34722e4 100644 --- a/sudo.pod +++ b/sudo.pod @@ -1,5 +1,6 @@ =cut -Copyright (c) 1994-1996,1998-2004 Todd C. Miller +Copyright (c) 1994-1996, 1998-2005, 2007 + Todd C. Miller Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -31,9 +32,9 @@ B B<-K> | B<-k> | B<-h> | B<-L> | B<-V> | B<-v> B B<-l> S<[B<-U> I]> S<[B<-u> I|I<#uid>]> [I] -B [B<-bHPS>] S<[B<-a> I]> S<[B<-C> I]> +B [B<-bEHPS>] S<[B<-a> I]> S<[B<-C> I]> S<[B<-c> I|I<->]> S<[B<-p> I]> S<[B<-u> I|I<#uid>]> -S<{B<-e> file [...] | B<-i> | B<-s> | I}> +S<[B=I]> S<{B<-e> file [...] | B<-i> | B<-s> | I}> B S<[B<-a> I]> S<[B<-p> I]> [B<-S>] S<[B<-u> I|I<#uid>]> @@ -131,6 +132,13 @@ as root, or the B command must be run from a shell that is already root. This option is only available on systems with BSD login classes where B has been configured with the --with-logincap option. +=item -E + +The B<-E> (I) option will override the +I option in L). It is only +available when either the matching command has the C tag +or the I option is set in L. + =item -e The B<-e> (I) option indicates that, instead of running @@ -252,7 +260,7 @@ expanded to the local hostname without the domain name expanded to the local hostname including the domain name (on if the machine's hostname is fully qualified or the I -sudoers option is set) +I option is set) =item C<%%> @@ -308,6 +316,13 @@ line arguments. It is most useful in conjunction with the B<-s> flag. =back +Environment variables to be set for the command may also be passed +on the command line in the form of B=I, e.g. +B=I. This is only permitted +when the I option is set in I or the command to +be run has the C tag set. See L +for more information. + =head1 RETURN VALUES Upon successful execution of a program, the return value from B diff --git a/sudoers.pod b/sudoers.pod index 86a358167..b6ccc2e0e 100644 --- a/sudoers.pod +++ b/sudoers.pod @@ -475,7 +475,7 @@ This flag is I by default. =item ignore_local_sudoers If set via LDAP, parsing of @sysconfdir@/sudoers will be skipped. -This is intended for an Enterprises that wish to prevent the usage of local +This is intended for Enterprises that wish to prevent the usage of local sudoers files so that only LDAP is used. This thwarts the efforts of rogue operators who would attempt to add roles to @sysconfdir@/sudoers. When this option is present, @sysconfdir@/sudoers does not even need to exist. @@ -540,6 +540,14 @@ error (ie: file descriptors 0-2). The I option can be used to specify a different file descriptor at which to start closing. The default is 3. +=item setenv + +Allow the user to set additional environment variables from the +command line. Note that variables set this way are not subject to +the restrictions imposed by I, I, or +I. As such, only trusted users should be allowed to set +variables in this manner. + =back B: @@ -838,7 +846,7 @@ B, and B. Runas_Spec ::= '(' Runas_List ')' Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' | - 'MONITOR' | 'NOMONITOR') + 'SETENV:' | 'NOSETENV:' | 'MONITOR:' | 'NOMONITOR:') A B determines which commands a user may run (and as what user) on specified hosts. By default, commands are @@ -872,12 +880,12 @@ but F and F as B. =head2 Tag_Spec A command may have zero or more tags associated with it. There are -four possible tag values, C, C, C, C, -C and C. +eight possible tag values, C, C, C, C, +C, C, C and C. Once a tag is set on a C, subsequent Cs in the C, inherit the tag unless it is overridden by the -opposite tag (ie: C overrides C and C -overrides C). +opposite tag (i.e.: C overrides C and C +overrides C). =head3 NOPASSWD and PASSWD @@ -921,6 +929,14 @@ and F but shell escapes will be disabled. See the L section below for more details on how C works and whether or not it will work on your system. +=head3 SETENV and NOSETENV + +These tags override the value of the I option on a per-command +basis. Note that environment variables set on the command line way +are not subject to the restrictions imposed by I, +I, or I. As such, only trusted users should +be allowed to set variables in this manner. + =head3 MONITOR and NOMONITOR If B has been configured with the C<--with-systrace> option, diff --git a/toke.c b/toke.c index 557960e24..cb3296e46 100644 --- a/toke.c +++ b/toke.c @@ -1,5 +1,4 @@ -#line 2 "toke.c" -/* $OpenBSD: flex.skl,v 1.8 2004/02/09 11:38:31 espie Exp $ */ +/* $OpenBSD: flex.skl,v 1.10 2007/01/26 14:38:19 tsi Exp $ */ /* A lexical scanner generated by flex */ @@ -289,57 +288,60 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 43 -#define YY_END_OF_BUFFER 44 -static yyconst short int yy_accept[428] = +#define YY_NUM_RULES 45 +#define YY_END_OF_BUFFER 46 +static yyconst short int yy_accept[456] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 44, 33, 39, 38, 37, 42, 33, 26, - 42, 33, 34, 33, 33, 33, 33, 36, 35, 27, - 27, 27, 27, 27, 42, 33, 39, 42, 27, 27, - 27, 27, 27, 28, 42, 28, 29, 28, 28, 28, - 28, 28, 27, 27, 27, 27, 27, 42, 28, 1, - 33, 33, 12, 11, 12, 11, 11, 42, 42, 2, - 8, 8, 8, 3, 8, 4, 42, 33, 0, 39, - 37, 0, 41, 23, 0, 22, 0, 32, 32, 0, - 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, - - 33, 40, 33, 39, 0, 0, 0, 0, 0, 0, - 33, 33, 33, 33, 33, 28, 0, 28, 23, 0, - 22, 0, 28, 0, 28, 28, 28, 28, 28, 27, - 27, 27, 27, 27, 28, 28, 1, 30, 30, 0, - 33, 12, 12, 10, 9, 10, 0, 2, 8, 0, - 8, 0, 0, 5, 6, 8, 8, 0, 33, 33, - 33, 27, 27, 27, 27, 27, 27, 33, 0, 0, - 0, 0, 0, 0, 33, 33, 33, 33, 33, 28, - 28, 28, 27, 27, 27, 27, 27, 27, 28, 0, - 33, 7, 7, 0, 7, 8, 33, 33, 33, 33, - - 33, 27, 27, 27, 27, 27, 27, 33, 0, 0, - 0, 0, 0, 0, 33, 33, 33, 28, 28, 28, - 28, 28, 27, 27, 27, 27, 27, 27, 28, 33, - 7, 33, 33, 33, 0, 19, 27, 27, 27, 27, - 27, 33, 0, 0, 0, 0, 33, 33, 28, 28, - 28, 27, 27, 27, 27, 27, 28, 33, 33, 33, - 33, 33, 33, 27, 27, 27, 27, 27, 33, 0, - 0, 0, 33, 33, 28, 28, 28, 28, 28, 27, - 27, 27, 27, 27, 28, 33, 24, 24, 24, 27, - 0, 18, 27, 27, 0, 17, 33, 0, 0, 0, - - 33, 33, 24, 24, 24, 27, 27, 27, 28, 33, - 33, 24, 24, 24, 24, 0, 21, 27, 27, 31, - 0, 0, 0, 33, 14, 28, 24, 24, 24, 24, - 27, 27, 28, 30, 33, 25, 25, 25, 27, 0, - 16, 0, 14, 0, 33, 0, 33, 28, 25, 25, - 25, 27, 33, 33, 25, 25, 25, 25, 25, 0, - 20, 0, 0, 15, 14, 0, 14, 0, 28, 28, - 25, 25, 25, 25, 25, 33, 33, 33, 25, 25, - 15, 0, 13, 28, 28, 28, 25, 25, 33, 33, - 33, 33, 33, 28, 28, 28, 28, 28, 33, 33, - - 33, 28, 28, 28, 33, 33, 33, 33, 33, 28, - 28, 28, 28, 28, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 0 + 0, 0, 46, 35, 41, 40, 39, 44, 35, 28, + 44, 35, 36, 35, 35, 35, 35, 38, 37, 29, + 29, 29, 29, 29, 29, 44, 35, 41, 44, 29, + 29, 29, 29, 29, 30, 44, 30, 31, 30, 30, + 30, 30, 30, 29, 29, 29, 29, 29, 29, 44, + 30, 1, 35, 35, 12, 11, 12, 11, 11, 44, + 44, 2, 8, 8, 8, 3, 8, 4, 44, 35, + 0, 41, 39, 0, 43, 25, 0, 24, 0, 34, + 34, 0, 35, 35, 35, 35, 35, 29, 29, 29, + + 29, 29, 29, 35, 42, 35, 41, 0, 0, 0, + 0, 0, 0, 35, 35, 35, 35, 35, 30, 0, + 30, 25, 0, 24, 0, 30, 0, 30, 30, 30, + 30, 30, 29, 29, 29, 29, 29, 29, 30, 30, + 1, 32, 32, 0, 35, 12, 12, 10, 9, 10, + 0, 2, 8, 0, 8, 0, 0, 5, 6, 8, + 8, 0, 35, 35, 35, 29, 29, 29, 29, 29, + 29, 29, 29, 35, 0, 0, 0, 0, 0, 0, + 35, 35, 35, 35, 35, 30, 30, 30, 29, 29, + 29, 29, 29, 29, 29, 29, 30, 0, 35, 7, + + 7, 0, 7, 8, 35, 35, 35, 35, 35, 29, + 29, 29, 29, 29, 29, 29, 29, 35, 0, 0, + 0, 0, 0, 0, 35, 35, 35, 30, 30, 30, + 30, 30, 29, 29, 29, 29, 29, 29, 29, 29, + 30, 35, 7, 35, 35, 35, 0, 19, 29, 29, + 29, 29, 29, 29, 29, 35, 0, 0, 0, 0, + 35, 35, 30, 30, 30, 29, 29, 29, 29, 29, + 29, 29, 30, 35, 35, 35, 35, 35, 35, 29, + 29, 29, 29, 29, 29, 29, 35, 0, 0, 0, + 35, 35, 30, 30, 30, 30, 30, 29, 29, 29, + + 29, 29, 29, 29, 30, 35, 26, 26, 26, 29, + 0, 18, 29, 29, 29, 0, 17, 0, 20, 35, + 0, 0, 0, 35, 35, 26, 26, 26, 29, 29, + 29, 29, 30, 35, 35, 26, 26, 26, 26, 0, + 23, 29, 29, 29, 33, 0, 0, 0, 35, 14, + 30, 26, 26, 26, 26, 29, 29, 29, 30, 32, + 35, 27, 27, 27, 29, 0, 16, 0, 21, 0, + 14, 0, 35, 0, 35, 30, 27, 27, 27, 29, + 35, 35, 27, 27, 27, 27, 27, 0, 22, 0, + 0, 15, 14, 0, 14, 0, 30, 30, 27, 27, + + 27, 27, 27, 35, 35, 35, 27, 27, 15, 0, + 13, 30, 30, 30, 27, 27, 35, 35, 35, 35, + 35, 30, 30, 30, 30, 30, 35, 35, 35, 30, + 30, 30, 35, 35, 35, 35, 35, 30, 30, 30, + 30, 30, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 0 } ; static yyconst int yy_ec[256] = @@ -352,12 +354,12 @@ static yyconst int yy_ec[256] = 19, 20, 21, 22, 22, 22, 22, 23, 1, 1, 24, 25, 10, 26, 27, 28, 29, 30, 31, 28, 28, 32, 33, 28, 28, 28, 34, 35, 36, 37, - 28, 38, 39, 40, 41, 28, 42, 43, 28, 28, - 10, 44, 10, 1, 45, 1, 46, 47, 48, 49, + 28, 38, 39, 40, 41, 42, 43, 44, 28, 28, + 10, 45, 10, 1, 46, 1, 47, 48, 49, 50, - 50, 51, 47, 47, 52, 47, 47, 53, 54, 55, - 56, 47, 47, 57, 58, 59, 60, 47, 47, 47, - 47, 47, 1, 1, 1, 1, 1, 1, 1, 1, + 51, 52, 48, 48, 53, 48, 48, 54, 55, 56, + 57, 48, 48, 58, 59, 60, 61, 48, 48, 48, + 48, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -374,366 +376,379 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[61] = +static yyconst int yy_meta[62] = { 0, 1, 2, 2, 3, 1, 4, 1, 3, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 6, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 + 1, 1, 1, 1, 6, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7 } ; -static yyconst short int yy_base[452] = +static yyconst short int yy_base[480] = { 0, - 0, 59, 100, 0, 159, 160, 167, 180, 223, 282, - 341, 384, 1714, 1669, 1683, 2099, 1680, 1680, 1612, 2099, - 2099, 1611, 2099, 168, 50, 214, 243, 2099, 2099, 428, - 1603, 1591, 1590, 1581, 487, 18, 178, 161, 1515, 1518, - 1503, 1480, 1481, 1485, 63, 1484, 2099, 1483, 197, 275, - 350, 359, 512, 1483, 1475, 1474, 1475, 571, 30, 1491, - 396, 33, 0, 2099, 1480, 0, 2099, 407, 84, 0, - 1435, 579, 51, 2099, 154, 2099, 96, 1434, 297, 1475, - 1472, 1471, 2099, 1429, 512, 1428, 596, 584, 1427, 623, - 339, 171, 596, 635, 644, 0, 1439, 1433, 163, 1428, - - 193, 2099, 165, 604, 1410, 1412, 1404, 1394, 1386, 184, - 144, 194, 196, 198, 199, 1399, 666, 294, 1396, 690, - 1394, 699, 672, 723, 720, 206, 735, 749, 764, 0, - 1403, 1391, 381, 1376, 347, 202, 1403, 782, 1360, 790, - 203, 0, 1399, 253, 2099, 2099, 315, 0, 1358, 671, - 798, 158, 379, 2099, 2099, 1357, 390, 815, 814, 827, - 843, 1370, 1365, 1354, 1360, 1361, 1330, 246, 1313, 1316, - 1308, 1310, 1305, 218, 357, 254, 264, 370, 363, 856, - 872, 885, 1325, 1320, 1309, 1315, 1301, 1280, 307, 907, - 318, 1271, 2099, 393, 909, 920, 918, 388, 929, 938, - - 949, 221, 1264, 1245, 1240, 1205, 1183, 448, 1166, 1160, - 1137, 1149, 1119, 449, 280, 578, 378, 958, 593, 967, - 978, 987, 492, 1125, 1115, 1101, 1096, 1066, 453, 456, - 582, 996, 1007, 1016, 574, 2099, 1071, 1077, 1072, 1039, - 1047, 460, 1023, 989, 990, 583, 597, 546, 1025, 1036, - 1045, 984, 990, 976, 951, 941, 595, 622, 1054, 668, - 1065, 1074, 1083, 889, 683, 884, 868, 698, 137, 839, - 803, 681, 606, 660, 1094, 673, 1103, 1112, 1123, 814, - 772, 811, 778, 774, 666, 676, 1133, 1142, 1153, 786, - 814, 2099, 776, 781, 817, 2099, 699, 736, 713, 683, - - 682, 701, 1163, 1172, 1183, 827, 725, 720, 716, 718, - 1192, 48, 1202, 1213, 864, 894, 2099, 706, 895, 665, - 641, 611, 422, 461, 1222, 1221, 586, 1234, 1252, 1243, - 629, 918, 567, 545, 1263, 1272, 1281, 1292, 1143, 1303, - 2099, 532, 1314, 803, 729, 464, 457, 1313, 1327, 1342, - 1356, 1315, 1363, 809, 1373, 1392, 1402, 1411, 1306, 1319, - 2099, 395, 424, 382, 355, 1433, 304, 1457, 1431, 810, - 1469, 1478, 1487, 1498, 1507, 1516, 1527, 1536, 1545, 851, - 2099, 301, 2099, 1556, 1565, 1574, 1585, 1581, 1594, 811, - 1614, 1623, 1603, 1632, 884, 1643, 1652, 1661, 1672, 1681, - - 1690, 1701, 1710, 1719, 1730, 928, 1739, 1748, 1759, 1768, - 947, 1777, 1788, 1797, 1806, 1817, 1826, 1835, 1846, 1855, - 204, 1864, 1875, 52, 1884, 1893, 2099, 1937, 1944, 1951, - 1958, 1965, 1972, 1979, 1986, 1993, 2000, 2007, 2014, 2021, - 2028, 66, 2035, 2042, 2049, 2056, 2063, 2070, 2077, 2084, - 2091 + 0, 60, 101, 0, 161, 162, 169, 182, 226, 286, + 346, 390, 1666, 1620, 1662, 2162, 1659, 1659, 1615, 2162, + 2162, 1614, 2162, 170, 51, 217, 277, 2162, 2162, 435, + 1606, 1613, 1612, 1620, 1615, 495, 18, 178, 187, 1574, + 1568, 1561, 1556, 1557, 1570, 64, 1568, 2162, 1567, 352, + 362, 399, 492, 537, 1567, 1574, 1573, 1574, 1551, 597, + 30, 1579, 360, 33, 0, 2162, 1576, 0, 2162, 613, + 85, 0, 1534, 626, 50, 2162, 52, 2162, 97, 1533, + 240, 1575, 1563, 1563, 2162, 1520, 300, 1519, 537, 363, + 1518, 637, 180, 168, 656, 665, 413, 0, 1531, 1517, + + 216, 1512, 1510, 209, 2162, 159, 625, 1494, 1497, 1490, + 1476, 1477, 162, 200, 172, 144, 212, 215, 1490, 688, + 297, 1489, 712, 1488, 721, 643, 745, 686, 177, 742, + 757, 772, 0, 1501, 1487, 490, 1482, 1480, 256, 255, + 1517, 776, 1473, 801, 276, 0, 1513, 267, 2162, 2162, + 325, 0, 1462, 398, 792, 178, 599, 2162, 2162, 1461, + 396, 806, 822, 831, 840, 1476, 1471, 1459, 1466, 1467, + 1457, 1448, 1447, 308, 1421, 1422, 1413, 1412, 1413, 258, + 361, 196, 329, 328, 367, 852, 861, 870, 1434, 1424, + 1412, 1419, 1426, 1421, 1408, 1414, 309, 893, 381, 1393, + + 2162, 455, 898, 906, 907, 341, 917, 928, 939, 164, + 1397, 1398, 1373, 1368, 1366, 1352, 1359, 392, 1343, 1342, + 1315, 1303, 1267, 308, 284, 206, 364, 947, 414, 958, + 969, 979, 500, 1284, 1265, 1260, 1255, 1253, 1221, 1227, + 471, 480, 603, 988, 999, 1009, 503, 2162, 1225, 1231, + 1226, 1219, 1225, 1225, 1212, 483, 1199, 1174, 1165, 604, + 490, 579, 1018, 1029, 1039, 1169, 1145, 1110, 1093, 1100, + 1082, 1059, 568, 585, 1048, 597, 1059, 1069, 1078, 1062, + 513, 1032, 1009, 977, 657, 696, 394, 944, 916, 688, + 672, 683, 1089, 650, 1099, 1108, 1119, 916, 732, 892, + + 878, 878, 797, 804, 487, 581, 1130, 1139, 1150, 809, + 812, 2162, 871, 872, 822, 832, 2162, 891, 2162, 705, + 774, 763, 664, 687, 707, 1161, 1170, 1181, 896, 786, + 753, 730, 722, 736, 1191, 595, 1201, 1212, 1222, 918, + 2162, 710, 938, 999, 694, 669, 650, 739, 567, 1240, + 1231, 654, 1253, 1262, 1271, 655, 1039, 1080, 644, 611, + 1283, 1292, 1301, 1313, 1139, 1140, 2162, 1171, 2162, 606, + 1322, 979, 774, 489, 485, 1322, 1335, 1352, 1365, 1191, + 1343, 786, 1382, 1395, 1404, 1414, 1425, 1202, 2162, 365, + 387, 342, 318, 1442, 275, 1467, 1464, 801, 1479, 1494, + + 1509, 1524, 1444, 1539, 1554, 1569, 1576, 1360, 2162, 300, + 2162, 1586, 1606, 1616, 1623, 1374, 1636, 849, 1653, 1666, + 1675, 1683, 851, 1696, 1705, 1715, 1726, 1735, 1745, 1756, + 1765, 1775, 1786, 997, 1795, 1805, 1816, 1825, 1057, 1835, + 1846, 1855, 1865, 1876, 1885, 1895, 1906, 1915, 181, 1925, + 1936, 48, 1945, 1955, 2162, 2000, 2007, 2014, 2021, 2028, + 2035, 2042, 2049, 2056, 2063, 2070, 2077, 2084, 2091, 57, + 2098, 2105, 2112, 2119, 2126, 2133, 2140, 2147, 2154 } ; -static yyconst short int yy_def[452] = +static yyconst short int yy_def[480] = { 0, - 427, 1, 427, 3, 1, 1, 428, 428, 429, 429, - 430, 430, 427, 431, 427, 427, 427, 432, 433, 427, - 427, 434, 427, 435, 431, 431, 431, 427, 427, 427, - 30, 30, 30, 30, 431, 431, 427, 432, 30, 30, - 30, 30, 30, 436, 427, 437, 427, 438, 439, 436, - 436, 436, 427, 53, 53, 53, 53, 436, 436, 427, - 440, 431, 441, 427, 441, 441, 427, 427, 427, 442, - 443, 444, 443, 427, 443, 427, 445, 431, 431, 427, - 427, 432, 427, 433, 433, 434, 434, 435, 446, 431, - 431, 431, 431, 431, 431, 30, 30, 30, 30, 30, - - 431, 427, 431, 427, 427, 427, 427, 427, 427, 432, - 431, 431, 431, 431, 431, 436, 436, 427, 437, 437, - 438, 438, 439, 436, 436, 436, 436, 436, 436, 53, - 53, 53, 53, 53, 436, 436, 427, 440, 447, 431, - 431, 441, 441, 427, 427, 427, 427, 442, 443, 443, - 444, 448, 444, 427, 427, 443, 443, 427, 431, 431, - 431, 30, 30, 30, 30, 30, 30, 431, 427, 427, - 427, 427, 427, 432, 431, 431, 431, 431, 431, 436, - 436, 436, 53, 53, 53, 53, 53, 53, 436, 427, - 431, 443, 427, 448, 444, 444, 431, 431, 431, 431, - - 431, 30, 30, 30, 30, 30, 30, 431, 427, 427, - 427, 427, 427, 432, 431, 431, 431, 436, 436, 436, - 436, 436, 53, 53, 53, 53, 53, 53, 436, 431, - 448, 431, 431, 431, 427, 427, 30, 30, 30, 30, - 30, 431, 427, 427, 427, 432, 431, 431, 436, 436, - 436, 53, 53, 53, 53, 53, 436, 431, 431, 431, - 431, 431, 431, 30, 30, 30, 30, 30, 431, 427, - 427, 432, 431, 431, 436, 436, 436, 436, 436, 53, - 53, 53, 53, 53, 436, 431, 431, 431, 431, 30, - 427, 427, 30, 30, 427, 427, 431, 427, 427, 432, - - 431, 431, 436, 436, 436, 53, 53, 53, 436, 431, - 431, 431, 431, 431, 431, 427, 427, 30, 30, 431, - 427, 427, 432, 431, 431, 436, 436, 436, 436, 436, - 53, 53, 436, 431, 431, 431, 431, 431, 30, 427, - 427, 427, 427, 432, 431, 449, 450, 436, 436, 436, - 436, 53, 431, 431, 431, 431, 431, 431, 431, 427, - 427, 427, 451, 431, 449, 449, 450, 450, 436, 436, - 436, 436, 436, 436, 436, 431, 431, 431, 431, 431, - 427, 451, 427, 436, 436, 436, 436, 436, 431, 431, - 431, 431, 431, 436, 436, 436, 436, 436, 431, 431, - - 431, 436, 436, 436, 431, 431, 431, 431, 431, 436, - 436, 436, 436, 436, 431, 431, 431, 436, 436, 436, - 431, 431, 431, 436, 436, 436, 0, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427 + 455, 1, 455, 3, 1, 1, 456, 456, 457, 457, + 458, 458, 455, 459, 455, 455, 455, 460, 461, 455, + 455, 462, 455, 463, 459, 459, 459, 455, 455, 455, + 30, 30, 30, 30, 30, 459, 459, 455, 460, 30, + 30, 30, 30, 30, 464, 455, 465, 455, 466, 467, + 464, 464, 464, 455, 54, 54, 54, 54, 54, 464, + 464, 455, 468, 459, 469, 455, 469, 469, 455, 455, + 455, 470, 471, 472, 471, 455, 471, 455, 473, 459, + 459, 455, 455, 460, 455, 461, 461, 462, 462, 463, + 474, 459, 459, 459, 459, 459, 459, 30, 30, 30, + + 30, 30, 30, 459, 455, 459, 455, 455, 455, 455, + 455, 455, 460, 459, 459, 459, 459, 459, 464, 464, + 455, 465, 465, 466, 466, 467, 464, 464, 464, 464, + 464, 464, 54, 54, 54, 54, 54, 54, 464, 464, + 455, 468, 475, 459, 459, 469, 469, 455, 455, 455, + 455, 470, 471, 471, 472, 476, 472, 455, 455, 471, + 471, 455, 459, 459, 459, 30, 30, 30, 30, 30, + 30, 30, 30, 459, 455, 455, 455, 455, 455, 460, + 459, 459, 459, 459, 459, 464, 464, 464, 54, 54, + 54, 54, 54, 54, 54, 54, 464, 455, 459, 471, + + 455, 476, 472, 472, 459, 459, 459, 459, 459, 30, + 30, 30, 30, 30, 30, 30, 30, 459, 455, 455, + 455, 455, 455, 460, 459, 459, 459, 464, 464, 464, + 464, 464, 54, 54, 54, 54, 54, 54, 54, 54, + 464, 459, 476, 459, 459, 459, 455, 455, 30, 30, + 30, 30, 30, 30, 30, 459, 455, 455, 455, 460, + 459, 459, 464, 464, 464, 54, 54, 54, 54, 54, + 54, 54, 464, 459, 459, 459, 459, 459, 459, 30, + 30, 30, 30, 30, 30, 30, 459, 455, 455, 460, + 459, 459, 464, 464, 464, 464, 464, 54, 54, 54, + + 54, 54, 54, 54, 464, 459, 459, 459, 459, 30, + 455, 455, 30, 30, 30, 455, 455, 455, 455, 459, + 455, 455, 460, 459, 459, 464, 464, 464, 54, 54, + 54, 54, 464, 459, 459, 459, 459, 459, 459, 455, + 455, 30, 30, 30, 459, 455, 455, 460, 459, 459, + 464, 464, 464, 464, 464, 54, 54, 54, 464, 459, + 459, 459, 459, 459, 30, 455, 455, 455, 455, 455, + 455, 460, 459, 477, 478, 464, 464, 464, 464, 54, + 459, 459, 459, 459, 459, 459, 459, 455, 455, 455, + 479, 459, 477, 477, 478, 478, 464, 464, 464, 464, + + 464, 464, 464, 459, 459, 459, 459, 459, 455, 479, + 455, 464, 464, 464, 464, 464, 459, 459, 459, 459, + 459, 464, 464, 464, 464, 464, 459, 459, 459, 464, + 464, 464, 459, 459, 459, 459, 459, 464, 464, 464, + 464, 464, 459, 459, 459, 464, 464, 464, 459, 459, + 459, 464, 464, 464, 0, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455 } ; -static yyconst short int yy_nxt[2160] = +static yyconst short int yy_nxt[2224] = { 0, 14, 15, 16, 17, 14, 18, 19, 20, 21, 14, 22, 23, 14, 14, 24, 25, 26, 27, 25, 25, 25, 25, 28, 29, 21, 14, 30, 30, 30, 30, - 31, 30, 30, 32, 33, 30, 34, 30, 30, 30, - 30, 30, 30, 35, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 36, 14, 14, - 37, 79, 311, 91, 38, 92, 92, 92, 92, 92, - 92, 92, 148, 117, 154, 118, 79, 103, 118, 118, - 118, 118, 118, 118, 118, 147, 102, 39, 40, 136, - 41, 79, 141, 79, 150, 117, 42, 157, 102, 43, - - 44, 15, 16, 17, 44, 45, 46, 21, 47, 44, - 48, 23, 44, 44, 49, 50, 51, 52, 50, 50, - 50, 50, 28, 29, 21, 44, 53, 53, 53, 53, - 54, 53, 53, 55, 56, 53, 57, 53, 53, 53, - 53, 53, 53, 58, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 59, 44, 44, - 60, 60, 193, 83, 21, 21, 21, 21, 15, 64, - 65, 89, 66, 61, 61, 89, 89, 155, 67, 104, - 79, 15, 64, 65, 91, 66, 83, 79, 297, 67, - 66, 67, 89, 164, 147, 102, 165, 150, 175, 166, - - 89, 194, 67, 66, 89, 89, 105, 106, 79, 107, - 68, 90, 110, 168, 79, 108, 62, 62, 109, 125, - 83, 89, 235, 68, 15, 16, 17, 91, 18, 93, - 93, 93, 93, 93, 93, 93, 79, 79, 174, 79, - 124, 79, 79, 236, 176, 117, 79, 79, 179, 117, - 189, 191, 178, 177, 147, 102, 91, 79, 94, 94, - 94, 94, 94, 95, 92, 214, 69, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 15, 16, 17, 79, 18, 125, 79, - 126, 126, 126, 126, 126, 126, 126, 79, 78, 216, - - 78, 208, 78, 383, 78, 78, 118, 79, 78, 118, - 118, 118, 118, 118, 118, 118, 147, 102, 117, 78, - 78, 78, 215, 79, 247, 69, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 15, 16, 17, 72, 18, 368, 147, 102, - 117, 73, 74, 75, 159, 160, 161, 159, 159, 159, - 159, 79, 229, 125, 76, 127, 127, 127, 127, 127, - 127, 127, 125, 230, 128, 128, 128, 128, 128, 129, - 126, 152, 79, 195, 77, 15, 16, 17, 72, 18, - 117, 147, 102, 117, 73, 74, 75, 231, 366, 139, - - 79, 197, 117, 139, 139, 215, 79, 76, 144, 102, - 145, 185, 146, 79, 186, 217, 145, 187, 146, 215, - 139, 79, 196, 344, 83, 79, 383, 77, 78, 146, - 146, 79, 78, 150, 78, 215, 194, 78, 78, 140, - 78, 78, 78, 96, 96, 96, 96, 96, 96, 96, - 146, 83, 381, 78, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 79, 96, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 101, 102, - 78, 79, 78, 235, 78, 78, 117, 242, 78, 79, - - 368, 246, 257, 79, 79, 258, 345, 366, 269, 78, - 78, 78, 116, 84, 236, 84, 116, 84, 116, 84, - 84, 116, 116, 84, 116, 116, 116, 130, 130, 130, - 130, 130, 130, 130, 84, 84, 84, 116, 130, 130, - 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, - 130, 130, 130, 130, 130, 117, 130, 116, 116, 116, - 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, - 116, 116, 135, 102, 116, 235, 116, 362, 116, 116, - 152, 152, 116, 149, 152, 83, 193, 89, 79, 79, - 152, 89, 89, 116, 116, 116, 236, 86, 274, 86, - - 326, 86, 152, 86, 86, 104, 218, 86, 89, 91, - 117, 92, 92, 92, 92, 92, 92, 92, 86, 86, - 86, 79, 153, 273, 88, 194, 78, 90, 88, 117, - 78, 78, 105, 106, 88, 107, 117, 248, 117, 79, - 79, 108, 272, 285, 109, 88, 88, 78, 91, 79, - 92, 92, 92, 92, 92, 92, 92, 91, 301, 92, - 92, 92, 92, 92, 92, 79, 352, 116, 343, 116, - 286, 116, 149, 116, 116, 89, 149, 116, 79, 89, - 89, 259, 149, 83, 291, 83, 275, 79, 116, 116, - 116, 119, 342, 119, 149, 119, 89, 119, 119, 295, - - 121, 119, 121, 79, 121, 292, 121, 121, 79, 117, - 121, 79, 119, 119, 119, 124, 117, 309, 302, 79, - 296, 121, 121, 121, 123, 79, 116, 310, 123, 300, - 116, 116, 323, 324, 123, 180, 181, 182, 180, 180, - 180, 180, 79, 339, 79, 123, 123, 116, 125, 332, - 126, 126, 126, 126, 126, 126, 126, 320, 325, 117, - 331, 79, 125, 117, 126, 126, 126, 126, 126, 126, - 126, 322, 79, 291, 333, 295, 334, 125, 117, 126, - 126, 126, 126, 126, 126, 139, 364, 316, 321, 139, - 139, 138, 117, 78, 292, 138, 296, 78, 78, 152, - - 152, 138, 192, 152, 344, 83, 139, 117, 317, 152, - 319, 318, 138, 138, 78, 291, 89, 363, 295, 308, - 89, 152, 353, 369, 389, 140, 89, 197, 316, 198, - 198, 198, 198, 198, 198, 198, 292, 89, 89, 296, - 197, 153, 199, 199, 199, 199, 199, 199, 199, 317, - 307, 306, 79, 117, 79, 299, 197, 79, 200, 200, - 200, 200, 200, 201, 198, 298, 380, 380, 380, 218, - 79, 219, 219, 219, 219, 219, 219, 219, 311, 312, - 312, 312, 312, 312, 312, 218, 79, 220, 220, 220, - 220, 220, 220, 220, 79, 316, 340, 394, 218, 117, - - 221, 221, 221, 221, 221, 222, 219, 79, 139, 294, - 152, 152, 139, 192, 152, 117, 317, 341, 139, 340, - 152, 152, 152, 293, 195, 152, 290, 117, 117, 139, - 139, 152, 152, 232, 233, 234, 232, 232, 232, 232, - 341, 405, 197, 152, 198, 198, 198, 198, 198, 198, - 198, 197, 153, 198, 198, 198, 198, 198, 198, 198, - 410, 79, 197, 153, 198, 198, 198, 198, 198, 198, - 284, 79, 79, 249, 250, 251, 249, 249, 249, 249, - 218, 79, 219, 219, 219, 219, 219, 219, 219, 283, - 117, 218, 79, 219, 219, 219, 219, 219, 219, 219, - - 218, 117, 219, 219, 219, 219, 219, 219, 282, 259, - 117, 260, 260, 260, 260, 260, 260, 260, 281, 280, - 259, 117, 261, 261, 261, 261, 261, 261, 261, 259, - 117, 262, 262, 262, 262, 262, 263, 260, 275, 79, - 276, 276, 276, 276, 276, 276, 276, 243, 271, 275, - 79, 277, 277, 277, 277, 277, 277, 277, 275, 79, - 278, 278, 278, 278, 278, 279, 276, 270, 117, 287, - 288, 289, 287, 287, 287, 287, 268, 267, 259, 117, - 260, 260, 260, 260, 260, 260, 260, 259, 117, 260, - 260, 260, 260, 260, 260, 260, 259, 79, 260, 260, - - 260, 260, 260, 260, 266, 265, 264, 256, 79, 303, - 304, 305, 303, 303, 303, 303, 275, 79, 276, 276, - 276, 276, 276, 276, 276, 275, 79, 276, 276, 276, - 276, 276, 276, 276, 255, 254, 275, 117, 276, 276, - 276, 276, 276, 276, 360, 253, 117, 311, 312, 312, - 312, 312, 312, 312, 312, 117, 311, 313, 313, 313, - 313, 313, 313, 313, 252, 361, 117, 311, 314, 314, - 314, 314, 314, 315, 312, 243, 79, 326, 327, 327, - 327, 327, 327, 327, 327, 79, 326, 328, 328, 328, - 328, 328, 328, 328, 245, 243, 79, 326, 329, 329, - - 329, 329, 329, 330, 327, 244, 117, 335, 336, 337, - 338, 335, 335, 335, 243, 117, 311, 312, 312, 312, - 312, 312, 312, 312, 241, 346, 117, 311, 312, 312, - 312, 312, 312, 312, 312, 79, 348, 349, 350, 351, - 348, 348, 348, 240, 346, 79, 346, 347, 326, 327, - 327, 327, 327, 327, 327, 327, 79, 326, 327, 327, - 327, 327, 327, 327, 117, 79, 326, 327, 327, 327, - 327, 327, 327, 327, 239, 238, 353, 117, 354, 354, - 354, 354, 354, 354, 354, 353, 117, 355, 355, 355, - 355, 355, 355, 355, 353, 117, 356, 356, 356, 356, - - 356, 357, 358, 237, 340, 353, 79, 359, 359, 359, - 354, 354, 354, 354, 150, 79, 360, 346, 228, 353, - 360, 380, 380, 380, 79, 341, 369, 227, 370, 370, - 370, 370, 370, 370, 370, 79, 346, 361, 346, 346, - 369, 361, 371, 371, 371, 371, 371, 371, 371, 79, - 226, 225, 224, 223, 213, 369, 117, 372, 372, 372, - 372, 372, 373, 374, 212, 211, 210, 209, 207, 369, - 117, 375, 375, 375, 370, 370, 370, 370, 376, 377, - 378, 376, 376, 376, 376, 117, 353, 206, 358, 358, - 358, 358, 358, 358, 358, 205, 204, 203, 202, 117, - - 150, 150, 143, 190, 137, 353, 79, 358, 358, 358, - 358, 358, 358, 358, 188, 353, 79, 358, 358, 358, - 358, 358, 358, 379, 353, 184, 379, 379, 379, 379, - 379, 379, 379, 183, 365, 79, 365, 122, 365, 120, - 365, 365, 117, 173, 365, 79, 384, 385, 386, 384, - 384, 384, 384, 172, 79, 365, 365, 365, 367, 171, - 367, 170, 367, 169, 367, 367, 167, 163, 367, 162, - 158, 87, 85, 83, 117, 81, 80, 79, 150, 367, - 367, 367, 369, 143, 374, 374, 374, 374, 374, 374, - 374, 369, 137, 374, 374, 374, 374, 374, 374, 374, - - 369, 134, 374, 374, 374, 374, 374, 374, 387, 133, - 132, 369, 117, 387, 387, 387, 387, 387, 387, 387, - 369, 117, 388, 388, 388, 131, 122, 120, 117, 389, - 117, 390, 390, 390, 390, 390, 390, 390, 115, 114, - 389, 117, 391, 391, 391, 391, 391, 391, 391, 389, - 117, 392, 392, 392, 392, 392, 393, 390, 113, 79, - 379, 379, 379, 379, 379, 379, 379, 112, 111, 394, - 79, 395, 395, 395, 395, 395, 395, 395, 394, 79, - 396, 396, 396, 396, 396, 396, 396, 394, 79, 397, - 397, 397, 397, 397, 398, 395, 388, 388, 388, 117, - - 387, 387, 387, 387, 387, 387, 387, 100, 117, 399, - 400, 401, 399, 399, 399, 399, 389, 117, 390, 390, - 390, 390, 390, 390, 117, 99, 98, 389, 117, 390, - 390, 390, 390, 390, 390, 390, 389, 79, 390, 390, - 390, 390, 390, 390, 390, 97, 79, 402, 403, 404, - 402, 402, 402, 402, 87, 85, 394, 79, 395, 395, - 395, 395, 395, 395, 395, 394, 79, 395, 395, 395, - 395, 395, 395, 395, 394, 117, 395, 395, 395, 395, - 395, 395, 83, 81, 80, 405, 117, 406, 406, 406, - 406, 406, 406, 406, 405, 117, 407, 407, 407, 407, - - 407, 407, 407, 405, 117, 408, 408, 408, 408, 408, - 409, 406, 79, 427, 410, 79, 411, 411, 411, 411, - 411, 411, 411, 410, 79, 412, 412, 412, 412, 412, - 412, 412, 410, 79, 413, 413, 413, 413, 413, 414, - 411, 427, 427, 427, 117, 415, 416, 417, 415, 415, - 415, 415, 405, 117, 406, 406, 406, 406, 406, 406, - 406, 405, 117, 406, 406, 406, 406, 406, 406, 406, - 427, 427, 405, 79, 406, 406, 406, 406, 406, 406, - 427, 427, 79, 418, 419, 420, 418, 418, 418, 418, - 410, 79, 411, 411, 411, 411, 411, 411, 411, 427, - - 427, 410, 79, 411, 411, 411, 411, 411, 411, 411, - 410, 117, 411, 411, 411, 411, 411, 411, 427, 427, - 117, 421, 421, 421, 421, 421, 421, 421, 427, 427, - 427, 117, 415, 415, 415, 415, 415, 415, 415, 427, - 117, 422, 422, 422, 422, 422, 423, 421, 427, 79, - 424, 424, 424, 424, 424, 424, 424, 427, 427, 427, - 79, 418, 418, 418, 418, 418, 418, 418, 427, 79, - 425, 425, 425, 425, 425, 426, 424, 427, 117, 421, - 421, 421, 421, 421, 421, 421, 427, 427, 427, 117, - 421, 421, 421, 421, 421, 421, 427, 427, 117, 424, - - 424, 424, 424, 424, 424, 424, 427, 79, 424, 424, - 424, 424, 424, 424, 427, 427, 427, 427, 79, 427, - 427, 427, 427, 427, 427, 427, 427, 117, 427, 427, - 427, 427, 427, 427, 427, 427, 117, 63, 63, 63, - 63, 63, 63, 63, 21, 21, 21, 21, 21, 21, - 21, 71, 71, 71, 71, 71, 71, 71, 78, 427, - 427, 427, 427, 78, 78, 82, 82, 82, 82, 82, - 82, 82, 84, 427, 427, 427, 427, 84, 84, 86, - 427, 427, 427, 427, 86, 86, 88, 427, 88, 427, - 427, 88, 88, 116, 427, 427, 427, 427, 116, 116, - - 119, 427, 427, 427, 427, 119, 119, 121, 427, 427, - 427, 427, 121, 121, 123, 427, 123, 427, 427, 123, - 123, 138, 427, 138, 427, 427, 138, 138, 142, 427, - 142, 142, 427, 427, 142, 149, 427, 149, 427, 149, - 149, 149, 151, 151, 151, 151, 151, 151, 151, 156, - 156, 156, 156, 156, 156, 156, 89, 427, 89, 427, - 427, 89, 89, 139, 427, 139, 427, 427, 139, 139, - 152, 152, 152, 152, 152, 152, 152, 365, 427, 427, - 427, 427, 365, 365, 367, 427, 427, 427, 427, 367, - 367, 382, 382, 382, 382, 382, 382, 382, 13, 427, - - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427 + 31, 30, 30, 32, 33, 30, 34, 30, 35, 30, + 30, 30, 30, 30, 36, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 37, 14, + 14, 38, 81, 152, 93, 39, 94, 94, 94, 94, + 94, 94, 94, 158, 120, 159, 121, 81, 106, 121, + 121, 121, 121, 121, 121, 121, 151, 105, 40, 41, + 140, 42, 120, 145, 154, 81, 154, 43, 161, 105, + + 44, 45, 15, 16, 17, 45, 46, 47, 21, 48, + 45, 49, 23, 45, 45, 50, 51, 52, 53, 51, + 51, 51, 51, 28, 29, 21, 45, 54, 54, 54, + 54, 55, 54, 54, 56, 57, 54, 58, 54, 59, + 54, 54, 54, 54, 54, 60, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 61, + 45, 45, 62, 62, 85, 247, 21, 21, 21, 21, + 15, 66, 67, 91, 68, 63, 63, 91, 91, 107, + 69, 93, 201, 15, 66, 67, 248, 68, 81, 85, + 128, 69, 68, 69, 91, 163, 164, 165, 163, 163, + + 163, 163, 183, 81, 69, 68, 108, 109, 174, 110, + 151, 105, 81, 70, 92, 111, 81, 180, 112, 64, + 64, 120, 202, 182, 81, 81, 70, 15, 16, 17, + 93, 18, 95, 95, 95, 95, 95, 95, 95, 113, + 81, 80, 226, 80, 81, 80, 168, 80, 80, 169, + 81, 80, 170, 81, 171, 181, 81, 151, 105, 81, + 85, 81, 80, 80, 80, 185, 262, 184, 151, 105, + 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 15, 16, 17, + 93, 18, 96, 96, 96, 96, 96, 97, 94, 120, + + 120, 86, 411, 86, 197, 86, 224, 86, 86, 121, + 85, 86, 121, 121, 121, 121, 121, 121, 121, 396, + 81, 81, 86, 86, 86, 199, 151, 105, 81, 261, + 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 15, 16, 17, + 74, 18, 81, 120, 205, 91, 75, 76, 77, 91, + 91, 260, 394, 143, 218, 241, 91, 143, 143, 78, + 91, 91, 81, 81, 227, 128, 91, 129, 129, 129, + 129, 129, 129, 129, 143, 81, 81, 91, 225, 411, + 79, 15, 16, 17, 74, 18, 127, 151, 105, 153, + + 75, 76, 77, 153, 144, 81, 120, 92, 81, 153, + 225, 81, 128, 78, 130, 130, 130, 130, 130, 130, + 130, 153, 225, 409, 225, 81, 93, 228, 94, 94, + 94, 94, 94, 94, 79, 80, 81, 242, 81, 80, + 154, 80, 256, 120, 80, 80, 320, 80, 80, 80, + 98, 98, 98, 98, 98, 98, 98, 81, 120, 243, + 80, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 81, + 98, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 104, 105, 80, 202, + + 80, 247, 80, 80, 247, 128, 80, 131, 131, 131, + 131, 131, 132, 129, 311, 120, 291, 80, 80, 80, + 191, 273, 248, 192, 81, 248, 193, 81, 194, 396, + 274, 120, 287, 394, 81, 312, 120, 119, 88, 333, + 88, 119, 88, 119, 88, 88, 119, 119, 88, 119, + 119, 119, 133, 133, 133, 133, 133, 133, 133, 88, + 88, 88, 119, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 120, 133, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 139, 105, + + 119, 156, 119, 203, 119, 119, 85, 201, 119, 335, + 275, 81, 120, 373, 148, 105, 149, 305, 150, 119, + 119, 119, 149, 81, 150, 81, 107, 156, 156, 81, + 153, 156, 292, 334, 306, 150, 150, 156, 90, 81, + 80, 81, 90, 204, 80, 80, 91, 202, 90, 156, + 91, 91, 390, 108, 109, 81, 110, 150, 316, 90, + 90, 80, 111, 293, 290, 112, 85, 91, 351, 93, + 157, 94, 94, 94, 94, 94, 94, 94, 93, 317, + 94, 94, 94, 94, 94, 94, 94, 127, 120, 119, + 85, 119, 380, 119, 120, 119, 119, 318, 120, 119, + + 81, 186, 187, 188, 186, 186, 186, 186, 371, 81, + 119, 119, 119, 122, 348, 122, 81, 122, 319, 122, + 122, 370, 124, 122, 124, 324, 124, 81, 124, 124, + 120, 81, 124, 311, 122, 122, 122, 323, 81, 349, + 372, 85, 325, 124, 124, 124, 126, 365, 119, 81, + 126, 81, 119, 119, 312, 128, 126, 129, 129, 129, + 129, 129, 129, 129, 345, 350, 120, 126, 126, 119, + 128, 358, 129, 129, 129, 129, 129, 129, 129, 143, + 81, 359, 357, 143, 143, 128, 120, 129, 129, 129, + 129, 129, 129, 156, 156, 360, 200, 156, 316, 381, + + 143, 120, 142, 156, 80, 318, 142, 91, 80, 80, + 340, 91, 142, 311, 397, 156, 120, 91, 81, 317, + 144, 356, 347, 142, 142, 80, 319, 346, 91, 91, + 81, 341, 392, 316, 312, 205, 157, 206, 206, 206, + 206, 206, 206, 206, 205, 120, 207, 207, 207, 207, + 207, 207, 207, 205, 317, 208, 208, 208, 208, 208, + 209, 206, 417, 344, 422, 228, 81, 229, 229, 229, + 229, 229, 229, 229, 228, 81, 230, 230, 230, 230, + 230, 230, 230, 228, 81, 231, 231, 231, 231, 231, + 232, 229, 318, 81, 143, 120, 120, 340, 143, 156, + + 156, 343, 200, 156, 143, 120, 342, 156, 156, 156, + 203, 156, 332, 319, 120, 143, 143, 156, 341, 340, + 331, 156, 244, 245, 246, 244, 244, 244, 244, 156, + 205, 330, 206, 206, 206, 206, 206, 206, 206, 366, + 341, 205, 157, 206, 206, 206, 206, 206, 206, 206, + 157, 81, 205, 329, 206, 206, 206, 206, 206, 206, + 367, 81, 263, 264, 265, 263, 263, 263, 263, 322, + 321, 228, 81, 229, 229, 229, 229, 229, 229, 229, + 372, 85, 228, 81, 229, 229, 229, 229, 229, 229, + 229, 120, 228, 391, 229, 229, 229, 229, 229, 229, + + 368, 275, 120, 276, 276, 276, 276, 276, 276, 276, + 433, 315, 275, 120, 277, 277, 277, 277, 277, 277, + 277, 369, 275, 120, 278, 278, 278, 278, 278, 279, + 276, 293, 81, 294, 294, 294, 294, 294, 294, 294, + 366, 81, 293, 81, 295, 295, 295, 295, 295, 295, + 295, 314, 293, 81, 296, 296, 296, 296, 296, 297, + 294, 367, 120, 307, 308, 309, 307, 307, 307, 307, + 438, 313, 275, 120, 276, 276, 276, 276, 276, 276, + 276, 368, 275, 120, 276, 276, 276, 276, 276, 276, + 276, 275, 81, 276, 276, 276, 276, 276, 276, 310, + + 304, 120, 369, 81, 326, 327, 328, 326, 326, 326, + 326, 303, 293, 81, 294, 294, 294, 294, 294, 294, + 294, 293, 81, 294, 294, 294, 294, 294, 294, 294, + 302, 301, 293, 120, 294, 294, 294, 294, 294, 294, + 388, 366, 300, 120, 335, 336, 336, 336, 336, 336, + 336, 336, 120, 335, 337, 337, 337, 337, 337, 337, + 337, 389, 367, 120, 335, 338, 338, 338, 338, 338, + 339, 336, 368, 299, 81, 351, 352, 352, 352, 352, + 352, 352, 352, 81, 351, 353, 353, 353, 353, 353, + 353, 353, 388, 369, 81, 351, 354, 354, 354, 354, + + 354, 355, 352, 388, 298, 120, 361, 362, 363, 364, + 361, 361, 361, 389, 120, 335, 336, 336, 336, 336, + 336, 336, 336, 257, 389, 120, 335, 336, 336, 336, + 336, 336, 336, 336, 289, 81, 335, 336, 336, 336, + 336, 336, 336, 374, 288, 81, 376, 377, 378, 379, + 376, 376, 376, 286, 285, 284, 81, 283, 282, 281, + 280, 272, 374, 271, 374, 375, 81, 351, 352, 352, + 352, 352, 352, 352, 352, 120, 351, 352, 352, 352, + 352, 352, 352, 352, 81, 351, 352, 352, 352, 352, + 352, 352, 270, 269, 268, 267, 381, 120, 382, 382, + + 382, 382, 382, 382, 382, 381, 120, 383, 383, 383, + 383, 383, 383, 383, 381, 120, 384, 384, 384, 384, + 384, 385, 386, 266, 257, 374, 381, 81, 387, 387, + 387, 382, 382, 382, 382, 397, 81, 398, 398, 398, + 398, 398, 398, 398, 374, 81, 374, 374, 397, 259, + 399, 399, 399, 399, 399, 399, 399, 81, 404, 405, + 406, 404, 404, 404, 404, 397, 120, 400, 400, 400, + 400, 400, 401, 402, 257, 408, 408, 408, 397, 120, + 403, 403, 403, 398, 398, 398, 398, 81, 258, 416, + 416, 416, 257, 255, 254, 381, 120, 386, 386, 386, + + 386, 386, 386, 386, 81, 253, 252, 251, 381, 120, + 386, 386, 386, 386, 386, 386, 386, 381, 120, 386, + 386, 386, 386, 386, 386, 407, 81, 381, 250, 407, + 407, 407, 407, 407, 407, 407, 249, 154, 381, 81, + 408, 408, 408, 393, 240, 393, 239, 393, 81, 393, + 393, 238, 237, 393, 236, 235, 234, 397, 81, 416, + 416, 416, 233, 223, 393, 393, 393, 222, 395, 81, + 395, 221, 395, 220, 395, 395, 219, 217, 395, 412, + 413, 414, 412, 412, 412, 412, 216, 215, 120, 395, + 395, 395, 397, 214, 402, 402, 402, 402, 402, 402, + + 402, 213, 212, 211, 210, 154, 154, 397, 120, 402, + 402, 402, 402, 402, 402, 402, 147, 198, 141, 196, + 195, 190, 397, 120, 402, 402, 402, 402, 402, 402, + 415, 189, 125, 123, 120, 179, 178, 397, 120, 415, + 415, 415, 415, 415, 415, 415, 177, 176, 175, 173, + 172, 167, 417, 120, 418, 418, 418, 418, 418, 418, + 418, 166, 162, 89, 87, 85, 83, 417, 120, 419, + 419, 419, 419, 419, 419, 419, 82, 81, 154, 147, + 141, 138, 417, 81, 420, 420, 420, 420, 420, 421, + 418, 407, 407, 407, 407, 407, 407, 407, 81, 422, + + 137, 423, 423, 423, 423, 423, 423, 423, 136, 135, + 134, 125, 123, 81, 120, 118, 117, 116, 115, 422, + 81, 424, 424, 424, 424, 424, 424, 424, 114, 422, + 120, 425, 425, 425, 425, 425, 426, 423, 415, 415, + 415, 415, 415, 415, 415, 103, 102, 101, 100, 99, + 120, 427, 428, 429, 427, 427, 427, 427, 89, 87, + 120, 85, 83, 82, 81, 455, 417, 120, 418, 418, + 418, 418, 418, 418, 418, 455, 455, 455, 455, 417, + 81, 418, 418, 418, 418, 418, 418, 418, 417, 455, + 418, 418, 418, 418, 418, 418, 455, 81, 430, 431, + + 432, 430, 430, 430, 430, 455, 455, 455, 455, 422, + 81, 423, 423, 423, 423, 423, 423, 423, 422, 81, + 423, 423, 423, 423, 423, 423, 423, 120, 422, 455, + 423, 423, 423, 423, 423, 423, 455, 455, 455, 433, + 120, 434, 434, 434, 434, 434, 434, 434, 433, 120, + 435, 435, 435, 435, 435, 435, 435, 455, 433, 120, + 436, 436, 436, 436, 436, 437, 434, 455, 455, 438, + 81, 439, 439, 439, 439, 439, 439, 439, 438, 81, + 440, 440, 440, 440, 440, 440, 440, 455, 438, 81, + 441, 441, 441, 441, 441, 442, 439, 455, 455, 455, + + 120, 443, 444, 445, 443, 443, 443, 443, 433, 120, + 434, 434, 434, 434, 434, 434, 434, 455, 433, 120, + 434, 434, 434, 434, 434, 434, 434, 455, 455, 433, + 81, 434, 434, 434, 434, 434, 434, 455, 455, 81, + 446, 447, 448, 446, 446, 446, 446, 455, 438, 81, + 439, 439, 439, 439, 439, 439, 439, 455, 455, 438, + 81, 439, 439, 439, 439, 439, 439, 439, 438, 120, + 439, 439, 439, 439, 439, 439, 455, 455, 455, 120, + 449, 449, 449, 449, 449, 449, 449, 455, 455, 455, + 120, 443, 443, 443, 443, 443, 443, 443, 455, 120, + + 450, 450, 450, 450, 450, 451, 449, 455, 455, 81, + 452, 452, 452, 452, 452, 452, 452, 455, 455, 455, + 81, 446, 446, 446, 446, 446, 446, 446, 455, 81, + 453, 453, 453, 453, 453, 454, 452, 455, 455, 120, + 449, 449, 449, 449, 449, 449, 449, 455, 455, 455, + 120, 449, 449, 449, 449, 449, 449, 455, 455, 120, + 452, 452, 452, 452, 452, 452, 452, 455, 455, 81, + 452, 452, 452, 452, 452, 452, 455, 455, 455, 455, + 81, 455, 455, 455, 455, 455, 455, 455, 455, 120, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 120, + + 65, 65, 65, 65, 65, 65, 65, 21, 21, 21, + 21, 21, 21, 21, 73, 73, 73, 73, 73, 73, + 73, 80, 455, 455, 455, 455, 80, 80, 84, 84, + 84, 84, 84, 84, 84, 86, 455, 455, 455, 455, + 86, 86, 88, 455, 455, 455, 455, 88, 88, 90, + 455, 90, 455, 455, 90, 90, 119, 455, 455, 455, + 455, 119, 119, 122, 455, 455, 455, 455, 122, 122, + 124, 455, 455, 455, 455, 124, 124, 126, 455, 126, + 455, 455, 126, 126, 142, 455, 142, 455, 455, 142, + 142, 146, 455, 146, 146, 455, 455, 146, 153, 455, + + 153, 455, 153, 153, 153, 155, 155, 155, 155, 155, + 155, 155, 160, 160, 160, 160, 160, 160, 160, 91, + 455, 91, 455, 455, 91, 91, 143, 455, 143, 455, + 455, 143, 143, 156, 156, 156, 156, 156, 156, 156, + 393, 455, 455, 455, 455, 393, 393, 395, 455, 455, + 455, 455, 395, 395, 410, 410, 410, 410, 410, 410, + 410, 13, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455 } ; -static yyconst short int yy_chk[2160] = +static yyconst short int yy_chk[2224] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -741,237 +756,245 @@ static yyconst short int yy_chk[2160] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 36, 312, 25, 2, 25, 25, 25, 25, 25, - 25, 25, 442, 59, 73, 45, 62, 36, 45, 45, - 45, 45, 45, 45, 45, 69, 69, 2, 2, 59, - 2, 312, 62, 25, 73, 424, 2, 77, 77, 2, + 1, 2, 37, 470, 25, 2, 25, 25, 25, 25, + 25, 25, 25, 75, 61, 77, 46, 64, 37, 46, + 46, 46, 46, 46, 46, 46, 71, 71, 2, 2, + 61, 2, 452, 64, 75, 25, 77, 2, 79, 79, + 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 5, 6, 152, 38, 5, 6, 5, 6, 7, 7, - 7, 24, 7, 5, 6, 24, 24, 75, 7, 37, - 269, 8, 8, 8, 92, 8, 110, 111, 269, 7, - 7, 8, 24, 99, 101, 101, 99, 75, 111, 99, - - 49, 152, 8, 8, 49, 49, 37, 37, 103, 37, - 7, 24, 38, 103, 92, 37, 5, 6, 37, 126, - 174, 49, 202, 8, 9, 9, 9, 26, 9, 26, - 26, 26, 26, 26, 26, 26, 101, 112, 110, 113, - 49, 114, 115, 202, 112, 136, 141, 421, 115, 126, - 136, 141, 114, 113, 144, 144, 27, 26, 27, 27, - 27, 27, 27, 27, 27, 174, 9, 9, 9, 9, + 3, 3, 5, 6, 113, 210, 5, 6, 5, 6, + 7, 7, 7, 24, 7, 5, 6, 24, 24, 38, + 7, 94, 156, 8, 8, 8, 210, 8, 116, 39, + 129, 7, 7, 8, 24, 93, 93, 93, 93, 93, + + 93, 93, 116, 106, 8, 8, 38, 38, 106, 38, + 104, 104, 94, 7, 24, 38, 115, 113, 38, 5, + 6, 129, 156, 115, 93, 449, 8, 9, 9, 9, + 26, 9, 26, 26, 26, 26, 26, 26, 26, 39, + 182, 81, 182, 81, 114, 81, 101, 81, 81, 101, + 226, 81, 101, 104, 101, 114, 117, 139, 139, 118, + 180, 26, 81, 81, 81, 118, 226, 117, 148, 148, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 10, 10, 10, 27, 10, 50, 168, - 50, 50, 50, 50, 50, 50, 50, 176, 79, 176, + 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, + 27, 10, 27, 27, 27, 27, 27, 27, 27, 140, - 79, 168, 79, 382, 79, 79, 118, 177, 79, 118, - 118, 118, 118, 118, 118, 118, 147, 147, 50, 79, - 79, 79, 177, 215, 215, 10, 10, 10, 10, 10, + 139, 87, 410, 87, 140, 87, 180, 87, 87, 121, + 224, 87, 121, 121, 121, 121, 121, 121, 121, 395, + 145, 27, 87, 87, 87, 145, 151, 151, 225, 225, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, 367, 135, 135, - 189, 11, 11, 11, 91, 91, 91, 91, 91, 91, - 91, 191, 189, 51, 11, 51, 51, 51, 51, 51, - 51, 51, 52, 191, 52, 52, 52, 52, 52, 52, - 52, 153, 91, 153, 11, 12, 12, 12, 12, 12, - 135, 157, 157, 51, 12, 12, 12, 194, 365, 61, - - 175, 198, 52, 61, 61, 175, 179, 12, 68, 68, - 68, 133, 68, 178, 133, 178, 68, 133, 68, 179, - 61, 217, 153, 323, 323, 364, 363, 12, 30, 68, - 68, 198, 30, 157, 30, 217, 194, 30, 30, 61, + 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 174, 197, 206, 50, 11, 11, 11, 50, + 50, 224, 393, 63, 174, 197, 90, 63, 63, 11, + 90, 90, 184, 183, 184, 51, 50, 51, 51, 51, + 51, 51, 51, 51, 63, 206, 392, 90, 183, 391, + 11, 12, 12, 12, 12, 12, 50, 161, 161, 154, + + 12, 12, 12, 154, 63, 181, 51, 90, 227, 154, + 181, 185, 52, 12, 52, 52, 52, 52, 52, 52, + 52, 154, 227, 390, 185, 199, 97, 229, 97, 97, + 97, 97, 97, 97, 12, 30, 218, 199, 287, 30, + 161, 30, 218, 52, 30, 30, 287, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 97, 229, 202, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 68, 214, 362, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 35, 35, - 35, 208, 35, 223, 35, 35, 229, 208, 35, 230, - - 347, 214, 229, 242, 324, 230, 324, 346, 242, 35, - 35, 35, 53, 85, 223, 85, 53, 85, 53, 85, - 85, 53, 53, 85, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 85, 85, 85, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 58, 58, 58, 235, 58, 342, 58, 58, - 72, 72, 58, 72, 72, 246, 231, 88, 334, 248, - 72, 88, 88, 58, 58, 58, 235, 87, 248, 87, - - 327, 87, 72, 87, 87, 104, 219, 87, 88, 93, - 333, 93, 93, 93, 93, 93, 93, 93, 87, 87, - 87, 216, 72, 247, 90, 231, 90, 88, 90, 327, - 90, 90, 104, 104, 90, 104, 219, 216, 257, 93, - 247, 104, 246, 257, 104, 90, 90, 90, 94, 273, - 94, 94, 94, 94, 94, 94, 94, 95, 273, 95, - 95, 95, 95, 95, 95, 258, 331, 117, 322, 117, - 258, 117, 150, 117, 117, 123, 150, 117, 94, 123, - 123, 260, 150, 272, 265, 300, 276, 95, 117, 117, - 117, 120, 321, 120, 150, 120, 123, 120, 120, 268, - - 122, 120, 122, 274, 122, 265, 122, 122, 320, 285, - 122, 260, 120, 120, 120, 123, 276, 285, 274, 286, - 268, 122, 122, 122, 124, 301, 124, 286, 124, 272, - 124, 124, 300, 301, 124, 125, 125, 125, 125, 125, - 125, 125, 297, 318, 302, 124, 124, 124, 127, 308, - 127, 127, 127, 127, 127, 127, 127, 297, 302, 309, - 307, 310, 128, 125, 128, 128, 128, 128, 128, 128, - 128, 299, 345, 281, 309, 284, 310, 129, 127, 129, - 129, 129, 129, 129, 129, 138, 345, 290, 298, 138, - 138, 140, 128, 140, 281, 140, 284, 140, 140, 151, - - 151, 140, 151, 151, 344, 344, 138, 129, 290, 151, - 294, 293, 140, 140, 140, 291, 158, 344, 295, 283, - 158, 151, 354, 370, 390, 138, 158, 159, 306, 159, - 159, 159, 159, 159, 159, 159, 291, 158, 158, 295, - 160, 151, 160, 160, 160, 160, 160, 160, 160, 306, - 282, 280, 354, 370, 390, 271, 161, 159, 161, 161, - 161, 161, 161, 161, 161, 270, 380, 380, 380, 180, - 160, 180, 180, 180, 180, 180, 180, 180, 315, 315, - 315, 315, 315, 315, 315, 181, 161, 181, 181, 181, - 181, 181, 181, 181, 380, 316, 319, 395, 182, 180, - - 182, 182, 182, 182, 182, 182, 182, 315, 190, 267, - 195, 195, 190, 195, 195, 181, 316, 319, 190, 332, - 195, 196, 196, 266, 196, 196, 264, 395, 182, 190, - 190, 196, 195, 197, 197, 197, 197, 197, 197, 197, - 332, 406, 199, 196, 199, 199, 199, 199, 199, 199, - 199, 200, 195, 200, 200, 200, 200, 200, 200, 200, - 411, 197, 201, 196, 201, 201, 201, 201, 201, 201, - 256, 406, 199, 218, 218, 218, 218, 218, 218, 218, - 220, 200, 220, 220, 220, 220, 220, 220, 220, 255, - 411, 221, 201, 221, 221, 221, 221, 221, 221, 221, - - 222, 218, 222, 222, 222, 222, 222, 222, 254, 232, - 220, 232, 232, 232, 232, 232, 232, 232, 253, 252, - 233, 221, 233, 233, 233, 233, 233, 233, 233, 234, - 222, 234, 234, 234, 234, 234, 234, 234, 249, 232, - 249, 249, 249, 249, 249, 249, 249, 245, 244, 250, - 233, 250, 250, 250, 250, 250, 250, 250, 251, 234, - 251, 251, 251, 251, 251, 251, 251, 243, 249, 259, - 259, 259, 259, 259, 259, 259, 241, 240, 261, 250, - 261, 261, 261, 261, 261, 261, 261, 262, 251, 262, - 262, 262, 262, 262, 262, 262, 263, 259, 263, 263, - - 263, 263, 263, 263, 239, 238, 237, 228, 261, 275, - 275, 275, 275, 275, 275, 275, 277, 262, 277, 277, - 277, 277, 277, 277, 277, 278, 263, 278, 278, 278, - 278, 278, 278, 278, 227, 226, 279, 275, 279, 279, - 279, 279, 279, 279, 339, 225, 277, 287, 287, 287, - 287, 287, 287, 287, 287, 278, 288, 288, 288, 288, - 288, 288, 288, 288, 224, 339, 279, 289, 289, 289, - 289, 289, 289, 289, 289, 213, 287, 303, 303, 303, - 303, 303, 303, 303, 303, 288, 304, 304, 304, 304, - 304, 304, 304, 304, 212, 211, 289, 305, 305, 305, - - 305, 305, 305, 305, 305, 210, 303, 311, 311, 311, - 311, 311, 311, 311, 209, 304, 313, 313, 313, 313, - 313, 313, 313, 313, 207, 325, 305, 314, 314, 314, - 314, 314, 314, 314, 314, 311, 326, 326, 326, 326, - 326, 326, 326, 206, 325, 313, 325, 325, 328, 328, - 328, 328, 328, 328, 328, 328, 314, 330, 330, 330, - 330, 330, 330, 330, 326, 325, 329, 329, 329, 329, - 329, 329, 329, 329, 205, 204, 335, 328, 335, 335, - 335, 335, 335, 335, 335, 336, 330, 336, 336, 336, - 336, 336, 336, 336, 337, 329, 337, 337, 337, 337, - - 337, 337, 337, 203, 340, 338, 335, 338, 338, 338, - 338, 338, 338, 338, 192, 336, 352, 343, 188, 359, - 360, 359, 359, 359, 337, 340, 348, 187, 348, 348, - 348, 348, 348, 348, 348, 338, 343, 352, 343, 343, - 349, 360, 349, 349, 349, 349, 349, 349, 349, 359, - 186, 185, 184, 183, 173, 350, 348, 350, 350, 350, - 350, 350, 350, 350, 172, 171, 170, 169, 167, 351, - 349, 351, 351, 351, 351, 351, 351, 351, 353, 353, - 353, 353, 353, 353, 353, 350, 355, 166, 355, 355, - 355, 355, 355, 355, 355, 165, 164, 163, 162, 351, - - 156, 149, 143, 139, 137, 356, 353, 356, 356, 356, - 356, 356, 356, 356, 134, 357, 355, 357, 357, 357, - 357, 357, 357, 357, 358, 132, 358, 358, 358, 358, - 358, 358, 358, 131, 366, 356, 366, 121, 366, 119, - 366, 366, 116, 109, 366, 357, 369, 369, 369, 369, - 369, 369, 369, 108, 358, 366, 366, 366, 368, 107, - 368, 106, 368, 105, 368, 368, 100, 98, 368, 97, - 89, 86, 84, 82, 369, 81, 80, 78, 71, 368, - 368, 368, 371, 65, 371, 371, 371, 371, 371, 371, - 371, 372, 60, 372, 372, 372, 372, 372, 372, 372, - - 373, 57, 373, 373, 373, 373, 373, 373, 373, 56, - 55, 374, 371, 374, 374, 374, 374, 374, 374, 374, - 375, 372, 375, 375, 375, 54, 48, 46, 44, 376, - 373, 376, 376, 376, 376, 376, 376, 376, 43, 42, - 377, 374, 377, 377, 377, 377, 377, 377, 377, 378, - 375, 378, 378, 378, 378, 378, 378, 378, 41, 376, - 379, 379, 379, 379, 379, 379, 379, 40, 39, 384, - 377, 384, 384, 384, 384, 384, 384, 384, 385, 378, - 385, 385, 385, 385, 385, 385, 385, 386, 379, 386, - 386, 386, 386, 386, 386, 386, 388, 388, 388, 384, - - 387, 387, 387, 387, 387, 387, 387, 34, 385, 389, - 389, 389, 389, 389, 389, 389, 393, 386, 393, 393, - 393, 393, 393, 393, 388, 33, 32, 391, 387, 391, - 391, 391, 391, 391, 391, 391, 392, 389, 392, 392, - 392, 392, 392, 392, 392, 31, 393, 394, 394, 394, - 394, 394, 394, 394, 22, 19, 396, 391, 396, 396, - 396, 396, 396, 396, 396, 397, 392, 397, 397, 397, - 397, 397, 397, 397, 398, 394, 398, 398, 398, 398, - 398, 398, 18, 17, 15, 399, 396, 399, 399, 399, - 399, 399, 399, 399, 400, 397, 400, 400, 400, 400, - - 400, 400, 400, 401, 398, 401, 401, 401, 401, 401, - 401, 401, 14, 13, 402, 399, 402, 402, 402, 402, - 402, 402, 402, 403, 400, 403, 403, 403, 403, 403, - 403, 403, 404, 401, 404, 404, 404, 404, 404, 404, - 404, 0, 0, 0, 402, 405, 405, 405, 405, 405, - 405, 405, 407, 403, 407, 407, 407, 407, 407, 407, - 407, 408, 404, 408, 408, 408, 408, 408, 408, 408, - 0, 0, 409, 405, 409, 409, 409, 409, 409, 409, - 0, 0, 407, 410, 410, 410, 410, 410, 410, 410, - 412, 408, 412, 412, 412, 412, 412, 412, 412, 0, - - 0, 413, 409, 413, 413, 413, 413, 413, 413, 413, - 414, 410, 414, 414, 414, 414, 414, 414, 0, 0, - 412, 415, 415, 415, 415, 415, 415, 415, 0, 0, - 0, 413, 416, 416, 416, 416, 416, 416, 416, 0, - 414, 417, 417, 417, 417, 417, 417, 417, 0, 415, - 418, 418, 418, 418, 418, 418, 418, 0, 0, 0, - 416, 419, 419, 419, 419, 419, 419, 419, 0, 417, - 420, 420, 420, 420, 420, 420, 420, 0, 418, 422, - 422, 422, 422, 422, 422, 422, 0, 0, 0, 419, - 423, 423, 423, 423, 423, 423, 0, 0, 420, 425, - - 425, 425, 425, 425, 425, 425, 0, 422, 426, 426, - 426, 426, 426, 426, 0, 0, 0, 0, 423, 0, - 0, 0, 0, 0, 0, 0, 0, 425, 0, 0, - 0, 0, 0, 0, 0, 0, 426, 428, 428, 428, - 428, 428, 428, 428, 429, 429, 429, 429, 429, 429, - 429, 430, 430, 430, 430, 430, 430, 430, 431, 0, - 0, 0, 0, 431, 431, 432, 432, 432, 432, 432, - 432, 432, 433, 0, 0, 0, 0, 433, 433, 434, - 0, 0, 0, 0, 434, 434, 435, 0, 435, 0, - 0, 435, 435, 436, 0, 0, 0, 0, 436, 436, - - 437, 0, 0, 0, 0, 437, 437, 438, 0, 0, - 0, 0, 438, 438, 439, 0, 439, 0, 0, 439, - 439, 440, 0, 440, 0, 0, 440, 440, 441, 0, - 441, 441, 0, 0, 441, 443, 0, 443, 0, 443, - 443, 443, 444, 444, 444, 444, 444, 444, 444, 445, - 445, 445, 445, 445, 445, 445, 446, 0, 446, 0, - 0, 446, 446, 447, 0, 447, 0, 0, 447, 447, - 448, 448, 448, 448, 448, 448, 448, 449, 0, 0, - 0, 0, 449, 449, 450, 0, 0, 0, 0, 450, - 450, 451, 451, 451, 451, 451, 451, 451, 427, 427, - - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427 + 30, 30, 30, 30, 30, 30, 36, 36, 36, 202, + + 36, 233, 36, 36, 247, 53, 36, 53, 53, 53, + 53, 53, 53, 53, 281, 241, 261, 36, 36, 36, + 136, 241, 233, 136, 242, 247, 136, 256, 136, 375, + 242, 305, 256, 374, 261, 281, 53, 54, 89, 305, + 89, 54, 89, 54, 89, 89, 54, 54, 89, 54, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 89, + 89, 89, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 54, 60, 60, + + 60, 157, 60, 157, 60, 60, 260, 243, 60, 336, + 276, 349, 273, 349, 70, 70, 70, 273, 70, 60, + 60, 60, 70, 262, 70, 306, 107, 74, 74, 274, + 74, 74, 262, 306, 274, 70, 70, 74, 92, 336, + 92, 276, 92, 157, 92, 92, 126, 243, 92, 74, + 126, 126, 370, 107, 107, 360, 107, 70, 285, 92, + 92, 92, 107, 294, 260, 107, 323, 126, 352, 95, + 74, 95, 95, 95, 95, 95, 95, 95, 96, 285, + 96, 96, 96, 96, 96, 96, 96, 126, 359, 120, + 290, 120, 356, 120, 294, 120, 120, 286, 352, 120, + + 95, 128, 128, 128, 128, 128, 128, 128, 347, 96, + 120, 120, 120, 123, 323, 123, 291, 123, 286, 123, + 123, 346, 125, 123, 125, 291, 125, 292, 125, 125, + 128, 324, 125, 299, 123, 123, 123, 290, 345, 324, + 348, 348, 292, 125, 125, 125, 127, 342, 127, 320, + 127, 325, 127, 127, 299, 130, 127, 130, 130, 130, + 130, 130, 130, 130, 320, 325, 333, 127, 127, 127, + 131, 332, 131, 131, 131, 131, 131, 131, 131, 142, + 334, 333, 331, 142, 142, 132, 130, 132, 132, 132, + 132, 132, 132, 155, 155, 334, 155, 155, 303, 382, + + 142, 131, 144, 155, 144, 304, 144, 162, 144, 144, + 310, 162, 144, 311, 398, 155, 132, 162, 373, 303, + 142, 330, 322, 144, 144, 144, 304, 321, 162, 162, + 382, 310, 373, 316, 311, 163, 155, 163, 163, 163, + 163, 163, 163, 163, 164, 398, 164, 164, 164, 164, + 164, 164, 164, 165, 316, 165, 165, 165, 165, 165, + 165, 165, 418, 315, 423, 186, 163, 186, 186, 186, + 186, 186, 186, 186, 187, 164, 187, 187, 187, 187, + 187, 187, 187, 188, 165, 188, 188, 188, 188, 188, + 188, 188, 318, 418, 198, 423, 186, 329, 198, 203, + + 203, 314, 203, 203, 198, 187, 313, 204, 204, 203, + 204, 204, 302, 318, 188, 198, 198, 204, 329, 340, + 301, 203, 205, 205, 205, 205, 205, 205, 205, 204, + 207, 300, 207, 207, 207, 207, 207, 207, 207, 343, + 340, 208, 203, 208, 208, 208, 208, 208, 208, 208, + 204, 205, 209, 298, 209, 209, 209, 209, 209, 209, + 343, 207, 228, 228, 228, 228, 228, 228, 228, 289, + 288, 230, 208, 230, 230, 230, 230, 230, 230, 230, + 372, 372, 231, 209, 231, 231, 231, 231, 231, 231, + 231, 228, 232, 372, 232, 232, 232, 232, 232, 232, + + 344, 244, 230, 244, 244, 244, 244, 244, 244, 244, + 434, 284, 245, 231, 245, 245, 245, 245, 245, 245, + 245, 344, 246, 232, 246, 246, 246, 246, 246, 246, + 246, 263, 244, 263, 263, 263, 263, 263, 263, 263, + 357, 434, 264, 245, 264, 264, 264, 264, 264, 264, + 264, 283, 265, 246, 265, 265, 265, 265, 265, 265, + 265, 357, 263, 275, 275, 275, 275, 275, 275, 275, + 439, 282, 277, 264, 277, 277, 277, 277, 277, 277, + 277, 358, 278, 265, 278, 278, 278, 278, 278, 278, + 278, 279, 275, 279, 279, 279, 279, 279, 279, 280, + + 272, 439, 358, 277, 293, 293, 293, 293, 293, 293, + 293, 271, 295, 278, 295, 295, 295, 295, 295, 295, + 295, 296, 279, 296, 296, 296, 296, 296, 296, 296, + 270, 269, 297, 293, 297, 297, 297, 297, 297, 297, + 365, 366, 268, 295, 307, 307, 307, 307, 307, 307, + 307, 307, 296, 308, 308, 308, 308, 308, 308, 308, + 308, 365, 366, 297, 309, 309, 309, 309, 309, 309, + 309, 309, 368, 267, 307, 326, 326, 326, 326, 326, + 326, 326, 326, 308, 327, 327, 327, 327, 327, 327, + 327, 327, 380, 368, 309, 328, 328, 328, 328, 328, + + 328, 328, 328, 388, 266, 326, 335, 335, 335, 335, + 335, 335, 335, 380, 327, 337, 337, 337, 337, 337, + 337, 337, 337, 259, 388, 328, 338, 338, 338, 338, + 338, 338, 338, 338, 258, 335, 339, 339, 339, 339, + 339, 339, 339, 350, 257, 337, 351, 351, 351, 351, + 351, 351, 351, 255, 254, 253, 338, 252, 251, 250, + 249, 240, 350, 239, 350, 350, 339, 353, 353, 353, + 353, 353, 353, 353, 353, 351, 354, 354, 354, 354, + 354, 354, 354, 354, 350, 355, 355, 355, 355, 355, + 355, 355, 238, 237, 236, 235, 361, 353, 361, 361, + + 361, 361, 361, 361, 361, 362, 354, 362, 362, 362, + 362, 362, 362, 362, 363, 355, 363, 363, 363, 363, + 363, 363, 363, 234, 223, 371, 364, 361, 364, 364, + 364, 364, 364, 364, 364, 376, 362, 376, 376, 376, + 376, 376, 376, 376, 371, 363, 371, 371, 377, 222, + 377, 377, 377, 377, 377, 377, 377, 364, 381, 381, + 381, 381, 381, 381, 381, 378, 376, 378, 378, 378, + 378, 378, 378, 378, 221, 408, 408, 408, 379, 377, + 379, 379, 379, 379, 379, 379, 379, 381, 220, 416, + 416, 416, 219, 217, 216, 383, 378, 383, 383, 383, + + 383, 383, 383, 383, 408, 215, 214, 213, 384, 379, + 384, 384, 384, 384, 384, 384, 384, 385, 416, 385, + 385, 385, 385, 385, 385, 385, 383, 386, 212, 386, + 386, 386, 386, 386, 386, 386, 211, 200, 387, 384, + 387, 387, 387, 394, 196, 394, 195, 394, 385, 394, + 394, 194, 193, 394, 192, 191, 190, 403, 386, 403, + 403, 403, 189, 179, 394, 394, 394, 178, 396, 387, + 396, 177, 396, 176, 396, 396, 175, 173, 396, 397, + 397, 397, 397, 397, 397, 397, 172, 171, 403, 396, + 396, 396, 399, 170, 399, 399, 399, 399, 399, 399, + + 399, 169, 168, 167, 166, 160, 153, 400, 397, 400, + 400, 400, 400, 400, 400, 400, 147, 143, 141, 138, + 137, 135, 401, 399, 401, 401, 401, 401, 401, 401, + 401, 134, 124, 122, 119, 112, 111, 402, 400, 402, + 402, 402, 402, 402, 402, 402, 110, 109, 108, 103, + 102, 100, 404, 401, 404, 404, 404, 404, 404, 404, + 404, 99, 91, 88, 86, 84, 83, 405, 402, 405, + 405, 405, 405, 405, 405, 405, 82, 80, 73, 67, + 62, 59, 406, 404, 406, 406, 406, 406, 406, 406, + 406, 407, 407, 407, 407, 407, 407, 407, 405, 412, + + 58, 412, 412, 412, 412, 412, 412, 412, 57, 56, + 55, 49, 47, 406, 45, 44, 43, 42, 41, 413, + 407, 413, 413, 413, 413, 413, 413, 413, 40, 414, + 412, 414, 414, 414, 414, 414, 414, 414, 415, 415, + 415, 415, 415, 415, 415, 35, 34, 33, 32, 31, + 413, 417, 417, 417, 417, 417, 417, 417, 22, 19, + 414, 18, 17, 15, 14, 13, 419, 415, 419, 419, + 419, 419, 419, 419, 419, 0, 0, 0, 0, 420, + 417, 420, 420, 420, 420, 420, 420, 420, 421, 0, + 421, 421, 421, 421, 421, 421, 0, 419, 422, 422, + + 422, 422, 422, 422, 422, 0, 0, 0, 0, 424, + 420, 424, 424, 424, 424, 424, 424, 424, 425, 421, + 425, 425, 425, 425, 425, 425, 425, 422, 426, 0, + 426, 426, 426, 426, 426, 426, 0, 0, 0, 427, + 424, 427, 427, 427, 427, 427, 427, 427, 428, 425, + 428, 428, 428, 428, 428, 428, 428, 0, 429, 426, + 429, 429, 429, 429, 429, 429, 429, 0, 0, 430, + 427, 430, 430, 430, 430, 430, 430, 430, 431, 428, + 431, 431, 431, 431, 431, 431, 431, 0, 432, 429, + 432, 432, 432, 432, 432, 432, 432, 0, 0, 0, + + 430, 433, 433, 433, 433, 433, 433, 433, 435, 431, + 435, 435, 435, 435, 435, 435, 435, 0, 436, 432, + 436, 436, 436, 436, 436, 436, 436, 0, 0, 437, + 433, 437, 437, 437, 437, 437, 437, 0, 0, 435, + 438, 438, 438, 438, 438, 438, 438, 0, 440, 436, + 440, 440, 440, 440, 440, 440, 440, 0, 0, 441, + 437, 441, 441, 441, 441, 441, 441, 441, 442, 438, + 442, 442, 442, 442, 442, 442, 0, 0, 0, 440, + 443, 443, 443, 443, 443, 443, 443, 0, 0, 0, + 441, 444, 444, 444, 444, 444, 444, 444, 0, 442, + + 445, 445, 445, 445, 445, 445, 445, 0, 0, 443, + 446, 446, 446, 446, 446, 446, 446, 0, 0, 0, + 444, 447, 447, 447, 447, 447, 447, 447, 0, 445, + 448, 448, 448, 448, 448, 448, 448, 0, 0, 446, + 450, 450, 450, 450, 450, 450, 450, 0, 0, 0, + 447, 451, 451, 451, 451, 451, 451, 0, 0, 448, + 453, 453, 453, 453, 453, 453, 453, 0, 0, 450, + 454, 454, 454, 454, 454, 454, 0, 0, 0, 0, + 451, 0, 0, 0, 0, 0, 0, 0, 0, 453, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 454, + + 456, 456, 456, 456, 456, 456, 456, 457, 457, 457, + 457, 457, 457, 457, 458, 458, 458, 458, 458, 458, + 458, 459, 0, 0, 0, 0, 459, 459, 460, 460, + 460, 460, 460, 460, 460, 461, 0, 0, 0, 0, + 461, 461, 462, 0, 0, 0, 0, 462, 462, 463, + 0, 463, 0, 0, 463, 463, 464, 0, 0, 0, + 0, 464, 464, 465, 0, 0, 0, 0, 465, 465, + 466, 0, 0, 0, 0, 466, 466, 467, 0, 467, + 0, 0, 467, 467, 468, 0, 468, 0, 0, 468, + 468, 469, 0, 469, 469, 0, 0, 469, 471, 0, + + 471, 0, 471, 471, 471, 472, 472, 472, 472, 472, + 472, 472, 473, 473, 473, 473, 473, 473, 473, 474, + 0, 474, 0, 0, 474, 474, 475, 0, 475, 0, + 0, 475, 475, 476, 476, 476, 476, 476, 476, 476, + 477, 0, 0, 0, 0, 477, 477, 478, 0, 0, + 0, 0, 478, 478, 479, 479, 479, 479, 479, 479, + 479, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455 } ; static yy_state_type yy_last_accepting_state; @@ -989,7 +1012,8 @@ char *yytext; #define INITIAL 0 #line 2 "toke.l" /* - * Copyright (c) 1996, 1998-2005 Todd C. Miller + * Copyright (c) 1996, 1998-2005, 2007 + * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1082,7 +1106,7 @@ extern void yyerror __P((const char *)); #define INDEFS 5 -#line 1086 "toke.c" +#line 1110 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1116,7 +1140,7 @@ static int input YY_PROTO(( void )); #endif #endif -#if YY_STACK_USED +#if defined(YY_STACK_USED) && YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; @@ -1236,9 +1260,9 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 104 "toke.l" +#line 105 "toke.l" -#line 1242 "toke.c" +#line 1266 "lex.yy.c" if ( yy_init ) { @@ -1290,13 +1314,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 428 ) + if ( yy_current_state >= 456 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 2099 ); + while ( yy_base[yy_current_state] != 2162 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1324,12 +1348,12 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 105 "toke.l" +#line 106 "toke.l" BEGIN STARTDEFS; YY_BREAK case 2: YY_RULE_SETUP -#line 107 "toke.l" +#line 108 "toke.l" { BEGIN INDEFS; LEXTRACE("DEFVAR "); @@ -1341,7 +1365,7 @@ YY_RULE_SETUP case 3: YY_RULE_SETUP -#line 116 "toke.l" +#line 117 "toke.l" { BEGIN STARTDEFS; LEXTRACE(", "); @@ -1350,7 +1374,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 122 "toke.l" +#line 123 "toke.l" { LEXTRACE("= "); return('='); @@ -1358,7 +1382,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 127 "toke.l" +#line 128 "toke.l" { LEXTRACE("+= "); return('+'); @@ -1366,7 +1390,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 132 "toke.l" +#line 133 "toke.l" { LEXTRACE("-= "); return('-'); @@ -1374,7 +1398,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 137 "toke.l" +#line 138 "toke.l" { LEXTRACE("WORD(1) "); if (!fill(yytext + 1, yyleng - 2)) @@ -1384,7 +1408,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 144 "toke.l" +#line 145 "toke.l" { LEXTRACE("WORD(2) "); if (!fill(yytext, yyleng)) @@ -1396,7 +1420,7 @@ YY_RULE_SETUP case 9: YY_RULE_SETUP -#line 153 "toke.l" +#line 154 "toke.l" { /* quoted fnmatch glob char, pass verbatim */ LEXTRACE("QUOTEDCHAR "); @@ -1407,7 +1431,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 161 "toke.l" +#line 162 "toke.l" { /* quoted sudoers special char, strip backslash */ LEXTRACE("QUOTEDCHAR "); @@ -1418,7 +1442,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 169 "toke.l" +#line 170 "toke.l" { BEGIN INITIAL; yyless(0); @@ -1427,7 +1451,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 175 "toke.l" +#line 176 "toke.l" { LEXTRACE("ARG "); if (!fill_args(yytext, yyleng, sawspace)) @@ -1438,7 +1462,7 @@ YY_RULE_SETUP case 13: YY_RULE_SETUP -#line 183 "toke.l" +#line 184 "toke.l" { char *cp, *ep; ++sudolineno; @@ -1459,7 +1483,7 @@ YY_RULE_SETUP YY_BREAK case 14: YY_RULE_SETUP -#line 201 "toke.l" +#line 202 "toke.l" { int n; for (n = 0; isblank((unsigned char)yytext[n]); n++) @@ -1491,7 +1515,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 230 "toke.l" +#line 231 "toke.l" { int n; for (n = 0; isblank((unsigned char)yytext[n]); n++) @@ -1517,7 +1541,7 @@ YY_RULE_SETUP YY_BREAK case 16: YY_RULE_SETUP -#line 253 "toke.l" +#line 254 "toke.l" { /* cmnd does not require passwd for this user */ LEXTRACE("NOPASSWD "); @@ -1526,7 +1550,7 @@ YY_RULE_SETUP YY_BREAK case 17: YY_RULE_SETUP -#line 259 "toke.l" +#line 260 "toke.l" { /* cmnd requires passwd for this user */ LEXTRACE("PASSWD "); @@ -1535,7 +1559,7 @@ YY_RULE_SETUP YY_BREAK case 18: YY_RULE_SETUP -#line 265 "toke.l" +#line 266 "toke.l" { LEXTRACE("NOEXEC "); return(NOEXEC); @@ -1543,7 +1567,7 @@ YY_RULE_SETUP YY_BREAK case 19: YY_RULE_SETUP -#line 270 "toke.l" +#line 271 "toke.l" { LEXTRACE("EXEC "); return(EXEC); @@ -1551,23 +1575,39 @@ YY_RULE_SETUP YY_BREAK case 20: YY_RULE_SETUP -#line 275 "toke.l" +#line 276 "toke.l" +{ + LEXTRACE("SETENV "); + return(SETENV); + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 281 "toke.l" +{ + LEXTRACE("NOSETENV "); + return(NOSETENV); + } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 286 "toke.l" { LEXTRACE("NOMONITOR "); return(NOMONITOR); } YY_BREAK -case 21: +case 23: YY_RULE_SETUP -#line 280 "toke.l" +#line 291 "toke.l" { LEXTRACE("MONITOR "); return(MONITOR); } YY_BREAK -case 22: +case 24: YY_RULE_SETUP -#line 285 "toke.l" +#line 296 "toke.l" { /* netgroup */ if (!fill(yytext, yyleng)) @@ -1576,9 +1616,9 @@ YY_RULE_SETUP return(NETGROUP); } YY_BREAK -case 23: +case 25: YY_RULE_SETUP -#line 293 "toke.l" +#line 304 "toke.l" { /* UN*X group */ if (!fill(yytext, yyleng)) @@ -1587,9 +1627,9 @@ YY_RULE_SETUP return(USERGROUP); } YY_BREAK -case 24: +case 26: YY_RULE_SETUP -#line 301 "toke.l" +#line 312 "toke.l" { if (!fill(yytext, yyleng)) yyterminate(); @@ -1597,9 +1637,9 @@ YY_RULE_SETUP return(NTWKADDR); } YY_BREAK -case 25: +case 27: YY_RULE_SETUP -#line 308 "toke.l" +#line 319 "toke.l" { if (!fill(yytext, yyleng)) yyterminate(); @@ -1607,18 +1647,18 @@ YY_RULE_SETUP return(NTWKADDR); } YY_BREAK -case 26: +case 28: YY_RULE_SETUP -#line 315 "toke.l" +#line 326 "toke.l" { BEGIN GOTRUNAS; LEXTRACE("RUNAS "); return (RUNAS); } YY_BREAK -case 27: +case 29: YY_RULE_SETUP -#line 321 "toke.l" +#line 332 "toke.l" { if (strcmp(yytext, "ALL") == 0) { LEXTRACE("ALL "); @@ -1631,9 +1671,9 @@ YY_RULE_SETUP } } YY_BREAK -case 28: +case 30: YY_RULE_SETUP -#line 333 "toke.l" +#line 344 "toke.l" { /* username/uid that user can run command as */ if (!fill(yytext, yyleng)) @@ -1642,16 +1682,16 @@ YY_RULE_SETUP return(WORD); } YY_BREAK -case 29: +case 31: YY_RULE_SETUP -#line 341 "toke.l" +#line 352 "toke.l" { BEGIN INITIAL; } YY_BREAK -case 30: +case 32: YY_RULE_SETUP -#line 345 "toke.l" +#line 356 "toke.l" { /* no command args allowed for Defaults!/path */ if (!fill_cmnd(yytext, yyleng)) @@ -1660,9 +1700,9 @@ YY_RULE_SETUP return(COMMAND); } YY_BREAK -case 31: +case 33: YY_RULE_SETUP -#line 353 "toke.l" +#line 364 "toke.l" { BEGIN GOTCMND; LEXTRACE("COMMAND "); @@ -1670,9 +1710,9 @@ YY_RULE_SETUP yyterminate(); } /* sudo -e */ YY_BREAK -case 32: +case 34: YY_RULE_SETUP -#line 360 "toke.l" +#line 371 "toke.l" { /* directories can't have args... */ if (yytext[yyleng - 1] == '/') { @@ -1688,9 +1728,9 @@ YY_RULE_SETUP } } /* a pathname */ YY_BREAK -case 33: +case 35: YY_RULE_SETUP -#line 375 "toke.l" +#line 386 "toke.l" { /* a word */ if (!fill(yytext, yyleng)) @@ -1699,41 +1739,41 @@ YY_RULE_SETUP return(WORD); } YY_BREAK -case 34: +case 36: YY_RULE_SETUP -#line 383 "toke.l" +#line 394 "toke.l" { LEXTRACE(", "); return(','); } /* return ',' */ YY_BREAK -case 35: +case 37: YY_RULE_SETUP -#line 388 "toke.l" +#line 399 "toke.l" { LEXTRACE("= "); return('='); } /* return '=' */ YY_BREAK -case 36: +case 38: YY_RULE_SETUP -#line 393 "toke.l" +#line 404 "toke.l" { LEXTRACE(": "); return(':'); } /* return ':' */ YY_BREAK -case 37: +case 39: YY_RULE_SETUP -#line 398 "toke.l" +#line 409 "toke.l" { if (yyleng % 2 == 1) return('!'); /* return '!' */ } YY_BREAK -case 38: +case 40: YY_RULE_SETUP -#line 403 "toke.l" +#line 414 "toke.l" { BEGIN INITIAL; ++sudolineno; @@ -1741,25 +1781,25 @@ YY_RULE_SETUP return(COMMENT); } /* return newline */ YY_BREAK -case 39: +case 41: YY_RULE_SETUP -#line 410 "toke.l" +#line 421 "toke.l" { /* throw away space/tabs */ sawspace = TRUE; /* but remember for fill_args */ } YY_BREAK -case 40: +case 42: YY_RULE_SETUP -#line 414 "toke.l" +#line 425 "toke.l" { sawspace = TRUE; /* remember for fill_args */ ++sudolineno; LEXTRACE("\n\t"); } /* throw away EOL after \ */ YY_BREAK -case 41: +case 43: YY_RULE_SETUP -#line 420 "toke.l" +#line 431 "toke.l" { BEGIN INITIAL; ++sudolineno; @@ -1767,9 +1807,9 @@ YY_RULE_SETUP return(COMMENT); } /* return comments */ YY_BREAK -case 42: +case 44: YY_RULE_SETUP -#line 427 "toke.l" +#line 438 "toke.l" { LEXTRACE("ERROR "); return(ERROR); @@ -1781,7 +1821,7 @@ case YY_STATE_EOF(GOTDEFS): case YY_STATE_EOF(GOTCMND): case YY_STATE_EOF(STARTDEFS): case YY_STATE_EOF(INDEFS): -#line 432 "toke.l" +#line 443 "toke.l" { if (YY_START != INITIAL) { BEGIN INITIAL; @@ -1792,12 +1832,12 @@ case YY_STATE_EOF(INDEFS): yyterminate(); } YY_BREAK -case 43: +case 45: YY_RULE_SETUP -#line 442 "toke.l" +#line 453 "toke.l" ECHO; YY_BREAK -#line 1801 "toke.c" +#line 1841 "lex.yy.c" case YY_END_OF_BUFFER: { @@ -2088,7 +2128,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 428 ) + if ( yy_current_state >= 456 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2123,11 +2163,11 @@ yy_state_type 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]; - if ( yy_current_state >= 428 ) + if ( yy_current_state >= 456 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 427); + yy_is_jam = (yy_current_state == 455); return yy_is_jam ? 0 : yy_current_state; } @@ -2384,10 +2424,10 @@ FILE *file; b->yy_input_file = file; b->yy_fill_buffer = 1; -#if YY_ALWAYS_INTERACTIVE +#if defined(YY_ALWAYS_INTERACTIVE) && YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else -#if YY_NEVER_INTERACTIVE +#if defined(YY_NEVER_INTERACTIVE) && YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; @@ -2679,14 +2719,14 @@ void *ptr; free( ptr ); } -#if YY_MAIN +#if defined(YY_MAIN) && YY_MAIN int main() { yylex(); return 0; } #endif -#line 442 "toke.l" +#line 453 "toke.l" static int fill(s, len) diff --git a/toke.l b/toke.l index 68c6bee29..087413e49 100644 --- a/toke.l +++ b/toke.l @@ -1,6 +1,7 @@ %{ /* - * Copyright (c) 1996, 1998-2005 Todd C. Miller + * Copyright (c) 1996, 1998-2005, 2007 + * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -272,6 +273,16 @@ EXEC[[:blank:]]*: { return(EXEC); } +SETENV[[:blank:]]*: { + LEXTRACE("SETENV "); + return(SETENV); + } + +NOSETENV[[:blank:]]*: { + LEXTRACE("NOSETENV "); + return(NOSETENV); + } + NOMONITOR[[:blank:]]*: { LEXTRACE("NOMONITOR "); return(NOMONITOR); -- 2.40.0