Bug 880020

Summary: rhevm-manage-domains -passwordFile=<existing empty file> give exception.
Product: Red Hat Enterprise Virtualization Manager Reporter: Chris Pelland <cpelland>
Component: ovirt-engine-configAssignee: Yair Zaslavsky <yzaslavs>
Status: CLOSED ERRATA QA Contact: Ilanit Stein <istein>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: bazulay, cpelland, dyasny, iheim, istein, oourfali, Rhev-m-bugs, sgordon, sgrinber, ykaul
Target Milestone: ---Keywords: ZStream
Target Release: 3.1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When an empty file was provided as the -passwordFile argument to the rhevm-manage-domains script then a NullPointerException (NPE) was thrown and a stack trace displayed. The rhevm-manage-domains script has been updated to detect whether or not the -passwordFile contains any data and handle the situation where it does not contain any more gracefully.
Story Points: ---
Clone Of: 870052 Environment:
Last Closed: 2013-01-15 15:13:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 870052    
Bug Blocks:    

Description Chris Pelland 2012-11-26 02:44:48 UTC
+++ This bug was initially created as a clone of Bug #870052 +++

Description of problem:

Running rhevm-manage-domains with -passwordFile=pass, when pass is existing empty file, give jave exception:


[root@lilach-rhel yum.repos.d]# rhevm-manage-domains  -action=add -addPermissions -domain=qa.lab.tlv.redhat.com -user=vdcadmin  -passwordFile=pass  -provider=activeDirectory
Error:  exception message: java.lang.NullPointerException
        at org.ovirt.engine.core.utils.kerberos.KerberosConfigCheck$KerberosUtilCallbackHandler.handle(KerberosConfigCheck.java:85)
        at javax.security.auth.login.LoginContext$SecureCallbackHandler$1.run(LoginContext.java:969)
        at javax.security.auth.login.LoginContext$SecureCallbackHandler$1.run(LoginContext.java:966)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.login.LoginContext$SecureCallbackHandler.handle(LoginContext.java:965)
        at com.sun.security.auth.module.Krb5LoginModule.promptForPass(Krb5LoginModule.java:870)
        at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:715)
        at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:580)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784)
        at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
        at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698)
        at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695)
        at javax.security.auth.login.LoginContext.login(LoginContext.java:594)
        at org.ovirt.engine.core.utils.kerberos.KerberosConfigCheck.checkAuthentication(KerberosConfigCheck.java:225)
        at org.ovirt.engine.core.utils.kerberos.KerberosConfigCheck.authenticate(KerberosConfigCheck.java:216)
        at org.ovirt.engine.core.utils.kerberos.KerberosConfigCheck.validateKerberosInstallation(KerberosConfigCheck.java:155)
        at org.ovirt.engine.core.utils.kerberos.KerberosConfigCheck.checkInstallation(KerberosConfigCheck.java:144)
        at org.ovirt.engine.core.utils.kerberos.ManageDomains.checkKerberosConfiguration(ManageDomains.java:628)
        at org.ovirt.engine.core.utils.kerberos.ManageDomains.testConfiguration(ManageDomains.java:778)
        at org.ovirt.engine.core.utils.kerberos.ManageDomains.addDomain(ManageDomains.java:440)
        at org.ovirt.engine.core.utils.kerberos.ManageDomains.runCommand(ManageDomains.java:238)
        at org.ovirt.engine.core.utils.kerberos.ManageDomains.main(ManageDomains.java:166)

Failure while testing domain qa.lab.tlv.redhat.com. Details: Kerberos error. Please check log for further details.


Version-Release number of selected component (if applicable):
SI22

How reproducible:
100%

Expected results:
Give just error which is user understandable & readble.

--- Additional comment from Ravi Nori on 2012-11-01 00:28:22 EDT ---

link : http://gerrit.ovirt.org/#/c/8965/

hash : cd3bc4ca2faca9efb46ec402093649b1f4af8c06

Comment 2 Ilanit Stein 2012-12-16 13:38:36 UTC
Verified on SI25.1:

[root@lilach-rhel ~]# rhevm-manage-domains  -action=add -addPermissions -domain=qa.lab.tlv.redhat.com -user=vdcadmin -provider=activeDirectory -passwordFile=pass
password file is empty
[root@lilach-rhel ~]# rm pass
rm: remove regular empty file `pass'? y
[root@lilach-rhel ~]# rhevm-manage-domains  -action=add -addPermissions -domain=qa.lab.tlv.redhat.com -user=vdcadmin -provider=activeDirectory -passwordFile=pass
failed reading password from password file

No errors on any recoed for the above actions in engine.log

Comment 4 errata-xmlrpc 2013-01-15 15:13:14 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.

http://rhn.redhat.com/errata/RHBA-2013-0003.html