Bug 304361

Summary: libvirt (at least virsh) doesn't use the username in an URI
Product: [Fedora] Fedora Reporter: Fabian Deutsch <fabian.deutsch>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7CC: xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-25 09:47:30 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Should fix missing recognition of the username when a port is given.
none
diff -u patch for adding username handling none

Description Fabian Deutsch 2007-09-24 20:56:17 EDT
Description of problem:
virsh and virt-manager igbore a given username.

Version-Release number of selected component (if applicable):
Name        : libvirt
Version     : 0.3.2
Name        : virt-manager
Version     : 0.4.0

How reproducible:
Be root and log into a different machine as a different user than root, using an
uri:
[root@sohost ~]# virsh -c qemu+ssh://fabiand@vhost.sowhere.org:222/system
root@vhost.sowhere.org's password: 


Steps to Reproduce:
See example above ...
  
Actual results:
virsh ignores the given username (fabiand)

Expected results:
I get a prompt for the given user e.g:
[root@sohost ~]# virsh -c qemu+ssh://fabiand@vhost.sowhere.org:222/system
fabiand@vhost.sowhere.org's password: 

Additional info:
Also happens in virt-manager.
Comment 1 Fabian Deutsch 2007-09-25 06:13:47 EDT
Created attachment 205071 [details]
Should fix missing recognition of the username when a port is given.

The problem might be fixed using this patch. Not tested with different
transport protocols.
Comment 2 Daniel Veillard 2007-09-25 08:17:05 EDT
Looks sensible, but:
 1/ a contextual patch (cvs diff -p) is less error prone
 2/ usually enhancement are best requested on the mailing-list
    to get active peer-review
W.r.t. 1/ could you send an updated patch, ideally on the mailing
list (see http://libvirt.org/bugs.html ), or just attached to this
bug,

  thanks !

Daniel
Comment 3 Fabian Deutsch 2007-09-25 08:58:01 EDT
Created attachment 205441 [details]
diff -u patch for adding username handling

Actually I thought that this is a bug, because handling a username is part of
the remote uri format.
For now I'll just post the bug here. Enhacements will go to the mailinglist in
future.
Comment 4 Daniel Berrange 2007-09-25 09:34:40 EDT
Ok, so the problem this patch is fixing is an interaction betweeen the port
number & username handling. If you add a port number, then it forgots to look
for the username. So this patch looks fine to me.
Comment 5 Richard W.M. Jones 2007-09-25 09:47:30 EDT
I think this probably happened as a result of patch fuzzing, causing
code to move around.  In any case I'm going to commit this to libvirt CVS now.
Comment 6 Fabian Deutsch 2007-09-25 09:53:17 EDT
nice :)