{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/38578385","id":38578385,"diff_hunk":"@@ -87,7 +87,10 @@ def self.evaluate(cond, rec, inputs={}, attr=:expression)\n   def self.do_eval(expr)\n     # Remove this [DEPRECATION] in the next version\n     if expr =~ /^__start_ruby__\\s?__start_context__\\s?(.*)\\s?__type__\\s?(.*)\\s?__end_context__\\s?__start_script__\\s?(.*)\\s?__end_script__\\s?__end_ruby__$/im\n-      raise \"Ruby scripts in expressions are no longer supported. Please use the regular expression feature of conditions instead.\"\n+      context, col_type, script = [$1, $2, $3]\n+      context = MiqExpression.quote(context, col_type)\n+      result = SafeNamespace.eval_script(script, context)","path":"app/models/condition.rb","position":7,"original_position":7,"commit_id":"9ecc7f6011f6f85b44873dafa32e7622d301521a","original_commit_id":"80d888104b70f589610a4a7d7f446a05bd7f72c8","user":{"login":"matthewd","id":1034,"avatar_url":"https://avatars.githubusercontent.com/u/1034?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewd","html_url":"https://github.com/matthewd","followers_url":"https://api.github.com/users/matthewd/followers","following_url":"https://api.github.com/users/matthewd/following{/other_user}","gists_url":"https://api.github.com/users/matthewd/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewd/subscriptions","organizations_url":"https://api.github.com/users/matthewd/orgs","repos_url":"https://api.github.com/users/matthewd/repos","events_url":"https://api.github.com/users/matthewd/events{/privacy}","received_events_url":"https://api.github.com/users/matthewd/received_events","type":"User","site_admin":false},"body":"> We thought that the feature was not being used anymore and that's why Bill had removed it. But, then when I was working on the BZ referenced above, I realized that the feature was still necessary.\r\n\r\nI thought we removed it because we wanted to kill it, and having discovered it was still being used for a desired feature, we were going to implement a \"better\" solution. :confused:","created_at":"2015-09-02T20:13:48Z","updated_at":"2015-09-02T20:13:48Z","html_url":"https://github.com/ManageIQ/manageiq/pull/3806#discussion_r38578385","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3806","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/38578385"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/3806#discussion_r38578385"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3806"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3806","id":42138628,"html_url":"https://github.com/ManageIQ/manageiq/pull/3806","diff_url":"https://github.com/ManageIQ/manageiq/pull/3806.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/3806.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3806","number":3806,"state":"open","locked":false,"title":"Reworked \"check\" expression to not use eval ","user":{"login":"gtanzillo","id":76593,"avatar_url":"https://avatars.githubusercontent.com/u/76593?v=3","gravatar_id":"","url":"https://api.github.com/users/gtanzillo","html_url":"https://github.com/gtanzillo","followers_url":"https://api.github.com/users/gtanzillo/followers","following_url":"https://api.github.com/users/gtanzillo/following{/other_user}","gists_url":"https://api.github.com/users/gtanzillo/gists{/gist_id}","starred_url":"https://api.github.com/users/gtanzillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtanzillo/subscriptions","organizations_url":"https://api.github.com/users/gtanzillo/orgs","repos_url":"https://api.github.com/users/gtanzillo/repos","events_url":"https://api.github.com/users/gtanzillo/events{/privacy}","received_events_url":"https://api.github.com/users/gtanzillo/received_events","type":"User","site_admin":false},"body":"Reworked the code that evaluates the \"check\" clause of a find/check expression.\r\n\r\nIt will no longer call eval and instead evaluate the expression in ruby method calls. This fixes a bug where valid expressions were failing because the expression string that was being passed to eval was tainted.\r\n\r\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1249730\r\n\r\nThis PR also reinstates the code that supports evaluation limited ruby code in an expression. The code was originally removed in #3708 because it was though to be obsolete. However, it is still necessary for evaluating \"find / check\" expressions and therefore needed to be put back.","created_at":"2015-08-11T14:58:20Z","updated_at":"2015-09-02T20:13:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8061f59d127ce527e779db37a0c0bd3bdc7bc255","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3806/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3806/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3806/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/9ecc7f6011f6f85b44873dafa32e7622d301521a","head":{"label":"gtanzillo:find-check-expr-with-tainted-obj","ref":"find-check-expr-with-tainted-obj","sha":"9ecc7f6011f6f85b44873dafa32e7622d301521a","user":{"login":"gtanzillo","id":76593,"avatar_url":"https://avatars.githubusercontent.com/u/76593?v=3","gravatar_id":"","url":"https://api.github.com/users/gtanzillo","html_url":"https://github.com/gtanzillo","followers_url":"https://api.github.com/users/gtanzillo/followers","following_url":"https://api.github.com/users/gtanzillo/following{/other_user}","gists_url":"https://api.github.com/users/gtanzillo/gists{/gist_id}","starred_url":"https://api.github.com/users/gtanzillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtanzillo/subscriptions","organizations_url":"https://api.github.com/users/gtanzillo/orgs","repos_url":"https://api.github.com/users/gtanzillo/repos","events_url":"https://api.github.com/users/gtanzillo/events{/privacy}","received_events_url":"https://api.github.com/users/gtanzillo/received_events","type":"User","site_admin":false},"repo":{"id":37150197,"name":"manageiq","full_name":"gtanzillo/manageiq","owner":{"login":"gtanzillo","id":76593,"avatar_url":"https://avatars.githubusercontent.com/u/76593?v=3","gravatar_id":"","url":"https://api.github.com/users/gtanzillo","html_url":"https://github.com/gtanzillo","followers_url":"https://api.github.com/users/gtanzillo/followers","following_url":"https://api.github.com/users/gtanzillo/following{/other_user}","gists_url":"https://api.github.com/users/gtanzillo/gists{/gist_id}","starred_url":"https://api.github.com/users/gtanzillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtanzillo/subscriptions","organizations_url":"https://api.github.com/users/gtanzillo/orgs","repos_url":"https://api.github.com/users/gtanzillo/repos","events_url":"https://api.github.com/users/gtanzillo/events{/privacy}","received_events_url":"https://api.github.com/users/gtanzillo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gtanzillo/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/gtanzillo/manageiq","forks_url":"https://api.github.com/repos/gtanzillo/manageiq/forks","keys_url":"https://api.github.com/repos/gtanzillo/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gtanzillo/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gtanzillo/manageiq/teams","hooks_url":"https://api.github.com/repos/gtanzillo/manageiq/hooks","issue_events_url":"https://api.github.com/repos/gtanzillo/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/gtanzillo/manageiq/events","assignees_url":"https://api.github.com/repos/gtanzillo/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/gtanzillo/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/gtanzillo/manageiq/tags","blobs_url":"https://api.github.com/repos/gtanzillo/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gtanzillo/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gtanzillo/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/gtanzillo/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gtanzillo/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/gtanzillo/manageiq/languages","stargazers_url":"https://api.github.com/repos/gtanzillo/manageiq/stargazers","contributors_url":"https://api.github.com/repos/gtanzillo/manageiq/contributors","subscribers_url":"https://api.github.com/repos/gtanzillo/manageiq/subscribers","subscription_url":"https://api.github.com/repos/gtanzillo/manageiq/subscription","commits_url":"https://api.github.com/repos/gtanzillo/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/gtanzillo/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/gtanzillo/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/gtanzillo/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/gtanzillo/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/gtanzillo/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gtanzillo/manageiq/merges","archive_url":"https://api.github.com/repos/gtanzillo/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gtanzillo/manageiq/downloads","issues_url":"https://api.github.com/repos/gtanzillo/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/gtanzillo/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/gtanzillo/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/gtanzillo/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gtanzillo/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/gtanzillo/manageiq/releases{/id}","created_at":"2015-06-09T18:24:07Z","updated_at":"2015-06-09T18:24:25Z","pushed_at":"2015-09-01T18:38:12Z","git_url":"git://github.com/gtanzillo/manageiq.git","ssh_url":"git@github.com:gtanzillo/manageiq.git","clone_url":"https://github.com/gtanzillo/manageiq.git","svn_url":"https://github.com/gtanzillo/manageiq","homepage":"manageiq.org","size":82147,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ManageIQ:master","ref":"master","sha":"5138f7360518d4eed5d7db03fc508e08951a4714","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Cloud Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","created_at":"2014-06-13T02:31:26Z","updated_at":"2015-08-30T09:33:06Z","pushed_at":"2015-09-02T20:13:45Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":156241,"stargazers_count":135,"watchers_count":135,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":148,"mirror_url":null,"open_issues_count":417,"forks":148,"open_issues":417,"watchers":135,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3806"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/3806"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/3806"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/3806/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3806/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3806/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/9ecc7f6011f6f85b44873dafa32e7622d301521a"}}}}