Author: remi
Date: 2009-08-06 10:20:05 +0200 (Thu, 06 Aug 2009)
New Revision: 5286

Modified:
   
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
Log:
* Hide user passwords from the plugins logs.

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
    2009-08-06 07:45:11 UTC (rev 5285)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
    2009-08-06 08:20:05 UTC (rev 5286)
@@ -192,6 +192,8 @@
         messageStr = ""
         for message in messagesList:
             messageStr += message
+        if messageStr.lower().find("   password:") != -1:
+            messageStr = "   password:********"
         plugin = pluginInterpreterContext.getParentPlugin()
         self.logger.logDebug("Plugin TRACE [%s] (%s)" % (
             plugin.getDescription().getName(), messageStr))
@@ -229,9 +231,13 @@
         plugin = pluginInterpreterContext.getParentPlugin()
         self.__publishEvents(False, ST_NAME_PS_PLUGIN_STARTED,
             [plugin.getDescription().getUuid(),])
+        params = 
copy.deepcopy(pluginInterpreterContext.getInstanceParameters())
+        if params.has_key('password'):
+            params['password'] = '********'
+        if params.has_key('Password'):
+            params['Password'] = '********'
         self.logger.logInfo("Plugin starting [%s] (%s)" % (
-            plugin.getDescription().getName(),
-            str(pluginInterpreterContext.getInstanceParameters())))
+            plugin.getDescription().getName(), str(params)))
         command = 
plugin.getCommand(pluginInterpreterContext.getInstanceCommandName())
         if (not command.isNotifier()) and (command.getName() == "run"):
             
resourceRobotContentInteractions.getPguContextsManager().createPguContext(


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to