Bug 304361 - libvirt (at least virsh) doesn't use the username in an URI
libvirt (at least virsh) doesn't use the username in an URI
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Daniel Veillard
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-09-24 20:56 EDT by Fabian Deutsch
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-09-25 09:47:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Should fix missing recognition of the username when a port is given. (481 bytes, patch)
2007-09-25 06:13 EDT, Fabian Deutsch
no flags Details | Diff
diff -u patch for adding username handling (960 bytes, patch)
2007-09-25 08:58 EDT, Fabian Deutsch
no flags Details | Diff

  None (edit)
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
[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

  thanks !

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
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 :)

Note You need to log in before you can comment on or make changes to this bug.