[Kimchi-devel] [PATCH V3 1/4] bug fix: network name can be any characters except " and /

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Thu Jun 19 00:53:28 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

" is not allowed in dnsmasq configure file.
/ is not allowed in a linux file name.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.network.js     | 2 +-
 ui/pages/tabs/network.html.tmpl | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 16b9ca6..7ab7ff9 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -334,7 +334,7 @@ kimchi.cleanNetworkDialog = function() {
 };
 kimchi.setupNetworkFormEvent = function() {
     $("#networkName").on("keyup", function(event) {
-        $("#networkName").toggleClass("invalid-field", !$("#networkName").val().match(/^[a-zA-Z0-9_]+$/));
+        $("#networkName").toggleClass("invalid-field", !$("#networkName").val().match(/^[^\"\/]+$/));
         kimchi.updateNetworkFormButton();
     });
     $("#networkTypeIso").on("click", function(event) {
diff --git a/ui/pages/tabs/network.html.tmpl b/ui/pages/tabs/network.html.tmpl
index 18fccef..92985ff 100644
--- a/ui/pages/tabs/network.html.tmpl
+++ b/ui/pages/tabs/network.html.tmpl
@@ -49,7 +49,7 @@
                 <input type="text" id="networkName" class="network-label"/>
                 <div class="input-hint">
                     <span class="ui-icon ui-icon-info input-hint-icon"></span>
-                    <span class="input-hint-text">$_("Alphanumeric and '_' characters only.")</span>
+                    <span class="input-hint-text">$_("Name should not contain '/' and '\"'.")</span>
                 </div>
             </div>
         </div>
-- 
1.9.3




More information about the Kimchi-devel mailing list