mirror of
https://github.com/Icinga/icinga2.git
synced 2026-06-08 16:26:42 -04:00
Warn if object name contains ctrl characters
This commit is contained in:
parent
da521203b1
commit
4039b39061
1 changed files with 9 additions and 0 deletions
|
|
@ -105,6 +105,15 @@ ConfigItem::Ptr ConfigItemBuilder::Compile()
|
|||
<< ", max: 255).\n" << oss.str();
|
||||
}
|
||||
|
||||
if (std::any_of(m_Name.Begin(), m_Name.End(), [&](char c) { return std::iscntrl(c, classic); })) {
|
||||
std::ostringstream oss;
|
||||
ShowCodeLocation(oss, m_DebugInfo, false);
|
||||
|
||||
Log(LogWarning, "config")
|
||||
<< "Object name of type '" << m_Type->GetName()
|
||||
<< "' contains ctrl or newline characters, which may cause problems in some contexts.\n" << oss.str();
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<Expression> > exprs;
|
||||
|
||||
Array::Ptr templateArray = new Array({ m_Name });
|
||||
|
|
|
|||
Loading…
Reference in a new issue