From eb432404648650b40f009ada4cbca58dbe3614b1 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Mon, 28 Jul 2008 17:11:57 +0000 Subject: [PATCH] Allow kernel config files to include files other than those in the CWD, using unquoted paths. --- usr.sbin/config/config.y | 6 ++++++ usr.sbin/config/lang.l | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 8eef64c71e88..9aa89e5593ce 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -31,6 +31,7 @@ %type Save_id %type Opt_value %type Dev +%token PATH %{ @@ -128,6 +129,11 @@ Spec: | Config_spec SEMICOLON | + INCLUDE PATH SEMICOLON { + if (incignore == 0) + include($2, 0); + }; + | INCLUDE ID SEMICOLON { if (incignore == 0) include($2, 0); diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l index 2f2886e28448..b89c6c4caeaa 100644 --- a/usr.sbin/config/lang.l +++ b/usr.sbin/config/lang.l @@ -96,6 +96,7 @@ int yyerror(const char *); %} ID [A-Za-z_][-A-Za-z_0-9]* +PATH [./][-/.%^A-Za-z_0-9]+ %START TOEOL %% {ID} { @@ -165,6 +166,11 @@ ID [A-Za-z_][-A-Za-z_0-9]* return tok; /* otherwise continue scanning */ } +{PATH} { + BEGIN 0; + yylval.str = strdup(yytext); + return PATH; + } . { return yytext[0]; } %%