ia64/xen-unstable

diff tools/python/xen/util/xsm/acm/acm.py @ 16522:54482c56e435

Implement legacy XML-RPC interface for ACM commands.

This patch moves the directory of files where xend is writing policies
and resource labels into to /var/lib/xend/security/policies.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Dec 05 09:45:13 2007 +0000 (2007-12-05)
parents 5255eac35270
children 433f6a6a862a
line diff
     1.1 --- a/tools/python/xen/util/xsm/acm/acm.py	Wed Dec 05 09:44:20 2007 +0000
     1.2 +++ b/tools/python/xen/util/xsm/acm/acm.py	Wed Dec 05 09:45:13 2007 +0000
     1.3 @@ -35,7 +35,8 @@ from xen.util import dictio, xsconstants
     1.4  from xen.xend.XendConstants import *
     1.5  
     1.6  #global directories and tools for security management
     1.7 -security_dir_prefix = "/etc/xen/acm-security"
     1.8 +install_policy_dir_prefix = "/etc/xen/acm-security/policies"
     1.9 +security_dir_prefix = XendOptions.instance().get_xend_security_path()
    1.10  policy_dir_prefix = security_dir_prefix + "/policies"
    1.11  res_label_filename = policy_dir_prefix + "/resource_labels"
    1.12  boot_filename = "/boot/grub/menu.lst"
    1.13 @@ -323,7 +324,7 @@ def label2ssidref(labelname, policyname,
    1.14      maps current policy to default directory
    1.15      to find mapping file    """
    1.16  
    1.17 -    if policyname in ['NULL', 'INACTIVE', 'DEFAULT', 'INACCESSIBLE' ]:
    1.18 +    if policyname in ['NULL', 'INACTIVE', 'INACCESSIBLE' ]:
    1.19          err("Cannot translate labels for \'" + policyname + "\' policy.")
    1.20  
    1.21      allowed_types = ['ANY']
    1.22 @@ -447,10 +448,8 @@ def get_ssid(domain):
    1.23      except:
    1.24          err("Cannot determine security information.")
    1.25  
    1.26 -    if active_policy in ["DEFAULT"]:
    1.27 -        label = "DEFAULT"
    1.28 -    else:
    1.29 -        label = ssidref2label(ssid_info["ssidref"])
    1.30 +    label = ssidref2label(ssid_info["ssidref"])
    1.31 +
    1.32      return(ssid_info["policyreference"],
    1.33             label,
    1.34             ssid_info["policytype"],