[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] This patch adds a quick check in "xm save" to make sure the path given



# HG changeset patch
# User emellor@ewan
# Node ID c9d690c52afc4e9aeab06dd5dd1122ec2b473527
# Parent  9575efe88e75e524cccfb77f3a54c077ec606a7b
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@xxxxxxxxxx>
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 9575efe88e75 -r c9d690c52afc tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Sep 27 14:03:00 2005
+++ b/tools/python/xen/xm/main.py       Tue Sep 27 14:06:40 2005
@@ -175,6 +175,10 @@
 
     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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.