diff options
author | obrien <obrien@FreeBSD.org> | 2008-07-28 17:11:57 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2008-07-28 17:11:57 +0000 |
commit | ffa615778870d82037421f0b90fa371af7218892 (patch) | |
tree | 8d099661592223adff18fcfb6fa2247292c91020 /usr.sbin/config | |
parent | 0c7c769464c641777d634b959d37a2f19a2ff375 (diff) | |
download | FreeBSD-src-ffa615778870d82037421f0b90fa371af7218892.zip FreeBSD-src-ffa615778870d82037421f0b90fa371af7218892.tar.gz |
Allow kernel config files to include files other than those in the CWD,
using unquoted paths.
Diffstat (limited to 'usr.sbin/config')
-rw-r--r-- | usr.sbin/config/config.y | 6 | ||||
-rw-r--r-- | usr.sbin/config/lang.l | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 8eef64c..9aa89e5 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -31,6 +31,7 @@ %type <str> Save_id %type <str> Opt_value %type <str> Dev +%token <str> 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 2f2886e..b89c6c4 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]; } %% |