Don't canonicalise the resource inside res_security_check if security is off.

This had broken use of relative paths to refer to ISOs etc.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
Ewan Mellor committed 2007-01-02 13:35:25 +00:00
1 parent dba11d1f26
commit 535e80fa87
1 file changed
+5 -3
+5 -3
View File
@@ -637,11 +637,11 @@ def res_security_check(resource, domain_label):
"""
rtnval = 1
#build canonical resource name
resource = unify_resname(resource)
# if security is on, ask the hypervisor for a decision
if on():
#build canonical resource name
resource = unify_resname(resource)
(label, ssidref, policy) = get_res_security_details(resource)
domac = ['access_control']
domac.append(['policy', active_policy])
@@ -660,6 +660,8 @@ def res_security_check(resource, domain_label):
# security is off, make sure resource isn't labeled
else:
# Note, we can't canonicalise the resource here, because people using
# xm without ACM are free to use relative paths.
(label, policy) = get_res_label(resource)
if policy != 'NULL':
raise ACMError("Security is off, but '"+resource+"' is labeled")
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.