mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
This patch adds a quick check in "xm save" to make sure the path given
exists, and is writable. This will fix the issue detected by xm-test 03_save_bogusfile_neg. Signed-off-by: Dan Smith <danms@us.ibm.com> Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
f8e5b67cfe
commit
9427933f18
1 file changed
+4
@@ -175,6 +175,10 @@ def xm_save(args):
|
||||
|
||||
dom = args[0] # TODO: should check if this exists
|
||||
savefile = os.path.abspath(args[1])
|
||||
|
||||
if not os.access(os.path.dirname(savefile), os.W_OK):
|
||||
err("xm save: Unable to create file %s" % savefile)
|
||||
sys.exit(1)
|
||||
|
||||
from xen.xend.XendClient import server
|
||||
server.xend_domain_save(dom, savefile)
|
||||
|
||||