WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch adds a quick check in "xm save" to make sure the path given
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Sep 2005 14:16:12 +0000
Delivery-date: Tue, 27 Sep 2005 14:13:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] This patch adds a quick check in "xm save" to make sure the path given, Xen patchbot -unstable <=