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

[Xen-changelog] This patch adds a quick check to 'xm restore' that checks the



# HG changeset patch
# User emellor@ewan
# Node ID fa4cc3f53c6401667b4758279f7f0d2be88dbca7
# Parent  c9d690c52afc4e9aeab06dd5dd1122ec2b473527
This patch adds a quick check to 'xm restore' that checks the
existence and readability of the file given.

This fixes the issue detected in xm-tests 03_restore_badparm_neg and
04_restore_badfilename_neg.

Signed-off-by: Dan Smith <danms@xxxxxxxxxx>
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r c9d690c52afc -r fa4cc3f53c64 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Sep 27 14:06:40 2005
+++ b/tools/python/xen/xm/main.py       Tue Sep 27 14:10:38 2005
@@ -187,6 +187,10 @@
     arg_check(args,1,"restore")
 
     savefile = os.path.abspath(args[0])
+
+    if not os.access(savefile, os.R_OK):
+        err("xm restore: Unable to read file %s" % savefile)
+        sys.exit(1)
 
     from xen.xend.XendClient import server
     info = server.xend_domain_restore(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®.