Actions
Bug #4229
closedconf parsing gives very confusing message if no '=' present on setting line
% Done:
0%
Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
A doc bug caused a user to attempt to include settings of the form
public network <addr>
i.e. missing the equals sign. The config parsing ended up saying
"unexpected character while parsing putative key value, at char N line M", where N was "one past EOL".
The problematic code calls #, ;, and '\0' all "illegal characters in key names", which they are,
but, '\0' should probably be handled differently, issuing something like "no value found on line M; missing =?"
Updated by Dan Mick about 11 years ago
Something like this:
--- a/src/common/ConfUtils.cc +++ b/src/common/ConfUtils.cc @@ -471,8 +471,13 @@ process_line(int line_no, const char *line, std::deque<std::string> *errors) case ACCEPT_KEY: if ((((c == '#') || (c == ';')) && (!escaping)) || (c == '\0')) { ostringstream oss; - oss << "unexpected character while parsing putative key value, " - << "at char " << (l - line) << ", line " << line_no; + if (c == '\0') { + oss << "end of key=val line " << line_no + << "reached, no \"=val\" found...missing =?"; + } else { + oss << "unexpected character while parsing putative key value, " + << "at char " << (l - line) << ", line " << line_no; + } errors->push_back(oss.str()); return NULL; }
Updated by Dan Mick about 11 years ago
- Status changed from New to Resolved
8c05af5dc3c398dda4c196a64f344db7ea69d209 pushed to next
Actions