提交 dc40dd60 编写于 作者: S Sławek Kapłoński 提交者: Michal Privoznik

networkValidate: Forbid new-line char in network name

New line character in name of network is now forbidden because it
mess virsh output and can be confusing for users.  Validation of
name is done in network driver, after parsing XML to avoid
problems with disappeared network which was already created with
new-line char in name.

Closes-Bug: https://bugzilla.redhat.com/show_bug.cgi?id=818064Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 e1b81968
...@@ -2973,6 +2973,9 @@ networkValidate(virNetworkDriverStatePtr driver, ...@@ -2973,6 +2973,9 @@ networkValidate(virNetworkDriverStatePtr driver,
bool bandwidthAllowed = true; bool bandwidthAllowed = true;
bool usesInterface = false, usesAddress = false; bool usesInterface = false, usesAddress = false;
if (virXMLCheckIllegalChars("name", def->name, "\n") < 0)
return -1;
/* Only the three L3 network types that are configured by libvirt /* Only the three L3 network types that are configured by libvirt
* need to have a bridge device name / mac address provided * need to have a bridge device name / mac address provided
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册