[augeas-devel] [Augeas] #125: Parentheses in key name causes path expression errors
Augeas
trac at fedorahosted.org
Thu Jul 1 16:49:40 UTC 2010
#125: Parentheses in key name causes path expression errors
--------------------+-------------------------------------------------------
Reporter: csears | Owner: lutter
Type: defect | Status: new
Priority: minor | Milestone: next
Component: Augeas | Version: 0.7.0
Keywords: |
--------------------+-------------------------------------------------------
It seems like parentheses in they key name may not be getting properly
escaped somewhere. With a small test I'm getting "Invalid path expression"
and "garbage at end of path expression" error messages at runtime.
Here's how to reproduce the error... (the files mentioned are attached)
{{{
# cat /tmp/bug_parens_in_key_func_file
some_func() {
return 1;
}
}}}
{{{
# cat bug_parens_in_key.aug
module Bug_Parens_In_Key =
autoload xfm
let empty = Util.empty
let eol = Util.eol
let ws = Util.del_ws_spc
let lbrace = Util.del_str "{"
let rbrace = Util.del_str "}"
let func_sig_no_args = /[A-Za-z0-9_]+\(\)/
let func_body = store /[^}]*/
let func = [ key func_sig_no_args . ws . lbrace . func_body . rbrace .
eol ]
let lns = (empty | func) *
let filter = incl "/tmp/bug_parens_in_key_func_file"
let xfm = transform lns filter
}}}
{{{
# augtool ls /files/tmp/bug_parens_in_key_func_file
error: Invalid path expression
error: garbage at end of path expression
error: /files/tmp/bug_parens_in_key_func_file/some_func(|=|)/*
error: Invalid path expression
error: garbage at end of path expression
error: /files/tmp/bug_parens_in_key_func_file/some_func(|=|)
some_func()/ = H
}}}
Another odd thing worth mentioning is that when I try to reproduce the
error using a test aug script, either the error doesn't occur or the error
message is suppressed.
{{{
# cat tests/test_bug_parens_in_key.aug
module Test_Bug_Parens_In_Key =
let func_file =
"some_func() {
return 1;
}
"
test Bug_Parens_In_Key.lns get func_file =
{ "some_func()" = "\n return 1;\n" }
}}}
{{{
# augparse -I bug_parens_in_key.aug tests/test_bug_parens_in_key.aug
#
}}}
No news is actually bad news.
--
Ticket URL: <https://fedorahosted.org/augeas/ticket/125>
Augeas <http://augeas.net/>
a configuration API
More information about the augeas-devel
mailing list