From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [RFC][PATCH] Secure XML-RPC for Xend Date: Fri, 09 Jun 2006 07:00:57 -0500 Message-ID: <448962F9.5020400@us.ibm.com> References: <4488D93D.7070303@us.ibm.com> <20060609083434.GA19035@fork.recoil.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060609083434.GA19035@fork.recoil.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anil Madhavapeddy Cc: xen-devel , Ewan Mellor List-Id: xen-devel@lists.xenproject.org > Why not just do the SSH every time, and let the user either set up > connection multiplexing or ssh agent in their local environment > instead? That way it will work for old OpenSSH versions and you > don't have to deal with all the quirks. > Another option is just to make sure that the XML-RPC supports keep-alive and reuse the same xm serve session. I think that's probably the most compatible approach. >> 2) A command *must* be executed to cleanup the ssh session on exit. I >> currently use __del__() which doesn't seem to make Python happy in certain >> cases. >> 3) I have done basic testing but not regression testing with xm-test >> >> diff -r 4f1e39ec05d6 -r 4de241a7e91a tools/python/xen/util/xmlrpclib2.py >> > ... > >> + def runcmd(self, cmd, data=None): >> + """Runs a command using an existing SSH connection. >> + >> + This function will run the passed in command on a remote >> + machine and either return the output or raise an OSError >> + if the command exits with a non-zero status (or some >> + other failure occurs).""" >> + >> + cmdline = self.getcmd(cmd) >> + if data: >> + f = open("/tmp/stuff.txt", "w") >> + f.write(data) >> + f.close() >> + cmdline = "cat /tmp/stuff.txt | %s" % cmdline >> > > Ouch, this bit definitely needs to be fixed at least :) > Yikes, didn't know that was still there :-) Regards, Anthony Liguori