Make 'xm restore' sanity check the path
PATCH 1/1 Make 'xm restore' sanity check the path
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 <[email protected]>
tools/python/xen/xm/main.py +4 -0
@@ -183,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)
Signature · 4 lines
Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [email protected]
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ewan Mellor
AppliedQuoted 7 lines · Dan Smith
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 <[email protected]>
Applied, thank you.
Ewan.