All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make 'xm restore' sanity check the path
@ 2005-09-26 17:44 Dan Smith
  2005-09-27 14:11 ` Ewan Mellor
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Smith @ 2005-09-26 17:44 UTC (permalink / raw)
  To: Xen Developers

[-- Attachment #1: Type: text/plain, Size: 250 bytes --]

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@us.ibm.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: restore-checkwrite.patch --]
[-- Type: text/x-patch, Size: 486 bytes --]

diff -r 5ea81e640509 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py	Sun Sep 25 10:47:22 2005
+++ b/tools/python/xen/xm/main.py	Mon Sep 26 10:37:34 2005
@@ -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)

[-- Attachment #3: Type: text/plain, Size: 87 bytes --]

-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@us.ibm.com

[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Make 'xm restore' sanity check the path
  2005-09-26 17:44 [PATCH] Make 'xm restore' sanity check the path Dan Smith
@ 2005-09-27 14:11 ` Ewan Mellor
  0 siblings, 0 replies; 2+ messages in thread
From: Ewan Mellor @ 2005-09-27 14:11 UTC (permalink / raw)
  To: xen-devel

On Mon, Sep 26, 2005 at 10:44:55AM -0700, Dan Smith wrote:

> 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@us.ibm.com>

Applied, thank you.

Ewan.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-27 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-26 17:44 [PATCH] Make 'xm restore' sanity check the path Dan Smith
2005-09-27 14:11 ` Ewan Mellor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.