{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/comments/66823741","id":66823741,"diff_hunk":"@@ -0,0 +1,244 @@\n+/*\n+ * --------------------------------- START OF LICENSE ----------------------------\n+ *\n+ * MySQL cimprov ver. 1.0\n+ *\n+ * Copyright (c) Microsoft Corporation\n+ *\n+ * All rights reserved. \n+ *\n+ * MIT License\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"\"Software\"\"), to deal\n+ * in the Software without restriction, including without limitation the rights to\n+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n+ * of the Software, and to permit persons to whom the Software is furnished to do\n+ * so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in all\n+ * copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+ * SOFTWARE.\n+ *\n+ * ---------------------------------- END OF LICENSE -----------------------------\n+*/\n+/**\n+    \\file        mycnf-scanner.cpp\n+\n+    \\brief       Scans mysql configuration to extract authentication information.\n+\n+    \\date        2014-11-05 16:22:00\n+\n+*/\n+/*----------------------------------------------------------------------------*/\n+\n+#include \"mycnf-scanner.h\"\n+\n+namespace MySQL\n+{\n+    static inline bool GetPathFromDirective(const std::wstring& line, SCXCoreLib::SCXFilePath& path)\n+    {\n+        std::vector<std::wstring> elements;\n+        SCXCoreLib::StrTokenize(line, elements, L\" \");\n+        if ( elements.size() != 2 )\n+        {\n+            return false;\n+        }\n+\n+        path.Set(elements[1]);\n+        return true;\n+    }\n+\n+    bool MySQL_ConfigurationScanner::LoadCnfFile(\n+        const SCXCoreLib::SCXFilePath& file, \n+        MySQL_Authentication& auth,\n+        std::set< std::wstring >& visited, \n+        std::map<unsigned int, std::wstring>& ports)\n+    {\n+        SCX_LOGHYSTERICAL(m_log, SCXCoreLib::StrAppend(L\" loading: \", file.Get()));\n+        std::pair<std::set< std::wstring >::iterator, bool> ins = visited.insert(file.Get());\n+        if (!ins.second)\n+        {\n+            std::wstringstream ss;\n+            ss << L\"Already visited \" << file.Get() << L\". skipping\";\n+            SCX_LOGWARNING(m_log, ss.str());\n+            return true;\n+        }\n+\n+        std::vector< std::wstring > lines;\n+        try\n+        {\n+            SCXCoreLib::SCXStream::NLFs nlfs;\n+\n+            m_extDepends->ReadAllLinesAsUTF8(file, lines, nlfs);\n+        }\n+        catch (SCXCoreLib::SCXException & e)\n+        {\n+            std::wstringstream ss;\n+            ss << L\"Caught \" << e.What() << L\" when trying to read \" << file.Get() ;\n+            SCX_LOGERROR(m_log, ss.str());\n+            return false;\n+        }\n+\n+        unsigned int portNum = 0;\n+        std::wstring bindAddress;\n+        for(std::vector< std::wstring >::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)\n+        {\n+            std::wstring line( SCXCoreLib::StrTrim(*iter) );\n+            SCX_LOGHYSTERICAL(m_log, SCXCoreLib::StrAppend(L\" Line: \", line));\n+            if (SCXCoreLib::StrIsPrefix(line, L\"!includedir\"))\n+            {\n+                SCXCoreLib::SCXFilePath directory;\n+                if (GetPathFromDirective(line, directory))\n+                {\n+                    LoadCnfDirectory(directory, auth, visited, ports);\n+                }\n+                else\n+                {\n+                    SCX_LOGWARNING(m_log, SCXCoreLib::StrAppend(L\" Ignoring Error in !includedir directive.\", line));","path":"source/code/providers/support/mycnf-scanner.cpp","position":105,"original_position":105,"commit_id":"b29efd57a6f733ee38ef49b7689021eb9f3a13e6","original_commit_id":"b29efd57a6f733ee38ef49b7689021eb9f3a13e6","user":{"login":"jeffaco","id":13700943,"avatar_url":"https://avatars.githubusercontent.com/u/13700943?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffaco","html_url":"https://github.com/jeffaco","followers_url":"https://api.github.com/users/jeffaco/followers","following_url":"https://api.github.com/users/jeffaco/following{/other_user}","gists_url":"https://api.github.com/users/jeffaco/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffaco/subscriptions","organizations_url":"https://api.github.com/users/jeffaco/orgs","repos_url":"https://api.github.com/users/jeffaco/repos","events_url":"https://api.github.com/users/jeffaco/events{/privacy}","received_events_url":"https://api.github.com/users/jeffaco/received_events","type":"User","site_admin":false},"body":"That error leaves something to be desired. WHY was this included? Was that already logged in all cases? If so, you might want to change to something like:\r\n\r\nIgnoring include directive \"<line from file>\" due to previous error in the log\r\n\r\nSomething like that, anyway.","created_at":"2016-06-13T16:29:44Z","updated_at":"2016-06-13T16:29:44Z","html_url":"https://github.com/Microsoft/MySQL-Provider/pull/5#discussion_r66823741","pull_request_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/comments/66823741"},"html":{"href":"https://github.com/Microsoft/MySQL-Provider/pull/5#discussion_r66823741"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/5","id":73367741,"html_url":"https://github.com/Microsoft/MySQL-Provider/pull/5","diff_url":"https://github.com/Microsoft/MySQL-Provider/pull/5.diff","patch_url":"https://github.com/Microsoft/MySQL-Provider/pull/5.patch","issue_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues/5","number":5,"state":"open","locked":false,"title":"Fixing Bug#7554562 - Supporting \"!include\" and \"!includedir\" directives","user":{"login":"kapilash","id":113322,"avatar_url":"https://avatars.githubusercontent.com/u/113322?v=3","gravatar_id":"","url":"https://api.github.com/users/kapilash","html_url":"https://github.com/kapilash","followers_url":"https://api.github.com/users/kapilash/followers","following_url":"https://api.github.com/users/kapilash/following{/other_user}","gists_url":"https://api.github.com/users/kapilash/gists{/gist_id}","starred_url":"https://api.github.com/users/kapilash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapilash/subscriptions","organizations_url":"https://api.github.com/users/kapilash/orgs","repos_url":"https://api.github.com/users/kapilash/repos","events_url":"https://api.github.com/users/kapilash/events{/privacy}","received_events_url":"https://api.github.com/users/kapilash/received_events","type":"User","site_admin":false},"body":"This commit introduces support for \"include\" and \"includedir\" directives in MySQL configuration files\r\n\r\n","created_at":"2016-06-10T12:44:31Z","updated_at":"2016-06-13T16:29:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed52bdf22a7413dda5be18fa041082d6d1e83f3b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues/5/comments","statuses_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/statuses/b29efd57a6f733ee38ef49b7689021eb9f3a13e6","head":{"label":"Microsoft:skapila/ConfigDirectives","ref":"skapila/ConfigDirectives","sha":"b29efd57a6f733ee38ef49b7689021eb9f3a13e6","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":47793697,"name":"MySQL-Provider","full_name":"Microsoft/MySQL-Provider","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/MySQL-Provider","description":"MySQL Monitoring Agent for OMI Server","fork":false,"url":"https://api.github.com/repos/Microsoft/MySQL-Provider","forks_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/forks","keys_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/teams","hooks_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/events","assignees_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/tags","blobs_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/languages","stargazers_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/subscription","commits_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/merges","archive_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/downloads","issues_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/deployments","created_at":"2015-12-10T23:33:24Z","updated_at":"2016-04-12T20:26:00Z","pushed_at":"2016-06-13T05:36:43Z","git_url":"git://github.com/Microsoft/MySQL-Provider.git","ssh_url":"git@github.com:Microsoft/MySQL-Provider.git","clone_url":"https://github.com/Microsoft/MySQL-Provider.git","svn_url":"https://github.com/Microsoft/MySQL-Provider","homepage":null,"size":7467,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"07381ab0f2ba1441b82173170a4dfc3d19c337f4","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":47793697,"name":"MySQL-Provider","full_name":"Microsoft/MySQL-Provider","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/MySQL-Provider","description":"MySQL Monitoring Agent for OMI Server","fork":false,"url":"https://api.github.com/repos/Microsoft/MySQL-Provider","forks_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/forks","keys_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/teams","hooks_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/events","assignees_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/tags","blobs_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/languages","stargazers_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/subscription","commits_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/merges","archive_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/downloads","issues_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/MySQL-Provider/deployments","created_at":"2015-12-10T23:33:24Z","updated_at":"2016-04-12T20:26:00Z","pushed_at":"2016-06-13T05:36:43Z","git_url":"git://github.com/Microsoft/MySQL-Provider.git","ssh_url":"git@github.com:Microsoft/MySQL-Provider.git","clone_url":"https://github.com/Microsoft/MySQL-Provider.git","svn_url":"https://github.com/Microsoft/MySQL-Provider","homepage":null,"size":7467,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/5"},"html":{"href":"https://github.com/Microsoft/MySQL-Provider/pull/5"},"issue":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues/5"},"comments":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/MySQL-Provider/statuses/b29efd57a6f733ee38ef49b7689021eb9f3a13e6"}}}}
{"actor":{"display_login":"jeffaco"}}