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-devel

[Xen-devel] [PATCH][RESENT] xend: fix bug in xend option parsing

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][RESENT] xend: fix bug in xend option parsing
From: Arnd Hannemann <hannemann@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 16 May 2010 23:34:59 +0200
Delivery-date: Sun, 16 May 2010 14:35:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4
Resent of mail sent on 28.04.


xend: fix bug in option parsing

If you enable legacy tcp xmlrpc in xend's config but omit to enable ssl
the following backtrace is generated when starting xend:

[2010-04-28 16:09:04 15754] ERROR (SrvDaemon:349) Exception starting xend 
('NoneType' object has no attribute 'rfind')
Traceback (most recent call last):
  File "usr/lib/python2.5/site-packages/xen/xend/server/SrvDaemon.py", line 
341, in run
    servers = SrvServer.create()
  File "usr/lib/python2.5/site-packages/xen/xend/server/SrvServer.py", line 
253, in create
    _loadConfig(servers, root, False)
  File "usr/lib/python2.5/site-packages/xen/xend/server/SrvServer.py", line 
233, in _loadConfig
    ssl_key_file = xoptions.get_xend_tcp_xmlrpc_server_ssl_key_file()
  File "usr/lib/python2.5/site-packages/xen/xend/XendOptions.py", line 210, in 
get_xend_tcp_xmlrpc_server_ssl_key_file
    if os.path.dirname(file) == "":
  File "/usr/lib/python2.5/posixpath.py", line 119, in dirname
    return split(p)[0]
  File "/usr/lib/python2.5/posixpath.py", line 77, in split
    i = p.rfind('/') + 1

This patch fixes above bug.
Patch should be considered for 4.0.x as the bug is present in release 4.0.0.

Signed-off-by: Arnd Hannemann <hannemann@xxxxxxxxxxxxxxxxxxx>

diff -r 9a1d7caa2024 -r 0d3979903bac tools/python/xen/xend/XendOptions.py
--- a/tools/python/xen/xend/XendOptions.py      Mon Apr 26 12:13:23 2010 +0100
+++ b/tools/python/xen/xend/XendOptions.py      Wed Apr 28 16:54:04 2010 +0200
@@ -207,18 +207,18 @@
     def get_xend_tcp_xmlrpc_server_ssl_key_file(self):
         name = 'xend-tcp-xmlrpc-server-ssl-key-file'
         file = self.get_config_string(name)
-        if os.path.dirname(file) == "":
+        if file and os.path.dirname(file) == "":
             file = auxbin.xen_configdir() + '/' + file;
-        if not os.path.exists(file):
+        if file and not os.path.exists(file):
             raise XendError("invalid xend config %s: directory '%s' does not 
exist" % (name, file))
         return file

     def get_xend_tcp_xmlrpc_server_ssl_cert_file(self):
         name = 'xend-tcp-xmlrpc-server-ssl-cert-file'
         file = self.get_config_string(name)
-        if os.path.dirname(file) == "":
+        if file and os.path.dirname(file) == "":
             file = auxbin.xen_configdir() + '/' + file;
-        if not os.path.exists(file):
+        if file and not os.path.exists(file):
             raise XendError("invalid xend config %s: directory '%s' does not 
exist" % (name, file))
         return file

Attachment: fix_xend_xmlrpc_tcp_without_ssl.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>