WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] acm, xend: Catch bad vlan identifiers
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 23 Sep 2008 13:10:12 -0700
Delivery-date: Tue, 23 Sep 2008 13:10:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] acm, xend: Catch bad vlan identifiers, Xen patchbot-unstable <=