[libvirt] remote driver RPC API usage breaks launching ssh askpass

Cole Robinson crobinso at redhat.com
Wed Jul 20 18:10:42 UTC 2011


On 07/20/2011 07:32 AM, Daniel P. Berrange wrote:
> On Tue, Jul 19, 2011 at 04:07:17PM -0400, Cole Robinson wrote:
>> This commit broke launching SSH askpass from virt-manager:
>>
>> http://libvirt.org/git/?p=libvirt.git;a=commit;h=c1b226447781ba8367606f760dde6a88414382a3
>>
>> Using upstream virt-manager, running
>>
>> python src/virt-manager.py
>>
>> and trying to connect to a remote SSH connection without SSH keys causes
>> a segfault:
>>
>> #0  virNetSocketRead (sock=0xc, buf=0x7f746c006458 "", len=4)
>>     at rpc/virnetsocket.c:969
>> #1  0x00007f7477ea7374 in virNetClientIOReadMessage (client=0x7f746c006400)
>>     at rpc/virnetclient.c:712
>> #2  virNetClientIOHandleInput (client=0x7f746c006400) at
>> rpc/virnetclient.c:731
>> #3  0x00007f7477ea7ae0 in virNetClientIncomingEvent (sock=0x7f746c002040,
>>     events=<value optimized out>, opaque=0x7f746c006400)
>>     at rpc/virnetclient.c:1120
> 
> I believe this should already be fixed in GIT.
> 

Thanks, segfault is indeed fixed.

> 
>> rerun make, and reproduce the error, libvirt raises an exception from
>> virConnectOpenAuth:
>>
>> libvirtError: Cannot recv data: Permission denied, please try again.
>> Permission denied, please try again.
>> Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). :
>> Connection reset by peer
>>
>> I haven't poked at it yet, putting it here incase anyone else has ideas.
> 
> Most likely bet is that we run ssh with different environment variables
> than we used to.  We now do:
> 
>     cmd = virCommandNew(binary ? binary : "ssh");
>     virCommandAddEnvPassCommon(cmd);
>     virCommandAddEnvPass(cmd, "SSH_AUTH_SOCK");
>     virCommandAddEnvPass(cmd, "SSH_ASKPASS");
>     virCommandClearCaps(cmd);
> 
> I guess it probably wants to have 'DISPLAY' passed through too. Can you
> see if this is sufficient.
> 

Adding DISPLAY makes askpass appear, thanks. I was hitting some other issues
that were exacerbated by a virt-manager bug:

http://git.fedorahosted.org/git?p=virt-manager.git;a=commit;h=b8c1d66801e87947fe9a31fe9c081e576235de49

I'll submit a libvirt patch shortly for the DISPLAY issue shortly.

Thanks,
Cole




More information about the libvir-list mailing list