aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxlu_cfg_l.l
diff options
context:
space:
mode:
authorIan Jackson <Ian.Jackson@eu.citrix.com>2011-01-11 19:31:41 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2011-01-11 19:31:41 +0000
commit54fbaf446bb350aff4dd5c4b0f44557186dd7d31 (patch)
tree935bc0f929a867e75ad01a6d21cc97ea8f1c02da /tools/libxl/libxlu_cfg_l.l
parent3e58e5d9c1fdc16dee74b891403f30e987965877 (diff)
downloadxen-54fbaf446bb350aff4dd5c4b0f44557186dd7d31.tar.gz
xen-54fbaf446bb350aff4dd5c4b0f44557186dd7d31.tar.bz2
xen-54fbaf446bb350aff4dd5c4b0f44557186dd7d31.zip
libxl: config parser: print warning for apparent arbitrary python
The characters - + . ( ) : are not legal in xl config files but are valid Python and use of at least one of them is almost essential for writing arbitrary Python in the config file. So if we see one of these during lexing, note it, and then after the parse is complete if it failed we print a special extra warning. Currently this warning refers to the nonexistent wiki page http://wiki.xen.org/xenwiki/PythonInXlConfig which will have to be written (and/or given a better name) before the actual 4.1 release. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxlu_cfg_l.l')
-rw-r--r--tools/libxl/libxlu_cfg_l.l6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/libxl/libxlu_cfg_l.l b/tools/libxl/libxlu_cfg_l.l
index ac6b0112c2..21c11ff747 100644
--- a/tools/libxl/libxlu_cfg_l.l
+++ b/tools/libxl/libxlu_cfg_l.l
@@ -64,6 +64,12 @@ void xlu__cfg_yyset_column(int column_no, yyscan_t yyscanner);
GOT(STRING);
}
+[+-.():] {
+ ctx->likely_python= 1;
+ BEGIN(lexerr);
+ yymore();
+ }
+
. {
BEGIN(lexerr);
yymore();