X-Git-Url: https://git.distorted.org.uk/~mdw/become/blobdiff_plain/082ddb2663e34c100f423b07384d870ff009a914..af4f4d6a77aceba8e2d6f58d15e894df320e7c24:/src/parser.y diff --git a/src/parser.y b/src/parser.y index d731389..860ed7e 100644 --- a/src/parser.y +++ b/src/parser.y @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: parser.y,v 1.6 1998/04/23 13:26:49 mdw Exp $ + * $Id: parser.y,v 1.9 2004/04/08 01:36:20 mdw Exp $ * * Parser for `become.conf' files * @@ -26,32 +26,6 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: parser.y,v $ - * Revision 1.6 1998/04/23 13:26:49 mdw - * New `parse' interface to configuration file parser; informs caller - * whether parsing encountered any errors. Also support no-network - * configuration. - * - * Revision 1.5 1998/01/12 16:46:22 mdw - * Fix copyright date. - * - * Revision 1.4 1997/09/17 10:26:52 mdw - * Use rewritten class handler. Makes the expression parsers considerably - * simpler. - * - * Revision 1.3 1997/09/09 18:17:06 mdw - * Allow default port to be given as a service name or port number. - * - * Revision 1.2 1997/08/04 10:24:24 mdw - * Sources placed under CVS control. - * - * Revision 1.1 1997/07/21 13:47:45 mdw - * Initial revision - * - */ - /*----- Header files ------------------------------------------------------*/ %{ @@ -74,6 +48,11 @@ #include #include +/* --- mLib headers --- */ + +#include +#include + /* --- Local headers --- */ #include "class.h" @@ -81,9 +60,7 @@ #include "lexer.h" #include "name.h" #include "rule.h" -#include "sym.h" #include "userdb.h" -#include "utils.h" %} /*----- Stack type --------------------------------------------------------*/ @@ -242,6 +219,7 @@ key_spec : KEYFILE STRING ';' { yynerrs++; YYERROR; #endif } + ; /* --- Parsing allow specifications --- */ @@ -249,6 +227,7 @@ allow_spec : ALLOW host_class_opt user_class ARROW user_class_opt command_class_opt ';' { rule_add($2, $3, $5, $6); } + ; host_class_opt : /* empty */ { $$ = class_all; } | '[' host_class ']' { $$ = $2; } @@ -271,6 +250,7 @@ name : WORD { n->c = 0; $$ = n; } + ; /*----- Various class expression types ------------------------------------* *