Bug 12047 - OVM Host Agent Username and Password are being logged in the management Server Log

status 12047: resolved fixed
This commit is contained in:
frank 2011-11-30 11:24:47 -08:00
parent aa9324855e
commit e9b1c5f9c3
2 changed files with 18 additions and 3 deletions

19
ovm/src/com/cloud/ovm/object/Connection.java Normal file → Executable file
View File

@ -62,7 +62,12 @@ public class Connection {
return callTimeoutInSec(method, params, 600);
}
public Object callTimeoutInSec(String method, Object[] params, int timeout) throws XmlRpcException {
public Object call(String method, Object[] params, boolean debug) throws XmlRpcException {
/* default timeout is 10 mins */
return callTimeoutInSec(method, params, 600, debug);
}
public Object callTimeoutInSec(String method, Object[] params, int timeout, boolean debug) throws XmlRpcException {
TimingOutCallback callback = new TimingOutCallback(timeout * 1000);
Object[] mParams = new Object[params.length + 1];
mParams[0] = method;
@ -70,7 +75,13 @@ public class Connection {
mParams[i+1] = params[i];
}
s_logger.debug("Call Ovm agent: " + Coder.toJson(mParams));
if (debug) {
/*
* some parameters including user password should not be printed in log
*/
s_logger.debug("Call Ovm agent: " + Coder.toJson(mParams));
}
long startTime = System.currentTimeMillis();
_client.executeAsync("OvmDispatch", mParams, callback);
try {
@ -86,6 +97,10 @@ public class Connection {
}
}
public Object callTimeoutInSec(String method, Object[] params, int timeout) throws XmlRpcException {
return callTimeoutInSec(method, params, timeout, true);
}
public String getIp() {
return _ip;
}

2
ovm/src/com/cloud/ovm/object/OvmHost.java Normal file → Executable file
View File

@ -29,7 +29,7 @@ public class OvmHost extends OvmObject {
public static void registerAsMaster(Connection c) throws XmlRpcException {
Object[] params = {c.getIp(), c.getUserName(), c.getPassword(), c.getPort(), c.getIsSsl()};
c.call("OvmHost.registerAsMaster", params);
c.call("OvmHost.registerAsMaster", params, false);
}
public static void registerAsVmServer(Connection c) throws XmlRpcException {