Bug 1500673

Summary: Error info shows wrong sometimes when ssh to conversion server using non-root user with sudo on p2v client
Product: Red Hat Enterprise Linux 7 Reporter: mxie <mxie>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.5CC: juzhou, kuwei, mzhan, ptoscano, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: P2V
Fixed In Version: libguestfs-1.36.7-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 09:18:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mxie@redhat.com 2017-10-11 10:15:02 UTC
Description of problem:
Error info shows wrong sometimes when ssh to conversion server using non-root user with sudo on p2v client

Version-Release number of selected component (if applicable):
virt-p2v-1.36.5-1.el7


How reproducible:
70%

Steps to Reproduce:
1.Not add non-user with password in sudoers file 
# cat /etc/sudoers

## Allow root to run any commands anywhere 
root    ALL=(ALL)       ALL

2. Boot the source machine into p2v client via iso
3. After virt-p2v client launched, fill information as following:
Conversion server: 10.66.xx.xx : 22
User name:mm(a non-root user)
Password:******
4. Check "Use sudo when running virt-v2v" button 
5.Press "Test connection" button and then shows error info "virt-v2v is not installed on the conversion server, or it might be a too old version"
6.If continue press "Test connection" button repeatedly,correct error info "sudo for user"mm"requires a password.Edit/etc/sudoers on the conversion server to ensure the "NOPASSWD:"option is set for this user" may show out
 

Actual results:
As above description

Expected results:
Should show error info "sudo for user"mm"requires a password.Edit/etc/sudoers on the conversion server to ensure the "NOPASSWD:"option is set for this user" in step5 with 100 percent


Additional info:
1.It is a regressed problem from bug 1349342 
2.Also can reproduce the problem on virt-p2v-1.36.3-2.el7 and virt-p2v-1.32.7-2.el7

Comment 2 Richard W.M. Jones 2017-10-11 12:20:53 UTC
Not able to reproduce this with virt-p2v / virt-v2v 1.37.29.
I'll try it shortly with RHEL 7.5 packages instead.

Comment 3 Richard W.M. Jones 2017-10-11 13:49:09 UTC
I *can* reproduce this with virt-p2v 1.37.29 connecting to a RHEL 7.5
server with virt-v2v 1.36.6-2.el7 installed.

Comment 4 Richard W.M. Jones 2017-10-11 14:17:23 UTC
Patch posted:

https://www.redhat.com/archives/libguestfs/2017-October/msg00113.html

Note this patch is for virt-p2v, so it will unfortunately require
a rebuild of the p2v ISO.

Comment 7 kuwei@redhat.com 2017-10-13 10:22:19 UTC
To verify the bug with below builds:
virt-p2v-1.36.7-1.el7.x86_64

remote v2v server:
libvirt-3.8.0-1.el7.x86_64-
virt-v2v-1.36.7-1.el7.x86_64

Steps:
Steps to Reproduce:
1.Not add non-user with password in sudoers file 
# cat /etc/sudoers

## Allow root to run any commands anywhere 
root    ALL=(ALL)       ALL

2. Boot the source machine into p2v client via iso
3. After virt-p2v client launched, fill information as following:
Conversion server: 10.66.xx.xx : 22
User name:mm(a non-root user)
Password:******
4. Check "Use sudo when running virt-v2v" button :
5.Press "Test connection" button and then shows right info "sudo for user"XX"requires a password.Edit/etc/sudoers on the conversion server to ensure the "NOPASSWD:"option is set for this user"
6.Continue press several times(>10),info still right.
7.Change another v2v server,also show the right info.


So,from above result ,the bug has fixed ,move the bug to VERIFIED

Comment 10 errata-xmlrpc 2018-04-10 09:18:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0677