Bug 12639: while logging events, hide value for configs containing password string in config name

Status 12639: resolved fixed
Reviewed-By: Nitin

Conflicts:

	server/src/com/cloud/configuration/ConfigurationManagerImpl.java
This commit is contained in:
kishan 2012-01-17 15:08:34 +05:30
parent 200f8e4d14
commit bad573168e
1 changed files with 2 additions and 1 deletions

View File

@ -436,7 +436,8 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
Long userId = UserContext.current().getCallerUserId();
String name = cmd.getCfgName();
String value = cmd.getValue();
UserContext.current().setEventDetails(" Name: " + name + " New Value: " + ((value == null) ? "" : value));
UserContext.current().setEventDetails(" Name: "+name +" New Value: "+ (((name.toLowerCase()).contains("password")) ? "*****" :
(((value == null) ? "" : value))));
// check if config value exists
ConfigurationVO config = _configDao.findByName(name);
if (config == null) {