rapid7/metasploit-framework — pull request #3290 by allfro (2014-04-22 06:28:02+00:00)
Title: Convert keys to symbols (fix encoding issue)

Another encoding issue is causing the retrieval of keys in create_db to fail. The reason is associated with the way ruby decides to inconsistently encode strings when processing strings from different I/O channels. In this case, when a user attempts to call the db.connect command via RPC, the creation of the database fails because `opt['database']` returns `nil`. This patch converts all keys in `opts` to symbols and gets rid of dealing with encoding. It might be better (not sure because I am not a ruby expert) to use this technique for the entire framework as this encoding issue has crept up in the past. This solution has been tested on both msfconsole and msfrpcd and appears to work consistently.