[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] acm, xend: Catch bad vlan identifiers



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1222169442 -3600
# Node ID fd3f54eb23e1d0fe64b6eb6c948bbc5d06df4d14
# Parent  df6f9fe48f1158f3c1430135e03b0ae7fc73ec23
acm, xend: Catch bad vlan identifiers

Add code to intercept badly formatted VLAN identifiers or
those that are out of range.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>
---
 tools/python/xen/util/xsm/acm/acm.py |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -r df6f9fe48f11 -r fd3f54eb23e1 tools/python/xen/util/xsm/acm/acm.py
--- a/tools/python/xen/util/xsm/acm/acm.py      Mon Sep 22 16:10:25 2008 +0100
+++ b/tools/python/xen/util/xsm/acm/acm.py      Tue Sep 23 12:30:42 2008 +0100
@@ -861,6 +861,15 @@ def unify_resname(resource, mustexist=Tr
         resfile = os.path.realpath(resfile)
         if mustexist and not os.path.isfile(resfile):
             err("Invalid resource")
+
+    if typ == "vlan":
+        try:
+            vlan = int(resfile)
+            if vlan < 1 or vlan > 4095:
+                err("VLAN ID %d out of range." % vlan)
+        except Exception, e:
+            err("Invalid VLAN : %s" % resfile)
+
 
     #file: resources must be specified with absolute path
     #vlan resources don't start with '/'

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.