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

xen-devel

[Top] [All Lists]

[Xen-devel] [PATCH][ACM] Add type check and conversion to get_decision

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][ACM] Add type check and conversion to get_decision
From: "Bryan D. Payne" <bdpayne@xxxxxxxxxx>
Date: 2006年5月31日 09:34:51 -0400
Cc: "Bryan D. Payne" <bdpayne@xxxxxxxxxx>, Reiner Sailer <sailer@xxxxxxxxxx>
Delivery-date: 2006年5月31日 06:33:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.2 (X11/20060501)
This patch allows domid and ssidref args to get_decision in util/security.py to be either strings or ints (previously only strings would work due to the underlying call to lowlevel.acm).
Signed-off-by: Bryan D. Payne <bdpayne@xxxxxxxxxx>
Signed-off-by: Reiner Sailer <sailer@xxxxxxxxxx>
---
tools/python/xen/util/security.py | 9 +++++++++
1 file changed, 9 insertions(+)
Index: xen-unstable.hg-shype/tools/python/xen/util/security.py
===================================================================
--- xen-unstable.hg-shype.orig/tools/python/xen/util/security.py
+++ xen-unstable.hg-shype/tools/python/xen/util/security.py
@@ -429,6 +429,15 @@ def get_decision(arg1, arg2):
 err("Argument type not supported.")
 ssidref = label2ssidref(arg2[2][1], arg2[1][1])
 arg2 = ['ssidref', str(ssidref)]
+
+ # accept only int or string types for domid and ssidref
+ if isinstance(arg1[1], int):
+ arg1[1] = str(arg1[1])
+ if isinstance(arg2[1], int):
+ arg2[1] = str(arg2[1])
+ if not isinstance(arg1[1], str) or not isinstance(arg2[1], str):
+ err("Invalid id or ssidref type, string or int required")
+
 try:
 decision = acm.getdecision(arg1[0], arg1[1], arg2[0], arg2[1])
 except:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][ACM] Add type check and conversion to get_decision, Bryan D. Payne <=
Previous by Date: [Xen-devel] [PATCH] x86-64 linux: unmap temporary mappings established for setup of 1:1 mappings , Jan Beulich
Next by Date: [Xen-devel] [PATCH] Enable VGA acceleration for VTI domain , Tian, Kevin
Previous by Thread: [Xen-devel] [PATCH] x86-64 linux: unmap temporary mappings established for setup of 1:1 mappings , Jan Beulich
Next by Thread: [Xen-devel] [PATCH] Enable VGA acceleration for VTI domain , Tian, Kevin
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /