{"action":"created","issue":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/3290","labels_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/3290/labels{/name}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/3290/comments","events_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/3290/events","html_url":"https://github.com/rapid7/metasploit-framework/pull/3290","id":31948507,"number":3290,"title":"Convert keys to symbols (fix encoding issue)","user":{"login":"allfro","id":618125,"avatar_url":"https://avatars.githubusercontent.com/u/618125?v=3","gravatar_id":"","url":"https://api.github.com/users/allfro","html_url":"https://github.com/allfro","followers_url":"https://api.github.com/users/allfro/followers","following_url":"https://api.github.com/users/allfro/following{/other_user}","gists_url":"https://api.github.com/users/allfro/gists{/gist_id}","starred_url":"https://api.github.com/users/allfro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allfro/subscriptions","organizations_url":"https://api.github.com/users/allfro/orgs","repos_url":"https://api.github.com/users/allfro/repos","events_url":"https://api.github.com/users/allfro/events{/privacy}","received_events_url":"https://api.github.com/users/allfro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/library","name":"library","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-04-22T06:28:02Z","updated_at":"2015-01-10T05:27:58Z","closed_at":"2015-01-10T05:27:58Z","pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/3290","html_url":"https://github.com/rapid7/metasploit-framework/pull/3290","diff_url":"https://github.com/rapid7/metasploit-framework/pull/3290.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/3290.patch"},"body":"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."},"comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/comments/69443283","html_url":"https://github.com/rapid7/metasploit-framework/pull/3290#issuecomment-69443283","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/3290","id":69443283,"user":{"login":"jvazquez-r7","id":1742838,"avatar_url":"https://avatars.githubusercontent.com/u/1742838?v=3","gravatar_id":"","url":"https://api.github.com/users/jvazquez-r7","html_url":"https://github.com/jvazquez-r7","followers_url":"https://api.github.com/users/jvazquez-r7/followers","following_url":"https://api.github.com/users/jvazquez-r7/following{/other_user}","gists_url":"https://api.github.com/users/jvazquez-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jvazquez-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvazquez-r7/subscriptions","organizations_url":"https://api.github.com/users/jvazquez-r7/orgs","repos_url":"https://api.github.com/users/jvazquez-r7/repos","events_url":"https://api.github.com/users/jvazquez-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jvazquez-r7/received_events","type":"User","site_admin":false},"created_at":"2015-01-10T05:27:58Z","updated_at":"2015-01-10T05:27:58Z","body":"Looks like bug fix by @allfro and @hmoore-r7 is already in master:  https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/core/db_manager/connection.rb#L85 (even when the string to symbol conversion has not been done).\r\n\r\nSo I'm going to close this one, since looks like has been a long time since the last follow-up. @allfro feel free to reopen pull request (solving conflicts) if you think any change is necessary still. Thanks!"}}