View | Details | Raw Unified | Return to bug 27189
Collapse All | Expand All

(-)a/branches/ucs-3.0/ucs/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py (-1 / +2 lines)
 Lines 56-61   import errno Link Here 
56
import fnmatch
56
import fnmatch
57
import re
57
import re
58
import random
58
import random
59
from xml.sax.saxutils import escape as xml_escape
59
try:
60
try:
60
	import xml.etree.ElementTree as ET
61
	import xml.etree.ElementTree as ET
61
except ImportError:
62
except ImportError:
 Lines 1590-1596   def domain_snapshot_create(uri, domain, snapshot): Link Here 
1590
		if dom_stat.pd.snapshots is None:
1591
		if dom_stat.pd.snapshots is None:
1591
			raise NodeError(_('Snapshot not supported "%(node)s"'), node=uri)
1592
			raise NodeError(_('Snapshot not supported "%(node)s"'), node=uri)
1592
		old_state = dom_stat.key()
1593
		old_state = dom_stat.key()
1593
		xml = '''<domainsnapshot><name>%s</name></domainsnapshot>''' % snapshot
1594
		xml = '''<domainsnapshot><name>%s</name></domainsnapshot>''' % (xml_escape(snapshot),)
1594
		s = dom.snapshotCreateXML(xml, 0)
1595
		s = dom.snapshotCreateXML(xml, 0)
1595
1596
1596
		dom_stat.update(dom)
1597
		dom_stat.update(dom)
(-)a/branches/ucs-3.0/ucs/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/storage.py (-4 / +5 lines)
 Lines 42-47   from protocol import Disk, Data_Pool Link Here 
42
import os.path
42
import os.path
43
import univention.config_registry as ucr
43
import univention.config_registry as ucr
44
import time
44
import time
45
from xml.sax.saxutils import escape as xml_escape
45
46
46
configRegistry = ucr.ConfigRegistry()
47
configRegistry = ucr.ConfigRegistry()
47
configRegistry.load()
48
configRegistry.load()
 Lines 63-70   def create_storage_pool(conn, dir, pool_name='default'): Link Here 
63
		</target>
64
		</target>
64
	</pool>
65
	</pool>
65
	''' % {
66
	''' % {
66
			'pool': pool_name,
67
			'pool': xml_escape(pool_name),
67
			'path': dir,
68
			'path': xml_escape(dir),
68
			}
69
			}
69
	try:
70
	try:
70
		p = conn.storagePoolDefineXML(xml, 0)
71
		p = conn.storagePoolDefineXML(xml, 0)
 Lines 127-133   def create_storage_volume(conn, domain, disk): Link Here 
127
		size = 8 << 30 # GiB
128
		size = 8 << 30 # GiB
128
129
129
	values = {
130
	values = {
130
			'name': os.path.basename(disk.source),
131
			'name': xml_escape(os.path.basename(disk.source)),
131
			'size': size,
132
			'size': size,
132
			}
133
			}
133
134
 Lines 137-143   def create_storage_volume(conn, domain, disk): Link Here 
137
	pool_type = doc.firstChild.getAttribute('type')
138
	pool_type = doc.firstChild.getAttribute('type')
138
	if pool_type in ('dir', 'fs', 'netfs'):
139
	if pool_type in ('dir', 'fs', 'netfs'):
139
		if hasattr(disk, 'driver_type') and disk.driver_type not in (None, 'iso', 'aio'):
140
		if hasattr(disk, 'driver_type') and disk.driver_type not in (None, 'iso', 'aio'):
140
			values['type'] = disk.driver_type
141
			values['type'] = xml_escape(disk.driver_type)
141
		else:
142
		else:
142
			values['type'] = 'raw'
143
			values['type'] = 'raw'
143
		# permissions
144
		# permissions

Return to bug 27189