From: Keir Fraser Date: Tue, 23 Sep 2008 11:30:42 +0000 (+0100) Subject: acm, xend: Catch bad vlan identifiers X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14101^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0e7c1355bc8892881dd51be14c9a3b50051569c4;p=xen.git 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 --- diff --git a/tools/python/xen/util/xsm/acm/acm.py b/tools/python/xen/util/xsm/acm/acm.py index 6c733549c5..c1efdfac0d 100644 --- a/tools/python/xen/util/xsm/acm/acm.py +++ b/tools/python/xen/util/xsm/acm/acm.py @@ -862,6 +862,15 @@ def unify_resname(resource, mustexist=True): 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 '/' if typ != "vlan":