{"action":"created","comment":{"url":"https://api.github.com/repos/OpenSCAP/openscap/pulls/comments/93043117","pull_request_review_id":13561772,"id":93043117,"diff_hunk":"@@ -757,76 +757,53 @@ int app_generate_fix(const struct oscap_action *action)\n \t\treturn OSCAP_ERROR;\n \t}\n \n-\tif (action->id != NULL) {\n-\t\t/* Listen very carefully -- I shall say this only once. This is temporaly\n-\t\t * fallback mode. Which may be dropped from future OpenSCAP releases.\n-\t\t *\n-\t\t * Previously, the OpenSCAP used XSLT to generate fixes from XCCDF files.\n-\t\t * That is no longer viable as XSLT cannot support Text substitution, CPE\n-\t\t * processing, DataStreams, or Tailoring.\n-\t\t *\n-\t\t * The XSLT used to print out <fix> elements from TestResult (if supplied)\n-\t\t * or from a profile (otherwise). We keep the former untouched (XSLT) and\n-\t\t * later was rewritten using C.\n-\t\t *\n-\t\t * When scanning OpenSCAP used to copy all the <fix> elements from Profile\n-\t\t * to the TestResult. That was not of much value. Now OpenSCAP includes in\n-\t\t * TestResult only those <fix> elements which were executed on a given\n-\t\t * system.\n-\t\t *\n-\t\t * Thus, this mode is usefull to review which fixes has been executed as a part\n-\t\t * of given scan (TestResult)\n-\t\t *\n-\t\t * TODO: Once this legacy is dropped, we need to document --cpe and --datastream\n-\t\t * support in man pages.\n-\t\t */\n-\t\tfprintf(stderr, \"#Warning: OpenSCAP will now use fallback mode (XSLT) to generate fixes. \"\n-\t\t\t\"Some of the functionality might be missing (Text substitution, CPE processing, DataStream support, and tailoring). \"\n-\t\t\t\"Please ommit --result-id option to trigger advanced processing.\\n\");\n-\t\treturn app_xccdf_xslt(action);\n-\t}\n-\t/* Otherwise, we better use internal solver instead of XSLT\n-\t * Mainly because of Text Substitution */\n \tint ret = OSCAP_ERROR;\n \tstruct xccdf_session *session = xccdf_session_new(action->f_xccdf);\n \tif (session == NULL)\n \t\tgoto cleanup;\n-\tif (xccdf_session_is_sds(session)) {\n-\t\txccdf_session_set_datastream_id(session, action->f_datastream_id);\n-\t\txccdf_session_set_component_id(session, action->f_xccdf_id);\n-\t\txccdf_session_set_benchmark_id(session, action->f_benchmark_id);\n-\t}\n+\n+\txccdf_session_set_validation(session, action->validate, getenv(\"OSCAP_FULL_VALIDATION\") != NULL);\n \txccdf_session_set_user_cpe(session, action->cpe);\n+\txccdf_session_set_remote_resources(session, action->remote_resources, download_reporting_callback);\n+\txccdf_session_set_custom_oval_files(session, action->f_ovals);\n \txccdf_session_set_user_tailoring_file(session, action->tailoring_file);\n \txccdf_session_set_user_tailoring_cid(session, action->tailoring_id);\n-\tif (xccdf_session_load_xccdf(session) != 0)\n-\t\tgoto cleanup;\n-\tif (xccdf_session_load_cpe(session) != 0)\n-\t\tgoto cleanup;\n-\tif (xccdf_session_load_tailoring(session) != 0)\n-\t\tgoto cleanup;\n-\n-\tif (!xccdf_session_set_profile_id(session, action->profile)) {\n-\t\treport_missing_profile(action);\n+\tif (xccdf_session_load(session) != 0)\n \t\tgoto cleanup;\n-\t}\n \n-\tstruct xccdf_policy *policy = xccdf_session_get_xccdf_policy(session);\n \tint output_fd = STDOUT_FILENO;\n \tif (action->f_results != NULL) {\n \t\tif ((output_fd = open(action->f_results, O_CREAT|O_TRUNC|O_NOFOLLOW|O_WRONLY, 0700)) < 0) {\n \t\t\tfprintf(stderr, \"Could not open %s: %s\", action->f_results, strerror(errno));\n \t\t\tgoto cleanup;\n \t\t}\n \t}\n-\tif (xccdf_policy_generate_fix(policy, NULL, action->tmpl, output_fd) == 0)\n-\t\tret = OSCAP_OK;\n \n+\tif (action->id != NULL) {","path":"utils/oscap-xccdf.c","position":74,"original_position":74,"commit_id":"add99fe043c47be0985aba0cf6265ac8b530376d","original_commit_id":"add99fe043c47be0985aba0cf6265ac8b530376d","user":{"login":"yuumasato","id":7460169,"avatar_url":"https://avatars.githubusercontent.com/u/7460169?v=3","gravatar_id":"","url":"https://api.github.com/users/yuumasato","html_url":"https://github.com/yuumasato","followers_url":"https://api.github.com/users/yuumasato/followers","following_url":"https://api.github.com/users/yuumasato/following{/other_user}","gists_url":"https://api.github.com/users/yuumasato/gists{/gist_id}","starred_url":"https://api.github.com/users/yuumasato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuumasato/subscriptions","organizations_url":"https://api.github.com/users/yuumasato/orgs","repos_url":"https://api.github.com/users/yuumasato/repos","events_url":"https://api.github.com/users/yuumasato/events{/privacy}","received_events_url":"https://api.github.com/users/yuumasato/received_events","type":"User","site_admin":false},"body":"`--result-id` has precedence over `--profile`. Does it make sense to print a warning if both parameters are set?\r\nIs this precedence documented to the user?","created_at":"2016-12-19T14:40:17Z","updated_at":"2016-12-19T14:40:17Z","html_url":"https://github.com/OpenSCAP/openscap/pull/597#discussion_r93043117","pull_request_url":"https://api.github.com/repos/OpenSCAP/openscap/pulls/597","_links":{"self":{"href":"https://api.github.com/repos/OpenSCAP/openscap/pulls/comments/93043117"},"html":{"href":"https://github.com/OpenSCAP/openscap/pull/597#discussion_r93043117"},"pull_request":{"href":"https://api.github.com/repos/OpenSCAP/openscap/pulls/597"}}},"pull_request":{"url":"https://api.github.com/repos/OpenSCAP/openscap/pulls/597","id":95549846,"html_url":"https://github.com/OpenSCAP/openscap/pull/597","diff_url":"https://github.com/OpenSCAP/openscap/pull/597.diff","patch_url":"https://github.com/OpenSCAP/openscap/pull/597.patch","issue_url":"https://api.github.com/repos/OpenSCAP/openscap/issues/597","number":597,"state":"open","locked":false,"title":"Added result-oriented 'generate fix' whenever an user pass a","user":{"login":"rsprudencio","id":728802,"avatar_url":"https://avatars.githubusercontent.com/u/728802?v=3","gravatar_id":"","url":"https://api.github.com/users/rsprudencio","html_url":"https://github.com/rsprudencio","followers_url":"https://api.github.com/users/rsprudencio/followers","following_url":"https://api.github.com/users/rsprudencio/following{/other_user}","gists_url":"https://api.github.com/users/rsprudencio/gists{/gist_id}","starred_url":"https://api.github.com/users/rsprudencio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsprudencio/subscriptions","organizations_url":"https://api.github.com/users/rsprudencio/orgs","repos_url":"https://api.github.com/users/rsprudencio/repos","events_url":"https://api.github.com/users/rsprudencio/events{/privacy}","received_events_url":"https://api.github.com/users/rsprudencio/received_events","type":"User","site_admin":false},"body":"result-id, else it will fallback to profile-oriented fix\r\ngeneration, which get fixes from all selected rules in\r\nprovided profile.","created_at":"2016-11-28T18:14:45Z","updated_at":"2016-12-19T14:43:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c109b91d73ef27a2f6ad98f63dc57f67b93ff679","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/OpenSCAP/openscap/milestones/10","html_url":"https://github.com/OpenSCAP/openscap/milestone/10","labels_url":"https://api.github.com/repos/OpenSCAP/openscap/milestones/10/labels","id":2136586,"number":10,"title":"1.2.13","description":"","creator":{"login":"mpreisler","id":753153,"avatar_url":"https://avatars.githubusercontent.com/u/753153?v=3","gravatar_id":"","url":"https://api.github.com/users/mpreisler","html_url":"https://github.com/mpreisler","followers_url":"https://api.github.com/users/mpreisler/followers","following_url":"https://api.github.com/users/mpreisler/following{/other_user}","gists_url":"https://api.github.com/users/mpreisler/gists{/gist_id}","starred_url":"https://api.github.com/users/mpreisler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpreisler/subscriptions","organizations_url":"https://api.github.com/users/mpreisler/orgs","repos_url":"https://api.github.com/users/mpreisler/repos","events_url":"https://api.github.com/users/mpreisler/events{/privacy}","received_events_url":"https://api.github.com/users/mpreisler/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":13,"state":"open","created_at":"2016-11-15T13:21:24Z","updated_at":"2016-12-15T21:12:27Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OpenSCAP/openscap/pulls/597/commits","review_comments_url":"https://api.github.com/repos/OpenSCAP/openscap/pulls/597/comments","review_comment_url":"https://api.github.com/repos/OpenSCAP/openscap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenSCAP/openscap/issues/597/comments","statuses_url":"https://api.github.com/repos/OpenSCAP/openscap/statuses/add99fe043c47be0985aba0cf6265ac8b530376d","head":{"label":"rsprudencio:maint-1.2-genfix-result-oriented","ref":"maint-1.2-genfix-result-oriented","sha":"add99fe043c47be0985aba0cf6265ac8b530376d","user":{"login":"rsprudencio","id":728802,"avatar_url":"https://avatars.githubusercontent.com/u/728802?v=3","gravatar_id":"","url":"https://api.github.com/users/rsprudencio","html_url":"https://github.com/rsprudencio","followers_url":"https://api.github.com/users/rsprudencio/followers","following_url":"https://api.github.com/users/rsprudencio/following{/other_user}","gists_url":"https://api.github.com/users/rsprudencio/gists{/gist_id}","starred_url":"https://api.github.com/users/rsprudencio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsprudencio/subscriptions","organizations_url":"https://api.github.com/users/rsprudencio/orgs","repos_url":"https://api.github.com/users/rsprudencio/repos","events_url":"https://api.github.com/users/rsprudencio/events{/privacy}","received_events_url":"https://api.github.com/users/rsprudencio/received_events","type":"User","site_admin":false},"repo":{"id":70164011,"name":"openscap","full_name":"rsprudencio/openscap","owner":{"login":"rsprudencio","id":728802,"avatar_url":"https://avatars.githubusercontent.com/u/728802?v=3","gravatar_id":"","url":"https://api.github.com/users/rsprudencio","html_url":"https://github.com/rsprudencio","followers_url":"https://api.github.com/users/rsprudencio/followers","following_url":"https://api.github.com/users/rsprudencio/following{/other_user}","gists_url":"https://api.github.com/users/rsprudencio/gists{/gist_id}","starred_url":"https://api.github.com/users/rsprudencio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsprudencio/subscriptions","organizations_url":"https://api.github.com/users/rsprudencio/orgs","repos_url":"https://api.github.com/users/rsprudencio/repos","events_url":"https://api.github.com/users/rsprudencio/events{/privacy}","received_events_url":"https://api.github.com/users/rsprudencio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rsprudencio/openscap","description":"NIST Certified SCAP 1.2 toolkit","fork":true,"url":"https://api.github.com/repos/rsprudencio/openscap","forks_url":"https://api.github.com/repos/rsprudencio/openscap/forks","keys_url":"https://api.github.com/repos/rsprudencio/openscap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rsprudencio/openscap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rsprudencio/openscap/teams","hooks_url":"https://api.github.com/repos/rsprudencio/openscap/hooks","issue_events_url":"https://api.github.com/repos/rsprudencio/openscap/issues/events{/number}","events_url":"https://api.github.com/repos/rsprudencio/openscap/events","assignees_url":"https://api.github.com/repos/rsprudencio/openscap/assignees{/user}","branches_url":"https://api.github.com/repos/rsprudencio/openscap/branches{/branch}","tags_url":"https://api.github.com/repos/rsprudencio/openscap/tags","blobs_url":"https://api.github.com/repos/rsprudencio/openscap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rsprudencio/openscap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rsprudencio/openscap/git/refs{/sha}","trees_url":"https://api.github.com/repos/rsprudencio/openscap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rsprudencio/openscap/statuses/{sha}","languages_url":"https://api.github.com/repos/rsprudencio/openscap/languages","stargazers_url":"https://api.github.com/repos/rsprudencio/openscap/stargazers","contributors_url":"https://api.github.com/repos/rsprudencio/openscap/contributors","subscribers_url":"https://api.github.com/repos/rsprudencio/openscap/subscribers","subscription_url":"https://api.github.com/repos/rsprudencio/openscap/subscription","commits_url":"https://api.github.com/repos/rsprudencio/openscap/commits{/sha}","git_commits_url":"https://api.github.com/repos/rsprudencio/openscap/git/commits{/sha}","comments_url":"https://api.github.com/repos/rsprudencio/openscap/comments{/number}","issue_comment_url":"https://api.github.com/repos/rsprudencio/openscap/issues/comments{/number}","contents_url":"https://api.github.com/repos/rsprudencio/openscap/contents/{+path}","compare_url":"https://api.github.com/repos/rsprudencio/openscap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rsprudencio/openscap/merges","archive_url":"https://api.github.com/repos/rsprudencio/openscap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rsprudencio/openscap/downloads","issues_url":"https://api.github.com/repos/rsprudencio/openscap/issues{/number}","pulls_url":"https://api.github.com/repos/rsprudencio/openscap/pulls{/number}","milestones_url":"https://api.github.com/repos/rsprudencio/openscap/milestones{/number}","notifications_url":"https://api.github.com/repos/rsprudencio/openscap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rsprudencio/openscap/labels{/name}","releases_url":"https://api.github.com/repos/rsprudencio/openscap/releases{/id}","deployments_url":"https://api.github.com/repos/rsprudencio/openscap/deployments","created_at":"2016-10-06T14:53:06Z","updated_at":"2016-10-06T14:53:14Z","pushed_at":"2016-12-19T12:56:43Z","git_url":"git://github.com/rsprudencio/openscap.git","ssh_url":"git@github.com:rsprudencio/openscap.git","clone_url":"https://github.com/rsprudencio/openscap.git","svn_url":"https://github.com/rsprudencio/openscap","homepage":"http://www.open-scap.org/tools/openscap-base","size":20054,"stargazers_count":0,"watchers_count":0,"language":"XSLT","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"maint-1.2"}},"base":{"label":"OpenSCAP:maint-1.2","ref":"maint-1.2","sha":"d047e458828ced4e0d67b776aaa466e61e6e4e5c","user":{"login":"OpenSCAP","id":7439934,"avatar_url":"https://avatars.githubusercontent.com/u/7439934?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSCAP","html_url":"https://github.com/OpenSCAP","followers_url":"https://api.github.com/users/OpenSCAP/followers","following_url":"https://api.github.com/users/OpenSCAP/following{/other_user}","gists_url":"https://api.github.com/users/OpenSCAP/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSCAP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSCAP/subscriptions","organizations_url":"https://api.github.com/users/OpenSCAP/orgs","repos_url":"https://api.github.com/users/OpenSCAP/repos","events_url":"https://api.github.com/users/OpenSCAP/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSCAP/received_events","type":"Organization","site_admin":false},"repo":{"id":19279199,"name":"openscap","full_name":"OpenSCAP/openscap","owner":{"login":"OpenSCAP","id":7439934,"avatar_url":"https://avatars.githubusercontent.com/u/7439934?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSCAP","html_url":"https://github.com/OpenSCAP","followers_url":"https://api.github.com/users/OpenSCAP/followers","following_url":"https://api.github.com/users/OpenSCAP/following{/other_user}","gists_url":"https://api.github.com/users/OpenSCAP/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSCAP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSCAP/subscriptions","organizations_url":"https://api.github.com/users/OpenSCAP/orgs","repos_url":"https://api.github.com/users/OpenSCAP/repos","events_url":"https://api.github.com/users/OpenSCAP/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSCAP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenSCAP/openscap","description":"NIST Certified SCAP 1.2 toolkit","fork":false,"url":"https://api.github.com/repos/OpenSCAP/openscap","forks_url":"https://api.github.com/repos/OpenSCAP/openscap/forks","keys_url":"https://api.github.com/repos/OpenSCAP/openscap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenSCAP/openscap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenSCAP/openscap/teams","hooks_url":"https://api.github.com/repos/OpenSCAP/openscap/hooks","issue_events_url":"https://api.github.com/repos/OpenSCAP/openscap/issues/events{/number}","events_url":"https://api.github.com/repos/OpenSCAP/openscap/events","assignees_url":"https://api.github.com/repos/OpenSCAP/openscap/assignees{/user}","branches_url":"https://api.github.com/repos/OpenSCAP/openscap/branches{/branch}","tags_url":"https://api.github.com/repos/OpenSCAP/openscap/tags","blobs_url":"https://api.github.com/repos/OpenSCAP/openscap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenSCAP/openscap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenSCAP/openscap/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenSCAP/openscap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenSCAP/openscap/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenSCAP/openscap/languages","stargazers_url":"https://api.github.com/repos/OpenSCAP/openscap/stargazers","contributors_url":"https://api.github.com/repos/OpenSCAP/openscap/contributors","subscribers_url":"https://api.github.com/repos/OpenSCAP/openscap/subscribers","subscription_url":"https://api.github.com/repos/OpenSCAP/openscap/subscription","commits_url":"https://api.github.com/repos/OpenSCAP/openscap/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenSCAP/openscap/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenSCAP/openscap/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenSCAP/openscap/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenSCAP/openscap/contents/{+path}","compare_url":"https://api.github.com/repos/OpenSCAP/openscap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenSCAP/openscap/merges","archive_url":"https://api.github.com/repos/OpenSCAP/openscap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenSCAP/openscap/downloads","issues_url":"https://api.github.com/repos/OpenSCAP/openscap/issues{/number}","pulls_url":"https://api.github.com/repos/OpenSCAP/openscap/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenSCAP/openscap/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenSCAP/openscap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenSCAP/openscap/labels{/name}","releases_url":"https://api.github.com/repos/OpenSCAP/openscap/releases{/id}","deployments_url":"https://api.github.com/repos/OpenSCAP/openscap/deployments","created_at":"2014-04-29T14:23:34Z","updated_at":"2016-12-08T23:26:08Z","pushed_at":"2016-12-19T12:56:45Z","git_url":"git://github.com/OpenSCAP/openscap.git","ssh_url":"git@github.com:OpenSCAP/openscap.git","clone_url":"https://github.com/OpenSCAP/openscap.git","svn_url":"https://github.com/OpenSCAP/openscap","homepage":"http://www.open-scap.org/tools/openscap-base","size":19986,"stargazers_count":145,"watchers_count":145,"language":"XSLT","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":87,"forks":64,"open_issues":87,"watchers":145,"default_branch":"maint-1.2"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSCAP/openscap/pulls/597"},"html":{"href":"https://github.com/OpenSCAP/openscap/pull/597"},"issue":{"href":"https://api.github.com/repos/OpenSCAP/openscap/issues/597"},"comments":{"href":"https://api.github.com/repos/OpenSCAP/openscap/issues/597/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSCAP/openscap/pulls/597/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSCAP/openscap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenSCAP/openscap/pulls/597/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSCAP/openscap/statuses/add99fe043c47be0985aba0cf6265ac8b530376d"}}}}
{"actor":{"display_login":"yuumasato"}}